IoCreateFileSpecifyDeviceObjectHint returning STATUS_OBJECT_PATH_SYNTAX_BAD

Under the assumption that Neal is going to find a viable solution for the hotfix I have begun to write the required code to handle the IoCreateFileSpecifyDeviceObjectHint and find I really don’t quite know how to use this function properly.

I seem to always get a return of STATUS_OBJECT_PATH_SYNTAX_BAD, and from the docs I am guessing it is because my CreateOptions and Dispositions are wrong.

The below snippet has “\Device\HarddiskVolume1\WINDOWS” as tokenStr, and I wish to open the directory so I can get the handle to make my FileObject and then pass it to my routine doing the directory query IRP. Can anyone tell me what causes the STATUS_OBJECT_PATH_SYNTAX_BAD to be returned?

InitializeObjectAttributes(
&attributes,
&tokenStr,
OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
NULL,
NULL );

status = IoCreateFileSpecifyDeviceObjectHint(
&handle, // File Handle
GENERIC_READ, // Desired Access
&attributes, // Attributes
&iosb, // IO Status Block
NULL, // Allocation size
FILE_ATTRIBUTE_DIRECTORY, // File attributes
FILE_SHARE_READ,
FILE_OPEN, // Create disposition
FILE_DIRECTORY_FILE, // Create options
NULL, // EA buffer
0, // EA size
CreateFileTypeNone, // CreateFileType
NULL, // Extra create parameters
0, // Options
devExt->AttachedToDeviceObject // Device object to use for open
);


Regards,
Dana Epp
[Blog: http://silverstr.ufies.org/blog/]