return;
for (iIndex = 0; iIndex < g_TotalRecords; iIndex++)
- HeapFree(GetProcessHeap(), 0, (PEVENTLOGRECORD) g_RecordPtrs[iIndex]);
- HeapFree(GetProcessHeap(), 0, (PEVENTLOGRECORD) g_RecordPtrs);
+ HeapFree(GetProcessHeap(), 0, g_RecordPtrs[iIndex]);
+ HeapFree(GetProcessHeap(), 0, g_RecordPtrs);
g_RecordPtrs = NULL;
}
szMessage = (LPWSTR)((LPBYTE)pevlr + pevlr->StringOffset);
/* Allocate space for parameters */
- szArguments = (LPWSTR*)malloc(sizeof(LPVOID) * pevlr->NumStrings);
+ szArguments = malloc(sizeof(LPVOID) * pevlr->NumStrings);
if (!szArguments)
{
return FALSE;
{
/* Not yet support for reading messages from parameter message DLL */
}
-
- szArguments[i] = szMessage;
- szMessage += wcslen(szMessage) + 1;
- }
- else
- {
- szArguments[i] = szMessage;
- szMessage += wcslen(szMessage) + 1;
}
+
+ szArguments[i] = szMessage;
+ szMessage += wcslen(szMessage) + 1;
}
szDll = wcstok(SourceModuleName, EVENT_DLL_SEPARATOR);
if (!bDone)
{
LoadStringW(hInst, IDS_EVENTSTRINGIDNOTFOUND, szStringIDNotFound, MAX_LOADSTRING);
- swprintf(EventText, szStringIDNotFound, (DWORD)(pevlr->EventID & 0xFFFF), SourceName);
+ swprintf(EventText, szStringIDNotFound, (pevlr->EventID & 0xFFFF), SourceName);
}
free(szArguments);
}
LoadStringW(hInst, IDS_EVENTSTRINGIDNOTFOUND, szStringIDNotFound, MAX_LOADSTRING);
- swprintf(EventText, szStringIDNotFound, (DWORD)(pevlr->EventID & 0xFFFF), SourceName);
+ swprintf(EventText, szStringIDNotFound, (pevlr->EventID & 0xFFFF), SourceName);
return FALSE;
}
GetNumberOfEventLogRecords (hEventLog , &dwTotalRecords);
g_TotalRecords = dwTotalRecords;
- g_RecordPtrs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwTotalRecords * sizeof(PEVENTLOGRECORD));
+ g_RecordPtrs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwTotalRecords * sizeof(PVOID));
/* If we have at least 1000 records show the waiting dialog */
if (dwTotalRecords > 1000)
while (dwCurrentRecord < dwTotalRecords)
{
- pevlr = (EVENTLOGRECORD*) HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD) * dwTotalRecords);
+ pevlr = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD) * dwTotalRecords);
g_RecordPtrs[dwCurrentRecord] = pevlr;
bResult = ReadEventLog(hEventLog, // Event log handle
if((!bResult) && (GetLastError () == ERROR_INSUFFICIENT_BUFFER))
{
HeapFree(GetProcessHeap(), 0, pevlr);
- pevlr = (EVENTLOGRECORD*) HeapAlloc(GetProcessHeap(), 0, dwNeeded);
+ pevlr = HeapAlloc(GetProcessHeap(), 0, dwNeeded);
g_RecordPtrs[dwCurrentRecord] = pevlr;
ReadEventLogW(hEventLog, // event log handle
GetEventType(pevlr->EventType, szEventTypeText);
GetEventCategory(lpLogName, lpSourceName, pevlr, szCategory);
- swprintf(szEventID, L"%u", (DWORD)(pevlr->EventID & 0xFFFF));
- swprintf(szCategoryID, L"%u", (DWORD)(pevlr->EventCategory));
+ swprintf(szEventID, L"%u", (pevlr->EventID & 0xFFFF));
+ swprintf(szCategoryID, L"%u", pevlr->EventCategory);
lviEventItem.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
lviEventItem.iItem = 0;
i = swprintf(szWindowTitle, L"%s - %s Log on \\\\", szTitle, lpLogName); /* i = number of characters written */
/* lpComputerName can be NULL here if no records was read */
- dwMaxLength = sizeof(szWindowTitle)/sizeof(WCHAR)-i;
+ dwMaxLength = sizeof(szWindowTitle) / sizeof(WCHAR) - i;
if(!lpComputerName)
GetComputerNameW(szWindowTitle+i, &dwMaxLength);
else