Software & Application Miscellaneous: ZwOpenFile issue

  • anonymous / 205 / Sun, 31 Jan 2010 15:55:00 GMT / Comments (1)
  • 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
  • Keywords:

    zwopenfile, issue, software, application

  • http://software.itags.org/software-application/240743/«« Last Thread - Next Thread »»
    1. 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

      hbb | Tues, 20 May 2008 07:46:00 GMT |

  • Software & Application Miscellaneous Questions

    • Zwiki 0.41 released, news for april

      Seems I'm never going to finish this just *post* it!*What is it ?*Zwiki is a Zope product for b...

      By simonmichael

    • How can I do?

      Thomas Bohl schrieb:> I have the impression that since some time (since Vers. 5.0?) N[expr] does&...

      By peter_pein

    • ZwCreateFile failing

      Hi, I have a routine which open the file handle for me. It works fine as long as no one touches the ...

      By anonymous

    • How can I do?

      Hello Bruce,Thanks a lot for your explanation! I got it.I should have read the known BUGs before:)Ma...

      By wyel_en