https://git.reactos.org/?p=reactos.git;a=commitdiff;h=01603541454b9153097e675459a6da9ccd6e96d1

commit 01603541454b9153097e675459a6da9ccd6e96d1
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Thu Aug 3 18:25:12 2023 +0900
Commit:     GitHub <[email protected]>
CommitDate: Thu Aug 3 18:25:12 2023 +0900

    [SHLWAPI] Fix version control (_WIN32_WINNT) (#5514)
    
    - _WIN32_WINNT had wrong value to do workaround on Vista+ RegGetValueW.
    - Do #undef and #define _WIN32_WINNT _WIN32_WINNT_VISTA in assoc.c.
    - Delete _WIN32_WINNT hack in CMakeLists.txt.
    CORE-9283
---
 dll/win32/shlwapi/CMakeLists.txt | 5 +----
 dll/win32/shlwapi/assoc.c        | 4 ++++
 dll/win32/shlwapi/path.c         | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dll/win32/shlwapi/CMakeLists.txt b/dll/win32/shlwapi/CMakeLists.txt
index af8ec781824..fcb03a15c37 100644
--- a/dll/win32/shlwapi/CMakeLists.txt
+++ b/dll/win32/shlwapi/CMakeLists.txt
@@ -1,9 +1,6 @@
 
 project(SHELL)
 
-remove_definitions(-D_WIN32_WINNT=0x502)
-add_definitions(-D_WIN32_WINNT=0x600)
-
 add_definitions(
     -D__WINESRC__
     -D_SHLWAPI_)
@@ -11,7 +8,6 @@ add_definitions(
 spec2def(shlwapi.dll shlwapi.spec ADD_IMPORTLIB)
 
 list(APPEND SOURCE
-    assoc.c
     clist.c
     istream.c
     msgbox.c
@@ -27,6 +23,7 @@ list(APPEND SOURCE
     url.c)
 
 list(APPEND PCH_SKIP_SOURCE
+    assoc.c
     wsprintf.c
     ${CMAKE_CURRENT_BINARY_DIR}/shlwapi_stubs.c)
 
diff --git a/dll/win32/shlwapi/assoc.c b/dll/win32/shlwapi/assoc.c
index a5cb4b11290..28c54527497 100644
--- a/dll/win32/shlwapi/assoc.c
+++ b/dll/win32/shlwapi/assoc.c
@@ -17,6 +17,10 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#ifdef __REACTOS__
+    #undef _WIN32_WINNT
+    #define _WIN32_WINNT _WIN32_WINNT_VISTA /* for RegGetValueW */
+#endif
 #include <stdarg.h>
 #include <assert.h>
 
diff --git a/dll/win32/shlwapi/path.c b/dll/win32/shlwapi/path.c
index 2966a8bf93b..b1b55b3f244 100644
--- a/dll/win32/shlwapi/path.c
+++ b/dll/win32/shlwapi/path.c
@@ -2249,7 +2249,7 @@ BOOL WINAPI PathIsUNCA(LPCSTR lpszPath)
  * considered UNC, while on Windows Vista+ this is not the case anymore.
  */
 // #ifdef __REACTOS__
-#if (WINVER >= _WIN32_WINNT_VISTA)
+#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
   if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\') && 
(lpszPath[2]!='?'))
 #else
   if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'))
@@ -2272,7 +2272,7 @@ BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
  * considered UNC, while on Windows Vista+ this is not the case anymore.
  */
 // #ifdef __REACTOS__
-#if (WINVER >= _WIN32_WINNT_VISTA)
+#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
   if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\') && 
(lpszPath[2]!='?'))
 #else
   if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'))

Reply via email to