GetDllDirectory function kernel32

Win32Result<int> GetDllDirectory(
  1. int nBufferLength,
  2. PWSTR? lpBuffer
)

Retrieves the application-specific portion of the search path used to locate DLLs for the application.

To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-getdlldirectoryw.

Implementation

Win32Result<int> GetDllDirectory(int nBufferLength, PWSTR? lpBuffer) {
  resolveGetLastError();
  final result_ = _GetDllDirectory(nBufferLength, lpBuffer ?? nullptr);
  return .new(value: result_, error: GetLastError());
}