Author: hbelusca
Date: Fri Jan 13 00:33:46 2017
New Revision: 73531
URL: http://svn.reactos.org/svn/reactos?rev=73531&view=rev
Log:
Use wine_dbgstr_w as Jared did originally (I hate this macro because it displays strings in 'C'-language form instead of in natural way).
Modified:
trunk/rostests/apitests/shlwapi/PathIsUNC.c
Modified: trunk/rostests/apitests/shlwapi/PathIsUNC.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/shlwapi/PathIsUN…
==============================================================================
--- trunk/rostests/apitests/shlwapi/PathIsUNC.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/shlwapi/PathIsUNC.c [iso-8859-1] Fri Jan 13 00:33:46 2017
@@ -25,7 +25,7 @@
#define CALL_ISUNC(exp, str) \
do { \
BOOL ret = pPathIsUNC((str)); \
- ok(ret == (exp), "Expected %ls to be %d, was %d\n", (str), (exp), ret); \
+ ok(ret == (exp), "Expected %s to be %d, was %d\n", wine_dbgstr_w((str)), (exp), ret); \
} while (0)
START_TEST(isuncpath)
Author: hbelusca
Date: Fri Jan 13 00:18:51 2017
New Revision: 73529
URL: http://svn.reactos.org/svn/reactos?rev=73529&view=rev
Log:
[SHLWAPI]: On Windows 2003, tests show that strings starting with "\\?" are considered UNC, while on Windows Vista+ this is not the case anymore.
Select Win2k3 behaviour: revert r54542 (and add a note).
CORE-12653 #resolve
Modified:
trunk/reactos/dll/win32/shlwapi/path.c
Modified: trunk/reactos/dll/win32/shlwapi/path.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?r…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] Fri Jan 13 00:18:51 2017
@@ -2197,7 +2197,12 @@
{
TRACE("(%s)\n",debugstr_a(lpszPath));
-#ifdef __REACTOS__
+/*
+ * On Windows 2003, tests show that strings starting with "\\?" are
+ * considered UNC, while on Windows Vista+ this is not the case anymore.
+ */
+// #ifdef __REACTOS__
+#if 0
if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\') && (lpszPath[2]!='?'))
#else
if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'))
@@ -2215,7 +2220,12 @@
{
TRACE("(%s)\n",debugstr_w(lpszPath));
-#ifdef __REACTOS__
+/*
+ * On Windows 2003, tests show that strings starting with "\\?" are
+ * considered UNC, while on Windows Vista+ this is not the case anymore.
+ */
+// #ifdef __REACTOS__
+#if 0
if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\') && (lpszPath[2]!='?'))
#else
if (lpszPath && (lpszPath[0]=='\\') && (lpszPath[1]=='\\'))
Author: hbelusca
Date: Fri Jan 13 00:06:12 2017
New Revision: 73527
URL: http://svn.reactos.org/svn/reactos?rev=73527&view=rev
Log:
[SHLWAPI_APITEST]: New test for PathIsUNC function, by Jared Smudde. Thanks!
ROSTESTS-256 #resolve
Added:
trunk/rostests/apitests/shlwapi/
trunk/rostests/apitests/shlwapi/CMakeLists.txt (with props)
trunk/rostests/apitests/shlwapi/PathIsUNC.c (with props)
trunk/rostests/apitests/shlwapi/testlist.c (with props)
Modified:
trunk/rostests/apitests/CMakeLists.txt
Modified: trunk/rostests/apitests/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?r…
==============================================================================
--- trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] Fri Jan 13 00:06:12 2017
@@ -26,6 +26,7 @@
add_subdirectory(sdk)
add_subdirectory(setupapi)
add_subdirectory(shell32)
+add_subdirectory(shlwapi)
add_subdirectory(spoolss)
add_subdirectory(psapi)
add_subdirectory(user32)
Added: trunk/rostests/apitests/shlwapi/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/shlwapi/CMakeLis…
==============================================================================
--- trunk/rostests/apitests/shlwapi/CMakeLists.txt (added)
+++ trunk/rostests/apitests/shlwapi/CMakeLists.txt [iso-8859-1] Fri Jan 13 00:06:12 2017
@@ -0,0 +1,5 @@
+
+add_executable(shlwapi_apitest PathIsUNC.c testlist.c)
+set_module_type(shlwapi_apitest win32cui)
+add_importlibs(shlwapi_apitest msvcrt kernel32)
+add_cd_file(TARGET shlwapi_apitest DESTINATION reactos/bin FOR all)
Propchange: trunk/rostests/apitests/shlwapi/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/shlwapi/PathIsUNC.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/shlwapi/PathIsUN…
==============================================================================
--- trunk/rostests/apitests/shlwapi/PathIsUNC.c (added)
+++ trunk/rostests/apitests/shlwapi/PathIsUNC.c [iso-8859-1] Fri Jan 13 00:06:12 2017
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017 Jared Smudde
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* Documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773712(v=vs.85).… */
+
+#include <apitest.h>
+
+static BOOL (WINAPI *pPathIsUNC)(PCWSTR);
+
+#define CALL_ISUNC(exp, str) \
+do { \
+ BOOL ret = pPathIsUNC((str)); \
+ ok(ret == (exp), "Expected %S to be %d, was %d\n", (str), (exp), ret); \
+} while (0)
+
+START_TEST(isuncpath)
+{
+ HMODULE hDll = LoadLibraryA("shlwapi.dll");
+
+ pPathIsUNC = (void*)GetProcAddress(hDll, "PathIsUNCW");
+ if (!hDll || !pPathIsUNC)
+ {
+ skip("shlwapi.dll or export PathIsUNCW not found! Tests will be skipped\n");
+ return;
+ }
+
+ CALL_ISUNC(TRUE, L"\\\\path1\\path2");
+ CALL_ISUNC(TRUE, L"\\\\path1");
+ CALL_ISUNC(FALSE, L"reactos\\path4\\path5");
+ CALL_ISUNC(TRUE, L"\\\\");
+ CALL_ISUNC(TRUE, L"\\\\?\\UNC\\path1\\path2");
+ CALL_ISUNC(TRUE, L"\\\\?\\UNC\\path1");
+ CALL_ISUNC(TRUE, L"\\\\?\\UNC\\");
+ CALL_ISUNC(FALSE, L"\\path1");
+ CALL_ISUNC(FALSE, L"path1");
+ CALL_ISUNC(FALSE, L"c:\\path1");
+
+ /* MSDN says FALSE but the test shows TRUE on Windows 2003, but returns FALSE on Windows 7 */
+ CALL_ISUNC(TRUE, L"\\\\?\\c:\\path1");
+
+ CALL_ISUNC(TRUE, L"\\\\path1\\");
+ CALL_ISUNC(FALSE, L"//");
+ CALL_ISUNC(FALSE, L"////path1");
+ CALL_ISUNC(FALSE, L"////path1//path2");
+ CALL_ISUNC(FALSE, L"reactos//path3//path4");
+ CALL_ISUNC(TRUE, L"\\\\reactos\\?");
+ CALL_ISUNC(TRUE, L"\\\\reactos\\\\");
+ CALL_ISUNC(FALSE, NULL);
+ CALL_ISUNC(FALSE, L" ");
+
+ /* The test shows TRUE on Windows 2003, but returns FALSE on Windows 7 */
+ CALL_ISUNC(TRUE, L"\\\\?\\");
+}
Propchange: trunk/rostests/apitests/shlwapi/PathIsUNC.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/shlwapi/testlist.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/shlwapi/testlist…
==============================================================================
--- trunk/rostests/apitests/shlwapi/testlist.c (added)
+++ trunk/rostests/apitests/shlwapi/testlist.c [iso-8859-1] Fri Jan 13 00:06:12 2017
@@ -0,0 +1,10 @@
+#define STANDALONE
+#include <apitest.h>
+
+extern void func_isuncpath(void);
+
+const struct test winetest_testlist[] =
+{
+ { "PathIsUNC", func_isuncpath },
+ { 0, 0 }
+};
Propchange: trunk/rostests/apitests/shlwapi/testlist.c
------------------------------------------------------------------------------
svn:eol-style = native