/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
{
PVOID pData;
size_t cbData;
- LPSTR pszExpr;
- LPSTR pszFile;
+ LPTSTR pszExpr;
+ LPTSTR pszFile;
DWORD dwLine;
DWORD dwTick;
DWORD dwEndSig;
#define cyLABELS 15
-HWND MakeWindow (LPCTSTR pszClass, LPCTSTR pszTitle, DWORD dwStyle, RECT *prSource,
+HWND MakeWindow (LPCTSTR pszClass, LPCTSTR pszTitle, DWORD dwStyle, RECT *prSource,
HWND hParent, UINT idc, DWORD dwStyleEx = 0)
{
RECT rr = { 0, 0, 16, 16 };
if (prSource)
rr = *prSource;
- HWND hWnd = CreateWindowEx (dwStyleEx, pszClass, pszTitle, dwStyle,
- rr.left, rr.top, rr.right - rr.left, rr.bottom - rr.top,
+ HWND hWnd = CreateWindowEx (dwStyleEx, pszClass, pszTitle, dwStyle,
+ rr.left, rr.top, rr.right - rr.left, rr.bottom - rr.top,
hParent, (HMENU)UIntToPtr(idc), GetModuleHandle(0), 0);
if (IsWindow (hWnd))
SendMessage (hWnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 1);
void SetWindowRect (HWND hWnd, RECT *pr)
{
- SetWindowPos (hWnd, 0, pr->left, pr->top, pr->right - pr->left,
+ SetWindowPos (hWnd, 0, pr->left, pr->top, pr->right - pr->left,
pr->bottom - pr->top, SWP_NOZORDER | SWP_NOACTIVATE);
}
}
-void MemMgr_ShowWarning (PMEMCHUNK pChunk, LPSTR pszFile, DWORD dwLine, LPTSTR pszDesc)
+void MemMgr_ShowWarning (PMEMCHUNK pChunk, LPTSTR pszFile, DWORD dwLine, LPTSTR pszDesc)
{
TCHAR szMessage[ 1024 ];
wsprintf (szMessage, TEXT("%s\n\n Address: 0x%08p (%s)\n Allocated: %s line %ld\n Freed: %s line %ld\n\nClick OK for memory details."), pszDesc, pChunk->pData, pChunk->pszExpr, pChunk->pszFile, pChunk->dwLine, pszFile, dwLine);
}
-void MemMgr_TrackAllocation (PVOID pData, size_t cb, LPSTR pszExpr, LPSTR pszFile, DWORD dwLine, BOOL fSig)
+void MemMgr_TrackAllocation (PVOID pData, size_t cb, LPTSTR pszExpr, LPTSTR pszFile, DWORD dwLine, BOOL fSig)
{
if (!pData)
return;
}
-BOOL MemMgr_TrackDestruction (PVOID pData, LPSTR pszFile, DWORD dwLine)
+BOOL MemMgr_TrackDestruction (PVOID pData, LPTSTR pszFile, DWORD dwLine)
{
if (MemMgr_Initialize())
{
MEMCHUNK Sim;
memset (&Sim, 0x00, sizeof(MEMCHUNK));
Sim.pData = pData;
- Sim.pszExpr = "(unknown)";
- Sim.pszFile = "(unknown)";
+ Sim.pszExpr = TEXT("(unknown)");
+ Sim.pszFile = TEXT("(unknown)");
MemMgr_ShowWarning (&Sim, pszFile, dwLine, TEXT("An invalid memory address was freed."));
}
else if (pChunk->dwEndSig && (*(DWORD*)((PBYTE)pData + pChunk->cbData) != pChunk->dwEndSig))
}
-PVOID MEMMGR_CALLCONV MemMgr_AllocateMemory (size_t cb, LPSTR pszExpr, LPSTR pszFile, DWORD dwLine)
+PVOID MEMMGR_CALLCONV MemMgr_AllocateMemory (size_t cb, LPTSTR pszExpr, LPTSTR pszFile, DWORD dwLine)
{
PVOID pData = GlobalAlloc (GMEM_FIXED, cb + sizeof(DWORD));
MemMgr_TrackAllocation (pData, cb, pszExpr, pszFile, dwLine, TRUE);
}
-void MEMMGR_CALLCONV MemMgr_FreeMemory (PVOID pData, LPSTR pszFile, DWORD dwLine)
+void MEMMGR_CALLCONV MemMgr_FreeMemory (PVOID pData, LPTSTR pszFile, DWORD dwLine)
{
if (MemMgr_TrackDestruction (pData, pszFile, dwLine))
{
}
-PVOID MEMMGR_CALLCONV MemMgr_TrackNew (PVOID pData, size_t cb, LPSTR pszExpr, LPSTR pszFile, DWORD dwLine)
+PVOID MEMMGR_CALLCONV MemMgr_TrackNew (PVOID pData, size_t cb, LPTSTR pszExpr, LPTSTR pszFile, DWORD dwLine)
{
MemMgr_TrackAllocation (pData, cb, pszExpr, pszFile, dwLine, FALSE);
return pData;
}
-void MEMMGR_CALLCONV MemMgr_TrackDelete (PVOID pData, LPSTR pszFile, DWORD dwLine)
+void MEMMGR_CALLCONV MemMgr_TrackDelete (PVOID pData, LPTSTR pszFile, DWORD dwLine)
{
MemMgr_TrackDestruction (pData, pszFile, dwLine);
}