Is it valid to call ZwOpenFile in the InstanceSetupCallback routine? The
Development Guide says that the InstanceSetupCallback routine can "It can
also open and close files on the volume". page (5). Does this mean
ZwOpenFile/ZwCloseFile?
On machines that it "works" on it never fails. On some machines it fails by
never returning from the call. The driver will never unload and you have to
do a hard boot.
Anybody ever use ZwOpenFile in the InstanceSetupCallback routine?
Still trying to build a perpetual motion machine
"jc" wrote:
> I have a filter driver that filters the UDF. When the UDF mounts the filter
> looks for certain files on the DVD to verify if it is something that I want
> to "filter". I use ZwOpenFile in the SetupCallback routine. This works fine
> except for one problem. If the last disc to be in the drive was one that I
> was filtering and I then eject the disc and unload/load the filter.
> Eventhough the disc is no longer in the drive I get a mount request. This
> would be OK except for the fact that my ZwOpenFile never returns. It is OK if
> there is ANY disc in the drive (one that I filter or not) but the lack of a
> disc seems to cause an issue. I think this is because of the caching the
> windows does.
> Is there a call that I can make so that windows can flush the cache so that
> it will recognize that there isn't a disc in the drive to mount?
> Is there an option to ZwOpenFile or InitializeObjectAttributes that I should
> set differently? I have tried FILE_SYNCHRONOUS_IO_ALERT.
> Here is my ZwOpenFile
> InitializeObjectAttributes( &ObjectAttributes,
> fileName,
> OBJ_CASE_INSENSITIVE|OBJ_KERNEL_HANDLE,
> NULL,
> NULL);
> ntStatus = ZwOpenFile( FileHandle,
> GENERIC_READ|SYNCHRONIZE,
> &ObjectAttributes,
> &IoStatusBlock,
> 0,
> FILE_NON_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT);
> Thanks!
> --
> Still trying to build a perpetual motion machine