mirror of
https://github.com/reactos/reactos.git
synced 2026-06-03 01:41:13 +08:00
[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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user