]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-eventlog-20080301
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 1 Mar 2008 15:38:34 +0000 (15:38 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 1 Mar 2008 15:38:34 +0000 (15:38 +0000)
LICENSE MIT

somewhere along the way Microsoft stopped opening Event Message files
explicitly.  Instead they search the PATH environment variable for
the specified file.  I think this is broken but simply registering
"afsd_service.exe" instead of the fully qualified path works.

(cherry picked from commit e4df679d1bcc6fb7e3c3eb4169e489c172910628)

src/WINNT/afsd/afsd_eventlog.c

index 6d71062e9b63e49c33f080832cb75ea5a1f87378..2a90d11235932d87aaad3c14ac4633f900727cb3 100644 (file)
@@ -99,17 +99,22 @@ AddEventSource()
                break;
            }
 
+#if 0
            // Set the name of the message file
            // Get "ImagePath" from TransarcAFSDaemon service
            memset(szBuf, '\0', MAX_PATH);
            dwData = MAX_PATH;
            GetServicePath(szBuf, &dwData);
-
+#else
+            // Windows takes the specified name and searchs the PATH environment variable
+            // It never appears to even try the fully qualified name.
+            strcpy(szBuf, "afsd_service.exe");
+#endif
            // Add the name to the EventMessageFile subkey. 
            if ( RegSetValueEx( hKey,                   // subkey handle 
                                AFSREG_APPLOG_MSGFILE_VALUE,    // value name 
                                0,                      // must be zero 
-                               REG_EXPAND_SZ,          // value type 
+                               REG_SZ,                 // value type 
                                (LPBYTE) szBuf,         // pointer to value data 
                                (DWORD)strlen(szBuf) + 1))      // length of value data
            {