QueryDosDevice function Null safety kernel32

int QueryDosDevice(
  1. Pointer<Utf16> lpDeviceName,
  2. Pointer<Utf16> lpTargetPath,
  3. int ucchMax
)

Retrieves information about MS-DOS device names. The function can obtain the current mapping for a particular MS-DOS device name. The function can also obtain a list of all existing MS-DOS device names.

DWORD QueryDosDeviceW(
  LPCWSTR lpDeviceName,
  LPWSTR  lpTargetPath,
  DWORD   ucchMax
);

Implementation

int QueryDosDevice(
    Pointer<Utf16> lpDeviceName, Pointer<Utf16> lpTargetPath, int ucchMax) {
  final _QueryDosDevice = _kernel32.lookupFunction<
      Uint32 Function(Pointer<Utf16> lpDeviceName, Pointer<Utf16> lpTargetPath,
          Uint32 ucchMax),
      int Function(Pointer<Utf16> lpDeviceName, Pointer<Utf16> lpTargetPath,
          int ucchMax)>('QueryDosDeviceW');
  return _QueryDosDevice(lpDeviceName, lpTargetPath, ucchMax);
}