GetUserDefaultLocaleName function Null safety kernel32

int GetUserDefaultLocaleName(
  1. Pointer<Utf16> lpLocaleName,
  2. int cchLocaleName
)

Retrieves the user default locale name.

int GetUserDefaultLocaleName(
  LPWSTR lpLocaleName,
  int    cchLocaleName
);

Implementation

int GetUserDefaultLocaleName(Pointer<Utf16> lpLocaleName, int cchLocaleName) {
  final _GetUserDefaultLocaleName = _kernel32.lookupFunction<
      Int32 Function(Pointer<Utf16> lpLocaleName, Int32 cchLocaleName),
      int Function(Pointer<Utf16> lpLocaleName,
          int cchLocaleName)>('GetUserDefaultLocaleName');
  return _GetUserDefaultLocaleName(lpLocaleName, cchLocaleName);
}