Author: akhaldi Date: Mon Nov 23 09:43:14 2015 New Revision: 70059
URL: http://svn.reactos.org/svn/reactos?rev=70059&view=rev Log: [SHLWAPI_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
Modified: trunk/rostests/winetests/shlwapi/ordinal.c trunk/rostests/winetests/shlwapi/path.c trunk/rostests/winetests/shlwapi/shreg.c
Modified: trunk/rostests/winetests/shlwapi/ordinal.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/ordinal.... ============================================================================== --- trunk/rostests/winetests/shlwapi/ordinal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/ordinal.c [iso-8859-1] Mon Nov 23 09:43:14 2015 @@ -1639,20 +1639,18 @@
out = 0xfeedface; rc = pSHPropertyBag_ReadLONG(NULL, szName1, &out); - ok(rc == E_INVALIDARG || broken(rc == 0), "incorrect return %x\n",rc); + ok(rc == E_INVALIDARG || broken(rc == S_OK), "incorrect return %x\n",rc); ok(out == 0xfeedface, "value should not have changed\n"); rc = pSHPropertyBag_ReadLONG(&pb->IPropertyBag_iface, NULL, &out); - ok(rc == E_INVALIDARG || broken(rc == 0) || broken(rc == 1), "incorrect return %x\n",rc); + ok(rc == E_INVALIDARG || broken(rc == S_OK) || broken(rc == S_FALSE), "incorrect return %x\n",rc); ok(out == 0xfeedface, "value should not have changed\n"); rc = pSHPropertyBag_ReadLONG(&pb->IPropertyBag_iface, szName1, NULL); - ok(rc == E_INVALIDARG || broken(rc == 0) || broken(rc == 1), "incorrect return %x\n",rc); + ok(rc == E_INVALIDARG || broken(rc == S_OK) || broken(rc == S_FALSE), "incorrect return %x\n",rc); rc = pSHPropertyBag_ReadLONG(&pb->IPropertyBag_iface, szName1, &out); - ok(rc == DISP_E_BADVARTYPE || broken(rc == 0) || broken(rc == 1), "incorrect return %x\n",rc); + ok(rc == DISP_E_BADVARTYPE || broken(rc == S_OK) || broken(rc == S_FALSE), "incorrect return %x\n",rc); ok(out == 0xfeedface || broken(out == 0xfeedfa00), "value should not have changed %x\n",out); IUnknown_Release((IUnknown*)pb); } - -
static void test_SHSetWindowBits(void) {
Modified: trunk/rostests/winetests/shlwapi/path.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/path.c?r... ============================================================================== --- trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] Mon Nov 23 09:43:14 2015 @@ -32,8 +32,8 @@ #include <shlwapi.h> #include <wininet.h>
-static HRESULT (WINAPI *pPathIsValidCharA)(char,DWORD); -static HRESULT (WINAPI *pPathIsValidCharW)(WCHAR,DWORD); +static BOOL (WINAPI *pPathIsValidCharA)(char,DWORD); +static BOOL (WINAPI *pPathIsValidCharW)(WCHAR,DWORD); static LPWSTR (WINAPI *pPathCombineW)(LPWSTR, LPCWSTR, LPCWSTR); static HRESULT (WINAPI *pPathCreateFromUrlA)(LPCSTR, LPSTR, LPDWORD, DWORD); static HRESULT (WINAPI *pPathCreateFromUrlW)(LPCWSTR, LPWSTR, LPDWORD, DWORD); @@ -1644,6 +1644,19 @@ } }
+static void test_PathStripPathA(void) +{ + const char const_path[] = "test"; + char path[] = "short//path\file.txt"; + + PathStripPathA(path); + ok(!strcmp(path, "file.txt"), "path = %s\n", path); + + /* following test should not crash */ + /* LavView 2013 depends on that behaviour */ + PathStripPathA((char*)const_path); +} + START_TEST(path) { HMODULE hShlwapi = GetModuleHandleA("shlwapi.dll"); @@ -1689,4 +1702,5 @@ test_PathUnExpandEnvStrings(); test_PathIsRelativeA(); test_PathIsRelativeW(); -} + test_PathStripPathA(); +}
Modified: trunk/rostests/winetests/shlwapi/shreg.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/shreg.c?... ============================================================================== --- trunk/rostests/winetests/shlwapi/shreg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/shreg.c [iso-8859-1] Mon Nov 23 09:43:14 2015 @@ -42,6 +42,8 @@ static DWORD (WINAPI *pSHRegGetPathA)(HKEY,LPCSTR,LPCSTR,LPSTR,DWORD); static LSTATUS (WINAPI *pSHRegGetValueA)(HKEY,LPCSTR,LPCSTR,SRRF,LPDWORD,LPVOID,LPDWORD); static LSTATUS (WINAPI *pSHRegCreateUSKeyW)(LPCWSTR,REGSAM,HUSKEY,PHUSKEY,DWORD); +static LSTATUS (WINAPI *pSHRegOpenUSKeyW)(LPCWSTR,REGSAM,HUSKEY,PHUSKEY,BOOL); +static LSTATUS (WINAPI *pSHRegCloseUSKey)(HUSKEY);
static const char sTestpath1[] = "%LONGSYSTEMVAR%\subdir1"; static const char sTestpath2[] = "%FOO%\subdir1"; @@ -462,6 +464,35 @@ ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); }
+static void test_SHRegCloseUSKey(void) +{ + static const WCHAR localW[] = {'S','o','f','t','w','a','r','e',0}; + LONG ret; + HUSKEY key; + + if (!pSHRegOpenUSKeyW || !pSHRegCloseUSKey) + { + win_skip("SHRegOpenUSKeyW or SHRegCloseUSKey not available\n"); + return; + } + + ret = pSHRegCloseUSKey(NULL); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + + ret = pSHRegOpenUSKeyW(localW, KEY_ALL_ACCESS, NULL, &key, FALSE); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = pSHRegCloseUSKey(key); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + /* Test with limited rights, specially without KEY_SET_VALUE */ + ret = pSHRegOpenUSKeyW(localW, KEY_QUERY_VALUE, NULL, &key, FALSE); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = pSHRegCloseUSKey(key); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); +} + START_TEST(shreg) { HKEY hkey = create_test_entries(); @@ -480,6 +511,8 @@ pSHRegGetPathA = (void*)GetProcAddress(hshlwapi,"SHRegGetPathA"); pSHRegGetValueA = (void*)GetProcAddress(hshlwapi,"SHRegGetValueA"); pSHRegCreateUSKeyW = (void*)GetProcAddress(hshlwapi, "SHRegCreateUSKeyW"); + pSHRegOpenUSKeyW = (void*)GetProcAddress(hshlwapi, "SHRegOpenUSKeyW"); + pSHRegCloseUSKey = (void*)GetProcAddress(hshlwapi, "SHRegCloseUSKey");
test_SHGetValue(); test_SHRegGetValue(); @@ -488,6 +521,7 @@ test_SHCopyKey(); test_SHDeleteKey(); test_SHRegCreateUSKeyW(); + test_SHRegCloseUSKey();
delete_key( hkey, "Software\Wine", "Test" ); }