none
how to open the file in system volume? RRS feed

  • Question

  • Hi all,

    Can someone tell me how to open a file in the system volume (ex. C:\test.txt, or D:\test.txt if OS is installed in D:\) by using ZwCreateFile().

    I tried to use the \SystemDrive namespace in the file name, but ZwCreateFile() returns a error code 0xC000003A which means STATUS_OBJECT_PATH_NOT_FOUND.

    thanks,

    Albert

    Tuesday, January 29, 2013 3:14 AM

All replies

  • What problem are you trying to solve? Writing to the root of the system volume is not a great idea.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 29, 2013 3:27 AM
  • i try to edit a file saved in \SystemDrive\xxx\xxx\xxx.txt

    Tuesday, January 29, 2013 3:37 AM
  • why are you doing this in a driver? you didn't describe the bigger problem you are trying to solve, rather you have just described what you think is the solution to the bigger problem

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 29, 2013 3:51 AM
  • i am trying to write a storport miniport driver.

    there is a file to save system configuration(like buzz enalbe/disable).

    if configuration change, i need to modify the config file.

    Tuesday, January 29, 2013 5:43 AM
  • Store your settings in the registry. There is no guarantee that the filesystem is up and running at boot when your miniport initializes. Either way you have an irql problem as both methods require passive irql, which i don't think you get in an storport callback after init.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 29, 2013 6:28 AM