27 #ifndef INCLUDED_WUTIL
28 #define INCLUDED_WUTIL
36 return h != 0 && h != INVALID_HANDLE_VALUE;
44 #define WUTIL_FUNC(varName, ret, params)\
45 ret (WINAPI* varName) params
55 #define WUTIL_IMPORT(hModule, procName, varName)\
57 const FARPROC f = GetProcAddress(hModule, #procName);\
58 memcpy(&varName, &f, sizeof(FARPROC));\
63 #define WUTIL_IMPORT_KERNEL32(procName, varName)\
64 WUTIL_IMPORT(GetModuleHandleW(L"kernel32.dll"), procName, varName)
205 #endif // #ifndef INCLUDED_WUTIL
void wutil_Unlock(WinLockId id)
some WinAPI functions SetLastError(0) on success, which is bad because it can hide previous errors...
HMODULE wutil_LibModuleHandle()
void * wutil_Allocate(size_t size)
bool wutil_IsValidHandle(H h)
~WinScopedPreserveLastError()
bool wutil_IsLocked(WinLockId id)
const OsPath & wutil_RoamingAppdataPath()
const OsPath & wutil_LocalAppdataPath()
WinScopedDisableWow64Redirection()
i64 Status
Error handling system.
Status wutil_SetPrivilege(const wchar_t *privilege, bool enable)
void * m_wasRedirectionEnabled
WinScopedPreserveLastError()
const OsPath & wutil_ExecutablePath()
WinScopedLock(WinLockId id)
const OsPath & wutil_SystemPath()
bool wutil_HasCommandLineArgument(const wchar_t *arg)
~WinScopedDisableWow64Redirection()
void wutil_Lock(WinLockId id)
const OsPath & wutil_PersonalPath()