The OVERLAPPED structure is widely used in the Win32 functions (some examples are the functions ReadFile, WriteFile, DeviceIOControl, etc.). This structure is used to hold information about asynchronous operations.
The OVERLAPPED structure is defined as follows:
typedef struct _OVERLAPPED
{
ULONG_PTR Internal;
ULONG_PTR InternalHigh;
DWORD Offset;
DWORD OffsetHigh;
HANDLE hEvent;
} OVERLAPPED;
typedef OVERLAPPED* LPOVERLAPPED;
If you want to P/Invoke a Win32 function that has defined a parameter as LPOVERLAPPED (a pointer to a OVERLAPPED structure), I recommend you to use the already defined and documented System.Threading.NativeOverlapped structure instead of define your own OVERLAPPED structure in C# (or any other .NET-language).
See some examples at http://www.pinvoke.net/, I already changed all references to the OVERLAPPED structure to System.Threading.NativeOverlapped instead. Be aware that System.Threading.NativeOverlapped is not included in the Microsoft .NET Compact Framework.
Tuesday, August 10, 2004
Subscribe to:
Posts (Atom)