After you successfully create your CDO, add a Symbolic link to the “DOS”
namespace.
Example:
UNICODE_STRING Win32DeviceName
RtlInitUnicodeString(&Win32DeviceName, L"\DosDevices\PkFilter");
status = IoCreateSymbolicLink(&Win32DeviceName, &nameString);
Now you should be able to open your device as: \.\PkFilter
/ted
-----Original Message-----
From: Brilly Wu (HangZhou) [mailto:xxxxx@viatech.com.cn]
Sent: Monday, July 12, 2004 1:41 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] DeviceIoControl to a filter,the APP how to CreateFile?
The following is my filter driver code for Create the Control Device Object
(CDO)
Then how to use CreateFile?
//
// Create the Control Device Object (CDO). This object represents
this
// driver. Note that it does not have a device extension.
//
RtlInitUnicodeString( &nameString,
L"\FileSystem\Filters\PkFilter" );
status = IoCreateDevice( DriverObject, 0, //has no device extension
&nameString, FILE_DEVICE_DISK_FILE_SYSTEM,
FILE_DEVICE_SECURE_OPEN, FALSE, &gPadLockFilter_ControlDeviceObject );
if ( status == STATUS_OBJECT_PATH_NOT_FOUND )
{
//
// This must be a version of the OS that doesn’t have the
Filters
// path in its namespace. This was added in Windows XP.
//
// We will try just putting our control device object in
the \FileSystem
// portion of the object name space.
//
RtlInitUnicodeString( &nameString,
L"\FileSystem\PkFilterCDO" );
status = IoCreateDevice( DriverObject, 0, //has no device
extension
&nameString, FILE_DEVICE_DISK_FILE_SYSTEM,
FILE_DEVICE_SECURE_OPEN, FALSE, &gPadLockFilter_ControlDeviceObject );
if ( !NT_SUCCESS( status ) )
{
KdPrint( ( “PkFilter!DriverEntry: Error creating
control device object "%wZ", status=%08x\n”, &nameString, status ) );
return status;
}
}
else if ( !NT_SUCCESS( status ) )
{
KdPrint( ( “PkFilter!DriverEntry: Error creating control
device object "%wZ", status=%08x\n”, &nameString, status ) );
return status;
}
Use the device interface reference strings.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “cnmmd”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Monday, July 12, 2004 5:52 AM
Subject: [ntfsd] DeviceIoControl to a filter,the APP how to CreateFile?
> 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@storagecraft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
—
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
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@livevault.com To unsubscribe
send a blank email to xxxxx@lists.osr.com