Author: spetreolle
Date: Sat Oct 4 13:34:19 2014
New Revision: 64520
URL:
http://svn.reactos.org/svn/reactos?rev=64520&view=rev
Log:
[EVENTVWR]
-Fix use of unitialized handle for the waiting dialog.
-Allocate the size of one event for each event, not the amount of all events.
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] Sat Oct 4
13:34:19 2014
@@ -520,7 +520,7 @@
QueryEventMessages(LPWSTR lpMachineName,
LPWSTR lpLogName)
{
- HWND hwndDlg;
+ HWND hwndDlg=0;
HANDLE hEventLog;
EVENTLOGRECORD *pevlr;
DWORD dwRead, dwNeeded, dwThisRecord, dwTotalRecords = 0, dwCurrentRecord = 0,
dwRecordsToRead = 0, dwFlags, dwMaxLength;
@@ -599,7 +599,7 @@
while (dwCurrentRecord < dwTotalRecords)
{
- pevlr = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD) * dwTotalRecords);
+ pevlr = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD));
g_RecordPtrs[dwCurrentRecord] = pevlr;
bResult = ReadEventLog(hEventLog, // Event log handle
@@ -713,7 +713,8 @@
}
// All events loaded
- EndDialog(hwndDlg, 0);
+ if(hwndDlg)
+ EndDialog(hwndDlg, 0);
StringCchPrintfExW(szWindowTitle,
sizeof(szWindowTitle) / sizeof(WCHAR),