This is an automated email from the ASF dual-hosted git repository.

borisk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/xerces-c.git

commit 2c0d9f7a63da8a6c45587a3f4fc833f023def221
Author: Alberto Massari <[email protected]>
AuthorDate: Sun Dec 15 21:31:20 2019 +0000

    [XERCESC-2177] Starting with Windows Vista, the dwMajorVersion changed from 
5 to 6
    
    git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@1871621 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../util/Transcoders/Win32/Win32TransService.cpp   | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp 
b/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
index e92ca6d..4819443 100644
--- a/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
+++ b/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
@@ -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* str)
 }
 
 
-// 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(MemoryManager* 
manager) :
     ::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(MemoryManager* 
manager) :
     //
     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(MemoryManager* 
manager) :
         }
 
         //
-        //  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(MemoryManager* 
manager) :
             //  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(MemoryManager* 
manager) :
                 , "Codepage"
                 , 0
                 , &theType
-                , (unsigned char*)&CPId
+                , (LPBYTE)&CPId
                 , &theSize) != ERROR_SUCCESS)
             {
                 ::RegCloseKey(encodingKey);
@@ -433,7 +433,7 @@ Win32TransService::Win32TransService(MemoryManager* 
manager) :
                     , "InternetEncoding"
                     , 0
                     , &theType
-                    , (unsigned char*)&IEId
+                    , (LPBYTE)&IEId
                     , &theSize) != ERROR_SUCCESS)
                 {
                     ::RegCloseKey(encodingKey);
@@ -485,7 +485,7 @@ Win32TransService::Win32TransService(MemoryManager* 
manager) :
         }
 
         //
-        //  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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to