PLOGHANDLE lpLogHandle;
PLOGFILE currentLogFile = NULL;
INT i, LogsActive;
+ PEVENTSOURCE pEventSource;
+
+ DPRINT("ElfCreateEventLogHandle(Name: %S)\n", Name);
lpLogHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(LOGHANDLE)
+ ((wcslen(Name) + 1) * sizeof(WCHAR)));
/* If Creating, default to the Application Log in case we fail, as documented on MSDN */
if (Create == TRUE)
- lpLogHandle->LogFile = LogfListItemByName(L"Application");
- else
- lpLogHandle->LogFile = NULL;
+ {
+ pEventSource = GetEventSourceByName(Name);
+ DPRINT("EventSource: %p\n", pEventSource);
+ if (pEventSource)
+ {
+ DPRINT("EventSource LogFile: %p\n", pEventSource->LogFile);
+ lpLogHandle->LogFile = pEventSource->LogFile;
+ }
+ else
+ {
+ DPRINT("EventSource LogFile: Application log file\n");
+ lpLogHandle->LogFile = LogfListItemByName(L"Application");
+ }
- for (i = 1; i <= LogsActive; i++)
+ DPRINT("LogHandle LogFile: %p\n", lpLogHandle->LogFile);
+ }
+ else
{
- currentLogFile = LogfListItemByIndex(i);
+ lpLogHandle->LogFile = NULL;
- if (_wcsicmp(Name, currentLogFile->LogName) == 0)
+ for (i = 1; i <= LogsActive; i++)
{
- lpLogHandle->LogFile = LogfListItemByIndex(i);
- lpLogHandle->CurrentRecord = LogfGetOldestRecord(lpLogHandle->LogFile);
- break;
+ currentLogFile = LogfListItemByIndex(i);
+
+ if (_wcsicmp(Name, currentLogFile->LogName) == 0)
+ {
+ lpLogHandle->LogFile = LogfListItemByIndex(i);
+ lpLogHandle->CurrentRecord = LogfGetOldestRecord(lpLogHandle->LogFile);
+ break;
+ }
}
}
DWORD MinorVersion,
IELF_HANDLE *LogHandle)
{
+ DPRINT1("ElfrRegisterEventSourceW()\n");
+
if ((MajorVersion != 1) || (MinorVersion != 1))
return STATUS_INVALID_PARAMETER;
if (RegModuleName->Length > 0)
return STATUS_INVALID_PARAMETER;
+ DPRINT1("ModuleName: %S\n", ModuleName->Buffer);
+
/*FIXME: UNCServerName must specify the server or empty for local */
/*FIXME: Must verify that caller has write access */
}
-void __RPC_FAR *__RPC_USER midl_user_allocate(size_t len)
+void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
}