31# pragma warning(disable:4091)
40 return h != 0 && h != INVALID_HANDLE_VALUE;
48#define WUTIL_FUNC(varName, ret, params)\
49 ret (WINAPI* varName) params
59#define WUTIL_IMPORT(hModule, procName, varName)\
61 const FARPROC f = GetProcAddress(hModule, #procName);\
62 memcpy(&varName, &f, sizeof(FARPROC));\
67#define WUTIL_IMPORT_KERNEL32(procName, varName)\
68 WUTIL_IMPORT(GetModuleHandleW(L"kernel32.dll"), procName, varName)
72#define WUTIL_IMPORT_NTDLL(procName, varName)\
73 WUTIL_IMPORT(GetModuleHandleW(L"ntdll.dll"), procName, varName)
~WinScopedLock()
Definition: wutil.h:109
WinScopedLock(WinLockId id)
Definition: wutil.h:103
WinLockId m_id
Definition: wutil.h:115
some WinAPI functions SetLastError(0) on success, which is bad because it can hide previous errors.
Definition: wutil.h:128
WinScopedPreserveLastError()
Definition: wutil.h:130
DWORD m_lastError
Definition: wutil.h:143
~WinScopedPreserveLastError()
Definition: wutil.h:136
i64 Status
Error handling system.
Definition: status.h:173
void wutil_EnableHiDPIOnWindows()
Definition: wutil.cpp:277
WinLockId
Definition: wutil.h:87
@ NUM_CS
Definition: wutil.h:91
@ WDIR_WATCH_CS
Definition: wutil.h:89
@ WDBG_SYM_CS
Definition: wutil.h:88
bool wutil_IsValidHandle(H h)
Definition: wutil.h:38
void wutil_SetAppWindow(void *hwnd)
Definition: wutil.cpp:251
Status wutil_SetPrivilege(const wchar_t *privilege, bool enable)
Definition: wutil.cpp:197
OsPath wutil_PersonalPath()
Definition: wutil.cpp:189
OsPath wutil_LocalAppdataPath()
Definition: wutil.cpp:177
void wutil_Lock(WinLockId id)
Definition: wutil.cpp:71
Status StatusFromWin()
Definition: wutil.cpp:119
bool wutil_IsLocked(WinLockId id)
Definition: wutil.cpp:85
OsPath wutil_RoamingAppdataPath()
Definition: wutil.cpp:183
HMODULE wutil_LibModuleHandle()
Definition: wutil.cpp:224
void * wutil_Allocate(size_t size)
Definition: wutil.cpp:48
void wutil_Free(void *p)
Definition: wutil.cpp:54
void wutil_Unlock(WinLockId id)
Definition: wutil.cpp:78
HWND wutil_AppWindow()
Definition: wutil.cpp:256