GetProcAddress function kernel32

Win32Result<FARPROC> GetProcAddress(
  1. HMODULE hModule,
  2. PCSTR lpProcName
)

Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).

To learn more, see learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress.

Implementation

Win32Result<FARPROC> GetProcAddress(HMODULE hModule, PCSTR lpProcName) {
  final result_ = GetProcAddress_Wrapper(hModule, lpProcName);
  return .new(value: result_.value.ptr.cast(), error: result_.error);
}