GetComputerName function Null safety kernel32

int GetComputerName(
  1. Pointer<Utf16> lpBuffer,
  2. Pointer<Uint32> nSize
)

Retrieves the NetBIOS name of the local computer. This name is established at system startup, when the system reads it from the registry.

BOOL GetComputerNameW(
  LPWSTR  lpBuffer,
  LPDWORD nSize
);

Implementation

int GetComputerName(Pointer<Utf16> lpBuffer, Pointer<Uint32> nSize) {
  final _GetComputerName = _kernel32.lookupFunction<
      Int32 Function(Pointer<Utf16> lpBuffer, Pointer<Uint32> nSize),
      int Function(
          Pointer<Utf16> lpBuffer, Pointer<Uint32> nSize)>('GetComputerNameW');
  return _GetComputerName(lpBuffer, nSize);
}