2 messages in net.java.dev.jna.usersNeed usage info and mapping for ReadFile
FromSent OnAttachments
Alan VeaseyApr 29, 2008 9:22 am 
Timothy WallApr 29, 2008 10:10 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Need usage info and mapping for ReadFileActions...
From:Alan Veasey (avea@yahoo.com)
Date:Apr 29, 2008 9:22:54 am
List:net.java.dev.jna.users

I am trying to use the ReadFile API function. The signatures goes like this:

BOOL WINAPI ReadFile( __in HANDLE hFile, __out LPVOID lpBuffer, __in DWORD nNumberOfBytesToRead, __out_opt LPDWORD lpNumberOfBytesRead, __inout_opt LPOVERLAPPED lpOverlapped );

So I have made:

boolean ReadFile( HANDLE hFile, Pointer lpBuffer, int nNumberOfBytesToRead, IntByReference lpNumberOfBytesRead, OVERLAPPED lpOverlapped);

I believe this is correct, but is it? I am using HANDLE and OVERLAPPED definitions from the Kernel32 samples.

Now the part I can't figure out - how to use it. I can't instantiate a Pointer or PointerType. So how do I declare the Pointer lpBuffer variable to pass to the function? Also, how do I get the data out of the variable type once read?

Thank you greatly for your help!

Alan