Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateFile problem!

Status
Not open for further replies.

shanlon

Technical User
Dec 4, 2000
24
IE
Could anyone tell me what is wrong with the following piece of code:
HANDLE hDriver;
hDriver = CreateFile("\\\\.\\E:", GENERIC_READ,
FILE_SHARE_READ,0,OPEN_EXISTING,0,0);

The problem is with the string as far as i know because when i call the ReadFile function and pass it the handle hDriver i get error6 which is INVALID_HANDLE.
I've tried all sorts of variations of the string and still nothing but error6.
According to MSDN the string should be ok.

I regularly use the string "\\\\.\\physicaldrive0" and this works fine but i want to access logical partitions.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top