: [ntfsd] RE: How to get volumn's handle, like "D:"

Thanks a lot.!

Is there any convenient way to get all the volumn that has been mounted, like GetLogicalDrives in WIN32

-----原始邮件-----
发件人: xxxxx@lists.osr.com [mailto:xxxxx@lists.
osr.com]代表 Neal Christiansen
发送时间: 2002年4月26日 22:30
收件人: File Systems Developers
主题: [ntfsd] RE: How to get volumn’s handle, like “D:”

The problem is you are trying to use a “win32” name in the “NT” name space. Try L"\??\d:\…" or L"\DosDevices\d:\…" they are equivalent

Neal Christiansen

This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: AChen [mailto:xxxxx@koal.com]
Sent: Friday, April 26, 2002 4:11 AM
To: File Systems Developers
Subject: [ntfsd] How to get volumn’s handle, like “D:”

hi, here is a question:

in win32 app, we can do this like this way

CreateFile(“\\.\D:”…)

so in kernel driver, i do the following way

WCHAR wszFilename = L"\\.\D:";

RtlInitUnicodeString( &fileNameUnicodeString, wszFilename );
InitializeObjectAttributes( &objectAttributes, &fileNameUnicodeString,
OBJ_CASE_INSENSITIVE, NULL, NULL );

//
// Get the Volumn handle
//
status = ZwOpenFile(
&ntFileHandle,
SYNCHRONIZE|FILE_ANY_ACCESS,
&objectAttributes,
&IoStatus,
FILE_SHARE_READ|FILE_SHARE_WRITE,
FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE );

but it doesn’t work, can anybody tell me what’s wrong?
How can i get the volumn’s driver

thx,
alexbvjjZrij~
b.?&v’j \d{.n+zwZnV [hz{_18?l