WriteFileEx function kernel32

int WriteFileEx(
  1. int hFile,
  2. Pointer<Uint8> lpBuffer,
  3. int nNumberOfBytesToWrite,
  4. Pointer<OVERLAPPED> lpOverlapped,
  5. Pointer<NativeFunction<LPOVERLAPPED_COMPLETION_ROUTINE>> lpCompletionRoutine,
)

Writes data to the specified file or input/output (I/O) device. It reports its completion status asynchronously, calling the specified completion routine when writing is completed or canceled and the calling thread is in an alertable wait state.

BOOL WriteFileEx(
  [in]           HANDLE                          hFile,
  [in, optional] LPCVOID                         lpBuffer,
  [in]           DWORD                           nNumberOfBytesToWrite,
  [in, out]      LPOVERLAPPED                    lpOverlapped,
  [in]           LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);

Implementation

int WriteFileEx(
        int hFile,
        Pointer<Uint8> lpBuffer,
        int nNumberOfBytesToWrite,
        Pointer<OVERLAPPED> lpOverlapped,
        Pointer<NativeFunction<LPOVERLAPPED_COMPLETION_ROUTINE>>
            lpCompletionRoutine) =>
    _WriteFileEx(hFile, lpBuffer, nNumberOfBytesToWrite, lpOverlapped,
        lpCompletionRoutine);