getIDList method

Pointer<ITEMIDLIST> getIDList(
  1. int dwFlags
)

Gets the location of the Shell namespace folder in the IDList (ITEMIDLIST) form.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-iknownfolder-getidlist.

Implementation

Pointer<ITEMIDLIST> getIDList(int dwFlags) {
  final ppidl = adaptiveCalloc<Pointer<ITEMIDLIST>>();
  final hr$ = HRESULT(_GetIDListFn(ptr, dwFlags, ppidl));
  if (hr$.isError) {
    free(ppidl);
    throw WindowsException(hr$);
  }
  final result$ = ppidl.value;
  free(ppidl);
  return result$;
}