I need to import a C-function which is descripted as
int Read(LPBYTE data, LPBYTE lengthOfData);
The documentation says the following:
data
[out] data which was read
lengthOfData
[out] length of data which was read
And there is the following example of using this function:
int num = 0;
BYTE data[16] = {0};
while (num < 6)
{
int dataLen = 0;
Read(data, &dataLen);
num += dataLen;
}
How to import this function?
As I understand, the first one parameter is an array of bytes.
Can I import it as:
public static extern int Read([Out] IntPtr data, [Out] byte dataLength);
or I should use out
keyword, maybe?