commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r644158 - /commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c
Date Thu, 03 Apr 2008 04:30:30 GMT
Author: mturk
Date: Wed Apr  2 21:30:29 2008
New Revision: 644158

URL: http://svn.apache.org/viewvc?rev=644158&view=rev
Log:
Fix Vista runs by prefixing the global object with Global, and 64 builds by using the same
registry key, so 32-bit manager can manage 64-bit services

Modified:
    commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c

Modified: commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c?rev=644158&r1=644157&r2=644158&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c Wed Apr  2 21:30:29
2008
@@ -40,6 +40,12 @@
 #define STDOUT_FILENO 1
 #define STDERR_FILENO 2
 
+#ifdef WIN64
+#define KREG_WOW6432  KEY_WOW64_32KEY
+#else
+#define KREG_WOW6432  0
+#endif
+
 typedef struct APX_STDWRAP {
     LPCWSTR szLogPath;
     LPCWSTR szStdOutFilename;
@@ -413,7 +419,8 @@
     int i = 0;
 
     SetLastError(ERROR_SUCCESS);
-    hRegistry = apxCreateRegistryW(gPool, KEY_READ, PRG_REGROOT,
+    hRegistry = apxCreateRegistryW(gPool, KEY_READ | KREG_WOW6432,
+                                   PRG_REGROOT,
                                    lpCmdline->szApplication,
                                    APXREG_SOFTWARE | APXREG_SERVICE);
     if (IS_INVALID_HANDLE(hRegistry)) {
@@ -485,7 +492,8 @@
 {
     APXHANDLE hRegistry;
     int i = 0;
-    hRegistry = apxCreateRegistryW(gPool, KEY_WRITE, PRG_REGROOT,
+    hRegistry = apxCreateRegistryW(gPool, KEY_WRITE | KREG_WOW6432,
+                                   PRG_REGROOT,
                                    lpCmdline->szApplication,
                                    APXREG_SOFTWARE | APXREG_SERVICE);
     if (IS_INVALID_HANDLE(hRegistry))
@@ -1161,9 +1169,10 @@
         WCHAR en[SIZ_DESLEN];
         int i;
         PSECURITY_ATTRIBUTES sa = GetNullACL();
-        lstrcpyW(en, _service_name);
+        lstrcpyW(en, L"Global\\");
+        lstrcatW(en, _service_name);
         lstrcatW(en, PRSRV_SIGNAL);
-        for (i = 0; i < lstrlenW(en); i++) {
+        for (i = 7; i < lstrlenW(en); i++) {
             if (en[i] >= L'a' && en[i] <= L'z')
                 en[i] = en[i] - 32;
         }



Mime
View raw message