Index: apitests/CMakeLists.txt =================================================================== --- apitests/CMakeLists.txt (revision 73526) +++ apitests/CMakeLists.txt (working copy) @@ -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) Index: apitests/shlwapi/CMakeLists.txt =================================================================== --- apitests/shlwapi/CMakeLists.txt (revision 0) +++ apitests/shlwapi/CMakeLists.txt (working copy) @@ -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) Index: apitests/shlwapi/PathIsUNC.c =================================================================== --- apitests/shlwapi/PathIsUNC.c (revision 0) +++ apitests/shlwapi/PathIsUNC.c (working copy) @@ -0,0 +1,66 @@ +/* + * 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).aspx */ + +#include + +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", wine_dbgstr_w((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"); + CALL_ISUNC(TRUE, L"\\\\?\\c:\\path1"); /* MSDN says false but the test shows true. */ + + 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" "); + CALL_ISUNC(TRUE, L"\\\\?\\"); + +} Index: apitests/shlwapi/testlist.c =================================================================== --- apitests/shlwapi/testlist.c (revision 0) +++ apitests/shlwapi/testlist.c (working copy) @@ -0,0 +1,10 @@ +#define STANDALONE +#include + +extern void func_isuncpath(void); + +const struct test winetest_testlist[] = +{ + { "PathIsUNC", func_isuncpath }, + { 0, 0 } +}; Index: apitests/shlwapi =================================================================== --- apitests/shlwapi (revision 0) +++ apitests/shlwapi (working copy) Property changes on: apitests/shlwapi ___________________________________________________________________ Added: bugtraq:logregex ## -0,0 +1 ## +((CORE|ROSTESTS|ROSAPPS)-\d+)(,? ?((CORE|ROSTESTS|ROSAPPS)-\d+))*(,? ?(and |or )?((CORE|ROSTESTS|ROSAPPS)-\d+))? Added: bugtraq:message ## -0,0 +1 ## +See issue %BUGID% for more details. \ No newline at end of property Added: bugtraq:url ## -0,0 +1 ## +https://jira.reactos.org/browse/%BUGID% \ No newline at end of property