Re: [ntfsd] RE: How to use ZwOpenSymbolicLinkObject and ZwQuerySymbolicLinkObject?

Hi Srin:
I have to admit that i’m new learner on driver(especially FSD) development.That’s why i come here asking for help.All the DDK routines are strange to me.I don’t think it’s a shame to make mistakes when using them.
But i don’t agree to your conclusion “Look at what he is passing as handle to ZwOpenSymbolicLinkObject. When some one programs this way it does not matter what they compile as .cpp or .c”.Could u tell me what’s wrong with the sentence “ZwOpenSymbolicLinkObject(Handle,GENERIC_READ,&ObjectAttributes)”?In fact I have succeed in getting STATUS_SUCCESS as the returned value.I modified some other sentences,but this one not included.
I don’t mean to enkindle an argument.I have learned a lot here and i hope to continue.I’m very thankful to those who answered my quesions.But i don’t want to be blamed like that.
Anyway,thank you for noticing my question.I wish i can continue in gaining your help.

Jim
BTW:English is not my mother tongue.I’m sorry if anybody offended by my words.

ZwOpenSymbolicLinkObject(Handle,GENERIC_READ,&ObjectAttributes)

Ryan,
I believe the developer/student first needs to learn programming
in C. Look at what he is passing as handle to ZwOpenSymbolicLinkObject.
When some one programs this way it does not matter what they compile as
.cpp or .c

-Srin.

-----Original Message-----
From: Nicholas Ryan [mailto:xxxxx@nryan.com]
Sent: Thursday, May 01, 2003 1:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: How to use ZwOpenSymbolicLinkObject and
ZwQuerySymbolicLinkObject?

I’m amazed that even compiles (must be a .c file, this is why you should
compile everything as .cpp). Do this:

OBJECT_ATTRIBUTES attribs;
UNICODE_STRING linkName;

RtlInitUnicodeString(&linkName, L"\DosDevices\C:");

InitializeObjectAttributes(&attribs, &linkName, OBJ_KERNEL_HANDLE, NULL,
NULL).

  • Nick Ryan

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Jim Zhong
> Sent: Wednesday, April 30, 2003 8:26 PM
> To: File Systems Developers
> Subject: [ntfsd] How to use ZwOpenSymbolicLinkObject and
> ZwQuerySymbolicLinkObject?
>
>
> Hi:
> Here are my codes about using ZwOpenSymbolicLinkObject
> and ZwQuerySymbolicLinkObject.There must be something wrong
> with them.But i don’t know where it is.
>
> PDEVICE_OBJECT PointertoC;
> PFILE_OBJECT FilePointertoC;
> UNICODE_STRING DeviceName;
> OBJECT_ATTRIBUTES ObjectAttributes;
> PHANDLE Handle=NULL;
> ULONG RetNum;
>
>
> InitializeObjectAttributes(&ObjectAttributes,L"//DosDevices//C
> :“,NULL,NULL,NULL);
>
> if(!NT_SUCCESS(ZwOpenSymbolicLinkObject(Handle,GENERIC_READ,&O
> bjectAttributes)))
> KdPrint((“ZwOpenSymbolicLinkObject failed\n”));
>
> //I don’t know how to use RtlInitUnicodeString.so…
> RtlInitUnicodeString(&DeviceName,L”//device//Ddddddddddddddddd
> ddddddddddddddddddd:");
>
> if(!NT_SUCCESS(ZwQuerySymbolicLinkObject(*Handle,&DeviceName,&
> RetNum)))
> KdPrint((“ZwQuerySymbolicLinkObject failed\n”));
>
> if(!NT_SUCCESS(IoGetDeviceObjectPointer(&DeviceName,FILE_READ_
> DATA,&FilePointertoC,&PointertoC)))
> KdPrint((“IoGetDeviceObjectPointer failed\n”));
>
> ZwOpenSymbolicLinkObject() doesn’t return
> STATUS_SUCCESS.What’s the problem?
>
> Thanks!
>
>
> Jim
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@nryan.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


You are currently subscribed to ntfsd as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@netease.com
To unsubscribe send a blank email to xxxxx@lists.osr.com