commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1197005 - in /commons/proper/daemon/trunk: ./ src/native/windows/apps/prunmgr/ src/native/windows/apps/prunsrv/ src/native/windows/include/ src/native/windows/src/
Date Thu, 03 Nov 2011 09:04:04 GMT
Author: mturk
Date: Thu Nov  3 09:04:04 2011
New Revision: 1197005

URL: http://svn.apache.org/viewvc?rev=1197005&view=rev
Log:
DAEMON-218: Use ANSI instead UTF8 conversion and increment current version numbers to reflect
next release

Modified:
    commons/proper/daemon/trunk/RELEASE-NOTES.txt
    commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.h
    commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.rc
    commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
    commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.h
    commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.rc
    commons/proper/daemon/trunk/src/native/windows/include/apxwin.h
    commons/proper/daemon/trunk/src/native/windows/src/utils.c

Modified: commons/proper/daemon/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/RELEASE-NOTES.txt?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/RELEASE-NOTES.txt (original)
+++ commons/proper/daemon/trunk/RELEASE-NOTES.txt Thu Nov  3 09:04:04 2011
@@ -80,7 +80,7 @@ NEW FEATURES:
 
 BUG FIXES:
 
-1.0.8: DAEMON-220, DAEMON-222, DAEMON-223, DAEMON-224
+1.0.8: DAEMON-218, DAEMON-220, DAEMON-222, DAEMON-223, DAEMON-224
 
 1.0.7: DAEMON-211, DAEMON-214
 

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.h?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.h (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.h Thu Nov  3 09:04:04
2011
@@ -24,7 +24,7 @@
 #define _PRUNMGR_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "1.0.7.0"
+#define PRG_VERSION    "1.0.8.0"
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #define IDM_TM_EXIT                     2000

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.rc
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.rc?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.rc (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.rc Thu Nov  3 09:04:04
2011
@@ -259,8 +259,8 @@ BEGIN
 END
 
 1 VERSIONINFO
- FILEVERSION 1,0,7,0
- PRODUCTVERSION 1,0,7,0
+ FILEVERSION 1,0,8,0
+ PRODUCTVERSION 1,0,8,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c Thu Nov  3 09:04:04
2011
@@ -1281,7 +1281,7 @@ void WINAPI serviceMain(DWORD argc, LPTS
     if (IS_VALID_STRING(SO_STARTMODE)) {
         if (!lstrcmpiW(SO_STARTMODE, PRSRV_JVM)) {
             _jni_startup = TRUE;
-            _jni_rclass  = WideToUTF8(SO_STARTCLASS);
+            _jni_rclass  = WideToANSI(SO_STARTCLASS);
             /* Exchange all dots with slashes */
             apxStrCharReplaceA(_jni_rclass, '.', '/');
             _jni_rparam = SO_STARTPARAMS;
@@ -1323,7 +1323,7 @@ void WINAPI serviceMain(DWORD argc, LPTS
     if (IS_VALID_STRING(SO_STOPMODE)) {
         if (!lstrcmpiW(SO_STOPMODE, PRSRV_JVM)) {
             _jni_shutdown = TRUE;
-            _jni_sclass = WideToUTF8(SO_STOPCLASS);
+            _jni_sclass = WideToANSI(SO_STOPCLASS);
             apxStrCharReplaceA(_jni_sclass, '.', '/');
             _jni_sparam = SO_STOPPARAMS;
         }
@@ -1367,12 +1367,12 @@ void WINAPI serviceMain(DWORD argc, LPTS
                 _jni_jvmpath = SO_JVM;
         }
         if (IS_VALID_STRING(SO_CLASSPATH))
-            _jni_classpath = WideToUTF8(SO_CLASSPATH);
+            _jni_classpath = WideToANSI(SO_CLASSPATH);
         if (IS_VALID_STRING(SO_STARTMETHOD))
             _jni_rmethod   = WideToAscii(SO_STARTMETHOD, (LPSTR)SO_STARTMETHOD);
         if (IS_VALID_STRING(SO_STOPMETHOD))
             _jni_smethod   = WideToAscii(SO_STOPMETHOD, (LPSTR)SO_STOPMETHOD);
-        _jni_jvmoptions    = MzWideToUTF8(SO_JVMOPTIONS);
+        _jni_jvmoptions    = MzWideToANSI(SO_JVMOPTIONS);
     }
     if (_service_mode) {
         /* Register Service Control handler */

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.h?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.h (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.h Thu Nov  3 09:04:04
2011
@@ -25,7 +25,7 @@
 #define _PRUNSRV_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "1.0.7.0"
+#define PRG_VERSION    "1.0.8.0"
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #endif /* _PRUNSRV_H */

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.rc
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.rc?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.rc (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.rc Thu Nov  3 09:04:04
2011
@@ -22,8 +22,8 @@
 IDI_MAINICON         ICON                   "../../resources/procrunw.ico"
 
 1 VERSIONINFO
- FILEVERSION 1,0,7,0
- PRODUCTVERSION 1,0,7,0
+ FILEVERSION 1,0,8,0
+ PRODUCTVERSION 1,0,8,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L

Modified: commons/proper/daemon/trunk/src/native/windows/include/apxwin.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/include/apxwin.h?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/include/apxwin.h (original)
+++ commons/proper/daemon/trunk/src/native/windows/include/apxwin.h Thu Nov  3 09:04:04 2011
@@ -148,6 +148,8 @@ LPSTR       WideToAscii(LPCWSTR ws, LPST
 LPSTR       MzWideToAscii(LPCWSTR ws, LPSTR s);
 LPSTR       WideToUTF8(LPCWSTR ws);
 LPSTR       MzWideToUTF8(LPCWSTR ws);
+LPSTR       WideToANSI(LPCWSTR ws);
+LPSTR       MzWideToANSI(LPCWSTR ws);
 
 typedef struct APXMULTISZ APXMULTISZ;
 typedef APXMULTISZ*       LPAPXMULTISZ;

Modified: commons/proper/daemon/trunk/src/native/windows/src/utils.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/utils.c?rev=1197005&r1=1197004&r2=1197005&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/utils.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/utils.c Thu Nov  3 09:04:04 2011
@@ -187,6 +187,32 @@ LPWSTR UTF8ToWide(LPCSTR cs)
     return s;
 }
 
+LPSTR WideToANSI(LPCWSTR ws)
+{
+
+    LPSTR s;
+    int cch = WideCharToMultiByte(CP_ACP, 0, ws, -1, NULL, 0, NULL, NULL);
+    s = (LPSTR)apxAlloc(cch);
+    if (!WideCharToMultiByte(CP_ACP, 0, ws, -1, s, cch, NULL, NULL)) {
+        apxFree(s);
+        return NULL;
+    }
+    return s;
+}
+
+LPWSTR ANSIToWide(LPCSTR cs)
+{
+
+    LPWSTR s;
+    int cch = MultiByteToWideChar(CP_ACP, 0, cs, -1, NULL, 0);
+    s = (LPWSTR)apxAlloc(cch * sizeof(WCHAR));
+    if (!MultiByteToWideChar(CP_ACP, 0, cs, -1, s, cch)) {
+        apxFree(s);
+        return NULL;
+    }
+    return s;
+}
+
 LPSTR MzWideToAscii(LPCWSTR ws, LPSTR s)
 {
     LPSTR pszSave = s;
@@ -235,6 +261,38 @@ LPSTR MzWideToUTF8(LPCWSTR ws)
     return str;
 }
 
+LPSTR MzWideToANSI(LPCWSTR ws)
+{
+    LPSTR str;
+    LPSTR s;
+    LPCWSTR p = ws;
+    int cch = 0;
+
+    for ( ; p && *p; p++) {
+        int len = WideCharToMultiByte(CP_ACP, 0, p, -1, NULL, 0, NULL, NULL);
+        if (len > 0)
+            cch += len;
+        while (*p)
+            p++;
+    }
+    cch ++;
+    str = s = (LPSTR)apxAlloc(cch + 1);
+
+    p = ws;
+    for ( ; p && *p; p++) {
+        int len = WideCharToMultiByte(CP_ACP, 0, p, -1, s, cch, NULL, NULL);
+        if (len > 0) {
+            s = s + len;
+            cch -= len;
+        }
+        while (*p)
+            p++;
+    }
+    /* double terminate */
+    *s = '\0';
+    return str;
+}
+
 DWORD __apxGetMultiSzLengthA(LPCSTR lpStr, LPDWORD lpdwCount)
 {
     LPCSTR p = lpStr;



Mime
View raw message