Author: akhaldi
Date: Mon Jul 20 22:58:24 2015
New Revision: 68502
URL:
http://svn.reactos.org/svn/reactos?rev=68502&view=rev
Log:
[SHLWAPI_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
Modified:
trunk/rostests/winetests/shlwapi/istream.c
trunk/rostests/winetests/shlwapi/ordinal.c
trunk/rostests/winetests/shlwapi/path.c
trunk/rostests/winetests/shlwapi/url.c
Modified: trunk/rostests/winetests/shlwapi/istream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/istream…
==============================================================================
--- trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] Mon Jul 20 22:58:24 2015
@@ -489,7 +489,8 @@
static const CHAR testEx_txt[] = "\\testEx.txt";
BOOL delret;
- trace("SHCreateStreamOnFileEx: testing mode %d, STGM flags %08x\n", mode,
stgm);
+ if (winetest_debug > 1)
+ trace("SHCreateStreamOnFileEx: testing mode %d, STGM flags %08x\n",
mode, stgm);
/* Don't used a fixed path for the testEx.txt file */
GetTempPathA(MAX_PATH, test_fileA);
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 Jul 20 22:58:24 2015
@@ -75,6 +75,7 @@
static HRESULT (WINAPI *pSKDeleteValueW)(DWORD, LPCWSTR, LPCWSTR);
static HRESULT (WINAPI *pSKAllocValueW)(DWORD, LPCWSTR, LPCWSTR, DWORD*, void**,
DWORD*);
static HWND (WINAPI *pSHSetParentHwnd)(HWND, HWND);
+static HRESULT (WINAPI *pIUnknown_GetClassID)(IUnknown*, CLSID*);
static HMODULE hmlang;
static HRESULT (WINAPI *pLcidToRfc1766A)(LCID, LPSTR, INT);
@@ -553,10 +554,10 @@
hmem2 = pSHMapHandle(hmem, procid, GetCurrentProcessId(), 0, 0);
/* It seems like Windows Vista/2008 uses a different internal implementation
- * for shared memory, and calling SHMapHandle fails with ERROR_INVALID_HANDLE. */
- ok(hmem2 != NULL || broken(hmem2 == NULL && GetLastError() ==
ERROR_INVALID_HANDLE),
+ * for shared memory, and calling SHMapHandle fails. */
+ ok(hmem2 != NULL || broken(hmem2 == NULL),
"SHMapHandle failed: %u\n", GetLastError());
- if (hmem2 == NULL && GetLastError() == ERROR_INVALID_HANDLE)
+ if (hmem2 == NULL)
{
win_skip("Subprocess failed to map shared memory, skipping test\n");
return;
@@ -3053,6 +3054,7 @@
MAKEFUNC(SHSetWindowBits, 165);
MAKEFUNC(SHSetParentHwnd, 167);
MAKEFUNC(ConnectToConnectionPoint, 168);
+ MAKEFUNC(IUnknown_GetClassID, 175);
MAKEFUNC(SHSearchMapInt, 198);
MAKEFUNC(SHCreateWorkerWindowA, 257);
MAKEFUNC(GUIDFromStringA, 269);
@@ -3158,6 +3160,95 @@
DestroyWindow(hwnd2);
}
+static HRESULT WINAPI testpersist_QI(IPersist *iface, REFIID riid, void **obj)
+{
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPersist)) {
+ *obj = iface;
+ IPersist_AddRef(iface);
+ return S_OK;
+ }
+
+ *obj = NULL;
+ return E_NOINTERFACE;
+}
+
+static HRESULT WINAPI testpersist_QI2(IPersist *iface, REFIID riid, void **obj)
+{
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPersistFolder))
{
+ *obj = iface;
+ IPersist_AddRef(iface);
+ return S_OK;
+ }
+
+ *obj = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI testpersist_AddRef(IPersist *iface)
+{
+ return 2;
+}
+
+static ULONG WINAPI testpersist_Release(IPersist *iface)
+{
+ return 1;
+}
+
+static HRESULT WINAPI testpersist_GetClassID(IPersist *iface, CLSID *clsid)
+{
+ memset(clsid, 0xab, sizeof(*clsid));
+ return 0x8fff2222;
+}
+
+static IPersistVtbl testpersistvtbl = {
+ testpersist_QI,
+ testpersist_AddRef,
+ testpersist_Release,
+ testpersist_GetClassID
+};
+
+static IPersistVtbl testpersist2vtbl = {
+ testpersist_QI2,
+ testpersist_AddRef,
+ testpersist_Release,
+ testpersist_GetClassID
+};
+
+static IPersist testpersist = { &testpersistvtbl };
+static IPersist testpersist2 = { &testpersist2vtbl };
+
+static void test_IUnknown_GetClassID(void)
+{
+ CLSID clsid, clsid2, clsid3;
+ HRESULT hr;
+
+if (0) /* crashes on native systems */
+ hr = pIUnknown_GetClassID(NULL, NULL);
+
+ memset(&clsid, 0xcc, sizeof(clsid));
+ memset(&clsid3, 0xcc, sizeof(clsid3));
+ hr = pIUnknown_GetClassID(NULL, &clsid);
+ ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(IsEqualCLSID(&clsid, &CLSID_NULL) || broken(IsEqualCLSID(&clsid,
&clsid3)) /* win2k, winxp, win2k3 */,
+ "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
+
+ memset(&clsid, 0xcc, sizeof(clsid));
+ memset(&clsid2, 0xab, sizeof(clsid2));
+ hr = pIUnknown_GetClassID((IUnknown*)&testpersist, &clsid);
+ 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));
+
+ /* IPersistFolder is also supported */
+ memset(&clsid, 0xcc, sizeof(clsid));
+ memset(&clsid2, 0xab, sizeof(clsid2));
+ memset(&clsid3, 0xcc, sizeof(clsid3));
+ hr = pIUnknown_GetClassID((IUnknown*)&testpersist2, &clsid);
+ 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));
+}
+
START_TEST(ordinal)
{
char **argv;
@@ -3212,6 +3303,7 @@
test_SHSetIniString();
test_SHGetShellKey();
test_SHSetParentHwnd();
+ test_IUnknown_GetClassID();
FreeLibrary(hshell32);
FreeLibrary(hmlang);
Modified: trunk/rostests/winetests/shlwapi/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/path.c?…
==============================================================================
--- trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] Mon Jul 20 22:58:24 2015
@@ -188,13 +188,18 @@
/* ################ */
-static LPWSTR GetWideString(const char* szString)
-{
- LPWSTR wszString = HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) *
sizeof(WCHAR));
-
- MultiByteToWideChar(CP_ACP, 0, szString, -1, wszString, INTERNET_MAX_URL_LENGTH);
-
- return wszString;
+static LPWSTR GetWideString(const char *src)
+{
+ WCHAR *ret;
+
+ if (!src)
+ return NULL;
+
+ ret = HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR));
+
+ MultiByteToWideChar(CP_ACP, 0, src, -1, ret, INTERNET_MAX_URL_LENGTH);
+
+ return ret;
}
static void FreeWideString(LPWSTR wszString)
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] Mon Jul 20 22:58:24 2015
@@ -1150,7 +1150,7 @@
if (todo)
{
- todo_wine ok(dwSize == dwExpectLen && (!SUCCEEDED(hr) ||
strcmp(szReturnUrl, szExpectUrl)==0),
+ todo_wine ok(dwSize == dwExpectLen && (FAILED(hr) || strcmp(szReturnUrl,
szExpectUrl)==0),
"Expected %s (len=%d), but got %s (len=%d)\n", szExpectUrl,
dwExpectLen, SUCCEEDED(hr) ? szReturnUrl : "(null)", dwSize);
}
else