SHGetKnownFolderPath function Null safety shell32

int SHGetKnownFolderPath(
  1. Pointer<GUID> rfid,
  2. int dwFlags,
  3. int hToken,
  4. Pointer<Pointer<Utf16>> ppszPath
)

Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID.

HRESULT SHGetKnownFolderPath(
  REFKNOWNFOLDERID rfid,
  DWORD            dwFlags,
  HANDLE           hToken,
  PWSTR            *ppszPath
);

Implementation

int SHGetKnownFolderPath(Pointer<GUID> rfid, int dwFlags, int hToken,
    Pointer<Pointer<Utf16>> ppszPath) {
  final _SHGetKnownFolderPath = _shell32.lookupFunction<
      Int32 Function(Pointer<GUID> rfid, Uint32 dwFlags, IntPtr hToken,
          Pointer<Pointer<Utf16>> ppszPath),
      int Function(Pointer<GUID> rfid, int dwFlags, int hToken,
          Pointer<Pointer<Utf16>> ppszPath)>('SHGetKnownFolderPath');
  return _SHGetKnownFolderPath(rfid, dwFlags, hToken, ppszPath);
}