You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2019/12/15 21:31:20 UTC

svn commit: r1871621 - /xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp

Author: amassari
Date: Sun Dec 15 21:31:20 2019
New Revision: 1871621

URL: http://svn.apache.org/viewvc?rev=1871621&view=rev
Log:
[XERCESC-2177] Starting with Windows Vista, the dwMajorVersion changed from 5 to 6

Modified:
    xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp

Modified: xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp?rev=1871621&r1=1871620&r2=1871621&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp Sun Dec 15 21:31:20 2019
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -154,21 +154,21 @@ static inline void xmlch_wcslwr(XMLCh* s
 }
 
 
-// it's a local function (instead of a static function) so that we are not 
+// it's a local function (instead of a static function) so that we are not
 // forced to include <windows.h> in the header
 bool isAlias(const   HKEY            encodingKey
              ,       char* const     aliasBuf = 0
              , const unsigned int    nameBufSz = 0)
 {
-    unsigned long theType;
-    unsigned long theSize = nameBufSz;
+    DWORD theType;
+    DWORD theSize = nameBufSz;
     return (::RegQueryValueExA
     (
         encodingKey
         , "AliasForCharset"
         , 0
         , &theType
-        , (unsigned char*)aliasBuf
+        , (LPBYTE)aliasBuf
         , &theSize
     ) == ERROR_SUCCESS);
 }
@@ -322,7 +322,7 @@ Win32TransService::Win32TransService(Mem
     ::GetVersionEx(&OSVer);
 
     if ((OSVer.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
-        ((OSVer.dwMajorVersion == 5) && (OSVer.dwMinorVersion > 0)))
+        (OSVer.dwMajorVersion > 5 || (OSVer.dwMajorVersion == 5 && OSVer.dwMinorVersion > 0)))
     {
         onXPOrLater = true;
     }
@@ -358,8 +358,8 @@ Win32TransService::Win32TransService(Mem
     //
     const unsigned int nameBufSz = 1024;
     char nameBuf[nameBufSz + 1];
-    unsigned int subIndex;
-    unsigned long theSize;
+    DWORD subIndex;
+    DWORD theSize;
     for (subIndex = 0;;++subIndex)
     {
         // Get the name of the next key
@@ -389,7 +389,7 @@ Win32TransService::Win32TransService(Mem
         }
 
         //
-        //  Lts see if its an alias. If so, then ignore it in this first
+        //  Let's see if its an alias. If so, then ignore it in this first
         //  loop. Else, we'll add a new entry for this one.
         //
         if (!isAlias(encodingKey))
@@ -402,7 +402,7 @@ Win32TransService::Win32TransService(Mem
             //  The Codepage entry is the default code page for a computer using that charset
             //  while the InternetEncoding holds the code page that represents that charset
             //
-            unsigned long theType;
+            DWORD theType;
             unsigned int CPId;
             unsigned int IEId;
 
@@ -413,7 +413,7 @@ Win32TransService::Win32TransService(Mem
                 , "Codepage"
                 , 0
                 , &theType
-                , (unsigned char*)&CPId
+                , (LPBYTE)&CPId
                 , &theSize) != ERROR_SUCCESS)
             {
                 ::RegCloseKey(encodingKey);
@@ -433,7 +433,7 @@ Win32TransService::Win32TransService(Mem
                     , "InternetEncoding"
                     , 0
                     , &theType
-                    , (unsigned char*)&IEId
+                    , (LPBYTE)&IEId
                     , &theSize) != ERROR_SUCCESS)
                 {
                     ::RegCloseKey(encodingKey);
@@ -485,7 +485,7 @@ Win32TransService::Win32TransService(Mem
         }
 
         //
-        //  If its an alias, look up the name in the map. If we find it,
+        //  If it's an alias, look up the name in the map. If we find it,
         //  then construct a new one with the new name and the aliased
         //  ids.
         //



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org