Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

OSR is Hiring! Click here to find out more.

Upcoming OSR Seminars:
Kernel Debugging & Crash Analysis Lab, Palo Alto, CA 18-22 August, 2014
Writing WDF Drivers for Windows Lab, Boston/Waltham, MA 22-26 September, 2014
Windows Internals & Software Drivers Lab, Dulles/Sterling, VA, 20-24 October, 2014
Developing File Systems for Windows, Seattle, WA 4-7 November, 2014


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 2  
16 Feb 02 11:20
ntdev member 4653
xxxxxx@mclean.sparta.com
Join Date:
Posts To This List: 3
writing to PhysicalDriveX

I have a requirement to do raw reads and writes to a physical drive at the kernel level. I am opening a handle to the drives using ZwCreateFile by passing in "\DosDevices\PhysicalDriveX" where "X" is "0", "1", etc. I can successfully open and read a drive using this technigue, but my ZwCreateFile call always fails when I attempt to open the drive for writing. The error returned varies between "STATUS_INVALID_PARAMETER", "STATUS_ACCESS_DENIED", and "STATUS_OBJECT_NAME_NOT_FOUND" depending on how I have the parameters set. Has anyone tried this and can provide me with the proper function syntax. Thanks in advance, Craig Denbrook Sparta, Inc. --- You are currently subscribed to ntdev as: $subst('Recip.EmailAddr') To unsubscribe send a blank email to leave-ntdev-$subst('Recip.MemberIDChar')@lists.osr.com
  Message 2 of 2  
16 Feb 02 13:42
ntdev member 6069
xxxxxx@backmagic.de
Join Date:
Posts To This List: 109
writing to PhysicalDriveX

Craig, you wrote on Saturday, February 16, 2002, 12:19:29: cmsc> I have a requirement to do raw reads and writes to a physical cmsc> drive at the kernel level. I am opening a handle to the drives cmsc> using ZwCreateFile by passing in "\DosDevices\PhysicalDriveX" cmsc> where "X" is "0", "1", etc. I can successfully open and read a cmsc> drive using this technigue, but my ZwCreateFile call always fails cmsc> when I attempt to open the drive for writing. The error returned cmsc> varies between "STATUS_INVALID_PARAMETER", "STATUS_ACCESS_DENIED", cmsc> and "STATUS_OBJECT_NAME_NOT_FOUND" depending on how I have the cmsc> parameters set. Has anyone tried this and can provide me with the cmsc> proper function syntax. Make sure you have the sharing options set to FILE_SHARE_READ|FILE_SHARE_WRITE. Ralf. --- You are currently subscribed to ntdev as: $subst('Recip.EmailAddr') To unsubscribe send a blank email to leave-ntdev-$subst('Recip.MemberIDChar')@lists.osr.com
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 15:29.


Copyright ©2014, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license