[EVENTCREATE] Improve imports, LP* -> P*, and fix x64 build warning

eventcreate\eventcreate.c(248):
  warning C4267: 'function': conversion from 'size_t' to 'DWORD', possible loss of data
This commit is contained in:
Hermès Bélusca-Maïto
2026-03-26 21:55:33 +01:00
parent 6079fab420
commit f19cb6af8b
2 changed files with 13 additions and 15 deletions

View File

@@ -1,12 +1,10 @@
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
## The message string templates are in ANSI to reduce binary size
add_message_headers(ANSI evtmsgstr.mc)
add_executable(eventcreate eventcreate.c eventcreate.rc)
set_module_type(eventcreate win32cui UNICODE)
add_dependencies(eventcreate evtmsgstr)
target_link_libraries(eventcreate conutils ${PSEH_LIB})
target_link_libraries(eventcreate conutils)
add_importlibs(eventcreate advapi32 msvcrt kernel32)
add_cd_file(TARGET eventcreate DESTINATION reactos/system32 FOR all)

View File

@@ -176,15 +176,15 @@ Quit:
static LONG
InstallEventSource(
IN HKEY hEventLogKey,
IN LPCWSTR EventLogSource)
IN HKEY hEventLogKey,
IN PCWSTR EventLogSource)
{
LONG lRet;
HKEY hSourceKey = NULL;
DWORD dwDisposition = 0;
DWORD dwData;
LPCWSTR EventMessageFile;
PCWSTR EventMessageFile;
DWORD PathSize;
WCHAR ExePath[MAX_PATH];
@@ -235,17 +235,17 @@ InstallEventSource(
dwData = 1;
RegSetValueExW(hSourceKey, L"CustomSource", 0, REG_DWORD,
(LPBYTE)&dwData, sizeof(dwData));
(PBYTE)&dwData, sizeof(dwData));
// FIXME: Set those flags according to caller's rights?
// Or, if we are using the Security log?
dwData = EVENTLOG_SUCCESS | EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE
/* | EVENTLOG_AUDIT_SUCCESS | EVENTLOG_AUDIT_FAILURE */ ;
/* | EVENTLOG_AUDIT_SUCCESS | EVENTLOG_AUDIT_FAILURE */;
RegSetValueExW(hSourceKey, L"TypesSupported", 0, REG_DWORD,
(LPBYTE)&dwData, sizeof(dwData));
(PBYTE)&dwData, sizeof(dwData));
RegSetValueExW(hSourceKey, L"EventMessageFile", 0, REG_EXPAND_SZ,
(LPBYTE)EventMessageFile, (wcslen(EventMessageFile) + 1) * sizeof(WCHAR));
(PBYTE)EventMessageFile, (DWORD)((wcslen(EventMessageFile) + 1) * sizeof(WCHAR)));
RegFlushKey(hSourceKey);
@@ -258,10 +258,10 @@ Quit:
static BOOL
CheckLogOrSourceExistence(
IN LPCWSTR UNCServerName OPTIONAL,
IN LPCWSTR EventLogName,
IN LPCWSTR EventLogSource,
IN BOOL AllowAppSources OPTIONAL)
IN PCWSTR UNCServerName OPTIONAL,
IN PCWSTR EventLogName,
IN PCWSTR EventLogSource,
IN BOOL AllowAppSources OPTIONAL)
{
/*
* The 'AllowAppSources' parameter allows the usage of
@@ -1242,7 +1242,7 @@ int wmain(int argc, WCHAR* argv[])
pUserToken->User.Sid,
1, // One string
0, // No raw data
(LPCWSTR*)&szDescription,
(PCWSTR*)&szDescription,
NULL // No raw data
);
if (!Success)