How would one set the Argument 5 of the function below to be NULL? The MSDN reference says that if we are not doing an asynchronous write then it needs to be set to NULL.
I have tried 0, null and IntPtr.Zero unsuccessfully. My attempts to create a fake NativeOverlapped* struct led me down a path where I had to declare unsafe and isolate the WriteFile from any access to necessary buffers and parameters.
The write file call:
success = FileIO.WriteFile
IntPtr.Zero); <- error CS1503: Argument '5': cannot convert from 'System.IntPtr' to 'System.Threading.NativeOverlapped*'
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)]
internal static extern unsafe int WriteFile(IntPtr handle, IntPtr buffer, int numBytesToWrite, IntPtr numBytesWritten, NativeOverlapped* lpOverlapped);
I made sure the Write Handle is not flagging the OVERLAPPED argument.
IntPtr pWriteHandle = FileIO.CreateFile
Thanks in advance for any insight.