: [ntfsd] DeviceIoControl to a filter,the APP how to CreateFile?

I think so,but it work not well.

///==================================

HANDLE hDevice; // handle to the drive to be examined

BOOL bResult; // results flag

DWORD junk; // discard results

hDevice = CreateFile(

_T(“\\.\PkFilter”),

GENERIC_READ,

FILE_SHARE_READ,

NULL,

OPEN_EXISTING,

0,

0

);

if (hDevice == INVALID_HANDLE_VALUE) // cannot open the drive

{

TRACE1(“lass erro code=%08x”,GetLastError());

AfxMessageBox(“CreateFile Error!”);

return;

}

bResult = DeviceIoControl(hDevice, // device to be queried

IOCTL_DISK_GET_DRIVE_GEOMETRY, // operation to perform

NULL, 0, // no input buffer

NULL, 0, // output buffer

&junk, // # bytes returned

(LPOVERLAPPED) NULL); // synchronous I/O

TRACE1(“bResult”,bResult);

CloseHandle(hDevice);

//==================================================

Lass erro code=00000002

Why?


use “\\.\pkfilter”

Manish

cnmmd wrote:

the filter driver create a CDO,named “pkfilter”,
in the Application,I want to use CreateFile to get a handle to the filter
CDO,then use DeviceIoControl.But what first parameter in the CreateFile?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

_____

Do you Yahoo!?
New
http:mail/static/efficiency.html> and Improved Yahoo! Mail - Send 10MB messages!
— Questions? First check the IFS FAQ at https://www.osronline.com/article.
cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:>