I need to use a method from a library that has the following signature in the header file:
NKREMOTELIB_API int __stdcall GetEvfFrame(
const unsigned char*& buffer,
size_t& size,
NKRemoteEvfDisplayInfo& displayInfo);
I call them from C # using the following:
[DllImport("NKRemoteLib.dll")]
public static extern int GetEvfFrame(out IntPtr buffer, out IntPtr size, out NKRemoteEvfDisplayInfo displayInfo);
private void Test() {
IntPtr size = new IntPtr();
IntPtr buffer = new IntPtr();
NKRemoteEvfDisplayInfo displayInfo;
int res = GetEvfFrame(out buffer, out size, out displayInfo);
}
I have displayInfo defined as a struct in C #.
In my question, what is the meaning for the ampersand in the function signature in the header file? Why size_t & instead of size_t or char * & instead of char *?
source
share