GetEnvironmentVariable function kernel32
Retrieves the contents of the specified variable from the environment block of the calling process.
To learn more, see learn.microsoft.com/windows/win32/api/processenv/nf-processenv-getenvironmentvariablew.
Implementation
Win32Result<int> GetEnvironmentVariable(
PCWSTR? lpName,
PWSTR? lpBuffer,
int nSize,
) {
final result_ = GetEnvironmentVariableW_Wrapper(
lpName ?? nullptr,
lpBuffer ?? nullptr,
nSize,
);
return .new(value: result_.value.u32, error: result_.error);
}