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