40 #define LVM_PROGRESS (WM_APP + 1) // Used by the subclassed ListView 55 #define EVENT_MESSAGE_EVENTTEXT_BUFFER 1024*10 // NOTE: Used by evtdetctl.c 56 #define EVENT_MESSAGE_FILE_BUFFER 1024*10 57 #define EVENT_DLL_SEPARATOR L";" 58 #define EVENT_CATEGORY_MESSAGE_FILE L"CategoryMessageFile" 59 #define EVENT_MESSAGE_FILE L"EventMessageFile" 60 #define EVENT_PARAMETER_MESSAGE_FILE L"ParameterMessageFile" 62 #define MAX_LOADSTRING 255 217 if (!lpCmdLine || !*lpCmdLine)
254 if (cbFileName > 0 &&
lpFileName[cbFileName - 1] ==
L'\"')
321 while (*lpTemp ==
L'\\')
481 &
Settings.wpPos.rcNormalPosition.left,
482 &
Settings.wpPos.rcNormalPosition.top,
483 &
Settings.wpPos.rcNormalPosition.right,
484 &
Settings.wpPos.rcNormalPosition.bottom,
492 Settings.wpPos.showCmd = nDefCmdShow;
559 Settings.wpPos.rcNormalPosition.left,
560 Settings.wpPos.rcNormalPosition.top,
561 Settings.wpPos.rcNormalPosition.right,
562 Settings.wpPos.rcNormalPosition.bottom,
591 iccx.
dwSize =
sizeof(iccx);
721 return (
int)
msg.wParam;
731 SYSTEMTIME st1970 = { 1970, 1, 0, 1, 0, 0, 0, 0 };
739 uUCT.ft.dwHighDateTime = 0;
740 uUCT.ft.dwLowDateTime = EventTime;
742 uUCT.ll = uUCT.ll * 10000000 + u1970.ll;
873 cbLength = (
wcslen(lpMessageDllList) + 1) *
sizeof(
WCHAR);
875 if (!szMessageDllList)
920 IN BOOL bMessagePreFormatted,
931 DWORD dwParamCount = 0;
933 size_t cchParams = 0;
940 *pFinalMessage =
NULL;
943 if (bMessagePreFormatted)
945 while ((pTempMessage =
wcschr(pTempMessage,
L'%')))
957 while ((pTempMessage =
wcsstr(pTempMessage,
L"%%")))
969 if (dwParamCount == 0)
987 pTempMessage = (
LPWSTR)pMessage;
988 if (bMessagePreFormatted)
990 while ((pTempMessage =
wcschr(pTempMessage,
L'%')) && (
i < dwParamCount))
1007 while ((pTempMessage =
wcsstr(pTempMessage,
L"%%")) && (
i < dwParamCount))
1015 while (
iswdigit(*++pTempMessage)) ;
1024 for (
i = 0;
i < dwParamCount;
i++)
1031 pParamData[
i].pParameterID,
1033 if (!pParamData[
i].pParameter)
1039 cchParams +=
wcslen(pParamData[
i].pParameter);
1048 if (!*pFinalMessage)
1054 pTempFinalMessage = *pFinalMessage;
1057 pTempMessage = (
LPWSTR)pMessage;
1058 for (
i = 0;
i < dwParamCount;
i++)
1065 pTempFinalMessage +=
cch;
1068 if (pParamData[
i].pParameter)
1084 pTempFinalMessage +=
cch;
1097 for (
i = 0;
i < dwParamCount;
i++)
1099 if (pParamData[
i].pParameter)
1118 WCHAR wszNumber[24];
1119 WCHAR wszDecimalSep[8], wszThousandSep[8];
1121 WCHAR wszGrouping[12];
1145 for (
i = 0;
i < cchGrouping;
i++)
1147 WCHAR wch = wszGrouping[
i];
1149 if (wch >=
L'0' && wch <=
L'9')
1151 else if (wch !=
L';')
1172 return cchResult - 1;
1178 UINT cchWritten, cchRemaining;
1180 size_t cchStringRemaining;
1183 cchWritten =
FormatInteger(cbSize, pwszResult, cchResultMax);
1188 pwszEnd = pwszResult + cchWritten;
1189 cchRemaining = cchResultMax - cchWritten;
1190 StringCchCopyExW(pwszEnd, cchRemaining,
L" ", &pwszEnd, &cchStringRemaining, 0);
1191 cchRemaining = (
UINT)cchStringRemaining;
1193 cchRemaining -= cchWritten;
1195 return cchResultMax - cchRemaining;
1201 UINT cchWritten, cchRemaining;
1203 size_t cchCopyRemaining;
1215 pwszEnd = pwszResult + cchWritten;
1216 cchRemaining = cchResultMax - cchWritten;
1218 cchRemaining = (
UINT)cchCopyRemaining;
1222 pwszEnd += cchWritten;
1223 cchRemaining -= cchWritten;
1238 UINT cchRemaining = cchResult;
1239 size_t cchCopyRemaining;
1240 LPWSTR pwszEnd = pwszResult;
1251 cchRemaining -= cchWritten;
1252 pwszEnd += cchWritten;
1255 cchRemaining = (
UINT)cchCopyRemaining;
1272 IN INT SelectedImage,
1281 Insert.hParent = hParent;
1282 Insert.item.pszText = lpText;
1283 Insert.item.iImage =
Image;
1284 Insert.item.iSelectedImage = SelectedImage;
1285 Insert.item.lParam =
lParam;
1339 if (EventLog->LogName)
1342 if (EventLog->ComputerName)
1345 if (EventLog->FileName)
1361 pStr = (
PWSTR)MultiStr;
1362 while (*pStr) pStr += (
wcslen(pStr) + 1);
1363 Length = MultiStr - pStr + 2;
1392 if (!EventLogFilter)
1396 EventLogFilter->
Warning = Warning;
1413 return EventLogFilter;
1419 if (EventLogFilter->Sources)
1422 if (EventLogFilter->Users)
1425 if (EventLogFilter->ComputerNames)
1488 if (ComputerName && *ComputerName)
1491 while (*ComputerName ==
L'\\')
1521 if (ComputerName && *ComputerName)
1526 if (*lpFullFileName && lpFullFileName[1] ==
L':')
1527 lpFullFileName[1] =
L'$';
1532 lpFullFileName[0] =
L'\\';
1533 lpFullFileName[1] =
L'\\';
1534 wcsncpy(lpFullFileName + 2, ComputerName,
wcslen(ComputerName));
1535 lpFullFileName[2 +
wcslen(ComputerName)] =
L'\\';
1621 pevlr->EventCategory,
1642 if (pevlr->EventCategory != 0)
1662 WCHAR SourceModuleName[1024];
1663 WCHAR ParameterModuleName[1024];
1666 LPWSTR szStringArray, szMessage;
1670 szStringArray = (
LPWSTR)((
LPBYTE)pevlr + pevlr->StringOffset);
1681 if (!IsParamModNameCached)
1688 if (IsParamModNameCached)
1693 szMessage = szStringArray;
1706 for (
i = 0;
i < pevlr->NumStrings;
i++)
1708 szMessage +=
wcslen(szMessage) + 1;
1710 cch = szMessage - szStringArray;
1713 szMessage = szStringArray;
1714 for (
i = 0;
i < pevlr->NumStrings;
i++)
1716 lpMsgBuf = szMessage;
1717 while ((lpMsgBuf =
wcsstr(lpMsgBuf,
L"%%")))
1725 szArguments[
i] = szMessage;
1726 szMessage +=
wcslen(szMessage) + 1;
1751 lpMsgBuf = szMessage;
1772 szMessage = szStringArray;
1773 for (
i = 0;
i < pevlr->NumStrings;
i++)
1777 szMessage +=
wcslen(szMessage) + 1;
1788 switch (dwEventType)
1822 WCHAR szDomain[1024];
1829 pCurrentSid = (
PSID)((
LPBYTE)pelr + pelr->UserSidOffset);
1836 else if (*pLastSid &&
EqualSid(*pLastSid, pCurrentSid))
1842 if (pelr->UserSidLength > 0)
1907 if ((pevlr->EventType ==
EVENTLOG_SUCCESS && !EventLogFilter->Information ) ||
1933 if (!*FilterString && !*
String)
1942 if ( (!*FilterString && *
String) || (*FilterString && !*
String) )
1951 pStr = FilterString;
1960 pStr += (
wcslen(pStr) + 1);
1988 DWORD dwTotalRecords = 0, dwCurrentRecord = 0;
1990 size_t cchRemaining;
1997 UINT uStep = 0, uStepAt = 0, uPos = 0;
2010 PWCHAR lpTitleTemplateEnd;
2021 EventLog = EventLogFilter->
EventLogs[0];
2033 &lpTitleTemplateEnd,
2037 dwMaxLength = (
DWORD)cchRemaining;
2044 sizeof(szStatusText),
2055 L"Many-logs filtering is not implemented yet!!",
2085 EventLog = EventLogFilter->
EventLogs[LogIndex];
2093 if (hEventLog ==
NULL)
2104 if (dwTotalRecords > 0)
2131 uStepAt = (dwTotalRecords / 100) + 1;
2150 dwWanted = dwNeeded;
2166 pEvlrBuffer = (
LPBYTE)pEvlr;
2167 pEvlrEnd = pEvlrBuffer + dwRead;
2169 while (pEvlrBuffer < pEvlrEnd)
2172 PWSTR lpszUsername, lpszCategoryName;
2177 if (uStep % uStepAt == 0)
2206 lpszUsername =
GetEventUserName(pEvlrTmp, &pLastSid, szUsername) ? szUsername : szNoUsername;
2214 lpszCategoryName =
GetEventCategory(EventLog->
LogName, lpszSourceName, pEvlrTmp, szCategory) ? szCategory : szNoCategory;
2223 lviEventItem.
iItem = 0;
2226 lviEventItem.
pszText = szEventTypeText;
2263 pEvlrBuffer += pEvlrTmp->
Length;
2294 sizeof(szStatusText),
2399 if (!EventLogFilter)
2461 tvItemEx.
hItem = hti;
2466 *phti = tvItemEx.
hItem;
2493 if (EventLog ==
NULL)
2504 if (EventLogFilter ==
NULL)
2516 cchFileName =
wcslen(lpszFileName) + 1;
2523 2, 3, (
LPARAM)EventLogFilter);
2561 if (!EventLogFilter)
2574 EventLog = EventLogFilter->EventLogs[0];
2595 if (!EventLogFilter)
2636 if (!EventLogFilter)
2664 EventLog = EventLogFilter->EventLogs[0];
2688 if (!EventLogFilter)
2701 wcex.
cbSize =
sizeof(wcex);
2733 DWORD dwType, cbData;
2734 DWORD dwMessageID = 0;
2784 cbData =
sizeof(dwMessageID);
2794 *pdwMessageID = dwMessageID;
2807 HKEY hEventLogKey, hLogKey;
2808 DWORD dwNumLogs = 0;
2809 DWORD dwIndex, dwMaxKeyLength;
2870 for (dwIndex = 0; dwIndex < dwNumLogs; dwIndex++)
2872 lpcName = dwMaxKeyLength;
2882 if (EventLog ==
NULL)
2890 if (EventLogFilter ==
NULL)
2982 2, 3, (
LPARAM)EventLogFilter);
2987 hItemDefault =
hItem;
3057 rs =
Settings.wpPos.rcNormalPosition;
3115 (rcClient.
bottom - rcClient.
top) - StatusHeight,
3171 : (rcClient.
bottom - rcClient.
top) - StatusHeight,
3333 :
cy - StatusHeight,
3428 while (*pszText &&
iswspace(*pszText))
3516 if (EventLogFilter &&
ClearEvents(EventLogFilter))
3561 if ( EventLogFilter)
3631 L"Help not implemented yet!",
3689 hInfo.
pt.
y = yPos - rc.
top;
3863 DWORD dwMaxSize = 0, dwRetention = 0;
3899 cbData =
sizeof(dwMaxSize);
3910 dwMaxSize = 16384 * 1024;
3915 cbData =
sizeof(dwRetention);
3929 dwRetention = (dwRetention + 24*3600 - 1) / (24*3600);
4021 if (dwRetention == 0)
4053 DWORD dwMaxSize = 0, dwRetention = 0;
4100 sizeof(dwRetention));
4151 if (EventLogFilter &&
ClearEvents(EventLogFilter))
4213 L"Help not implemented yet!",
4238 if (!EventLogFilter)
4250 psh.
dwSize =
sizeof(psh);
4262 psp[0].
dwSize =
sizeof(psp[0]);
4271 psp[1].
dwSize =
sizeof(psp[1]);
4301 INT sbVXSize, sbHYSize;
4321 rcWnd.
right - sbVXSize,
4356 cxMin += -2*rcWnd.left;
4357 cyMin += -rcWnd.top + 12;
4360 cxOld = rcWnd.right - rcWnd.left;
4361 cyOld = rcWnd.bottom - rcWnd.top;
4401 L"Help not implemented yet!",
HANDLE WINAPI OpenEventLogW(IN LPCWSTR lpUNCServerName, IN LPCWSTR lpSourceName)
_In_ LPCSTR _Out_writes_bytes_to_opt_ cbSid PSID _Inout_ LPDWORD _Out_writes_to_opt_ cchReferencedDomainName LPS