J
Jim Flanagan
Hi...
I am using VB.net Express to experiment with the Win32 API functions
that are available. The current project is an application that will
read the raw sectors of a logical drive so that a CRC-32 calculation can
be performed on all of the bytes of the logical drive. This is my first
experience with the CreateFile function.
Here is the problem(s) that I am having.
Here is my declaration of the function in a separate module.
Declare Function CreateFile Lib "kernel32" _
Alias "CreateFileA" ( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Integer, _
ByVal dwShareMode As Integer, _
ByRef lpSecurityAttributes As Integer, _
ByVal dwCreationDisposition As Integer, _
ByVal dwFlagsAndAttributes As Integer, _
ByVal hTemplateFile As Integer) As Integer
Here is how I am calling the function:
Simply trying to open a file for reading...
hDevice = CreateFile("C:\Autoexec.bat", GENERIC_READ, _
FILE_SHARE_READ Or FILE_SHARE_WRITE, _
0%, _
OPEN_EXISTING, _
0%, 0%)
Initially, I was having success opening a physical drive using this
function. However, all of a sudden I am now getting a system error:
"The revision level is unknown."
and the function fails.
I'm stumped. If anyone has any suggestions would be appreciated.
Thanks.
-jim
I am using VB.net Express to experiment with the Win32 API functions
that are available. The current project is an application that will
read the raw sectors of a logical drive so that a CRC-32 calculation can
be performed on all of the bytes of the logical drive. This is my first
experience with the CreateFile function.
Here is the problem(s) that I am having.
Here is my declaration of the function in a separate module.
Declare Function CreateFile Lib "kernel32" _
Alias "CreateFileA" ( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Integer, _
ByVal dwShareMode As Integer, _
ByRef lpSecurityAttributes As Integer, _
ByVal dwCreationDisposition As Integer, _
ByVal dwFlagsAndAttributes As Integer, _
ByVal hTemplateFile As Integer) As Integer
Here is how I am calling the function:
Simply trying to open a file for reading...
hDevice = CreateFile("C:\Autoexec.bat", GENERIC_READ, _
FILE_SHARE_READ Or FILE_SHARE_WRITE, _
0%, _
OPEN_EXISTING, _
0%, 0%)
Initially, I was having success opening a physical drive using this
function. However, all of a sudden I am now getting a system error:
"The revision level is unknown."
and the function fails.
I'm stumped. If anyone has any suggestions would be appreciated.
Thanks.
-jim