14#if defined(__cplusplus)
23 #define snprintf _snprintf
24 #if !defined(vsnprintf)
25 #define vsnprintf _vsnprintf
29#if !defined(__KERNEL__)
40#if !defined(__KERNEL__)
197 #define OsMemoryBarrier() __sync_synchronize()
199 #define OsMemoryBarrier() MemoryBarrier()
202#if !defined(__KERNEL__)
205int print2wstr(
wchar_t *buffer,
size_t count,
const wchar_t *format , ...);
227 _In_ const char *format,
_In_ va_list ap);
249 const char *format, ...);
301 _In_ DWORD dwSizeStr,
_In_ const CHAR *pcInputText,
302 _In_ const CHAR *pcDefaultString);
320 _In_ DWORD dwFileNameSize,
_In_ const CHAR *pcDefaultFileName);
348 #if !defined(stricmp)
349 #define stricmp strcasecmp
351 #if !defined(strnicmp)
352 #define strnicmp strncasecmp
378#if !defined(INFINITE)
379 #define INFINITE 0xffffffff
int print2wstr(wchar_t *buffer, size_t count, const wchar_t *format,...)
void DLLCALLCONV vPrintDbgMessage(_In_ DWORD dwLevel, _In_ DWORD dwSection, _In_ const char *format, _In_ va_list ap)
Sends debug messages to the Debug Monitor.
void DLLCALLCONV PrintDbgMessage(DWORD dwLevel, DWORD dwSection, const char *format,...)
Sends debug messages to the Debug Monitor.
void DLLCALLCONV OsMutexClose(_In_ HANDLE hOsMutex)
Closes a handle to a mutex object.
DWORD DLLCALLCONV OsEventReset(_In_ HANDLE hOsEvent)
Resets the specified event object to the non-signaled state.
BOOL UtilGetCurrentTime(_Out_ TIME_TYPE *time)
Retrieves the current time, in OS units.
DWORD DLLCALLCONV OsEventSignal(_In_ HANDLE hOsEvent)
Sets the specified event object to the signaled state.
DWORD DLLCALLCONV ThreadStart(_Outptr_ HANDLE *phThread, _In_ HANDLER_FUNC pFunc, _In_ void *pData)
Creates a thread.
DWORD DLLCALLCONV OsMutexCreate(_Outptr_ HANDLE *phOsMutex)
Creates a mutex object.
void DLLCALLCONV ThreadWait(_In_ HANDLE hThread)
Waits for a thread to exit.
void(DLLCALLCONV * HANDLER_FUNC)(void *pData)
DWORD DLLCALLCONV UtilGetStringFromUser(_Out_ PCHAR pcString, _In_ DWORD dwSizeStr, _In_ const CHAR *pcInputText, _In_ const CHAR *pcDefaultString)
Gets a string from user input and out it in pcString.
void DLLCALLCONV SleepWrapper(_In_ DWORD dwMicroSecs)
Wrapper to WD_Sleep, Sleeps dwMicroSecs microseconds.
double UtilGetTimeDiff(_In_ TIME_TYPE *end, _In_ TIME_TYPE *start)
Calculates the time difference in milliseconds.
BOOL DLLCALLCONV UtilGetFileSize(_In_ const PCHAR sFileName, _Outptr_ DWORD *pdwFileSize, _In_ PCHAR sErrString)
Writes the file size with name sFileName in dwFileSize.
DWORD DLLCALLCONV UtilGetFileName(_Out_ PCHAR pcFileName, _In_ DWORD dwFileNameSize, _In_ const CHAR *pcDefaultFileName)
Gets a file name from user input and out it in pcFileName.
DWORD DLLCALLCONV OsMutexLock(_In_ HANDLE hOsMutex)
Locks the specified mutex object.
DWORD UtilGetCurrentTimeInMillisec(void)
Get the current time in milliseconds, relative to a non user determined starting point (Starting poin...
int DLLCALLCONV GetNumberOfProcessors(void)
Returns the number of processors currently online (available)
int DLLCALLCONV GetPageSize(void)
Returns the page size in the OS.
DWORD DLLCALLCONV OsEventWait(_In_ HANDLE hOsEvent, _In_ DWORD dwSecTimeout)
Waits until a specified event object is in the signaled state or the time-out interval elapses.
void DLLCALLCONV OsEventClose(_In_ HANDLE hOsEvent)
Closes a handle to an event object.
DWORD DLLCALLCONV EnableVTMode(void)
Enables Virtual Terminal Mode in Windows, allows color prints in the terminal.
DWORD DLLCALLCONV OsMutexUnlock(_In_ HANDLE hOsMutex)
Releases (unlocks) a locked mutex object.
DWORD DLLCALLCONV OsEventCreate(_Outptr_ HANDLE *phOsEvent)
Creates an event object.