Author: akhaldi
Date: Sun Mar 24 12:36:17 2013
New Revision: 58601
URL:
http://svn.reactos.org/svn/reactos?rev=58601&view=rev
Log:
[SHLWAPI_WINETEST]
* Sync with Wine 1.5.26.
Modified:
trunk/rostests/winetests/shlwapi/assoc.c
trunk/rostests/winetests/shlwapi/clist.c
trunk/rostests/winetests/shlwapi/clsid.c
trunk/rostests/winetests/shlwapi/generated.c
trunk/rostests/winetests/shlwapi/istream.c
trunk/rostests/winetests/shlwapi/ordinal.c
trunk/rostests/winetests/shlwapi/path.c
trunk/rostests/winetests/shlwapi/shreg.c
trunk/rostests/winetests/shlwapi/string.c
trunk/rostests/winetests/shlwapi/testlist.c
trunk/rostests/winetests/shlwapi/thread.c
trunk/rostests/winetests/shlwapi/url.c
Modified: trunk/rostests/winetests/shlwapi/assoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/assoc.c…
==============================================================================
--- trunk/rostests/winetests/shlwapi/assoc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/assoc.c [iso-8859-1] Sun Mar 24 12:36:17 2013
@@ -17,11 +17,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdarg.h>
-
-#include "wine/test.h"
-#include "shlwapi.h"
-#include "shlguid.h"
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdarg.h>
+
+#include <wine/test.h>
+#include <winreg.h>
+#include <shlwapi.h>
+#include <shlguid.h>
#define expect(expected, got) ok ( expected == got, "Expected %d, got %d\n",
expected, got)
#define expect_hr(expected, got) ok ( expected == got, "Expected %08x, got
%08x\n", expected, got)
@@ -78,7 +83,8 @@
hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotBad, open, NULL,
&len);
ok(hr == E_FAIL ||
- hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8
*/
+ hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win9x/WinMe/NT4/W2K/Vista/W2K8
*/ ||
+ hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), /* Win8 */
"Unexpected result : %08x\n", hr);
hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, invalid, NULL,
&len);
@@ -133,7 +139,8 @@
hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, open, NULL,
&len);
ok(hr == S_FALSE ||
- hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* Win9x/NT4 */
+ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* Win9x/NT4 */ ||
+ hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), /* Win8 */
"Unexpected result : %08x\n", hr);
if (hr != S_FALSE)
{
Modified: trunk/rostests/winetests/shlwapi/clist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/clist.c…
==============================================================================
--- trunk/rostests/winetests/shlwapi/clist.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/clist.c [iso-8859-1] Sun Mar 24 12:36:17 2013
@@ -17,12 +17,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdarg.h>
-
-#include "wine/test.h"
-#include "windef.h"
-#include "winbase.h"
-#include "objbase.h"
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdarg.h>
+
+#include <wine/test.h>
+//#include "windef.h"
+//#include "winbase.h"
+#include <objbase.h>
typedef struct tagSHLWAPI_CLIST
{
Modified: trunk/rostests/winetests/shlwapi/clsid.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/clsid.c…
==============================================================================
--- trunk/rostests/winetests/shlwapi/clsid.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/clsid.c [iso-8859-1] Sun Mar 24 12:36:17 2013
@@ -17,17 +17,22 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdio.h>
-
-#include "wine/test.h"
-#include "winbase.h"
-#include "winerror.h"
-#include "winnls.h"
-#include "winuser.h"
-#include "initguid.h"
-#include "shlguid.h"
-#include "shobjidl.h"
-#include "olectl.h"
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdio.h>
+
+#include <wine/test.h>
+//#include "winbase.h"
+//#include "winerror.h"
+//#include "winnls.h"
+//#include "winuser.h"
+#include <objbase.h>
+#include <initguid.h>
+#include <shlguid.h>
+#include <shobjidl.h>
+#include <olectl.h>
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
Modified: trunk/rostests/winetests/shlwapi/generated.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/generat…
==============================================================================
--- trunk/rostests/winetests/shlwapi/generated.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/generated.c [iso-8859-1] Sun Mar 24 12:36:17 2013
@@ -4,6 +4,10 @@
/*
* Unit tests for data structure packing
*/
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
#define WINVER 0x0501
#define _WIN32_IE 0x0501
@@ -12,13 +16,13 @@
#define WINE_NOWINSOCK
#include <stdarg.h>
-#include "windef.h"
-#include "winbase.h"
-#include "wtypes.h"
-#include "winreg.h"
-#include "shlwapi.h"
-
-#include "wine/test.h"
+#include <windef.h>
+#include <winbase.h>
+//#include "wtypes.h"
+#include <winreg.h>
+#include <shlwapi.h>
+
+#include <wine/test.h>
/***********************************************************************
* Compatibility macros
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] Sun Mar 24 12:36:17 2013
@@ -17,16 +17,22 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
#define COBJMACROS
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "wine/test.h"
-#include "windef.h"
-#include "winbase.h"
-#include "objbase.h"
-#include "shlwapi.h"
+//#include <stdarg.h>
+//#include <stdio.h>
+
+#include <wine/test.h>
+//#include "windef.h"
+//#include "winbase.h"
+#include <winnls.h>
+#include <winreg.h>
+#include <objbase.h>
+//#include "shlwapi.h"
/* Function pointers for the SHCreateStreamOnFile functions */
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] Sun Mar 24 12:36:17 2013
@@ -17,22 +17,28 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdio.h>
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdio.h>
#define COBJMACROS
#define CONST_VTABLE
-#include "wine/test.h"
-#include "winbase.h"
-#include "winerror.h"
-#include "winuser.h"
-#include "ole2.h"
-#include "oaidl.h"
-#include "ocidl.h"
-#include "mlang.h"
-#include "shlwapi.h"
-#include "docobj.h"
-#include "shobjidl.h"
-#include "shlobj.h"
+#include <wine/test.h>
+//#include "winbase.h"
+#include <winreg.h>
+#include <winnls.h>
+//#include "winerror.h"
+//#include "winuser.h"
+#include <ole2.h>
+//#include "oaidl.h"
+//#include "ocidl.h"
+//#include "mlang.h"
+#include <shlwapi.h>
+//#include "docobj.h"
+#include <shobjidl.h>
+//#include "shlobj.h"
/* Function ptrs for ordinal calls */
static HMODULE hShlwapi;
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] Sun Mar 24 12:36:17 2013
@@ -17,21 +17,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdarg.h>
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdarg.h>
#include <stdio.h>
-#include "wine/test.h"
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "shlwapi.h"
-#include "wininet.h"
+#include <wine/test.h>
+//#include "windef.h"
+//#include "winbase.h"
+#include <winreg.h>
+#include <winnls.h>
+#include <shlwapi.h>
+#include <wininet.h>
static HRESULT (WINAPI *pPathIsValidCharA)(char,DWORD);
static HRESULT (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);
+static HRESULT (WINAPI *pPathCreateFromUrlAlloc)(LPCWSTR, LPWSTR*, DWORD);
static BOOL (WINAPI *pPathAppendA)(LPSTR, LPCSTR);
/* ################ */
@@ -39,34 +45,88 @@
static const struct {
const char *url;
const char *path;
- DWORD ret;
+ DWORD ret, todo;
} TEST_PATHFROMURL[] = {
- {"file:///c:/foo/ba%5Cr", "c:\\foo\\ba\\r", S_OK},
- {"file:///c:/foo/../ba%5Cr", "c:\\foo\\..\\ba\\r", S_OK},
- {"file:///host/c:/foo/bar", "\\host\\c:\\foo\\bar", S_OK},
- {"file://host/c:/foo/bar", "\\\\hostc:\\foo\\bar", S_OK},
- {"file://host/c:/foo/bar", "\\\\hostc:\\foo\\bar", S_OK},
- {"file:\\\\host\\c:\\foo\\bar", "\\\\hostc:\\foo\\bar", S_OK},
- {"file:\\\\host\\ca\\foo\\bar", "\\\\host\\ca\\foo\\bar", S_OK},
- {"file:\\\\host\\c|\\foo\\bar", "\\\\hostc|\\foo\\bar", S_OK},
- {"file:\\%5Chost\\c:\\foo\\bar", "\\\\host\\c:\\foo\\bar",
S_OK},
- {"file:\\\\host\\cx:\\foo\\bar", "\\\\host\\cx:\\foo\\bar",
S_OK},
- {"file://c:/foo/bar", "c:\\foo\\bar", S_OK},
- {"file://c:/d:/foo/bar", "c:\\d:\\foo\\bar", S_OK},
- {"file://c|/d|/foo/bar", "c:\\d|\\foo\\bar", S_OK},
- {"file://host/foo/bar", "\\\\host\\foo\\bar", S_OK},
- {"file:/foo/bar", "\\foo\\bar", S_OK},
- {"file:/foo/bar/", "\\foo\\bar\\", S_OK},
- {"file:foo/bar", "foo\\bar", S_OK},
- {"file:c:/foo/bar", "c:\\foo\\bar", S_OK},
- {"file:c|/foo/bar", "c:\\foo\\bar", S_OK},
- {"file:cx|/foo/bar", "cx|\\foo\\bar", S_OK},
- {"file:////c:/foo/bar", "c:\\foo\\bar", S_OK},
-/* {"file:////c:/foo/foo%20bar", "c:\\foo\\foo%20bar", S_OK},*/
-
- {"c:\\foo\\bar", NULL, E_INVALIDARG},
- {"foo/bar", NULL, E_INVALIDARG},
- {"http://foo/bar", NULL, E_INVALIDARG},
+ /* 0 leading slash */
+ {"file:c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:c|/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:cx|/foo/bar", "cx|\\foo\\bar", S_OK, 0},
+ {"file:c:foo/bar", "c:foo\\bar", S_OK, 0},
+ {"file:c|foo/bar", "c:foo\\bar", S_OK, 0},
+ {"file:c:/foo%20ba%2fr", "c:\\foo ba/r", S_OK, 0},
+ {"file:foo%20ba%2fr", "foo ba/r", S_OK, 0},
+ {"file:foo/bar/", "foo\\bar\\", S_OK, 0},
+
+ /* 1 leading (back)slash */
+ {"file:/c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:\\c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:/c|/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:/cx|/foo/bar", "\\cx|\\foo\\bar", S_OK, 0},
+ {"file:/c:foo/bar", "c:foo\\bar", S_OK, 0},
+ {"file:/c|foo/bar", "c:foo\\bar", S_OK, 0},
+ {"file:/c:/foo%20ba%2fr", "c:\\foo ba/r", S_OK, 0},
+ {"file:/foo%20ba%2fr", "\\foo ba/r", S_OK, 0},
+ {"file:/foo/bar/", "\\foo\\bar\\", S_OK, 0},
+
+ /* 2 leading (back)slashes */
+ {"file://c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file://c:/d:/foo/bar", "c:\\d:\\foo\\bar", S_OK, 0},
+ {"file://c|/d|/foo/bar", "c:\\d|\\foo\\bar", S_OK, 0},
+ {"file://cx|/foo/bar", "\\\\cx|\\foo\\bar", S_OK, 0},
+ {"file://c:foo/bar", "c:foo\\bar", S_OK, 0},
+ {"file://c|foo/bar", "c:foo\\bar", S_OK, 0},
+ {"file://c:/foo%20ba%2fr", "c:\\foo%20ba%2fr", S_OK, 0},
+ {"file://c%3a/foo/../bar", "\\\\c:\\foo\\..\\bar", S_OK, 0},
+ {"file://c%7c/foo/../bar", "\\\\c|\\foo\\..\\bar", S_OK, 0},
+ {"file://foo%20ba%2fr", "\\\\foo ba/r", S_OK, 0},
+ {"file://localhost/c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file://localhost/c:/foo%20ba%5Cr", "c:\\foo ba\\r", S_OK, 0},
+ {"file://LocalHost/c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:\\\\localhost\\c:\\foo\\bar", "c:\\foo\\bar", S_OK, 0},
+ {"file://incomplete", "\\\\incomplete", S_OK, 0},
+
+ /* 3 leading (back)slashes (omitting hostname) */
+ {"file:///c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"File:///c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:///c:/foo%20ba%2fr", "c:\\foo ba/r", S_OK, 0},
+ {"file:///foo%20ba%2fr", "\\foo ba/r", S_OK, 0},
+ {"file:///foo/bar/", "\\foo\\bar\\", S_OK, 0},
+ {"file:///localhost/c:/foo/bar", "\\localhost\\c:\\foo\\bar",
S_OK, 0},
+
+ /* 4 leading (back)slashes */
+ {"file:////c:/foo/bar", "c:\\foo\\bar", S_OK, 0},
+ {"file:////c:/foo%20ba%2fr", "c:\\foo%20ba%2fr", S_OK, 0},
+ {"file:////foo%20ba%2fr", "\\\\foo%20ba%2fr", S_OK, 0},
+
+ /* 5 and more leading (back)slashes */
+ {"file://///c:/foo/bar", "\\\\c:\\foo\\bar", S_OK, 0},
+ {"file://///c:/foo%20ba%2fr", "\\\\c:\\foo ba/r", S_OK, 0},
+ {"file://///foo%20ba%2fr", "\\\\foo ba/r", S_OK, 0},
+ {"file://////c:/foo/bar", "\\\\c:\\foo\\bar", S_OK, 0},
+
+ /* Leading (back)slashes cannot be escaped */
+ {"file:%2f%2flocalhost%2fc:/foo/bar", "//localhost/c:\\foo\\bar",
S_OK, 0},
+ {"file:%5C%5Clocalhost%5Cc:/foo/bar",
"\\\\localhost\\c:\\foo\\bar", S_OK, 0},
+
+ /* Hostname handling */
+ {"file://l%6fcalhost/c:/foo/bar", "\\\\localhostc:\\foo\\bar",
S_OK, 0},
+ {"file://localhost:80/c:/foo/bar",
"\\\\localhost:80c:\\foo\\bar", S_OK, 0},
+ {"file://host/c:/foo/bar", "\\\\hostc:\\foo\\bar", S_OK, 0},
+ {"file://host//c:/foo/bar", "\\\\host\\\\c:\\foo\\bar", S_OK,
0},
+ {"file://host/\\c:/foo/bar", "\\\\host\\\\c:\\foo\\bar", S_OK,
0},
+ {"file://host/c:foo/bar", "\\\\hostc:foo\\bar", S_OK, 0},
+ {"file://host/foo/bar", "\\\\host\\foo\\bar", S_OK, 0},
+ {"file:\\\\host\\c:\\foo\\bar", "\\\\hostc:\\foo\\bar", S_OK,
0},
+ {"file:\\\\host\\ca\\foo\\bar", "\\\\host\\ca\\foo\\bar", S_OK,
0},
+ {"file:\\\\host\\c|\\foo\\bar", "\\\\hostc|\\foo\\bar", S_OK,
0},
+ {"file:\\%5Chost\\c:\\foo\\bar", "\\\\host\\c:\\foo\\bar", S_OK,
0},
+ {"file:\\\\host\\cx:\\foo\\bar", "\\\\host\\cx:\\foo\\bar", S_OK,
0},
+ {"file:///host/c:/foo/bar", "\\host\\c:\\foo\\bar", S_OK, 0},
+
+ /* Not file URLs */
+ {"c:\\foo\\bar", NULL, E_INVALIDARG, 0},
+ {"foo/bar", NULL, E_INVALIDARG, 0},
+ {"http://foo/bar", NULL, E_INVALIDARG, 0},
};
@@ -128,7 +188,7 @@
{
LPWSTR wszString = HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) *
sizeof(WCHAR));
- MultiByteToWideChar(0, 0, szString, -1, wszString, INTERNET_MAX_URL_LENGTH);
+ MultiByteToWideChar(CP_ACP, 0, szString, -1, wszString, INTERNET_MAX_URL_LENGTH);
return wszString;
}
@@ -203,44 +263,86 @@
{
size_t i;
char ret_path[INTERNET_MAX_URL_LENGTH];
- DWORD len, ret;
+ DWORD len, len2, ret;
WCHAR ret_pathW[INTERNET_MAX_URL_LENGTH];
WCHAR *pathW, *urlW;
- static const char url[] = "http://www.winehq.org";
if (!pPathCreateFromUrlA) {
win_skip("PathCreateFromUrlA not found\n");
return;
}
- /* Check ret_path = NULL */
- len = sizeof(url);
- ret = pPathCreateFromUrlA(url, NULL, &len, 0);
- ok ( ret == E_INVALIDARG, "got 0x%08x expected E_INVALIDARG\n", ret);
-
+ /* Won't say how much is needed without a buffer */
+ len = 0xdeca;
+ ret = pPathCreateFromUrlA("file://foo", NULL, &len, 0);
+ ok(ret == E_INVALIDARG, "got 0x%08x expected E_INVALIDARG\n", ret);
+ ok(len == 0xdeca, "got %x expected 0xdeca\n", len);
+
+ /* Test the decoding itself */
for(i = 0; i < sizeof(TEST_PATHFROMURL) / sizeof(TEST_PATHFROMURL[0]); i++) {
len = INTERNET_MAX_URL_LENGTH;
ret = pPathCreateFromUrlA(TEST_PATHFROMURL[i].url, ret_path, &len, 0);
- ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url %s\n", ret,
TEST_PATHFROMURL[i].url);
- if(TEST_PATHFROMURL[i].path) {
- ok(!lstrcmpi(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s
from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
- ok(len == strlen(ret_path), "ret len %d from url %s\n", len,
TEST_PATHFROMURL[i].url);
+ if (!(TEST_PATHFROMURL[i].todo & 0x1))
+ ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url %s\n", ret,
TEST_PATHFROMURL[i].url);
+ else todo_wine
+ ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url %s\n", ret,
TEST_PATHFROMURL[i].url);
+ if(SUCCEEDED(ret) && TEST_PATHFROMURL[i].path) {
+ if(!(TEST_PATHFROMURL[i].todo & 0x2)) {
+ ok(!lstrcmpi(ret_path, TEST_PATHFROMURL[i].path), "got %s expected
%s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
+ ok(len == strlen(ret_path), "ret len %d from url %s\n", len,
TEST_PATHFROMURL[i].url);
+ } else todo_wine
+ /* Wrong string, don't bother checking the length */
+ ok(!lstrcmpi(ret_path, TEST_PATHFROMURL[i].path), "got %s expected
%s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
}
+
if (pPathCreateFromUrlW) {
len = INTERNET_MAX_URL_LENGTH;
pathW = GetWideString(TEST_PATHFROMURL[i].path);
urlW = GetWideString(TEST_PATHFROMURL[i].url);
ret = pPathCreateFromUrlW(urlW, ret_pathW, &len, 0);
- WideCharToMultiByte(CP_ACP, 0, ret_pathW, -1, ret_path,
sizeof(ret_path),0,0);
- ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url
L\"%s\"\n", ret, TEST_PATHFROMURL[i].url);
- if(TEST_PATHFROMURL[i].path) {
- ok(!lstrcmpiW(ret_pathW, pathW), "got %s expected %s from url
L\"%s\"\n",
- ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
- ok(len == lstrlenW(ret_pathW), "ret len %d from url
L\"%s\"\n", len, TEST_PATHFROMURL[i].url);
+ WideCharToMultiByte(CP_ACP, 0, ret_pathW, -1, ret_path,
sizeof(ret_path),NULL,NULL);
+ if (!(TEST_PATHFROMURL[i].todo & 0x1))
+ ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url
L\"%s\"\n", ret, TEST_PATHFROMURL[i].url);
+ else todo_wine
+ ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url
L\"%s\"\n", ret, TEST_PATHFROMURL[i].url);
+ if(SUCCEEDED(ret) && TEST_PATHFROMURL[i].path) {
+ if(!(TEST_PATHFROMURL[i].todo & 0x2)) {
+ ok(!lstrcmpiW(ret_pathW, pathW), "got %s expected %s from url
L\"%s\"\n",
+ ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
+ ok(len == lstrlenW(ret_pathW), "ret len %d from url
L\"%s\"\n", len, TEST_PATHFROMURL[i].url);
+ } else todo_wine
+ /* Wrong string, don't bother checking the length */
+ ok(!lstrcmpiW(ret_pathW, pathW), "got %s expected %s from url
L\"%s\"\n",
+ ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
}
+
+ if (SUCCEEDED(ret))
+ {
+ /* Check what happens if the buffer is too small */
+ len2 = 2;
+ ret = pPathCreateFromUrlW(urlW, ret_pathW, &len2, 0);
+ ok(ret == E_POINTER, "ret %08x, expected E_POINTER from url
%s\n", ret, TEST_PATHFROMURL[i].url);
+ if(!(TEST_PATHFROMURL[i].todo & 0x4))
+ ok(len2 == len + 1, "got len = %d expected %d from url
%s\n", len2, len + 1, TEST_PATHFROMURL[i].url);
+ else todo_wine
+ ok(len2 == len + 1, "got len = %d expected %d from url
%s\n", len2, len + 1, TEST_PATHFROMURL[i].url);
+ }
+
FreeWideString(urlW);
FreeWideString(pathW);
}
+ }
+
+ if (pPathCreateFromUrlAlloc)
+ {
+ static const WCHAR fileW[] =
{'f','i','l','e',':','/','/','f','o','o',0};
+ static const WCHAR fooW[] =
{'\\','\\','f','o','o',0};
+
+ pathW = NULL;
+ ret = pPathCreateFromUrlAlloc(fileW, &pathW, 0);
+ ok(ret == S_OK, "got 0x%08x expected S_OK\n", ret);
+ ok(lstrcmpiW(pathW, fooW) == 0, "got %s expected %s\n",
wine_dbgstr_w(pathW), wine_dbgstr_w(fooW));
+ HeapFree(GetProcessHeap(), 0, pathW);
}
}
@@ -1369,6 +1471,7 @@
pPathCreateFromUrlA = (void*)GetProcAddress(hShlwapi,
"PathCreateFromUrlA");
pPathCreateFromUrlW = (void*)GetProcAddress(hShlwapi,
"PathCreateFromUrlW");
+ pPathCreateFromUrlAlloc = (void*)GetProcAddress(hShlwapi,
"PathCreateFromUrlAlloc");
pPathCombineW = (void*)GetProcAddress(hShlwapi, "PathCombineW");
pPathIsValidCharA = (void*)GetProcAddress(hShlwapi, (LPSTR)455);
pPathIsValidCharW = (void*)GetProcAddress(hShlwapi, (LPSTR)456);
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] Sun Mar 24 12:36:17 2013
@@ -17,16 +17,20 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "wine/test.h"
-#include "windef.h"
-#include "winbase.h"
-#include "winerror.h"
-#include "winreg.h"
-#include "winuser.h"
-#include "shlwapi.h"
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdarg.h>
+//#include <stdio.h>
+
+#include <wine/test.h>
+//#include "windef.h"
+//#include "winbase.h"
+//#include "winerror.h"
+#include <winreg.h>
+//#include "winuser.h"
+#include <shlwapi.h>
/* Keys used for testing */
#define REG_TEST_KEY "Software\\Wine\\Test"
Modified: trunk/rostests/winetests/shlwapi/string.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/string.…
==============================================================================
--- trunk/rostests/winetests/shlwapi/string.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/string.c [iso-8859-1] Sun Mar 24 12:36:17 2013
@@ -17,18 +17,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdio.h>
-
-#include "wine/test.h"
-#include "winbase.h"
-#include "winerror.h"
-#include "winnls.h"
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdio.h>
+
+#include <wine/test.h>
+//#include "winbase.h"
+//#include "winerror.h"
+#include <winnls.h>
+#include <ole2.h>
#define NO_SHLWAPI_REG
#define NO_SHLWAPI_PATH
#define NO_SHLWAPI_GDI
#define NO_SHLWAPI_STREAM
-#include "shlwapi.h"
-#include "shtypes.h"
+#include <shlwapi.h>
+//#include "shtypes.h"
#define expect_eq(expr, val, type, fmt) do { \
type ret = expr; \
@@ -411,7 +416,7 @@
while(result->value)
{
-
MultiByteToWideChar(0,0,result->byte_size_64,-1,szSrc,sizeof(szSrc)/sizeof(WCHAR));
+
MultiByteToWideChar(CP_ACP,0,result->byte_size_64,-1,szSrc,sizeof(szSrc)/sizeof(WCHAR));
lpRes = StrCpyW(szBuff, szSrc);
ok(!StrCmpW(szSrc, szBuff) && lpRes == szBuff, "Copied string %s
wrong\n", result->byte_size_64);
@@ -475,7 +480,7 @@
while (result->string)
{
- MultiByteToWideChar(0,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+
MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
return_val = StrToIntW(szBuff);
ok(return_val == result->str_to_int, "converted '%s' wrong
(%d)\n",
result->string, return_val);
@@ -525,7 +530,7 @@
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(0,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+
MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
bRet = StrToIntExW(szBuff, 0, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -539,7 +544,7 @@
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(0,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+
MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
bRet = StrToIntExW(szBuff, STIF_SUPPORT_HEX, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -604,7 +609,7 @@
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(0,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+
MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
bRet = pStrToInt64ExW(szBuff, 0, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -618,7 +623,7 @@
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(0,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+
MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
bRet = pStrToInt64ExW(szBuff, STIF_SUPPORT_HEX, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -693,7 +698,7 @@
while(result->value)
{
pStrFormatKBSizeW(result->value, szBuffW, 256);
- WideCharToMultiByte(0,0,szBuffW,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR),0,0);
+
WideCharToMultiByte(CP_ACP,0,szBuffW,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR),NULL,NULL);
ok(!strcmp(result->kb_size, szBuff), "Formatted %x%08x wrong: got %s,
expected %s\n",
(LONG)(result->value >> 32), (LONG)result->value, szBuff,
result->kb_size);
Modified: trunk/rostests/winetests/shlwapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/testlis…
==============================================================================
--- trunk/rostests/winetests/shlwapi/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/testlist.c [iso-8859-1] Sun Mar 24 12:36:17 2013
@@ -1,10 +1,7 @@
/* Automatically generated file; DO NOT EDIT!! */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
#define STANDALONE
-#include "wine/test.h"
+#include <wine/test.h>
extern void func_clist(void);
extern void func_clsid(void);
Modified: trunk/rostests/winetests/shlwapi/thread.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/thread.…
==============================================================================
--- trunk/rostests/winetests/shlwapi/thread.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/thread.c [iso-8859-1] Sun Mar 24 12:36:17 2013
@@ -17,19 +17,24 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdio.h>
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdio.h>
#include <stdarg.h>
#define COBJMACROS
#define CONST_VTABLE
-#include "windef.h"
-#include "winbase.h"
-#include "winerror.h"
-#include "ole2.h"
-#include "shlwapi.h"
-
-#include "wine/test.h"
+#include <windef.h>
+#include <winbase.h>
+//#include "winreg.h"
+//#include "winerror.h"
+#include <ole2.h>
+//#include "shlwapi.h"
+
+#include <wine/test.h>
static HRESULT (WINAPI *pSHCreateThreadRef)(LONG*, IUnknown**);
static HRESULT (WINAPI *pSHGetThreadRef)(IUnknown**);
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] Sun Mar 24 12:36:17 2013
@@ -18,16 +18,21 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "wine/test.h"
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "shlwapi.h"
-#include "wininet.h"
-#include "intshcut.h"
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+//#include <stdarg.h>
+//#include <stdio.h>
+
+#include <wine/test.h>
+//#include "windef.h"
+//#include "winbase.h"
+#include <winreg.h>
+#include <winnls.h>
+#include <shlwapi.h>
+#include <wininet.h>
+#include <intshcut.h>
/* ################ */
static HMODULE hShlwapi;
@@ -450,7 +455,8 @@
{ "file://e:/b/c", FALSE, TRUE },
{ "http:partial", FALSE, FALSE },
{ "mailto://www.winehq.org/test.html", TRUE, FALSE },
- { "file:partial", FALSE, TRUE }
+ { "file:partial", FALSE, TRUE },
+ { "File:partial", FALSE, TRUE },
};
/* ########################### */
@@ -459,7 +465,7 @@
{
LPWSTR wszString = HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) *
sizeof(WCHAR));
- MultiByteToWideChar(0, 0, szString, -1, wszString, INTERNET_MAX_URL_LENGTH);
+ MultiByteToWideChar(CP_ACP, 0, szString, -1, wszString, INTERNET_MAX_URL_LENGTH);
return wszString;
}
@@ -1062,7 +1068,7 @@
BOOL choped;
int pos;
- MultiByteToWideChar(CP_ACP, 0, "http://www.winehq.org/X", -1, szUrl,
128);
+ MultiByteToWideChar(CP_ACP, 0, "http://www.winehq.org/X", -1, szUrl,
sizeof(szUrl)/sizeof(szUrl[0]));
pos = lstrlenW(szUrl) - 1;
szUrl[pos] = i;
urllen = INTERNET_MAX_URL_LENGTH;
@@ -1219,7 +1225,7 @@
test_UrlIs_null(URLIS_URL);
for(i = 0; i < sizeof(TEST_PATH_IS_URL) / sizeof(TEST_PATH_IS_URL[0]); i++) {
- MultiByteToWideChar(CP_ACP, 0, TEST_PATH_IS_URL[i].path, -1, wurl, 80);
+ MultiByteToWideChar(CP_ACP, 0, TEST_PATH_IS_URL[i].path, -1, wurl,
sizeof(wurl)/sizeof(*wurl));
ret = pUrlIsA( TEST_PATH_IS_URL[i].path, URLIS_URL );
ok( ret == TEST_PATH_IS_URL[i].expect,
@@ -1234,7 +1240,7 @@
}
}
for(i = 0; i < sizeof(TEST_URLIS_ATTRIBS) / sizeof(TEST_URLIS_ATTRIBS[0]); i++) {
- MultiByteToWideChar(CP_ACP, 0, TEST_URLIS_ATTRIBS[i].url, -1, wurl, 80);
+ MultiByteToWideChar(CP_ACP, 0, TEST_URLIS_ATTRIBS[i].url, -1, wurl,
sizeof(wurl)/sizeof(*wurl));
ret = pUrlIsA( TEST_URLIS_ATTRIBS[i].url, URLIS_OPAQUE);
ok( ret == TEST_URLIS_ATTRIBS[i].expectOpaque,
@@ -1288,7 +1294,7 @@
ok(strcmp(szReturnUrl,TEST_URL_UNESCAPE[i].expect)==0, "Expected
\"%s\", but got \"%s\" from \"%s\"\n",
TEST_URL_UNESCAPE[i].expect, szReturnUrl, TEST_URL_UNESCAPE[i].url);
ZeroMemory(szReturnUrl, sizeof(szReturnUrl));
- /* if we set the bufferpointer to NULL here UrlUnescape fails and string gets
not converted */
+ /* if we set the buffer pointer to NULL here, UrlUnescape fails and the string is
not converted */
res = pUrlUnescapeA(TEST_URL_UNESCAPE[i].url, szReturnUrl, NULL, 0);
ok(res == E_INVALIDARG,
"UrlUnescapeA returned 0x%x (expected E_INVALIDARG) for
\"%s\"\n",
@@ -1319,7 +1325,7 @@
ok(!strcmp(inplace, expected), "got %s expected %s\n", inplace, expected);
ok(dwEscaped == 27, "got %d expected 27\n", dwEscaped);
- /* if we set the bufferpointer to NULL, the string apparently still gets converted
(Google Lively does this)) */
+ /* if we set the buffer pointer to NULL, the string apparently still gets converted
(Google Lively does this) */
res = pUrlUnescapeA(another_inplace, NULL, NULL, URL_UNESCAPE_INPLACE);
ok(res == S_OK, "UrlUnescapeA returned 0x%x (expected S_OK)\n", res);
ok(!strcmp(another_inplace, expected), "got %s expected %s\n",
another_inplace, expected);
@@ -1330,7 +1336,7 @@
ok(res == S_OK, "UrlUnescapeW returned 0x%x (expected S_OK)\n", res);
ok(dwEscaped == 50, "got %d expected 50\n", dwEscaped);
- /* if we set the bufferpointer to NULL, the string apparently still gets
converted (Google Lively does this)) */
+ /* if we set the buffer pointer to NULL, the string apparently still gets
converted (Google Lively does this) */
res = pUrlUnescapeW(another_inplaceW, NULL, NULL, URL_UNESCAPE_INPLACE);
ok(res == S_OK, "UrlUnescapeW returned 0x%x (expected S_OK)\n", res);