Author: tkreuzer
Date: Tue Dec 16 21:03:24 2014
New Revision: 65687
URL:
http://svn.reactos.org/svn/reactos?rev=65687&view=rev
Log:
[EVENTVWR]
Fix MSVC build and x64 warnings
Modified:
trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
Modified: trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] Tue Dec 16
21:03:24 2014
@@ -54,6 +54,7 @@
#define EVENT_PARAMETER_MESSAGE_FILE L"ParameterMessageFile"
#define MAX_LOADSTRING 255
+#define ENTRY_SIZE 2056
/* Globals */
HINSTANCE hInst; /* current instance */
@@ -723,7 +724,7 @@
0,
szTitleTemplate, szTitle, lpLogName); /* i = number of characters
written */
/* lpComputerName can be NULL here if no records was read */
- dwMaxLength = cchRemaining;
+ dwMaxLength = (DWORD)cchRemaining;
if (!lpComputerName)
GetComputerNameW(lpTitleTemplateEnd, &dwMaxLength);
else
@@ -880,7 +881,7 @@
WCHAR *KeyPath;
WCHAR szModuleName[MAX_PATH];
DWORD cbData;
- DWORD cbKeyPath;
+ SIZE_T cbKeyPath;
cbKeyPath = (wcslen(EVENTLOG_BASE_KEY) + wcslen(lpLogName) + 1) * sizeof(WCHAR);
KeyPath = HeapAlloc(GetProcessHeap(), 0, cbKeyPath);
@@ -916,7 +917,7 @@
WCHAR *KeyPath;
DWORD dwMessageID = 0;
DWORD cbData;
- DWORD cbKeyPath;
+ SIZE_T cbKeyPath;
cbKeyPath = (wcslen(EVENTLOG_BASE_KEY) + wcslen(lpLogName) + 1) * sizeof(WCHAR);
KeyPath = HeapAlloc(GetProcessHeap(), 0, cbKeyPath);
@@ -1444,7 +1445,6 @@
VOID
CopyEventEntry(HWND hWnd)
{
- const SIZE_T entrySize = 2056;
WCHAR output[4130], tmpHeader[512];
WCHAR szEventType[MAX_PATH];
WCHAR szSource[MAX_PATH];
@@ -1454,7 +1454,7 @@
WCHAR szTime[MAX_PATH];
WCHAR szUser[MAX_PATH];
WCHAR szComputer[MAX_PATH];
- WCHAR evtDesc[entrySize];
+ WCHAR evtDesc[ENTRY_SIZE];
HGLOBAL hMem;
if (!OpenClipboard(hWnd))
@@ -1475,14 +1475,14 @@
GetDlgItemText(hWnd, IDC_EVENTTIMESTATIC, szTime, MAX_PATH);
GetDlgItemText(hWnd, IDC_EVENTUSERSTATIC, szUser, MAX_PATH);
GetDlgItemText(hWnd, IDC_EVENTCOMPUTERSTATIC, szComputer, MAX_PATH);
- GetDlgItemText(hWnd, IDC_EVENTTEXTEDIT, evtDesc, entrySize);
+ GetDlgItemText(hWnd, IDC_EVENTTEXTEDIT, evtDesc, ENTRY_SIZE);
/* Consolidate the information into on big piece */
wsprintfW(output, tmpHeader, szEventType, szSource, szCategory, szEventID, szDate,
szTime, szUser, szComputer, evtDesc);
/* Sort out the memory needed to write to the clipboard */
- hMem = GlobalAlloc(GMEM_MOVEABLE, entrySize);
- memcpy(GlobalLock(hMem), output, entrySize);
+ hMem = GlobalAlloc(GMEM_MOVEABLE, ENTRY_SIZE);
+ memcpy(GlobalLock(hMem), output, ENTRY_SIZE);
GlobalUnlock(hMem);
/* Write the final content to the clipboard */