CreateFile2 function kernel32

int CreateFile2(
  1. Pointer<Utf16> lpFileName,
  2. int dwDesiredAccess,
  3. int dwShareMode,
  4. int dwCreationDisposition,
  5. Pointer<CREATEFILE2_EXTENDED_PARAMETERS> pCreateExParams,
)

Creates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe. The function returns a handle that can be used to access the file or device for various types of I/O depending on the file or device and the flags and attributes specified.

HANDLE CreateFile2(
  [in]           LPCWSTR                           lpFileName,
  [in]           DWORD                             dwDesiredAccess,
  [in]           DWORD                             dwShareMode,
  [in]           DWORD                             dwCreationDisposition,
  [in, optional] LPCREATEFILE2_EXTENDED_PARAMETERS pCreateExParams
);

Implementation

int CreateFile2(
  Pointer<Utf16> lpFileName,
  int dwDesiredAccess,
  int dwShareMode,
  int dwCreationDisposition,
  Pointer<CREATEFILE2_EXTENDED_PARAMETERS> pCreateExParams,
) => _CreateFile2(
  lpFileName,
  dwDesiredAccess,
  dwShareMode,
  dwCreationDisposition,
  pCreateExParams,
);