Author: akhaldi
Date: Sat Mar 5 10:21:38 2016
New Revision: 70933
URL:
http://svn.reactos.org/svn/reactos?rev=70933&view=rev
Log:
[SHLWAPI_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912
Modified:
trunk/rostests/winetests/shlwapi/ordinal.c
trunk/rostests/winetests/shlwapi/url.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] Sat Mar 5 10:21:38 2016
@@ -76,6 +76,24 @@
static HRESULT (WINAPI *pSKAllocValueW)(DWORD, LPCWSTR, LPCWSTR, DWORD*, void**,
DWORD*);
static HWND (WINAPI *pSHSetParentHwnd)(HWND, HWND);
static HRESULT (WINAPI *pIUnknown_GetClassID)(IUnknown*, CLSID*);
+static HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO2*);
+
+typedef struct SHELL_USER_SID {
+ SID_IDENTIFIER_AUTHORITY sidAuthority;
+ DWORD dwUserGroupID;
+ DWORD dwUserID;
+} SHELL_USER_SID, *PSHELL_USER_SID;
+typedef struct SHELL_USER_PERMISSION {
+
+ SHELL_USER_SID susID;
+ DWORD dwAccessType;
+ BOOL fInherit;
+ DWORD dwAccessMask;
+ DWORD dwInheritMask;
+ DWORD dwInheritAccessMask;
+} SHELL_USER_PERMISSION, *PSHELL_USER_PERMISSION;
+
+static SECURITY_DESCRIPTOR* (WINAPI *pGetShellSecurityDescriptor)(const
SHELL_USER_PERMISSION**,int);
static HMODULE hmlang;
static HRESULT (WINAPI *pLcidToRfc1766A)(LCID, LPSTR, INT);
@@ -522,6 +540,11 @@
ret = pSHFreeShared(hmem2, procid);
ok(ret, "SHFreeShared failed: %u\n", GetLastError());
}
+
+ SetLastError(0xdeadbeef);
+ ret = pSHFreeShared(NULL, procid);
+ ok(ret, "SHFreeShared failed: %u\n", GetLastError());
+ ok(GetLastError() == 0xdeadbeef, "last error should not have changed, got
%u\n", GetLastError());
}
static void test_alloc_shared_remote(DWORD procid, HANDLE hmem)
@@ -551,6 +574,11 @@
ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
/* test SHMapHandle */
+ SetLastError(0xdeadbeef);
+ hmem2 = pSHMapHandle(NULL, procid, GetCurrentProcessId(), 0, 0);
+ ok(hmem2 == NULL, "expected NULL, got new handle\n");
+ ok(GetLastError() == 0xdeadbeef, "last error should not have changed, got
%u\n", GetLastError());
+
hmem2 = pSHMapHandle(hmem, procid, GetCurrentProcessId(), 0, 0);
/* It seems like Windows Vista/2008 uses a different internal implementation
@@ -676,39 +704,22 @@
HeapFree(GetProcessHeap(), 0, mem);
}
-
-typedef struct SHELL_USER_SID {
- SID_IDENTIFIER_AUTHORITY sidAuthority;
- DWORD dwUserGroupID;
- DWORD dwUserID;
-} SHELL_USER_SID, *PSHELL_USER_SID;
-typedef struct SHELL_USER_PERMISSION {
- SHELL_USER_SID susID;
- DWORD dwAccessType;
- BOOL fInherit;
- DWORD dwAccessMask;
- DWORD dwInheritMask;
- DWORD dwInheritAccessMask;
-} SHELL_USER_PERMISSION, *PSHELL_USER_PERMISSION;
static void test_GetShellSecurityDescriptor(void)
{
- SHELL_USER_PERMISSION supCurrentUserFull = {
+ static const SHELL_USER_PERMISSION supCurrentUserFull = {
{ {SECURITY_NULL_SID_AUTHORITY}, 0, 0 },
ACCESS_ALLOWED_ACE_TYPE, FALSE,
GENERIC_ALL, 0, 0 };
#define MY_INHERITANCE 0xBE /* invalid value to proof behavior */
- SHELL_USER_PERMISSION supEveryoneDenied = {
+ static const SHELL_USER_PERMISSION supEveryoneDenied = {
{ {SECURITY_WORLD_SID_AUTHORITY}, SECURITY_WORLD_RID, 0 },
ACCESS_DENIED_ACE_TYPE, TRUE,
GENERIC_WRITE, MY_INHERITANCE | 0xDEADBA00, GENERIC_READ };
- PSHELL_USER_PERMISSION rgsup[2] = {
+ const SHELL_USER_PERMISSION* rgsup[2] = {
&supCurrentUserFull, &supEveryoneDenied,
};
SECURITY_DESCRIPTOR* psd;
- SECURITY_DESCRIPTOR*
(WINAPI*pGetShellSecurityDescriptor)(PSHELL_USER_PERMISSION*,int);
void *pChrCmpIW = GetProcAddress(hShlwapi, "ChrCmpIW");
-
- pGetShellSecurityDescriptor=(void*)GetProcAddress(hShlwapi,(char*)475);
if(!pGetShellSecurityDescriptor)
{
@@ -3072,6 +3083,7 @@
MAKEFUNC(SHFormatDateTimeA, 353);
MAKEFUNC(SHFormatDateTimeW, 354);
MAKEFUNC(SHIShellFolder_EnumObjects, 404);
+ MAKEFUNC(GetShellSecurityDescriptor, 475);
MAKEFUNC(SHGetObjectCompatFlags, 476);
MAKEFUNC(IUnknown_QueryServiceExec, 484);
MAKEFUNC(SHGetShellKey, 491);
@@ -3082,6 +3094,8 @@
MAKEFUNC(SKDeleteValueW, 518);
MAKEFUNC(SKAllocValueW, 519);
#undef MAKEFUNC
+
+ pDllGetVersion = (void*)GetProcAddress(hShlwapi, "DllGetVersion");
}
static void test_SHSetParentHwnd(void)
@@ -3253,6 +3267,14 @@
ok(hr == 0x8fff2222, "got 0x%08x\n", hr);
ok(IsEqualCLSID(&clsid, &clsid2) || broken(IsEqualCLSID(&clsid,
&clsid3)) /* win2k3 */,
"got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
+}
+
+static void test_DllGetVersion(void)
+{
+ HRESULT hr;
+
+ hr = pDllGetVersion(NULL);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
}
START_TEST(ordinal)
@@ -3310,6 +3332,7 @@
test_SHGetShellKey();
test_SHSetParentHwnd();
test_IUnknown_GetClassID();
+ test_DllGetVersion();
FreeLibrary(hshell32);
FreeLibrary(hmlang);
Modified: trunk/rostests/winetests/shlwapi/url.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/url.c?r…
==============================================================================
--- trunk/rostests/winetests/shlwapi/url.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/url.c [iso-8859-1] Sat Mar 5 10:21:38 2016
@@ -315,6 +315,45 @@
{"ftp\x1f\1end/", 0, 0, S_OK, "ftp%1F%01end/"}
};
+typedef struct _TEST_URL_ESCAPEW {
+ const WCHAR url[INTERNET_MAX_URL_LENGTH];
+ DWORD flags;
+ HRESULT expectret;
+ const WCHAR expecturl[INTERNET_MAX_URL_LENGTH];
+ const WCHAR win7url[INTERNET_MAX_URL_LENGTH]; /* <= Win7 */
+ const WCHAR vistaurl[INTERNET_MAX_URL_LENGTH]; /* <= Vista/2k8 */
+} TEST_URL_ESCAPEW;
+
+static const TEST_URL_ESCAPEW TEST_ESCAPEW[] = {
+ {{' ','<','>','"',0}, URL_ESCAPE_AS_UTF8,
S_OK,
{'%','2','0','%','3','C','%','3','E','%','2','2',0}},
+ {{'{','}','|','\\',0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','7','B','%','7','D','%','7','C','%','5','C',0}},
+ {{'^',']','[','`',0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','5','E','%','5','D','%','5','B','%','6','0',0}},
+ {{'&','/','?','#',0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','2','6','/','?','#',0}},
+ {{'M','a','s','s',0}, URL_ESCAPE_AS_UTF8, S_OK,
{'M','a','s','s',0}},
+
+ /* broken < Win8/10 */
+
+ {{'M','a',0xdf,0}, URL_ESCAPE_AS_UTF8, S_OK,
{'M','a','%','C','3','%','9','F',0},
+
{'M','a','%','D','F',0}},
+ /* 0x2070E */
+ {{0xd841,0xdf0e,0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','F','0','%','A','0','%','9','C','%','8','E',0},
+
{'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0},
+ {0xd841,0xdf0e,0}},
+ /* 0x27A3E */
+ {{0xd85e,0xde3e,0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','F','0','%','A','7','%','A','8','%','B','E',0},
+
{'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0},
+ {0xd85e,0xde3e,0}},
+
+ {{0xd85e,0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','E','F','%','B','F','%','B','D',0},
+ {0xd85e,0}},
+ {{0xd85e,0x41}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','E','F','%','B','F','%','B','D','A',0},
+ {0xd85e,'A',0}},
+ {{0xdc00,0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','E','F','%','B','F','%','B','D',0},
+ {0xdc00,0}},
+ {{0xffff,0}, URL_ESCAPE_AS_UTF8, S_OK,
{'%','E','F','%','B','F','%','B','F',0},
+ {0xffff,0}},
+};
+
/* ################ */
typedef struct _TEST_URL_COMBINE {
@@ -885,6 +924,15 @@
ok(size == 34, "got %d, expected %d\n", size, 34);
ok(empty_string[0] == 127, "String has changed, empty_string[0] = %d\n",
empty_string[0]);
+ size = 1;
+ empty_string[0] = 127;
+ ret = pUrlEscapeA("/woningplan/woonkamer basis.swf", empty_string,
&size, URL_ESCAPE_AS_UTF8);
+ ok(ret == E_NOTIMPL || broken(ret == E_POINTER), /* < Win7/Win2k8 */
+ "got %x, expected %x\n", ret, E_NOTIMPL);
+ ok(size == 1 || broken(size == 34), /* < Win7/Win2k8 */
+ "got %d, expected %d\n", size, 1);
+ ok(empty_string[0] == 127, "String has changed, empty_string[0] = %d\n",
empty_string[0]);
+
for(i=0; i<sizeof(TEST_ESCAPE)/sizeof(TEST_ESCAPE[0]); i++) {
CHAR ret_url[INTERNET_MAX_URL_LENGTH];
@@ -947,6 +995,21 @@
wine_dbgstr_w(expected_urlW), wine_dbgstr_w(ret_urlW), wine_dbgstr_w(urlW),
TEST_ESCAPE[i].flags);
FreeWideString(urlW);
FreeWideString(expected_urlW);
+ }
+
+ for(i=0; i<sizeof(TEST_ESCAPEW)/sizeof(TEST_ESCAPEW[0]); i++) {
+ WCHAR ret_url[INTERNET_MAX_URL_LENGTH];
+
+ size = INTERNET_MAX_URL_LENGTH;
+ ret = pUrlEscapeW(TEST_ESCAPEW[i].url, ret_url, &size,
TEST_ESCAPEW[i].flags);
+ ok(ret == TEST_ESCAPEW[i].expectret, "UrlEscapeW returned 0x%08x instead of
0x%08x for \"%s\"\n",
+ ret, TEST_ESCAPEW[i].expectret, wine_dbgstr_w(TEST_ESCAPEW[i].url));
+ ok(!lstrcmpW(ret_url, TEST_ESCAPEW[i].expecturl) ||
+ broken(!lstrcmpW(ret_url, TEST_ESCAPEW[i].vistaurl)) ||
+ broken(!lstrcmpW(ret_url, TEST_ESCAPEW[i].win7url)),
+ "Expected \"%s\" or \"%s\" or \"%s\", but
got \"%s\" for \"%s\"\n",
+ wine_dbgstr_w(TEST_ESCAPEW[i].expecturl),
wine_dbgstr_w(TEST_ESCAPEW[i].vistaurl),
+ wine_dbgstr_w(TEST_ESCAPEW[i].win7url), wine_dbgstr_w(ret_url),
wine_dbgstr_w(TEST_ESCAPEW[i].url));
}
}