mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
1fda267dc5
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2315 21ef857c-d57f-4fe0-8362-d861dc6d29cd
57 lines
960 B
C
57 lines
960 B
C
#include <phgui.h>
|
|
#include <wchar.h>
|
|
|
|
PVOID PhAllocate(
|
|
__in SIZE_T Size
|
|
)
|
|
{
|
|
return HeapAlloc(PhHeapHandle, 0, Size);
|
|
}
|
|
|
|
VOID PhFree(
|
|
__in PVOID Memory
|
|
)
|
|
{
|
|
HeapFree(PhHeapHandle, 0, Memory);
|
|
}
|
|
|
|
PVOID PhReAlloc(
|
|
__in PVOID Memory,
|
|
__in SIZE_T Size
|
|
)
|
|
{
|
|
return HeapReAlloc(PhHeapHandle, 0, Memory, Size);
|
|
}
|
|
|
|
INT PhShowMessage(
|
|
__in HWND hWnd,
|
|
__in ULONG Type,
|
|
__in PWSTR Format,
|
|
...
|
|
)
|
|
{
|
|
va_list argptr;
|
|
|
|
va_start(argptr, Format);
|
|
|
|
return PhShowMessage_V(hWnd, Type, Format, argptr);
|
|
}
|
|
|
|
INT PhShowMessage_V(
|
|
__in HWND hWnd,
|
|
__in ULONG Type,
|
|
__in PWSTR Format,
|
|
__in va_list ArgPtr
|
|
)
|
|
{
|
|
INT result;
|
|
WCHAR message[PH_MAX_MESSAGE_SIZE];
|
|
|
|
result = _vsnwprintf(message, PH_MAX_MESSAGE_SIZE, Format, ArgPtr);
|
|
|
|
if (result == -1)
|
|
return -1;
|
|
|
|
return MessageBox(hWnd, message, PH_APP_NAME, Type);
|
|
}
|