?
=?ISO-8859-1?Q?Herbert_VON_GR=DCNENWALD?=
i'v got:
[DllImport("KERNEL32.DLL")]
public static extern int ReadFile(
IntPtr hFile,
IntPtr lpBuffer,
uint nNumberOfBytesToRead,
ref uint lpNumberOfBytesRead,
uint lpOverlapped);
to map:
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
my call in C# is:
byte[] buf = new byte[512];
uint NumberOfBytesRead;
Win32.ReadFile(handle, buf, (uint)buf.Length, ref NumberOfBytesRead, 0);
but of course, buf is not a IntPtr
so, my questions are:
- what is the best signature for ReadFile ?
- id byte[] is adequate for LPVOID ?
[DllImport("KERNEL32.DLL")]
public static extern int ReadFile(
IntPtr hFile,
IntPtr lpBuffer,
uint nNumberOfBytesToRead,
ref uint lpNumberOfBytesRead,
uint lpOverlapped);
to map:
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
my call in C# is:
byte[] buf = new byte[512];
uint NumberOfBytesRead;
Win32.ReadFile(handle, buf, (uint)buf.Length, ref NumberOfBytesRead, 0);
but of course, buf is not a IntPtr
so, my questions are:
- what is the best signature for ReadFile ?
- id byte[] is adequate for LPVOID ?