[ros-diffs] [fireball] 47112: [ADVAPI32] - Katayama Hirofumi: Use a real computer name instead of an empty string when reporting events in ReportEventA and W. See issue #5358 for more details.

fireball at svn.reactos.org fireball at svn.reactos.org
Thu May 6 12:09:51 CEST 2010


Author: fireball
Date: Thu May  6 12:09:33 2010
New Revision: 47112

URL: http://svn.reactos.org/svn/reactos?rev=47112&view=rev
Log:
[ADVAPI32]
- Katayama Hirofumi: Use a real computer name instead of an empty string when reporting events in ReportEventA and W.
See issue #5358 for more details.

Modified:
    trunk/reactos/dll/win32/advapi32/service/eventlog.c

Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service/eventlog.c?rev=47112&r1=47111&r2=47112&view=diff
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] Thu May  6 12:09:33 2010
@@ -945,6 +945,8 @@
     ANSI_STRING *Strings;
     ANSI_STRING ComputerName;
     WORD i;
+    CHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD dwSize;
 
     TRACE("%p, %u, %u, %lu, %p, %u, %lu, %p, %p\n",
           hEventLog, wType, wCategory, dwEventID, lpUserSid,
@@ -962,8 +964,9 @@
     for (i = 0; i < wNumStrings; i++)
         RtlInitAnsiString(&Strings[i], lpStrings[i]);
 
-    /*FIXME: ComputerName */
-    RtlInitAnsiString(&ComputerName, "");
+    dwSize = MAX_COMPUTERNAME_LENGTH + 1;
+    GetComputerNameA(szComputerName, &dwSize);
+    RtlInitAnsiString(&ComputerName, szComputerName);
 
     RpcTryExcept
     {
@@ -1029,6 +1032,8 @@
     UNICODE_STRING *Strings;
     UNICODE_STRING ComputerName;
     WORD i;
+    WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD dwSize;
 
     TRACE("%p, %u, %u, %lu, %p, %u, %lu, %p, %p\n",
           hEventLog, wType, wCategory, dwEventID, lpUserSid,
@@ -1046,8 +1051,9 @@
     for (i = 0; i < wNumStrings; i++)
         RtlInitUnicodeString(&Strings[i], lpStrings[i]);
 
-    /*FIXME: ComputerName */
-    RtlInitUnicodeString(&ComputerName, L"");
+    dwSize = MAX_COMPUTERNAME_LENGTH + 1;
+    GetComputerNameW(szComputerName, &dwSize);
+    RtlInitUnicodeString(&ComputerName, szComputerName);
 
     RpcTryExcept
     {




More information about the Ros-diffs mailing list