shell32/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-05 12:08:01 +01:00 committed by Alexandre Julliard
parent 87c9a0dd08
commit 4ad1bab464
17 changed files with 1695 additions and 1696 deletions

View file

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = shell32.dll
IMPORTS = shell32 ole32 oleaut32 user32 gdi32 advapi32 shlwapi

View file

@ -78,19 +78,19 @@ static void testwindow_setpos(HWND hwnd)
switch (info->edge)
{
case ABE_BOTTOM:
ok(info->desired_rect.top == abd.rc.top, "ABM_QUERYPOS changed top of rect from %i to %i\n", info->desired_rect.top, abd.rc.top);
ok(info->desired_rect.top == abd.rc.top, "ABM_QUERYPOS changed top of rect from %li to %li\n", info->desired_rect.top, abd.rc.top);
abd.rc.top = abd.rc.bottom - (info->desired_rect.bottom - info->desired_rect.top);
break;
case ABE_LEFT:
ok(info->desired_rect.right == abd.rc.right, "ABM_QUERYPOS changed right of rect from %i to %i\n", info->desired_rect.right, abd.rc.right);
ok(info->desired_rect.right == abd.rc.right, "ABM_QUERYPOS changed right of rect from %li to %li\n", info->desired_rect.right, abd.rc.right);
abd.rc.right = abd.rc.left + (info->desired_rect.right - info->desired_rect.left);
break;
case ABE_RIGHT:
ok(info->desired_rect.left == abd.rc.left, "ABM_QUERYPOS changed left of rect from %i to %i\n", info->desired_rect.left, abd.rc.left);
ok(info->desired_rect.left == abd.rc.left, "ABM_QUERYPOS changed left of rect from %li to %li\n", info->desired_rect.left, abd.rc.left);
abd.rc.left = abd.rc.right - (info->desired_rect.right - info->desired_rect.left);
break;
case ABE_TOP:
ok(info->desired_rect.bottom == abd.rc.bottom, "ABM_QUERYPOS changed bottom of rect from %i to %i\n", info->desired_rect.bottom, abd.rc.bottom);
ok(info->desired_rect.bottom == abd.rc.bottom, "ABM_QUERYPOS changed bottom of rect from %li to %li\n", info->desired_rect.bottom, abd.rc.bottom);
abd.rc.bottom = abd.rc.top + (info->desired_rect.bottom - info->desired_rect.top);
break;
}
@ -339,7 +339,7 @@ static void test_setpos(void)
win_skip("Some broken Vista boxes don't move the higher appbar down\n");
else
ok(windows[1].allocated_rect.bottom == expected_bottom,
"windows[1]'s bottom is %i, expected %i\n",
"windows[1]'s bottom is %li, expected %i\n",
windows[1].allocated_rect.bottom, expected_bottom);
test_window_rects(1, 2);
@ -432,7 +432,7 @@ static void test_GetCurrentProcessExplicitAppUserModelID(void)
appid = (void*)0xdeadbeef;
hr = pGetCurrentProcessExplicitAppUserModelID(&appid);
todo_wine
ok(hr == E_FAIL, "got 0x%08x\n", hr);
ok(hr == E_FAIL, "got 0x%08lx\n", hr);
ok(appid == NULL, "got %p\n", appid);
}
@ -450,14 +450,14 @@ static void test_SHGetPropertyStoreForWindow(void)
unk = (IUnknown *)0xdeadbeef;
hr = pSHGetPropertyStoreForWindow(GetDesktopWindow(), &IID_IDispatch, (void **)&unk);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
ok(unk == NULL, "got %p\n", unk);
hr = pSHGetPropertyStoreForWindow(GetDesktopWindow(), &IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IPropertyStore, (void **)&store);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
if (store) IPropertyStore_Release(store);
if (unk) IUnknown_Release(unk);

View file

@ -37,22 +37,22 @@ static void test_IQueryAssociations_QueryInterface(void)
HRESULT hr;
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&qa);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IQueryAssociations_QueryInterface(qa, &IID_IQueryAssociations, (void**)&qa2);
ok(hr == S_OK, "QueryInterface (IQueryAssociations) returned 0x%x\n", hr);
ok(hr == S_OK, "QueryInterface (IQueryAssociations) returned 0x%lx\n", hr);
if (SUCCEEDED(hr)) {
IQueryAssociations_Release(qa2);
}
hr = IQueryAssociations_QueryInterface(qa, &IID_IUnknown, (void**)&unk);
ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%x\n", hr);
ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%lx\n", hr);
if (SUCCEEDED(hr)) {
IUnknown_Release(unk);
}
hr = IQueryAssociations_QueryInterface(qa, &IID_IUnknown, NULL);
ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
ok(hr == E_POINTER, "got 0x%lx (expected E_POINTER)\n", hr);
IQueryAssociations_Release(qa);
}
@ -66,19 +66,19 @@ static void test_IApplicationAssociationRegistration_QueryInterface(IApplication
hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IApplicationAssociationRegistration,
(void**)&appreg2);
ok(hr == S_OK, "QueryInterface (IApplicationAssociationRegistration) returned 0x%x\n", hr);
ok(hr == S_OK, "QueryInterface (IApplicationAssociationRegistration) returned 0x%lx\n", hr);
if (SUCCEEDED(hr)) {
IApplicationAssociationRegistration_Release(appreg2);
}
hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IUnknown, (void**)&unk);
ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%x\n", hr);
ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%lx\n", hr);
if (SUCCEEDED(hr)) {
IUnknown_Release(unk);
}
hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IUnknown, NULL);
ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
ok(hr == E_POINTER, "got 0x%lx (expected E_POINTER)\n", hr);
}
struct assoc_getstring_test
@ -109,13 +109,13 @@ static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCW
DWORD len;
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc);
ok_(__FILE__, line)(hr == S_OK, "failed to create IQueryAssociations, 0x%x\n", hr);
ok_(__FILE__, line)(hr == S_OK, "failed to create IQueryAssociations, 0x%lx\n", hr);
hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, assocName, progIdKey, NULL);
ok_(__FILE__, line)(hr == S_OK, "IQueryAssociations::Init failed, 0x%x\n", hr);
ok_(__FILE__, line)(hr == S_OK, "IQueryAssociations::Init failed, 0x%lx\n", hr);
hr = IQueryAssociations_GetString(assoc, ASSOCF_NONE, str, NULL, NULL, &len);
if (expected_string) {
ok_(__FILE__, line)(hr == S_FALSE, "GetString returned 0x%x, expected S_FALSE\n", hr);
ok_(__FILE__, line)(hr == S_FALSE, "GetString returned 0x%lx, expected S_FALSE\n", hr);
if (hr != S_FALSE) {
/* don't try to allocate memory using uninitialized len */
IQueryAssociations_Release(assoc);
@ -125,12 +125,12 @@ static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCW
buffer = heap_alloc(len * sizeof(WCHAR));
ok_(__FILE__, line)(buffer != NULL, "out of memory\n");
hr = IQueryAssociations_GetString(assoc, 0, str, NULL, buffer, &len);
ok_(__FILE__, line)(hr == S_OK, "GetString returned 0x%x, expected S_OK\n", hr);
ok_(__FILE__, line)(hr == S_OK, "GetString returned 0x%lx, expected S_OK\n", hr);
ok_(__FILE__, line)(lstrcmpW(buffer, expected_string) == 0, "GetString returned %s, expected %s\n",
wine_dbgstr_w(buffer), wine_dbgstr_w(expected_string));
} else {
ok_(__FILE__, line)(FAILED(hr), "GetString returned 0x%x, expected failure\n", hr);
ok_(__FILE__, line)(FAILED(hr), "GetString returned 0x%lx, expected failure\n", hr);
}
IQueryAssociations_Release(assoc);
@ -162,22 +162,22 @@ static void test_IQueryAssociations_GetString(void)
return;
}
ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR, \".test\") failed: 0x%lx\n", r);
ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR, \".test\") failed: 0x%Ix\n", r);
r = RegSetValueExW(test_extension_key, NULL, 0, REG_SZ, (PBYTE)test_progidW, sizeof(test_progidW));
ok(r == ERROR_SUCCESS, "RegSetValueExW(HKCR\\.test, NULL, \"testfile\") failed: 0x%lx\n", r);
ok(r == ERROR_SUCCESS, "RegSetValueExW(HKCR\\.test, NULL, \"testfile\") failed: 0x%Ix\n", r);
/* adding progid key with no information should fail to return information */
r = RegCreateKeyExW(HKEY_CLASSES_ROOT, test_progidW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_progid_key, NULL);
ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR, \"testfile\") failed: 0x%lx\n", r);
ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR, \"testfile\") failed: 0x%Ix\n", r);
getstring_test(test_extensionW, NULL, ASSOCSTR_DEFAULTICON, NULL, __LINE__);
getstring_test(test_progidW, NULL, ASSOCSTR_DEFAULTICON, NULL, __LINE__);
getstring_test(NULL, test_progid_key, ASSOCSTR_DEFAULTICON, NULL, __LINE__);
/* adding information to the progid should return that information */
r = RegCreateKeyExW(test_progid_key, DefaultIconW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_defaulticon_key, NULL);
ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR\\testfile\\DefaultIcon) failed: 0x%lx\n", r);
ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR\\testfile\\DefaultIcon) failed: 0x%Ix\n", r);
r = RegSetValueExW(test_defaulticon_key, NULL, 0, REG_SZ, (PBYTE)test_iconW, sizeof(test_iconW));
ok(r == ERROR_SUCCESS, "RegSetValueExW(HKCR\\testfile\\DefaultIcon, NULL, \"folder.ico\") failed: 0x%lx\n", r);
ok(r == ERROR_SUCCESS, "RegSetValueExW(HKCR\\testfile\\DefaultIcon, NULL, \"folder.ico\") failed: 0x%Ix\n", r);
getstring_test(test_extensionW, NULL, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__);
getstring_test(test_progidW, NULL, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__);
getstring_test(NULL, test_progid_key, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__);
@ -187,15 +187,15 @@ static void test_IQueryAssociations_GetString(void)
RegDeleteKeyW(HKEY_CLASSES_ROOT, test_extensionW);
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc);
ok(hr == S_OK, "failed to create object, 0x%x\n", hr);
ok(hr == S_OK, "failed to create object, 0x%lx\n", hr);
hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, httpW, NULL, NULL);
ok(hr == S_OK, "Init failed, 0x%x\n", hr);
ok(hr == S_OK, "Init failed, 0x%lx\n", hr);
len = 0;
hr = IQueryAssociations_GetString(assoc, ASSOCF_NONE, ASSOCSTR_EXECUTABLE, NULL, NULL, &len);
ok(hr == S_FALSE, "got 0x%08x\n", hr);
ok(len > 0, "got wrong needed length, %d\n", len);
ok(hr == S_FALSE, "got 0x%08lx\n", hr);
ok(len > 0, "got wrong needed length, %ld\n", len);
while (ptr->key)
{
@ -203,17 +203,17 @@ static void test_IQueryAssociations_GetString(void)
DWORD len;
hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, ptr->key, NULL, NULL);
ok(hr == S_OK, "%d: Init failed, 0x%x\n", i, hr);
ok(hr == S_OK, "%d: Init failed, 0x%lx\n", i, hr);
len = ptr->len;
buffW[0] = ptr->flags & ASSOCF_NOTRUNCATE ? 0x1 : 0;
hr = IQueryAssociations_GetString(assoc, ptr->flags, ptr->str, NULL, buffW, &len);
if (hr != ptr->hr)
ok(broken(hr == ptr->brokenhr), "%d: GetString failed, 0x%08x\n", i, hr);
ok(broken(hr == ptr->brokenhr), "%d: GetString failed, 0x%08lx\n", i, hr);
else
{
ok(hr == ptr->hr, "%d: GetString failed, 0x%08x\n", i, hr);
ok(len > ptr->len, "%d: got needed length %d\n", i, len);
ok(hr == ptr->hr, "%d: GetString failed, 0x%08lx\n", i, hr);
ok(len > ptr->len, "%d: got needed length %ld\n", i, len);
}
/* even with ASSOCF_NOTRUNCATE it's null terminated */
@ -237,20 +237,20 @@ static void test_IQueryAssociations_Init(void)
DWORD len;
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc);
ok(hr == S_OK, "failed to create object, 0x%x\n", hr);
ok(hr == S_OK, "failed to create object, 0x%lx\n", hr);
hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Init failed, 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Init failed, 0x%08lx\n", hr);
hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, httpW, NULL, NULL);
ok(hr == S_OK, "Init failed, 0x%08x\n", hr);
ok(hr == S_OK, "Init failed, 0x%08lx\n", hr);
hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, badW, NULL, NULL);
ok(hr == S_OK || broken(hr == S_FALSE) /* pre-vista */, "Init failed, 0x%08x\n", hr);
ok(hr == S_OK || broken(hr == S_FALSE) /* pre-vista */, "Init failed, 0x%08lx\n", hr);
len = 0;
hr = IQueryAssociations_GetString(assoc, ASSOCF_NONE, ASSOCSTR_EXECUTABLE, NULL, NULL, &len);
ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) || broken(hr == E_FAIL) /* pre-vista */, "got 0x%08x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) || broken(hr == E_FAIL) /* pre-vista */, "got 0x%08lx\n", hr);
IQueryAssociations_Release(assoc);
}
@ -264,31 +264,31 @@ static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplic
LPWSTR assocprog = NULL;
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog);
ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%lx\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%lx\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, spacetxtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /*Win8*/, "got 0x%x\n", hr);
ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /*Win8*/, "got 0x%lx\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, NULL);
ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%lx\n", hr);
/* AT_FILEEXTENSION must start with a period */
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, txtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
ok(hr == S_OK, "got 0x%x\n", hr);
ok(hr == S_OK, "got 0x%lx\n", hr);
trace("%s\n", wine_dbgstr_w(assocprog));
CoTaskMemFree(assocprog);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_STARTMENUCLIENT, AL_EFFECTIVE, &assocprog);
ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%lx\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_MIMETYPE, AL_EFFECTIVE, &assocprog);
ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%lx\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog);
ok(hr == S_OK, "got 0x%x\n", hr);
ok(hr == S_OK, "got 0x%lx\n", hr);
trace("%s\n", wine_dbgstr_w(assocprog));
CoTaskMemFree(assocprog);
@ -313,7 +313,7 @@ START_TEST(assoc)
IQueryAssociations_Release(qa);
}
else
win_skip("IQueryAssociations not supported, 0x%x\n", hr);
win_skip("IQueryAssociations not supported, 0x%lx\n", hr);
/* this works since Vista */
hr = CoCreateInstance(&CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC_SERVER,
@ -326,7 +326,7 @@ START_TEST(assoc)
IApplicationAssociationRegistration_Release(appreg);
}
else
win_skip("IApplicationAssociationRegistration not supported: 0x%x\n", hr);
win_skip("IApplicationAssociationRegistration not supported: 0x%lx\n", hr);
CoUninitialize();
}

View file

@ -50,7 +50,7 @@ static void test_invalid_init(void)
win_skip("CLSID_AutoComplete is not registered\n");
return;
}
ok(hr == S_OK, "no IID_IAutoComplete (0x%08x)\n", hr);
ok(hr == S_OK, "no IID_IAutoComplete (0x%08lx)\n", hr);
/* AutoComplete source */
hr = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER,
@ -61,7 +61,7 @@ static void test_invalid_init(void)
IAutoComplete_Release(ac);
return;
}
ok(hr == S_OK, "no IID_IACList (0x%08x)\n", hr);
ok(hr == S_OK, "no IID_IACList (0x%08lx)\n", hr);
edit_control = CreateWindowExA(0, "EDIT", "Some text", 0, 10, 10, 300, 300,
hMainWnd, NULL, hinst, NULL);
@ -71,14 +71,14 @@ static void test_invalid_init(void)
hr = IAutoComplete_Init(ac, NULL, acSource, NULL, NULL);
ok(hr == E_INVALIDARG ||
broken(hr == S_OK), /* Win2k/XP/Win2k3 */
"Init returned 0x%08x\n", hr);
"Init returned 0x%08lx\n", hr);
if (hr == E_INVALIDARG)
{
LONG ref;
IUnknown_AddRef(acSource);
ref = IUnknown_Release(acSource);
ok(ref == 1, "Expected AutoComplete source refcount to be 1, got %d\n", ref);
ok(ref == 1, "Expected AutoComplete source refcount to be 1, got %ld\n", ref);
}
if (0)
@ -88,43 +88,43 @@ if (0)
* object after this call succeeds would fail, because initialization
* state is determined by whether a non-NULL window handle is stored. */
hr = IAutoComplete_Init(ac, (HWND)0xdeadbeef, acSource, NULL, NULL);
ok(hr == S_OK, "Init returned 0x%08x\n", hr);
ok(hr == S_OK, "Init returned 0x%08lx\n", hr);
/* Tests crash on older Windows. */
hr = IAutoComplete_Init(ac, NULL, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Init returned 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Init returned 0x%08lx\n", hr);
hr = IAutoComplete_Init(ac, edit_control, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Init returned 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Init returned 0x%08lx\n", hr);
}
/* bind to edit control */
hr = IAutoComplete_Init(ac, edit_control, acSource, NULL, NULL);
ok(hr == S_OK, "Init returned 0x%08x\n", hr);
ok(hr == S_OK, "Init returned 0x%08lx\n", hr);
/* try invalid parameters after successful initialization .*/
hr = IAutoComplete_Init(ac, NULL, NULL, NULL, NULL);
ok(hr == E_INVALIDARG ||
hr == E_FAIL, /* Win2k/XP/Win2k3 */
"Init returned 0x%08x\n", hr);
"Init returned 0x%08lx\n", hr);
hr = IAutoComplete_Init(ac, NULL, acSource, NULL, NULL);
ok(hr == E_INVALIDARG ||
hr == E_FAIL, /* Win2k/XP/Win2k3 */
"Init returned 0x%08x\n", hr);
"Init returned 0x%08lx\n", hr);
hr = IAutoComplete_Init(ac, edit_control, NULL, NULL, NULL);
ok(hr == E_INVALIDARG ||
hr == E_FAIL, /* Win2k/XP/Win2k3 */
"Init returned 0x%08x\n", hr);
"Init returned 0x%08lx\n", hr);
/* try initializing twice on the same control */
hr = IAutoComplete_Init(ac, edit_control, acSource, NULL, NULL);
ok(hr == E_FAIL, "Init returned 0x%08x\n", hr);
ok(hr == E_FAIL, "Init returned 0x%08lx\n", hr);
/* try initializing with a different control */
hr = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
ok(hr == E_FAIL, "Init returned 0x%08x\n", hr);
ok(hr == E_FAIL, "Init returned 0x%08lx\n", hr);
DestroyWindow(edit_control);
@ -133,7 +133,7 @@ if (0)
hr = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
ok(hr == E_UNEXPECTED ||
hr == E_FAIL, /* Win2k/XP/Win2k3 */
"Init returned 0x%08x\n", hr);
"Init returned 0x%08lx\n", hr);
IUnknown_Release(acSource);
IAutoComplete_Release(ac);
@ -153,7 +153,7 @@ static IAutoComplete *test_init(void)
win_skip("CLSID_AutoComplete is not registered\n");
return NULL;
}
ok(r == S_OK, "no IID_IAutoComplete (0x%08x)\n", r);
ok(r == S_OK, "no IID_IAutoComplete (0x%08lx)\n", r);
/* AutoComplete source */
r = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER,
@ -164,14 +164,14 @@ static IAutoComplete *test_init(void)
IAutoComplete_Release(ac);
return NULL;
}
ok(r == S_OK, "no IID_IACList (0x%08x)\n", r);
ok(r == S_OK, "no IID_IACList (0x%08lx)\n", r);
user_data = GetWindowLongPtrA(hEdit, GWLP_USERDATA);
ok(user_data == 0, "Expected the edit control user data to be zero\n");
/* bind to edit control */
r = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
ok(r == S_OK, "Init returned 0x%08x\n", r);
ok(r == S_OK, "Init returned 0x%08lx\n", r);
user_data = GetWindowLongPtrA(hEdit, GWLP_USERDATA);
ok(user_data == 0, "Expected the edit control user data to be zero\n");
@ -179,10 +179,10 @@ static IAutoComplete *test_init(void)
/* bind a different object to the same edit control */
r = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER,
&IID_IAutoComplete, (LPVOID*)&ac2);
ok(r == S_OK, "no IID_IAutoComplete (0x%08x)\n", r);
ok(r == S_OK, "no IID_IAutoComplete (0x%08lx)\n", r);
r = IAutoComplete_Init(ac2, hEdit, acSource, NULL, NULL);
ok(r == S_OK, "Init returned 0x%08x\n", r);
ok(r == S_OK, "Init returned 0x%08lx\n", r);
IAutoComplete_Release(ac2);
IUnknown_Release(acSource);
@ -459,7 +459,7 @@ static void check_dropdown_(const char *file, UINT line, IAutoCompleteDropDown *
HRESULT hr;
hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, &str);
ok_(file, line)(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
ok_(file, line)(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %lx\n", hr);
if (hr != S_OK) return;
if (list_num) ok_(file, line)(flags & ACDD_VISIBLE, "AutoComplete DropDown not visible\n");
else
@ -480,7 +480,7 @@ static void check_dropdown_(const char *file, UINT line, IAutoCompleteDropDown *
SendMessageW(hwnd_edit, WM_KEYDOWN, VK_DOWN, 0);
SendMessageW(hwnd_edit, WM_KEYUP, VK_DOWN, 0xc0000000);
hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, &str);
ok_(file, line)(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
ok_(file, line)(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %lx\n", hr);
ok_(file, line)(flags & ACDD_VISIBLE, "AutoComplete DropDown not visible\n");
if (hr == S_OK)
{
@ -555,7 +555,7 @@ static void test_aclist_expand(HWND hwnd_edit, void *enumerator, IAutoCompleteDr
ok(lstrcmpW(obj->last_expand, str1a) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str1a), wine_dbgstr_w(obj->last_expand));
ok(obj->num_resets == 6, "Expected 6 resets, got %u\n", obj->num_resets);
hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %lx\n", hr);
SendMessageW(hwnd_edit, WM_CHAR, 'o', 1);
dispatch_messages();
ok(obj->num_expand == 6, "Expected 6 expansions, got %u\n", obj->num_expand);
@ -595,17 +595,17 @@ static void test_prefix_filtering(HWND hwnd_edit)
HRESULT hr;
hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, &IID_IAutoComplete2, (void**)&autocomplete);
ok(hr == S_OK, "CoCreateInstance failed: %x\n", hr);
ok(hr == S_OK, "CoCreateInstance failed: %lx\n", hr);
hr = IAutoComplete2_QueryInterface(autocomplete, &IID_IAutoCompleteDropDown, (LPVOID*)&acdropdown);
ok(hr == S_OK, "No IAutoCompleteDropDown interface: %x\n", hr);
ok(hr == S_OK, "No IAutoCompleteDropDown interface: %lx\n", hr);
string_enumerator_create((void**)&enumerator, suggestions, ARRAY_SIZE(suggestions));
hr = IAutoComplete2_SetOptions(autocomplete, ACO_FILTERPREFIXES | ACO_AUTOSUGGEST | ACO_AUTOAPPEND);
ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %x\n", hr);
ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %lx\n", hr);
hr = IAutoComplete2_Init(autocomplete, hwnd_edit, enumerator, NULL, NULL);
ok(hr == S_OK, "IAutoComplete_Init failed: %x\n", hr);
ok(hr == S_OK, "IAutoComplete_Init failed: %lx\n", hr);
SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
@ -711,20 +711,20 @@ static void test_custom_source(void)
hwnd_edit = CreateWindowA("Edit", "", WS_OVERLAPPED | WS_VISIBLE | WS_CHILD | WS_BORDER, 50, 5, 200, 20, hMainWnd, 0, NULL, 0);
hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, &IID_IAutoComplete2, (void**)&autocomplete);
ok(hr == S_OK, "CoCreateInstance failed: %x\n", hr);
ok(hr == S_OK, "CoCreateInstance failed: %lx\n", hr);
hr = IAutoComplete2_QueryInterface(autocomplete, &IID_IAutoCompleteDropDown, (LPVOID*)&acdropdown);
ok(hr == S_OK, "No IAutoCompleteDropDown interface: %x\n", hr);
ok(hr == S_OK, "No IAutoCompleteDropDown interface: %lx\n", hr);
string_enumerator_create((void**)&enumerator, suggestions, ARRAY_SIZE(suggestions));
obj = (struct string_enumerator*)enumerator;
hr = IAutoComplete2_SetOptions(autocomplete, ACO_AUTOSUGGEST | ACO_AUTOAPPEND);
ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %x\n", hr);
ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %lx\n", hr);
hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %lx\n", hr);
hr = IAutoComplete2_Init(autocomplete, hwnd_edit, enumerator, NULL, NULL);
ok(hr == S_OK, "IAutoComplete_Init failed: %x\n", hr);
ok(hr == S_OK, "IAutoComplete_Init failed: %lx\n", hr);
SetFocus(hwnd_edit);
SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
@ -740,7 +740,7 @@ static void test_custom_source(void)
ok(buffer[0] == '\0', "Expected empty string, got %s\n", wine_dbgstr_w(buffer));
ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %lx\n", hr);
ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
obj->num_resets = 0;
@ -762,7 +762,7 @@ static void test_custom_source(void)
SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer);
ok(buffer[0] == '\0', "Expected empty string, got %s\n", wine_dbgstr_w(buffer));
hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %lx\n", hr);
HijackerWndProc_prev = (WNDPROC)SetWindowLongPtrW(hwnd_edit, GWLP_WNDPROC, (LONG_PTR)HijackerWndProc2);
SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
@ -775,17 +775,17 @@ static void test_custom_source(void)
/* end of hijacks */
hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %lx\n", hr);
ok(flags & ACDD_VISIBLE, "AutoComplete DropDown should be visible\n");
SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_au);
dispatch_messages();
hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %lx\n", hr);
ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should have been hidden\n");
SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_aut);
dispatch_messages();
hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %lx\n", hr);
ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should be hidden\n");
SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer);
ok(lstrcmpW(str_aut, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_aut), wine_dbgstr_w(buffer));
@ -794,7 +794,7 @@ static void test_custom_source(void)
obj->num_resets = 0;
hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %lx\n", hr);
SendMessageW(hwnd_edit, WM_CHAR, 'x', 1);
dispatch_messages();
ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
@ -821,7 +821,7 @@ START_TEST(autocomplete)
POINT orig_pos;
r = CoInitialize(NULL);
ok(r == S_OK, "CoInitialize failed (0x%08x). Tests aborted.\n", r);
ok(r == S_OK, "CoInitialize failed (0x%08lx). Tests aborted.\n", r);
if (r != S_OK)
return;

View file

@ -177,14 +177,14 @@ static void test_click_make_new_folder_button(void)
resCoInit = CoInitialize(NULL);
if(!(resCoInit == S_OK || resCoInit == S_FALSE))
{
skip("COM could not be initialized %u\n", GetLastError());
skip("COM could not be initialized %lu\n", GetLastError());
return;
}
/* Leave room for concatenating title, two backslashes, and an extra NULL. */
if (!GetCurrentDirectoryA(MAX_PATH-strlen(title)-3, test_folder_path))
{
skip("GetCurrentDirectoryA failed %u\n", GetLastError());
skip("GetCurrentDirectoryA failed %lu\n", GetLastError());
}
strcat(test_folder_path, "\\");
strcat(test_folder_path, title);
@ -193,7 +193,7 @@ static void test_click_make_new_folder_button(void)
/* Avoid conflicts by creating a test folder. */
if (!CreateDirectoryA(title, NULL))
{
skip("CreateDirectoryA failed %u\n", GetLastError());
skip("CreateDirectoryA failed %lu\n", GetLastError());
return;
}
@ -207,7 +207,7 @@ static void test_click_make_new_folder_button(void)
MultiByteToWideChar(CP_UTF8, 0, test_folder_path, -1,
test_folder_pathW, MAX_PATH);
hr = SHGetDesktopFolder(&test_folder_object);
ok (SUCCEEDED(hr), "SHGetDesktopFolder failed with hr 0x%08x\n", hr);
ok (SUCCEEDED(hr), "SHGetDesktopFolder failed with hr 0x%08lx\n", hr);
if (FAILED(hr)) {
skip("SHGetDesktopFolder failed - skipping\n");
return;
@ -268,34 +268,34 @@ static int CALLBACK selection_callback(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR
case BFFM_INITIALIZED:
/* test with zero values */
ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 0, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
ret = SendMessageA(hwnd, BFFM_SETSELECTIONW, 0, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
if(0)
{
/* Crashes on NT4 */
ret = SendMessageA(hwnd, BFFM_SETSELECTIONW, 1, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
}
ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 0, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 0, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)new_folder_name);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)new_folder_name);
ok(!ret, "SendMessage returned: %u\n", ret);
ok(!ret, "SendMessage returned: %lu\n", ret);
SendMessageA(hwnd, WM_COMMAND, IDOK, 0);
return 1;
@ -316,13 +316,13 @@ static void test_selection(void)
resCoInit = CoInitialize(NULL);
if(!(resCoInit == S_OK || resCoInit == S_FALSE))
{
skip("COM could not be initialized %u\n", GetLastError());
skip("COM could not be initialized %lu\n", GetLastError());
return;
}
if (!GetCurrentDirectoryW(MAX_PATH, selected_folderW))
{
skip("GetCurrentDirectoryW failed %u\n", GetLastError());
skip("GetCurrentDirectoryW failed %lu\n", GetLastError());
}
/* Initialize browse info struct for SHBrowseForFolder */
@ -332,7 +332,7 @@ static void test_selection(void)
bi.lpfn = selection_callback;
hr = SHGetDesktopFolder(&desktop_object);
ok (SUCCEEDED(hr), "SHGetDesktopFolder failed with hr 0x%08x\n", hr);
ok (SUCCEEDED(hr), "SHGetDesktopFolder failed with hr 0x%08lx\n", hr);
if (FAILED(hr)) {
skip("SHGetDesktopFolder failed - skipping\n");
return;

View file

@ -207,7 +207,7 @@ static HRESULT WINAPI IExplorerPaneVisibility_fnGetPaneState(IExplorerPaneVisibi
ok(ep != NULL, "ep is NULL.\n");
ok(peps != NULL, "peps is NULL.\n");
ok(*peps == 0, "got %d\n", *peps);
ok(*peps == 0, "got %ld\n", *peps);
*peps = EPS_FORCE;
if(IsEqualGUID(&EP_NavPane, ep)) This->np++;
@ -505,12 +505,12 @@ static void test_QueryInterface(void)
LONG lres;
hr = ebrowser_instantiate(&peb);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
#define test_qinterface(iid, exp) \
do { \
hr = IExplorerBrowser_QueryInterface(peb, &iid, (void**)&punk); \
ok(hr == exp, "(%s:)Expected (0x%08x), got (0x%08x)\n", \
ok(hr == exp, "(%s:)Expected (0x%08lx), got (0x%08lx)\n", \
#iid, exp, hr); \
if(SUCCEEDED(hr)) IUnknown_Release(punk); \
} while(0)
@ -536,7 +536,7 @@ static void test_QueryInterface(void)
#undef test_qinterface
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got %d\n", lres);
ok(lres == 0, "Got %ld\n", lres);
}
static void test_SB_misc(void)
@ -551,7 +551,7 @@ static void test_SB_misc(void)
ebrowser_instantiate(&peb);
hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(FAILED(hr))
{
skip("Failed to get IShellBrowser interface.\n");
@ -561,42 +561,42 @@ static void test_SB_misc(void)
/* Some unimplemented methods */
retHwnd = (HWND)0xdeadbeef;
hr = IShellBrowser_GetControlWindow(psb, FCW_TOOLBAR, &retHwnd);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd);
retHwnd = (HWND)0xdeadbeef;
hr = IShellBrowser_GetControlWindow(psb, FCW_STATUS, &retHwnd);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd);
retHwnd = (HWND)0xdeadbeef;
hr = IShellBrowser_GetControlWindow(psb, FCW_TREE, &retHwnd);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd);
retHwnd = (HWND)0xdeadbeef;
hr = IShellBrowser_GetControlWindow(psb, FCW_PROGRESS, &retHwnd);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd);
/* ::InsertMenuSB */
hr = IShellBrowser_InsertMenusSB(psb, NULL, NULL);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
/* ::RemoveMenusSB */
hr = IShellBrowser_RemoveMenusSB(psb, NULL);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
/* ::SetMenuSB */
hr = IShellBrowser_SetMenuSB(psb, NULL, NULL, NULL);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
/***** Before EB::Initialize *****/
/* ::GetWindow */
retHwnd = (HWND)0xDEADBEEF;
hr = IShellBrowser_GetWindow(psb, &retHwnd);
ok(hr == E_FAIL, "got (0x%08x)\n", hr);
ok(hr == E_FAIL, "got (0x%08lx)\n", hr);
ok(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n");
todo_wine
@ -605,28 +605,28 @@ static void test_SB_misc(void)
/* ::SendControlMsg */
lres = 0xDEADBEEF;
hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, &lres);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(lres == 0, "lres was %ld\n", lres);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(lres == 0, "lres was %Id\n", lres);
lres = 0xDEADBEEF;
hr = IShellBrowser_SendControlMsg(psb, FCW_TOOLBAR, TB_CHECKBUTTON,
FCIDM_TB_SMALLICON, TRUE, &lres);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(lres == 0, "lres was %ld\n", lres);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(lres == 0, "lres was %Id\n", lres);
hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellBrowser_SendControlMsg(psb, FCW_TREE, 0, 0, 0, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellBrowser_SendControlMsg(psb, FCW_PROGRESS, 0, 0, 0, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
}
/* ::QueryActiveShellView */
hr = IShellBrowser_QueryActiveShellView(psb, (IShellView**)&punk);
ok(hr == E_FAIL, "got (0x%08x)\n", hr);
ok(hr == E_FAIL, "got (0x%08lx)\n", hr);
/* Initialize ExplorerBrowser */
ebrowser_initialize(peb);
@ -635,46 +635,46 @@ static void test_SB_misc(void)
/* ::GetWindow */
hr = IShellBrowser_GetWindow(psb, &retHwnd);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(GetParent(retHwnd) == hwnd, "The HWND returned is not our child.\n");
todo_wine
{
/* ::SendControlMsg */
hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
lres = 0xDEADBEEF;
hr = IShellBrowser_SendControlMsg(psb, FCW_TOOLBAR, 0, 0, 0, &lres);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(lres == 0, "lres was %ld\n", lres);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(lres == 0, "lres was %Id\n", lres);
lres = 0xDEADBEEF;
hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, &lres);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(lres == 0, "lres was %ld\n", lres);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(lres == 0, "lres was %Id\n", lres);
lres = 0xDEADBEEF;
hr = IShellBrowser_SendControlMsg(psb, 1234, 0, 0, 0, &lres);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(lres == 0, "lres was %ld\n", lres);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(lres == 0, "lres was %Id\n", lres);
/* Returns S_OK */
hr = IShellBrowser_SetStatusTextSB(psb, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellBrowser_ContextSensitiveHelp(psb, FALSE);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellBrowser_EnableModelessSB(psb, TRUE);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellBrowser_SetToolbarItems(psb, NULL, 1, 1);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
}
hr = IShellBrowser_QueryActiveShellView(psb, (IShellView**)&punk);
ok(hr == E_FAIL, "got (0x%08x)\n", hr);
ok(hr == E_FAIL, "got (0x%08lx)\n", hr);
IShellBrowser_Release(psb);
IExplorerBrowser_Destroy(peb);
@ -687,19 +687,19 @@ static void test_SB_misc(void)
process_msgs();
hr = ebrowser_browse_to_desktop(peb);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
process_msgs();
/****** After Browsing *****/
hr = IShellBrowser_QueryActiveShellView(psb, (IShellView**)&punk);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
IShellBrowser_Release(psb);
IExplorerBrowser_Destroy(peb);
ref = IExplorerBrowser_Release(peb);
ok(ref == 0, "Got %d\n", ref);
ok(ref == 0, "Got %ld\n", ref);
}
static void test_initialization(void)
@ -724,36 +724,36 @@ static void test_initialization(void)
ZeroMemory(&rc, sizeof(RECT));
hr = IExplorerBrowser_Initialize(peb, NULL, &rc, NULL);
ok(hr == E_INVALIDARG, "got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "got (0x%08lx)\n", hr);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
/* Initialize twice */
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr);
ok(hr == E_UNEXPECTED, "got (0x%08lx)\n", hr);
hr = IExplorerBrowser_Destroy(peb);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
/* Initialize again */
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr);
ok(hr == E_UNEXPECTED, "got (0x%08lx)\n", hr);
/* Destroy again */
hr = IExplorerBrowser_Destroy(peb);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got %d\n", lres);
ok(lres == 0, "Got %ld\n", lres);
/* Initialize with a few different rectangles */
peb = NULL;
ebrowser_instantiate(&peb);
SetRect(&rc, 50, 20, 100, 80);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
RECT eb_rc;
@ -762,14 +762,14 @@ static void test_initialization(void)
static const RECT exp_rc = {0, 0, 48, 58};
hr = IShellBrowser_GetWindow(psb, &eb_hwnd);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
GetClientRect(eb_hwnd, &eb_rc);
ok(EqualRect(&eb_rc, &exp_rc), "Got client rect %s\n", wine_dbgstr_rect(&eb_rc));
GetWindowRect(eb_hwnd, &eb_rc);
ok(eb_rc.right - eb_rc.left == 50, "Got window width %d\n", eb_rc.right - eb_rc.left);
ok(eb_rc.bottom - eb_rc.top == 60, "Got window height %d\n", eb_rc.bottom - eb_rc.top);
ok(eb_rc.right - eb_rc.left == 50, "Got window width %ld\n", eb_rc.right - eb_rc.left);
ok(eb_rc.bottom - eb_rc.top == 60, "Got window height %ld\n", eb_rc.bottom - eb_rc.top);
buf[0] = '\0';
GetClassNameA(eb_hwnd, buf, 1024);
@ -777,11 +777,11 @@ static void test_initialization(void)
expected_style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER;
style = GetWindowLongPtrW(eb_hwnd, GWL_STYLE);
todo_wine ok(style == expected_style, "Got style 0x%08x, expected 0x%08x\n", style, expected_style);
todo_wine ok(style == expected_style, "Got style 0x%08lx, expected 0x%08lx\n", style, expected_style);
expected_style = WS_EX_CONTROLPARENT;
style = GetWindowLongPtrW(eb_hwnd, GWL_EXSTYLE);
ok(style == expected_style, "Got exstyle 0x%08x, expected 0x%08x\n", style, expected_style);
ok(style == expected_style, "Got exstyle 0x%08lx, expected 0x%08lx\n", style, expected_style);
ok(GetParent(eb_hwnd) == hwnd, "GetParent returns %p\n", GetParent(eb_hwnd));
@ -792,7 +792,7 @@ static void test_initialization(void)
IShellBrowser_Release(psb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got refcount %d\n", lres);
ok(lres == 0, "Got refcount %ld\n", lres);
}
else
{
@ -800,26 +800,26 @@ static void test_initialization(void)
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got refcount %d\n", lres);
ok(lres == 0, "Got refcount %ld\n", lres);
}
/* check window style with EBO_NOBORDER */
ebrowser_instantiate(&peb);
hr = IExplorerBrowser_SetOptions(peb, EBO_NOBORDER);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
SetRect(&rc, 50, 20, 100, 80);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IShellBrowser_GetWindow(psb, &eb_hwnd);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
style = GetWindowLongPtrW(eb_hwnd, GWL_STYLE);
ok(!(style & WS_BORDER) || broken(style & WS_BORDER) /* before win8 */, "got style 0x%08x\n", style);
ok(!(style & WS_BORDER) || broken(style & WS_BORDER) /* before win8 */, "got style 0x%08lx\n", style);
IShellBrowser_Release(psb);
IExplorerBrowser_Destroy(peb);
@ -829,34 +829,34 @@ static void test_initialization(void)
ebrowser_instantiate(&peb);
SetRectEmpty(&rc);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got refcount %d\n", lres);
ok(lres == 0, "Got refcount %ld\n", lres);
ebrowser_instantiate(&peb);
SetRect(&rc, -1, -1, 1, 1);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got refcount %d\n", lres);
ok(lres == 0, "Got refcount %ld\n", lres);
ebrowser_instantiate(&peb);
SetRect(&rc, 10, 10, 5, 5);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got refcount %d\n", lres);
ok(lres == 0, "Got refcount %ld\n", lres);
ebrowser_instantiate(&peb);
SetRect(&rc, 10, 10, 5, 5);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got refcount %d\n", lres);
ok(lres == 0, "Got refcount %ld\n", lres);
}
static void test_SetSite(void)
@ -883,13 +883,13 @@ static void test_SetSite(void)
IExplorerBrowser_SetOptions(peb, EBO_SHOWFRAMES);
hr = IExplorerBrowser_QueryInterface(peb, &IID_IObjectWithSite, (void**)&pow);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
spimpl->interfaces = expected;
hr = IObjectWithSite_SetSite(pow, (IUnknown*)&spimpl->IServiceProvider_iface);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(FAILED(hr))
IObjectWithSite_Release(pow);
@ -904,7 +904,7 @@ static void test_SetSite(void)
IExplorerPaneVisibility_Release(&epvimpl->IExplorerPaneVisibility_iface);
IExplorerBrowser_Destroy(peb);
ref = IExplorerBrowser_Release(peb);
ok(ref == 0, "Got ref %d\n", ref);
ok(ref == 0, "Got ref %ld\n", ref);
return;
}
@ -932,52 +932,52 @@ static void test_SetSite(void)
todo_wine ok(cdbimpl->OnPreviewCreated, "Got %d\n", cdbimpl->OnPreviewCreated);
/* IExplorerPaneVisibility */
ok(epvimpl->np, "Got %d\n", epvimpl->np);
todo_wine ok(epvimpl->cp, "Got %d\n", epvimpl->cp);
todo_wine ok(epvimpl->cp_o, "Got %d\n", epvimpl->cp_o);
todo_wine ok(epvimpl->cp_v, "Got %d\n", epvimpl->cp_v);
todo_wine ok(epvimpl->dp, "Got %d\n", epvimpl->dp);
todo_wine ok(epvimpl->pp, "Got %d\n", epvimpl->pp);
ok(!epvimpl->qp, "Got %d\n", epvimpl->qp);
ok(!epvimpl->aqp, "Got %d\n", epvimpl->aqp);
ok(!epvimpl->unk, "Got %d\n", epvimpl->unk);
ok(epvimpl->np, "Got %ld\n", epvimpl->np);
todo_wine ok(epvimpl->cp, "Got %ld\n", epvimpl->cp);
todo_wine ok(epvimpl->cp_o, "Got %ld\n", epvimpl->cp_o);
todo_wine ok(epvimpl->cp_v, "Got %ld\n", epvimpl->cp_v);
todo_wine ok(epvimpl->dp, "Got %ld\n", epvimpl->dp);
todo_wine ok(epvimpl->pp, "Got %ld\n", epvimpl->pp);
ok(!epvimpl->qp, "Got %ld\n", epvimpl->qp);
ok(!epvimpl->aqp, "Got %ld\n", epvimpl->aqp);
ok(!epvimpl->unk, "Got %ld\n", epvimpl->unk);
/* Test when IServiceProvider is released. */
IServiceProvider_AddRef(&spimpl->IServiceProvider_iface);
ref = IServiceProvider_Release(&spimpl->IServiceProvider_iface);
ok(ref == 2, "Got ref %d\n", ref);
ok(ref == 2, "Got ref %ld\n", ref);
hr = IObjectWithSite_SetSite(pow, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IServiceProvider_AddRef(&spimpl->IServiceProvider_iface);
ref = IServiceProvider_Release(&spimpl->IServiceProvider_iface);
ok(ref == 1, "Got ref %d\n", ref);
ok(ref == 1, "Got ref %ld\n", ref);
hr = IObjectWithSite_SetSite(pow, (IUnknown*)&spimpl->IServiceProvider_iface);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IServiceProvider_AddRef(&spimpl->IServiceProvider_iface);
ref = IServiceProvider_Release(&spimpl->IServiceProvider_iface);
ok(ref == 2, "Got ref %d\n", ref);
ok(ref == 2, "Got ref %ld\n", ref);
IExplorerBrowser_Destroy(peb);
IServiceProvider_AddRef(&spimpl->IServiceProvider_iface);
ref = IServiceProvider_Release(&spimpl->IServiceProvider_iface);
ok(ref == 2, "Got ref %d\n", ref);
ok(ref == 2, "Got ref %ld\n", ref);
IObjectWithSite_Release(pow);
ref = IExplorerBrowser_Release(peb);
ok(ref == 0, "Got ref %d\n", ref);
ok(ref == 0, "Got ref %ld\n", ref);
ref = IServiceProvider_Release(&spimpl->IServiceProvider_iface);
ok(ref == 0, "Got ref %d\n", ref);
ok(ref == 0, "Got ref %ld\n", ref);
ref = ICommDlgBrowser3_Release(&cdbimpl->ICommDlgBrowser3_iface);
ok(ref == 0, "Got ref %d\n", ref);
ok(ref == 0, "Got ref %ld\n", ref);
ref = IExplorerPaneVisibility_Release(&epvimpl->IExplorerPaneVisibility_iface);
ok(ref == 0, "Got ref %d\n", ref);
ok(ref == 0, "Got ref %ld\n", ref);
}
static void test_basics(void)
@ -998,23 +998,23 @@ static void test_basics(void)
/* SetRect */
SetRectEmpty(&rc);
hr = IExplorerBrowser_SetRect(peb, NULL, rc);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
SetRect(&rc, 100, 100, 10, 10);
hr = IExplorerBrowser_SetRect(peb, NULL, rc);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
/* SetRect with DeferWindowPos */
SetRect(&rc, 0, 0, 10, 10);
hdwp = BeginDeferWindowPos(1);
hr = IExplorerBrowser_SetRect(peb, &hdwp, rc);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
lres = EndDeferWindowPos(hdwp);
ok(lres, "EndDeferWindowPos failed.\n");
hdwp = NULL;
hr = IExplorerBrowser_SetRect(peb, &hdwp, rc);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(hdwp == NULL, "got %p\n", hdwp);
lres = EndDeferWindowPos(hdwp);
ok(!lres, "EndDeferWindowPos succeeded unexpectedly.\n");
@ -1022,9 +1022,9 @@ static void test_basics(void)
/* Test positioning */
SetRect(&rc, 10, 20, 50, 50);
hr = IExplorerBrowser_SetRect(peb, NULL, rc);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
HWND eb_hwnd;
@ -1033,7 +1033,7 @@ static void test_basics(void)
static const RECT exp_rc2 = {11, 21, 49, 24};
hr = IShellBrowser_GetWindow(psb, &eb_hwnd);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
GetClientRect(eb_hwnd, &eb_rc);
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
@ -1043,14 +1043,14 @@ static void test_basics(void)
rc.bottom = 25;
hdwp = (HDWP)0xdeadbeef;
hr = IExplorerBrowser_SetRect(peb, &hdwp, rc);
ok(hr == E_FAIL, "Got 0x%08x\n", hr);
ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
GetClientRect(eb_hwnd, &eb_rc);
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
ok(EqualRect(&eb_rc, &exp_rc), "Got rect %s\n", wine_dbgstr_rect(&eb_rc));
hdwp = NULL;
hr = IExplorerBrowser_SetRect(peb, &hdwp, rc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
GetClientRect(eb_hwnd, &eb_rc);
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
ok(EqualRect(&eb_rc, &exp_rc2), "Got rect %s\n", wine_dbgstr_rect(&eb_rc));
@ -1070,18 +1070,18 @@ static void test_basics(void)
}
hr = IExplorerBrowser_GetOptions(peb, &flags);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(flags == 0, "got (0x%08x)\n", flags);
/* Settings preserved through Initialize. */
hr = IExplorerBrowser_SetOptions(peb, 0xDEADBEEF);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ebrowser_initialize(peb);
hr = IExplorerBrowser_GetOptions(peb, &flags);
ok(flags == 0xDEADBEEF, "got (0x%08x)\n", flags);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
IExplorerBrowser_Destroy(peb);
IExplorerBrowser_Release(peb);
@ -1091,22 +1091,22 @@ static void test_basics(void)
/* SetFolderSettings */
hr = IExplorerBrowser_SetFolderSettings(peb, NULL);
ok(hr == E_INVALIDARG, "got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "got (0x%08lx)\n", hr);
fs.ViewMode = 0; fs.fFlags = 0;
hr = IExplorerBrowser_SetFolderSettings(peb, &fs);
todo_wine ok(hr == E_INVALIDARG, "got (0x%08x)\n", hr);
todo_wine ok(hr == E_INVALIDARG, "got (0x%08lx)\n", hr);
/* SetPropertyBag */
hr = IExplorerBrowser_SetPropertyBag(peb, NULL);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
hr = IExplorerBrowser_SetPropertyBag(peb, winetest);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
/* TODO: Test after browsing somewhere. */
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got %d\n", lres);
ok(lres == 0, "Got %ld\n", lres);
}
static void test_Advise(void)
@ -1133,13 +1133,13 @@ static void test_Advise(void)
/* Using Unadvise with a cookie that has yet to be given out
* results in E_INVALIDARG */
hr = IExplorerBrowser_Unadvise(peb, 11);
ok(hr == E_INVALIDARG, "got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "got (0x%08lx)\n", hr);
/* Add some before initialization */
for(i = 0; i < 5; i++)
{
hr = IExplorerBrowser_Advise(peb, pebe, &cookies[i]);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
}
ebrowser_initialize(peb);
@ -1148,10 +1148,10 @@ static void test_Advise(void)
for(i = 5; i < 10; i++)
{
hr = IExplorerBrowser_Advise(peb, pebe, &cookies[i]);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
}
ok(ebev.ref == 10, "Got %d\n", ebev.ref);
ok(ebev.ref == 10, "Got %ld\n", ebev.ref);
ebev.completed = 0;
ebrowser_browse_to_desktop(peb);
@ -1162,7 +1162,7 @@ static void test_Advise(void)
for(i = 4; i < 8; i++)
{
hr = IExplorerBrowser_Unadvise(peb, cookies[i]);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
}
ebev.completed = 0;
@ -1183,11 +1183,11 @@ static void test_Advise(void)
if(i<4||i>7)
{
hr = IExplorerBrowser_Unadvise(peb, cookies[i]);
ok(hr == S_OK, "%d: got (0x%08x)\n", i, hr);
ok(hr == S_OK, "%d: got (0x%08lx)\n", i, hr);
}
}
ok(ebev.ref == 0, "Got %d\n", ebev.ref);
ok(ebev.ref == 0, "Got %ld\n", ebev.ref);
ebev.completed = 0;
ebrowser_browse_to_desktop(peb);
@ -1196,12 +1196,12 @@ static void test_Advise(void)
/* ::Destroy implies ::Unadvise. */
hr = IExplorerBrowser_Advise(peb, pebe, &cookies[0]);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(ebev.ref == 1, "Got %d\n", ebev.ref);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(ebev.ref == 1, "Got %ld\n", ebev.ref);
hr = IExplorerBrowser_Destroy(peb);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(ebev.ref == 0, "Got %d\n", ebev.ref);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(ebev.ref == 0, "Got %ld\n", ebev.ref);
ref = IExplorerBrowser_Release(peb);
ok(!ref, "Got %d\n", ref);
@ -1236,7 +1236,7 @@ static void test_browse_pidl_(IExplorerBrowser *peb, IExplorerBrowserEventsImpl
ebev->completed = ebev->created = ebev->pending = ebev->failed = 0;
hr = IExplorerBrowser_BrowseToIDList(peb, pidl, uFlags);
ok_(file, line) (hr == hr_exp, "BrowseToIDList returned 0x%08x\n", hr);
ok_(file, line) (hr == hr_exp, "BrowseToIDList returned 0x%08lx\n", hr);
process_msgs();
ok_(file, line)
@ -1257,13 +1257,13 @@ static void test_browse_pidl_sb_(IExplorerBrowser *peb, IExplorerBrowserEventsIm
HRESULT hr;
hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb);
ok_(file, line) (hr == S_OK, "QueryInterface returned 0x%08x\n", hr);
ok_(file, line) (hr == S_OK, "QueryInterface returned 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
ebev->completed = ebev->created = ebev->pending = ebev->failed = 0;
hr = IShellBrowser_BrowseObject(psb, pidl, uFlags);
ok_(file, line) (hr == hr_exp, "BrowseObject returned 0x%08x\n", hr);
ok_(file, line) (hr == hr_exp, "BrowseObject returned 0x%08lx\n", hr);
process_msgs();
ok_(file, line)
@ -1309,9 +1309,9 @@ static void test_navigation(void)
CreateDirectoryW(child_path, NULL);
hr = SHParseDisplayName(current_path, NULL, &pidl_current, 0, NULL);
ok(hr == S_OK, "Failed to parse a path, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to parse a path, hr %#lx.\n", hr);
hr = SHParseDisplayName(child_path, NULL, &pidl_child, 0, NULL);
ok(hr == S_OK, "Failed to parse a path, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to parse a path, hr %#lx.\n", hr);
ebrowser_instantiate(&peb);
ebrowser_initialize(peb);
@ -1364,16 +1364,16 @@ static void test_navigation(void)
test_browse_pidl_sb(peb2, &ebev, pidl_current, SBSP_ABSOLUTE, S_OK, 1, 0, 0, 1);
hr = IExplorerBrowser_GetCurrentView(peb, &IID_IFolderView, (void**)&pfv);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
LPITEMIDLIST pidl_relative;
hr = IFolderView_GetFolder(pfv, &IID_IShellFolder, (void**)&psf);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IShellFolder_ParseDisplayName(psf, NULL, NULL, (LPWSTR)testfolderW,
NULL, &pidl_relative, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
/* Browsing to another location here before using the
* pidl_relative would make ExplorerBrowser in Windows 7 show a
@ -1414,11 +1414,11 @@ static void test_navigation(void)
}
hr = IExplorerBrowser_Unadvise(peb, cookie);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IExplorerBrowser_Destroy(peb);
process_msgs();
hr = IExplorerBrowser_Unadvise(peb2, cookie2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IExplorerBrowser_Destroy(peb2);
process_msgs();
@ -1427,42 +1427,42 @@ static void test_navigation(void)
test_browse_pidl_sb(peb2, &ebev, pidl_child, SBSP_ABSOLUTE, HRESULT_FROM_WIN32(ERROR_BUSY), 0, 0, 0, 0);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got lres %d\n", lres);
ok(lres == 0, "Got lres %ld\n", lres);
lres = IExplorerBrowser_Release(peb2);
ok(lres == 0, "Got lres %d\n", lres);
ok(lres == 0, "Got lres %ld\n", lres);
/******************************************/
/* Test some options that affect browsing */
ebrowser_instantiate(&peb);
hr = IExplorerBrowser_Advise(peb, &ebev.IExplorerBrowserEvents_iface, &cookie);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IExplorerBrowser_SetOptions(peb, EBO_NAVIGATEONCE);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ebrowser_initialize(peb);
test_browse_pidl(peb, &ebev, pidl_current, 0, S_OK, 1, 1, 0, 1);
test_browse_pidl(peb, &ebev, pidl_current, 0, E_FAIL, 0, 0, 0, 0);
hr = IExplorerBrowser_SetOptions(peb, 0);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
test_browse_pidl(peb, &ebev, pidl_current, 0, S_OK, 1, 0, 0, 1);
test_browse_pidl(peb, &ebev, pidl_current, 0, S_OK, 1, 0, 0, 1);
/* Difference in behavior lies where? */
hr = IExplorerBrowser_SetOptions(peb, EBO_ALWAYSNAVIGATE);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
test_browse_pidl(peb, &ebev, pidl_current, 0, S_OK, 1, 0, 0, 1);
test_browse_pidl(peb, &ebev, pidl_current, 0, S_OK, 1, 0, 0, 1);
hr = IExplorerBrowser_Unadvise(peb, cookie);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got lres %d\n", lres);
ok(lres == 0, "Got lres %ld\n", lres);
/* BrowseToObject tests */
ebrowser_instantiate(&peb);
@ -1470,11 +1470,11 @@ static void test_navigation(void)
/* Browse to the desktop by passing an IShellFolder */
hr = SHGetDesktopFolder(&psf);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IExplorerBrowser_BrowseToObject(peb, (IUnknown*)psf, SBSP_DEFBROWSER);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
if(hr == S_OK) process_msgs();
IShellFolder_Release(psf);
@ -1482,11 +1482,11 @@ static void test_navigation(void)
/* Browse to the current directory by passing a ShellItem */
hr = pSHCreateShellItem(NULL, NULL, pidl_current, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IExplorerBrowser_BrowseToObject(peb, (IUnknown*)psi, SBSP_DEFBROWSER);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
process_msgs();
IShellItem_Release(psi);
@ -1494,7 +1494,7 @@ static void test_navigation(void)
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got lres %d\n", lres);
ok(lres == 0, "Got lres %ld\n", lres);
/* Cleanup */
RemoveDirectoryW(child_path);
@ -1517,12 +1517,12 @@ static void test_GetCurrentView(void)
IExplorerBrowser_GetCurrentView(peb, NULL, NULL);
}
hr = IExplorerBrowser_GetCurrentView(peb, NULL, (void**)&punk);
ok(hr == E_FAIL, "Got 0x%08x\n", hr);
ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
#define test_gcv(iid, exp) \
do { \
hr = IExplorerBrowser_GetCurrentView(peb, &iid, (void**)&punk); \
ok(hr == exp, "(%s:)Expected (0x%08x), got: (0x%08x)\n", \
ok(hr == exp, "(%s:)Expected (0x%08lx), got: (0x%08lx)\n", \
#iid ,exp, hr); \
if(SUCCEEDED(hr)) IUnknown_Release(punk); \
} while(0)
@ -1585,7 +1585,7 @@ static void test_InputObject(void)
ebrowser_instantiate(&peb);
hr = IExplorerBrowser_QueryInterface(peb, &IID_IInputObject, (void**)&pio);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(FAILED(hr))
{
win_skip("IInputObject not supported.\n");
@ -1594,47 +1594,47 @@ static void test_InputObject(void)
/* Before initializing */
hr = IInputObject_TranslateAcceleratorIO(pio, &msg_a);
todo_wine ok(hr == E_FAIL, "Got 0x%08x\n", hr);
todo_wine ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
hr = IInputObject_HasFocusIO(pio);
todo_wine ok(hr == E_FAIL, "Got 0x%08x\n", hr);
todo_wine ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
hr = IInputObject_UIActivateIO(pio, TRUE, &msg_a);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IInputObject_HasFocusIO(pio);
todo_wine ok(hr == E_FAIL, "Got 0x%08x\n", hr);
todo_wine ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
hr = IInputObject_TranslateAcceleratorIO(pio, &msg_a);
todo_wine ok(hr == E_FAIL, "Got 0x%08x\n", hr);
todo_wine ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
SetRect(&rc, 0, 0, 100, 100);
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IInputObject_HasFocusIO(pio);
todo_wine ok(hr == E_FAIL, "Got 0x%08x\n", hr);
todo_wine ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
hr = IInputObject_TranslateAcceleratorIO(pio, &msg_a);
todo_wine ok(hr == E_FAIL, "Got 0x%08x\n", hr);
todo_wine ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
/* Browse to the desktop */
SHGetDesktopFolder(&psf);
hr = IExplorerBrowser_BrowseToObject(peb, (IUnknown*)psf, SBSP_DEFBROWSER);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IShellFolder_Release(psf);
hr = IInputObject_UIActivateIO(pio, TRUE, &msg_a);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IInputObject_HasFocusIO(pio);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IInputObject_UIActivateIO(pio, FALSE, &msg_a);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IInputObject_HasFocusIO(pio);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IInputObject_TranslateAcceleratorIO(pio, &msg_a);
if(hr == S_OK)
@ -1656,7 +1656,7 @@ static void test_InputObject(void)
msg_a.wParam = i;
process_msgs();
hr = IInputObject_TranslateAcceleratorIO(pio, &msg_a);
todo_wine ok(hr == (found ? S_OK : S_FALSE), "Got 0x%08x (%04x)\n", hr, i);
todo_wine ok(hr == (found ? S_OK : S_FALSE), "Got 0x%08lx (%04x)\n", hr, i);
if(i == VK_F5)
Sleep(1000); /* Needed for w2k8 (64bit) */
}
@ -1674,7 +1674,7 @@ static BOOL test_instantiate_control(void)
HRESULT hr;
hr = ebrowser_instantiate(&peb);
ok(hr == S_OK || hr == REGDB_E_CLASSNOTREG, "Got (0x%08x)\n", hr);
ok(hr == S_OK || hr == REGDB_E_CLASSNOTREG, "Got (0x%08lx)\n", hr);
if(FAILED(hr))
return FALSE;

View file

@ -132,14 +132,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
{
failcount++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->wParam, actual->wParam);
}
}
else
{
ok_(file, line) (expected->wParam == actual->wParam,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->wParam, actual->wParam);
}
}
@ -152,14 +152,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
{
failcount++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->lParam, actual->lParam);
}
}
else
{
ok_(file, line) (expected->lParam == actual->lParam,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->lParam, actual->lParam);
}
}

View file

@ -58,7 +58,7 @@ static void test_query_recyclebin(void)
ok(GetTempFileNameA(temp_path, "trash", 0, buf), "GetTempFileName failed\n");
buf[strlen(buf) + 1] = '\0';
hr = pSHQueryRecycleBinA(buf,&info1);
ok(hr == S_OK, "SHQueryRecycleBinA failed with error 0x%x\n", hr);
ok(hr == S_OK, "SHQueryRecycleBinA failed with error 0x%lx\n", hr);
ok(info1.i64Size!=0xdeadbeef,"i64Size not set\n");
ok(info1.i64NumItems!=0xdeadbeef,"i64NumItems not set\n");
/*create and send a file to the recycle bin*/
@ -75,7 +75,7 @@ static void test_query_recyclebin(void)
shfo.lpszProgressTitle = NULL;
ok(!pSHFileOperationA(&shfo), "Deletion was not successful\n");
hr = pSHQueryRecycleBinA(buf,&info2);
ok(hr == S_OK, "SHQueryRecycleBinA failed with error 0x%x\n", hr);
ok(hr == S_OK, "SHQueryRecycleBinA failed with error 0x%lx\n", hr);
ok(info2.i64Size==info1.i64Size+written,"Expected recycle bin to have 0x%s bytes\n",wine_dbgstr_longlong(info1.i64Size+written));
ok(info2.i64NumItems==info1.i64NumItems+1,"Expected recycle bin to have 0x%s items\n",wine_dbgstr_longlong(info1.i64NumItems+1));
}

File diff suppressed because it is too large Load diff

View file

@ -74,7 +74,7 @@ static LPITEMIDLIST path_to_pidl(const char* path)
MultiByteToWideChar(CP_ACP, 0, path, -1, pathW, len);
r=pSHILCreateFromPath(pathW, &pidl, NULL);
ok(r == S_OK, "SHILCreateFromPath failed (0x%08x)\n", r);
ok(r == S_OK, "SHILCreateFromPath failed (0x%08lx)\n", r);
heap_free(pathW);
}
return pidl;
@ -100,93 +100,93 @@ static void test_get_set(void)
r = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
&IID_IShellLinkA, (LPVOID*)&sl);
ok(r == S_OK, "no IID_IShellLinkA (0x%08x)\n", r);
ok(r == S_OK, "no IID_IShellLinkA (0x%08lx)\n", r);
if (r != S_OK)
return;
/* Test Getting / Setting the description */
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
ok(r == S_OK, "GetDescription failed (0x%08lx)\n", r);
ok(*buffer=='\0', "GetDescription returned '%s'\n", buffer);
str="Some description";
r = IShellLinkA_SetDescription(sl, str);
ok(r == S_OK, "SetDescription failed (0x%08x)\n", r);
ok(r == S_OK, "SetDescription failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
ok(r == S_OK, "GetDescription failed (0x%08lx)\n", r);
ok(strcmp(buffer,str)==0, "GetDescription returned '%s'\n", buffer);
r = IShellLinkA_SetDescription(sl, NULL);
ok(r == S_OK, "SetDescription failed (0x%08x)\n", r);
ok(r == S_OK, "SetDescription failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
ok(r == S_OK, "GetDescription failed (0x%08lx)\n", r);
ok(!*buffer, "GetDescription returned '%s'\n", buffer);
/* Test Getting / Setting the work directory */
strcpy(buffer,"garbage");
r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r);
ok(r == S_OK, "GetWorkingDirectory failed (0x%08lx)\n", r);
ok(*buffer=='\0', "GetWorkingDirectory returned '%s'\n", buffer);
str="c:\\nonexistent\\directory";
r = IShellLinkA_SetWorkingDirectory(sl, str);
ok(r == S_OK, "SetWorkingDirectory failed (0x%08x)\n", r);
ok(r == S_OK, "SetWorkingDirectory failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r);
ok(r == S_OK, "GetWorkingDirectory failed (0x%08lx)\n", r);
ok(lstrcmpiA(buffer,str)==0, "GetWorkingDirectory returned '%s'\n", buffer);
/* Test Getting / Setting the path */
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r);
ok(r == S_FALSE, "GetPath failed (0x%08lx)\n", r);
ok(!*buffer, "GetPath returned '%s'\n", buffer);
strcpy(buffer,"garbage");
memset(&finddata, 0xaa, sizeof(finddata));
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), &finddata, SLGP_RAWPATH);
ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r);
ok(r == S_FALSE, "GetPath failed (0x%08lx)\n", r);
ok(!*buffer, "GetPath returned '%s'\n", buffer);
ok(finddata.dwFileAttributes == 0, "unexpected attributes %x\n", finddata.dwFileAttributes);
ok(finddata.dwFileAttributes == 0, "unexpected attributes %lx\n", finddata.dwFileAttributes);
ok(finddata.cFileName[0] == 0, "unexpected filename '%s'\n", finddata.cFileName);
r = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (void **)&slW);
ok(r == S_OK, "CoCreateInstance failed (0x%08x)\n", r);
ok(r == S_OK, "CoCreateInstance failed (0x%08lx)\n", r);
IShellLinkW_Release(slW);
r = IShellLinkA_SetPath(sl, NULL);
ok(r == E_INVALIDARG, "Unexpected hr %#x.\n", r);
ok(r == E_INVALIDARG, "Unexpected hr %#lx.\n", r);
r = IShellLinkA_SetPath(sl, "");
ok(r==S_OK, "SetPath failed (0x%08x)\n", r);
ok(r==S_OK, "SetPath failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r);
ok(r == S_FALSE, "GetPath failed (0x%08lx)\n", r);
ok(*buffer=='\0', "GetPath returned '%s'\n", buffer);
/* Win98 returns S_FALSE, but WinXP returns S_OK */
str="c:\\nonexistent\\file";
r = IShellLinkA_SetPath(sl, str);
ok(r==S_FALSE || r==S_OK, "SetPath failed (0x%08x)\n", r);
ok(r==S_FALSE || r==S_OK, "SetPath failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_OK, "GetPath failed (0x%08x)\n", r);
ok(r == S_OK, "GetPath failed (0x%08lx)\n", r);
ok(lstrcmpiA(buffer,str)==0, "GetPath returned '%s'\n", buffer);
strcpy(buffer,"garbage");
memset(&finddata, 0xaa, sizeof(finddata));
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), &finddata, SLGP_RAWPATH);
ok(r == S_OK, "GetPath failed (0x%08x)\n", r);
ok(r == S_OK, "GetPath failed (0x%08lx)\n", r);
ok(lstrcmpiA(buffer,str)==0, "GetPath returned '%s'\n", buffer);
ok(finddata.dwFileAttributes == 0, "unexpected attributes %x\n", finddata.dwFileAttributes);
ok(finddata.dwFileAttributes == 0, "unexpected attributes %lx\n", finddata.dwFileAttributes);
ok(lstrcmpiA(finddata.cFileName, "file") == 0, "unexpected filename '%s'\n", finddata.cFileName);
/* Get some real path to play with */
@ -196,7 +196,7 @@ static void test_get_set(void)
/* Test the interaction of SetPath and SetIDList */
tmp_pidl=NULL;
r = IShellLinkA_GetIDList(sl, &tmp_pidl);
ok(r == S_OK, "GetIDList failed (0x%08x)\n", r);
ok(r == S_OK, "GetIDList failed (0x%08lx)\n", r);
if (r == S_OK)
{
BOOL ret;
@ -217,16 +217,16 @@ static void test_get_set(void)
LPITEMIDLIST second_pidl;
r = IShellLinkA_SetIDList(sl, pidl);
ok(r == S_OK, "SetIDList failed (0x%08x)\n", r);
ok(r == S_OK, "SetIDList failed (0x%08lx)\n", r);
tmp_pidl=NULL;
r = IShellLinkA_GetIDList(sl, &tmp_pidl);
ok(r == S_OK, "GetIDList failed (0x%08x)\n", r);
ok(r == S_OK, "GetIDList failed (0x%08lx)\n", r);
ok(tmp_pidl && ILIsEqual(pidl, tmp_pidl),
"GetIDList returned an incorrect pidl\n");
r = IShellLinkA_GetIDList(sl, &second_pidl);
ok(r == S_OK, "GetIDList failed (0x%08x)\n", r);
ok(r == S_OK, "GetIDList failed (0x%08lx)\n", r);
ok(second_pidl && ILIsEqual(pidl, second_pidl),
"GetIDList returned an incorrect pidl\n");
ok(second_pidl != tmp_pidl, "pidls are the same\n");
@ -237,15 +237,15 @@ static void test_get_set(void)
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_OK, "GetPath failed (0x%08x)\n", r);
ok(r == S_OK, "GetPath failed (0x%08lx)\n", r);
ok(lstrcmpiA(buffer, mypath)==0, "GetPath returned '%s'\n", buffer);
strcpy(buffer,"garbage");
memset(&finddata, 0xaa, sizeof(finddata));
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), &finddata, SLGP_RAWPATH);
ok(r == S_OK, "GetPath failed (0x%08x)\n", r);
ok(r == S_OK, "GetPath failed (0x%08lx)\n", r);
ok(lstrcmpiA(buffer, mypath)==0, "GetPath returned '%s'\n", buffer);
ok(finddata.dwFileAttributes != 0, "unexpected attributes %x\n", finddata.dwFileAttributes);
ok(finddata.dwFileAttributes != 0, "unexpected attributes %lx\n", finddata.dwFileAttributes);
ok(lstrcmpiA(finddata.cFileName, "regedit.exe") == 0, "unexpected filename '%s'\n", finddata.cFileName);
}
@ -254,22 +254,22 @@ static void test_get_set(void)
LPITEMIDLIST pidl_controls;
r = pSHGetFolderLocation(NULL, CSIDL_CONTROLS, NULL, 0, &pidl_controls);
ok(r == S_OK, "SHGetFolderLocation failed (0x%08x)\n", r);
ok(r == S_OK, "SHGetFolderLocation failed (0x%08lx)\n", r);
r = IShellLinkA_SetIDList(sl, pidl_controls);
ok(r == S_OK, "SetIDList failed (0x%08x)\n", r);
ok(r == S_OK, "SetIDList failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r);
ok(r == S_FALSE, "GetPath failed (0x%08lx)\n", r);
ok(buffer[0] == 0, "GetPath returned '%s'\n", buffer);
strcpy(buffer,"garbage");
memset(&finddata, 0xaa, sizeof(finddata));
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), &finddata, SLGP_RAWPATH);
ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r);
ok(r == S_FALSE, "GetPath failed (0x%08lx)\n", r);
ok(buffer[0] == 0, "GetPath returned '%s'\n", buffer);
ok(finddata.dwFileAttributes == 0, "unexpected attributes %x\n", finddata.dwFileAttributes);
ok(finddata.dwFileAttributes == 0, "unexpected attributes %lx\n", finddata.dwFileAttributes);
ok(finddata.cFileName[0] == 0, "unexpected filename '%s'\n", finddata.cFileName);
ILFree(pidl_controls);
@ -277,102 +277,102 @@ static void test_get_set(void)
/* test path with quotes (IShellLinkA_SetPath returns S_FALSE on W2K and below and S_OK on XP and above */
r = IShellLinkA_SetPath(sl, "\"c:\\nonexistent\\file\"");
ok(r==S_FALSE || r == S_OK, "SetPath failed (0x%08x)\n", r);
ok(r==S_FALSE || r == S_OK, "SetPath failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r==S_OK, "GetPath failed (0x%08x)\n", r);
ok(r==S_OK, "GetPath failed (0x%08lx)\n", r);
todo_wine ok(!strcmp(buffer, "C:\\nonexistent\\file"),
"case doesn't match\n");
r = IShellLinkA_SetPath(sl, "\"c:\\foo");
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08x)\n", r);
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08lx)\n", r);
r = IShellLinkA_SetPath(sl, "\"\"c:\\foo");
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08x)\n", r);
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08lx)\n", r);
r = IShellLinkA_SetPath(sl, "c:\\foo\"");
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08x)\n", r);
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08lx)\n", r);
r = IShellLinkA_SetPath(sl, "\"\"c:\\foo\"");
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08x)\n", r);
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08lx)\n", r);
r = IShellLinkA_SetPath(sl, "\"\"c:\\foo\"\"");
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08x)\n", r);
ok(r==S_FALSE || r == S_OK || r == E_INVALIDARG /* Vista */, "SetPath failed (0x%08lx)\n", r);
/* Test Getting / Setting the arguments */
strcpy(buffer,"garbage");
r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetArguments failed (0x%08x)\n", r);
ok(r == S_OK, "GetArguments failed (0x%08lx)\n", r);
ok(*buffer=='\0', "GetArguments returned '%s'\n", buffer);
str="param1 \"spaced param2\"";
r = IShellLinkA_SetArguments(sl, str);
ok(r == S_OK, "SetArguments failed (0x%08x)\n", r);
ok(r == S_OK, "SetArguments failed (0x%08lx)\n", r);
strcpy(buffer,"garbage");
r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetArguments failed (0x%08x)\n", r);
ok(r == S_OK, "GetArguments failed (0x%08lx)\n", r);
ok(strcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer);
strcpy(buffer,"garbage");
r = IShellLinkA_SetArguments(sl, NULL);
ok(r == S_OK, "SetArguments failed (0x%08x)\n", r);
ok(r == S_OK, "SetArguments failed (0x%08lx)\n", r);
r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetArguments failed (0x%08x)\n", r);
ok(r == S_OK, "GetArguments failed (0x%08lx)\n", r);
ok(!buffer[0] || strcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer);
strcpy(buffer,"garbage");
r = IShellLinkA_SetArguments(sl, "");
ok(r == S_OK, "SetArguments failed (0x%08x)\n", r);
ok(r == S_OK, "SetArguments failed (0x%08lx)\n", r);
r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetArguments failed (0x%08x)\n", r);
ok(r == S_OK, "GetArguments failed (0x%08lx)\n", r);
ok(!buffer[0], "GetArguments returned '%s'\n", buffer);
/* Test Getting / Setting showcmd */
i=0xdeadbeef;
r = IShellLinkA_GetShowCmd(sl, &i);
ok(r == S_OK, "GetShowCmd failed (0x%08x)\n", r);
ok(r == S_OK, "GetShowCmd failed (0x%08lx)\n", r);
ok(i==SW_SHOWNORMAL, "GetShowCmd returned %d\n", i);
r = IShellLinkA_SetShowCmd(sl, SW_SHOWMAXIMIZED);
ok(r == S_OK, "SetShowCmd failed (0x%08x)\n", r);
ok(r == S_OK, "SetShowCmd failed (0x%08lx)\n", r);
i=0xdeadbeef;
r = IShellLinkA_GetShowCmd(sl, &i);
ok(r == S_OK, "GetShowCmd failed (0x%08x)\n", r);
ok(r == S_OK, "GetShowCmd failed (0x%08lx)\n", r);
ok(i==SW_SHOWMAXIMIZED, "GetShowCmd returned %d'\n", i);
/* Test Getting / Setting the icon */
i=0xdeadbeef;
strcpy(buffer,"garbage");
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(*buffer=='\0', "GetIconLocation returned '%s'\n", buffer);
ok(i==0, "GetIconLocation returned %d\n", i);
str="c:\\nonexistent\\file";
r = IShellLinkA_SetIconLocation(sl, str, 0xbabecafe);
ok(r == S_OK, "SetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "SetIconLocation failed (0x%08lx)\n", r);
i=0xdeadbeef;
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(lstrcmpiA(buffer,str)==0, "GetIconLocation returned '%s'\n", buffer);
ok(i==0xbabecafe, "GetIconLocation returned %d'\n", i);
/* Test Getting / Setting the hot key */
w=0xbeef;
r = IShellLinkA_GetHotkey(sl, &w);
ok(r == S_OK, "GetHotkey failed (0x%08x)\n", r);
ok(r == S_OK, "GetHotkey failed (0x%08lx)\n", r);
ok(w==0, "GetHotkey returned %d\n", w);
r = IShellLinkA_SetHotkey(sl, 0x5678);
ok(r == S_OK, "SetHotkey failed (0x%08x)\n", r);
ok(r == S_OK, "SetHotkey failed (0x%08lx)\n", r);
w=0xbeef;
r = IShellLinkA_GetHotkey(sl, &w);
ok(r == S_OK, "GetHotkey failed (0x%08x)\n", r);
ok(r == S_OK, "GetHotkey failed (0x%08lx)\n", r);
ok(w==0x5678, "GetHotkey returned %d'\n", w);
IShellLinkA_Release(sl);
@ -394,53 +394,53 @@ void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
r = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
&IID_IShellLinkA, (LPVOID*)&sl);
lok(r == S_OK, "no IID_IShellLinkA (0x%08x)\n", r);
lok(r == S_OK, "no IID_IShellLinkA (0x%08lx)\n", r);
if (r != S_OK)
return;
if (desc->description)
{
r = IShellLinkA_SetDescription(sl, desc->description);
lok(r == S_OK, "SetDescription failed (0x%08x)\n", r);
lok(r == S_OK, "SetDescription failed (0x%08lx)\n", r);
}
if (desc->workdir)
{
r = IShellLinkA_SetWorkingDirectory(sl, desc->workdir);
lok(r == S_OK, "SetWorkingDirectory failed (0x%08x)\n", r);
lok(r == S_OK, "SetWorkingDirectory failed (0x%08lx)\n", r);
}
if (desc->path)
{
r = IShellLinkA_SetPath(sl, desc->path);
lok(SUCCEEDED(r), "SetPath failed (0x%08x)\n", r);
lok(SUCCEEDED(r), "SetPath failed (0x%08lx)\n", r);
}
if (desc->pidl)
{
r = IShellLinkA_SetIDList(sl, desc->pidl);
lok(r == S_OK, "SetIDList failed (0x%08x)\n", r);
lok(r == S_OK, "SetIDList failed (0x%08lx)\n", r);
}
if (desc->arguments)
{
r = IShellLinkA_SetArguments(sl, desc->arguments);
lok(r == S_OK, "SetArguments failed (0x%08x)\n", r);
lok(r == S_OK, "SetArguments failed (0x%08lx)\n", r);
}
if (desc->showcmd)
{
r = IShellLinkA_SetShowCmd(sl, desc->showcmd);
lok(r == S_OK, "SetShowCmd failed (0x%08x)\n", r);
lok(r == S_OK, "SetShowCmd failed (0x%08lx)\n", r);
}
if (desc->icon)
{
r = IShellLinkA_SetIconLocation(sl, desc->icon, desc->icon_id);
lok(r == S_OK, "SetIconLocation failed (0x%08x)\n", r);
lok(r == S_OK, "SetIconLocation failed (0x%08lx)\n", r);
}
if (desc->hotkey)
{
r = IShellLinkA_SetHotkey(sl, desc->hotkey);
lok(r == S_OK, "SetHotkey failed (0x%08x)\n", r);
lok(r == S_OK, "SetHotkey failed (0x%08lx)\n", r);
}
r = IShellLinkA_QueryInterface(sl, &IID_IPersistFile, (void**)&pf);
lok(r == S_OK, "no IID_IPersistFile (0x%08x)\n", r);
lok(r == S_OK, "no IID_IPersistFile (0x%08lx)\n", r);
if (r == S_OK)
{
LPOLESTR str;
@ -453,39 +453,39 @@ void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
init_dirty = IPersistFile_IsDirty(pf); /* empty links start off as clean */
r = IPersistFile_Save(pf, NULL, FALSE);
lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, "save failed (0x%08x)\n", r);
lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, "save failed (0x%08lx)\n", r);
r = IPersistFile_IsDirty(pf);
lok(r == init_dirty, "dirty (0x%08x)\n", r);
lok(r == init_dirty, "dirty (0x%08lx)\n", r);
r = IPersistFile_Save(pf, NULL, TRUE);
lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, "save failed (0x%08x)\n", r);
lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, "save failed (0x%08lx)\n", r);
r = IPersistFile_IsDirty(pf);
lok(r == init_dirty, "dirty (0x%08x)\n", r);
lok(r == init_dirty, "dirty (0x%08lx)\n", r);
/* test GetCurFile before ::Save */
str = (LPWSTR)0xdeadbeef;
r = IPersistFile_GetCurFile(pf, &str);
lok(r == S_FALSE, "got 0x%08x\n", r);
lok(r == S_FALSE, "got 0x%08lx\n", r);
lok(str == NULL, "got %p\n", str);
r = IPersistFile_Save(pf, path, TRUE);
lok(r == S_OK, "save failed (0x%08x)\n", r);
lok(r == S_OK, "save failed (0x%08lx)\n", r);
r = IPersistFile_IsDirty(pf);
lok(r == S_FALSE, "dirty (0x%08x)\n", r);
lok(r == S_FALSE, "dirty (0x%08lx)\n", r);
/* test GetCurFile after ::Save */
r = IPersistFile_GetCurFile(pf, &str);
lok(r == S_OK, "got 0x%08x\n", r);
lok(r == S_OK, "got 0x%08lx\n", r);
lok(str != NULL, "Didn't expect NULL\n");
lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str));
CoTaskMemFree(str);
r = IPersistFile_Save(pf, NULL, TRUE);
lok(r == S_OK, "save failed (0x%08x)\n", r);
lok(r == S_OK, "save failed (0x%08lx)\n", r);
/* test GetCurFile after ::Save */
r = IPersistFile_GetCurFile(pf, &str);
lok(r == S_OK, "got 0x%08x\n", r);
lok(r == S_OK, "got 0x%08lx\n", r);
lok(str != NULL, "Didn't expect NULL\n");
lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str));
CoTaskMemFree(str);
@ -506,12 +506,12 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
r = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
&IID_IShellLinkA, (LPVOID*)&sl);
lok(r == S_OK, "no IID_IShellLinkA (0x%08x)\n", r);
lok(r == S_OK, "no IID_IShellLinkA (0x%08lx)\n", r);
if (r != S_OK)
return;
r = IShellLinkA_QueryInterface(sl, &IID_IPersistFile, (LPVOID*)&pf);
lok(r == S_OK, "no IID_IPersistFile (0x%08x)\n", r);
lok(r == S_OK, "no IID_IPersistFile (0x%08lx)\n", r);
if (r != S_OK)
{
IShellLinkA_Release(sl);
@ -521,15 +521,15 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
/* test GetCurFile before ::Load */
str = (LPWSTR)0xdeadbeef;
r = IPersistFile_GetCurFile(pf, &str);
lok(r == S_FALSE, "got 0x%08x\n", r);
lok(r == S_FALSE, "got 0x%08lx\n", r);
lok(str == NULL, "got %p\n", str);
r = IPersistFile_Load(pf, path, STGM_READ);
lok(r == S_OK, "load failed (0x%08x)\n", r);
lok(r == S_OK, "load failed (0x%08lx)\n", r);
/* test GetCurFile after ::Save */
r = IPersistFile_GetCurFile(pf, &str);
lok(r == S_OK, "got 0x%08x\n", r);
lok(r == S_OK, "got 0x%08lx\n", r);
lok(str != NULL, "Didn't expect NULL\n");
lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str));
CoTaskMemFree(str);
@ -540,7 +540,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
{
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
lok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
lok(r == S_OK, "GetDescription failed (0x%08lx)\n", r);
todo_wine_if ((todo & 0x1) != 0)
lok(strcmp(buffer, desc->description)==0, "GetDescription returned '%s' instead of '%s'\n",
buffer, desc->description);
@ -549,7 +549,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
{
strcpy(buffer,"garbage");
r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
lok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r);
lok(r == S_OK, "GetWorkingDirectory failed (0x%08lx)\n", r);
todo_wine_if ((todo & 0x2) != 0)
lok(lstrcmpiA(buffer, desc->workdir)==0, "GetWorkingDirectory returned '%s' instead of '%s'\n",
buffer, desc->workdir);
@ -558,7 +558,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
{
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
lok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
lok(SUCCEEDED(r), "GetPath failed (0x%08lx)\n", r);
todo_wine_if ((todo & 0x4) != 0)
lok(lstrcmpiA(buffer, desc->path)==0, "GetPath returned '%s' instead of '%s'\n",
buffer, desc->path);
@ -567,7 +567,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
{
LPITEMIDLIST pidl=NULL;
r = IShellLinkA_GetIDList(sl, &pidl);
lok(r == S_OK, "GetIDList failed (0x%08x)\n", r);
lok(r == S_OK, "GetIDList failed (0x%08lx)\n", r);
todo_wine_if ((todo & 0x8) != 0)
lok(ILIsEqual(pidl, desc->pidl), "GetIDList returned an incorrect pidl\n");
}
@ -575,7 +575,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
{
int i=0xdeadbeef;
r = IShellLinkA_GetShowCmd(sl, &i);
lok(r == S_OK, "GetShowCmd failed (0x%08x)\n", r);
lok(r == S_OK, "GetShowCmd failed (0x%08lx)\n", r);
todo_wine_if ((todo & 0x10) != 0)
lok(i==desc->showcmd, "GetShowCmd returned 0x%0x instead of 0x%0x\n",
i, desc->showcmd);
@ -585,7 +585,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
int i=0xdeadbeef;
strcpy(buffer,"garbage");
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
lok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
lok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
todo_wine_if ((todo & 0x20) != 0) {
lok(lstrcmpiA(buffer, desc->icon)==0, "GetIconLocation returned '%s' instead of '%s'\n",
buffer, desc->icon);
@ -597,7 +597,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
{
WORD i=0xbeef;
r = IShellLinkA_GetHotkey(sl, &i);
lok(r == S_OK, "GetHotkey failed (0x%08x)\n", r);
lok(r == S_OK, "GetHotkey failed (0x%08lx)\n", r);
todo_wine_if ((todo & 0x40) != 0)
lok(i==desc->hotkey, "GetHotkey returned 0x%04x instead of 0x%04x\n",
i, desc->hotkey);
@ -651,7 +651,7 @@ static void test_load_save(void)
check_lnk(lnkfile, &desc, 0x0);
r=GetModuleFileNameA(NULL, mypath, sizeof(mypath));
ok(r<sizeof(mypath), "GetModuleFileName failed (%d)\n", r);
ok(r<sizeof(mypath), "GetModuleFileName failed (%ld)\n", r);
strcpy(mydir, mypath);
p=strrchr(mydir, '\\');
if (p)
@ -726,9 +726,9 @@ static void test_load_save(void)
/* Create a temporary non-executable file */
r=GetTempPathA(sizeof(mypath), mypath);
ok(r<sizeof(mypath), "GetTempPath failed (%d), err %d\n", r, GetLastError());
ok(r<sizeof(mypath), "GetTempPath failed (%ld), err %ld\n", r, GetLastError());
r = GetLongPathNameA(mypath, mydir, sizeof(mydir));
ok(r<sizeof(mydir), "GetLongPathName failed (%d), err %d\n", r, GetLastError());
ok(r<sizeof(mydir), "GetLongPathName failed (%ld), err %ld\n", r, GetLastError());
p=strrchr(mydir, '\\');
if (p)
*p='\0';
@ -753,7 +753,7 @@ static void test_load_save(void)
check_lnk(lnkfile, &desc, 0x0);
r = GetShortPathNameA(mydir, mypath, sizeof(mypath));
ok(r<sizeof(mypath), "GetShortPathName failed (%d), err %d\n", r, GetLastError());
ok(r<sizeof(mypath), "GetShortPathName failed (%ld), err %ld\n", r, GetLastError());
strcpy(realpath, mypath);
strcat(realpath, "\\test.txt");
@ -774,7 +774,7 @@ static void test_load_save(void)
check_lnk(lnkfile, &desc, 0x0);
r = DeleteFileA(mypath);
ok(r, "failed to delete file %s (%d)\n", mypath, GetLastError());
ok(r, "failed to delete file %s (%ld)\n", mypath, GetLastError());
/* Create a temporary .bat file */
strcpy(mypath, mydir);
@ -804,7 +804,7 @@ static void test_load_save(void)
check_lnk(lnkfile, &desc, 0x4);
r = DeleteFileA(realpath);
ok(r, "failed to delete file %s (%d)\n", realpath, GetLastError());
ok(r, "failed to delete file %s (%ld)\n", realpath, GetLastError());
/* FIXME: Also test saving a .lnk pointing to a pidl that cannot be
* represented as a path.
@ -812,7 +812,7 @@ static void test_load_save(void)
/* DeleteFileW is not implemented on Win9x */
r=DeleteFileA(lnkfileA);
ok(r, "failed to delete link '%s' (%d)\n", lnkfileA, GetLastError());
ok(r, "failed to delete link '%s' (%ld)\n", lnkfileA, GetLastError());
}
static void test_datalink(void)
@ -836,10 +836,10 @@ static void test_datalink(void)
r = CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
&IID_IShellLinkW, (LPVOID*)&sl );
ok( r == S_OK, "Failed to create shelllink object, hr %#x.\n", r);
ok( r == S_OK, "Failed to create shelllink object, hr %#lx.\n", r);
r = IShellLinkW_QueryInterface( sl, &IID_IShellLinkDataList, (void **)&dl );
ok( r == S_OK, "Failed to get interface, hr %#x.\n", r);
ok( r == S_OK, "Failed to get interface, hr %#lx.\n", r);
flags = 0;
r = IShellLinkDataList_GetFlags( dl, &flags );
@ -852,7 +852,7 @@ static void test_datalink(void)
ok( dar == NULL, "should be null\n");
r = IShellLinkW_SetPath(sl, NULL);
ok(r == E_INVALIDARG, "Unexpected hr %#x.\n", r);
ok(r == E_INVALIDARG, "Unexpected hr %#lx.\n", r);
r = IShellLinkW_SetPath(sl, lnk);
ok(r == S_OK, "SetPath failed\n");
@ -889,7 +889,7 @@ static void test_shdefextracticon(void)
HRESULT res;
res = SHDefExtractIconA("shell32.dll", 0, 0, &hiconlarge, &hiconsmall, MAKELONG(16,24));
ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%x\n", res);
ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%lx\n", res);
ok(hiconlarge != NULL, "got null hiconlarge\n");
ok(hiconsmall != NULL, "got null hiconsmall\n");
DestroyIcon(hiconlarge);
@ -897,12 +897,12 @@ static void test_shdefextracticon(void)
hiconsmall = NULL;
res = SHDefExtractIconA("shell32.dll", 0, 0, NULL, &hiconsmall, MAKELONG(16,24));
ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%x\n", res);
ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%lx\n", res);
ok(hiconsmall != NULL, "got null hiconsmall\n");
DestroyIcon(hiconsmall);
res = SHDefExtractIconA("shell32.dll", 0, 0, NULL, NULL, MAKELONG(16,24));
ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%x\n", res);
ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%lx\n", res);
}
static void test_GetIconLocation(void)
@ -917,25 +917,25 @@ static void test_GetIconLocation(void)
r = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
&IID_IShellLinkA, (LPVOID*)&sl);
ok(r == S_OK, "no IID_IShellLinkA (0x%08x)\n", r);
ok(r == S_OK, "no IID_IShellLinkA (0x%08lx)\n", r);
if(r != S_OK)
return;
i = 0xdeadbeef;
strcpy(buffer, "garbage");
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(*buffer == '\0', "GetIconLocation returned '%s'\n", buffer);
ok(i == 0, "GetIconLocation returned %d\n", i);
str = "c:\\some\\path";
r = IShellLinkA_SetPath(sl, str);
ok(r == S_FALSE || r == S_OK, "SetPath failed (0x%08x)\n", r);
ok(r == S_FALSE || r == S_OK, "SetPath failed (0x%08lx)\n", r);
i = 0xdeadbeef;
strcpy(buffer, "garbage");
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(*buffer == '\0', "GetIconLocation returned '%s'\n", buffer);
ok(i == 0, "GetIconLocation returned %d\n", i);
@ -943,48 +943,48 @@ static void test_GetIconLocation(void)
strcat(mypath, "\\regedit.exe");
pidl = path_to_pidl(mypath);
r = IShellLinkA_SetIDList(sl, pidl);
ok(r == S_OK, "SetPath failed (0x%08x)\n", r);
ok(r == S_OK, "SetPath failed (0x%08lx)\n", r);
ILFree(pidl);
i = 0xdeadbeef;
strcpy(buffer, "garbage");
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(*buffer == '\0', "GetIconLocation returned '%s'\n", buffer);
ok(i == 0, "GetIconLocation returned %d\n", i);
str = "c:\\nonexistent\\file";
r = IShellLinkA_SetIconLocation(sl, str, 0xbabecafe);
ok(r == S_OK, "SetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "SetIconLocation failed (0x%08lx)\n", r);
i = 0xdeadbeef;
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(lstrcmpiA(buffer,str) == 0, "GetIconLocation returned '%s'\n", buffer);
ok(i == 0xbabecafe, "GetIconLocation returned %#x.\n", i);
r = IShellLinkA_SetIconLocation(sl, NULL, 0xcafefe);
ok(r == S_OK, "SetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "SetIconLocation failed (0x%08lx)\n", r);
i = 0xdeadbeef;
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(!*buffer, "GetIconLocation returned '%s'\n", buffer);
ok(i == 0xcafefe, "GetIconLocation returned %#x.\n", i);
r = IShellLinkA_QueryInterface(sl, &IID_IShellLinkW, (void **)&slW);
ok(SUCCEEDED(r), "Failed to get IShellLinkW, hr %#x.\n", r);
ok(SUCCEEDED(r), "Failed to get IShellLinkW, hr %#lx.\n", r);
str = "c:\\nonexistent\\file";
r = IShellLinkA_SetIconLocation(sl, str, 0xbabecafe);
ok(r == S_OK, "SetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "SetIconLocation failed (0x%08lx)\n", r);
r = IShellLinkA_SetIconLocation(sl, NULL, 0xcafefe);
ok(r == S_OK, "SetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "SetIconLocation failed (0x%08lx)\n", r);
i = 0xdeadbeef;
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
ok(r == S_OK, "GetIconLocation failed (0x%08lx)\n", r);
ok(!*buffer, "GetIconLocation returned '%s'\n", buffer);
ok(i == 0xcafefe, "GetIconLocation returned %#x.\n", i);
@ -1010,7 +1010,7 @@ static void test_SHGetStockIconInfo(void)
memset(buffer, '#', sizeof(buffer));
sii->cbSize = sizeof(SHSTOCKICONINFO);
hr = pSHGetStockIconInfo(SIID_INVALID, SHGSI_ICONLOCATION, sii);
ok(hr == E_INVALIDARG, "-1: got 0x%x (expected E_INVALIDARG)\n", hr);
ok(hr == E_INVALIDARG, "-1: got 0x%lx (expected E_INVALIDARG)\n", hr);
/* max. id for vista is 140 (no definition exists for this value) */
for (i = SIID_DOCNOASSOC; i <= SIID_CLUSTEREDDRIVE; i++)
@ -1020,7 +1020,7 @@ static void test_SHGetStockIconInfo(void)
hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii);
ok(hr == S_OK,
"%3d: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n",
"%3d: got 0x%lx, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n",
i, hr, sii->iSysImageIndex, sii->iIcon);
if ((hr == S_OK) && (winetest_debug > 1))
@ -1034,7 +1034,7 @@ static void test_SHGetStockIconInfo(void)
memset(buffer, '#', sizeof(buffer));
sii->cbSize = sizeof(SHSTOCKICONINFO);
hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii);
ok(hr == E_INVALIDARG, "%3d: got 0x%x (expected E_INVALIDARG)\n", i, hr);
ok(hr == E_INVALIDARG, "%3d: got 0x%lx (expected E_INVALIDARG)\n", i, hr);
todo_wine {
ok(sii->iSysImageIndex == -1, "%d: got iSysImageIndex %d\n", i, sii->iSysImageIndex);
ok(sii->iIcon == -1, "%d: got iIcon %d\n", i, sii->iIcon);
@ -1045,7 +1045,7 @@ static void test_SHGetStockIconInfo(void)
memset(buffer, '#', sizeof(buffer));
sii->cbSize = sizeof(SHSTOCKICONINFO);
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii);
ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
ok(!sii->hIcon, "got %p (expected NULL)\n", sii->hIcon);
ok(sii->iSysImageIndex == -1, "got %d (expected -1)\n", sii->iSysImageIndex);
@ -1053,26 +1053,26 @@ static void test_SHGetStockIconInfo(void)
memset(buffer, '#', sizeof(buffer));
sii->cbSize = sizeof(SHSTOCKICONINFO) + 2;
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii);
ok(hr == E_INVALIDARG, "+2: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
ok(hr == E_INVALIDARG, "+2: got 0x%lx, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
memset(buffer, '#', sizeof(buffer));
sii->cbSize = sizeof(SHSTOCKICONINFO) + 1;
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii);
ok(hr == E_INVALIDARG, "+1: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
ok(hr == E_INVALIDARG, "+1: got 0x%lx, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
memset(buffer, '#', sizeof(buffer));
sii->cbSize = sizeof(SHSTOCKICONINFO) - 1;
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii);
ok(hr == E_INVALIDARG, "-1: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
ok(hr == E_INVALIDARG, "-1: got 0x%lx, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
memset(buffer, '#', sizeof(buffer));
sii->cbSize = sizeof(SHSTOCKICONINFO) - 2;
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii);
ok(hr == E_INVALIDARG, "-2: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
ok(hr == E_INVALIDARG, "-2: got 0x%lx, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon);
/* there is a NULL check for the struct */
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, NULL);
ok(hr == E_INVALIDARG, "NULL: got 0x%x\n", hr);
ok(hr == E_INVALIDARG, "NULL: got 0x%lx\n", hr);
}
static void test_SHExtractIcons(void)
@ -1141,10 +1141,10 @@ static void test_propertystore(void)
hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
&IID_IShellLinkA, (void**)&linkA);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IShellLinkA_QueryInterface(linkA, &IID_IShellLinkW, (void**)&linkW);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IShellLinkA_QueryInterface(linkA, &IID_IPropertyStore, (void**)&ps);
if (hr == S_OK) {
@ -1153,10 +1153,10 @@ static void test_propertystore(void)
IPropertyStore_Release(ps);
hr = IShellLinkW_QueryInterface(linkW, &IID_IPropertyStore, (void**)&ps);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IPropertyStore_QueryInterface(ps, &IID_IPropertyStoreCache, (void**)&pscache);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
IPropertyStore_Release(ps);
}
@ -1218,7 +1218,7 @@ static void test_ExtractIcon(void)
ok(hicon == NULL, "Got icon %p\n", hicon);
r = DeleteFileA(path);
ok(r, "failed to delete file %s (%d)\n", path, GetLastError());
ok(r, "failed to delete file %s (%ld)\n", path, GetLastError());
/* same for W variant */
if (0)
@ -1266,7 +1266,7 @@ if (0)
ok(hicon == NULL, "Got icon %p\n", hicon);
r = DeleteFileW(pathW);
ok(r, "failed to delete file %s (%d)\n", path, GetLastError());
ok(r, "failed to delete file %s (%ld)\n", path, GetLastError());
}
static void test_ExtractAssociatedIcon(void)
@ -1346,20 +1346,20 @@ static void test_SHGetImageList(void)
BOOL dpi_aware = pIsProcessDPIAware && pIsProcessDPIAware();
hr = SHGetImageList( SHIL_LARGE, &IID_IImageList, (void **)&list );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
start_refs = IImageList_AddRef( list );
IImageList_Release( list );
hr = SHGetImageList( SHIL_LARGE, &IID_IImageList, (void **)&list2 );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( list == list2, "lists differ\n" );
refs = IImageList_AddRef( list );
IImageList_Release( list );
ok( refs == start_refs + 1, "got %d, start_refs %d\n", refs, start_refs );
ok( refs == start_refs + 1, "got %ld, start_refs %ld\n", refs, start_refs );
IImageList_Release( list2 );
hr = SHGetImageList( SHIL_SMALL, &IID_IImageList, (void **)&list2 );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ret = Shell_GetImageLists( &lg, &sm );
ok( ret, "got %d\n", ret );
@ -1369,7 +1369,7 @@ static void test_SHGetImageList(void)
/* Shell_GetImageLists doesn't take a reference */
refs = IImageList_AddRef( list );
IImageList_Release( list );
ok( refs == start_refs, "got %d, start_refs %d\n", refs, start_refs );
ok( refs == start_refs, "got %ld, start_refs %ld\n", refs, start_refs );
IImageList_Release( list2 );
IImageList_Release( list );
@ -1379,7 +1379,7 @@ static void test_SHGetImageList(void)
{
hr = SHGetImageList( i, &IID_IImageList, (void **)&list );
ok( hr == S_OK || broken( i == SHIL_JUMBO && hr == E_INVALIDARG ), /* XP and 2003 */
"%d: got %08x\n", i, hr );
"%d: got %08lx\n", i, hr );
if (FAILED(hr)) continue;
IImageList_GetIconSize( list, &width, &height );
switch (i)
@ -1424,7 +1424,7 @@ START_TEST(shelllink)
pIsProcessDPIAware = (void *)GetProcAddress(huser32, "IsProcessDPIAware");
r = CoInitialize(NULL);
ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r);
ok(r == S_OK, "CoInitialize failed (0x%08lx)\n", r);
if (r != S_OK)
return;

View file

@ -116,15 +116,15 @@ static HRESULT WINAPI PropertyStorage_ReadMultiple(IPropertyStorage *This, ULONG
ok(rgpspec != NULL, "rgpspec = NULL\n");
ok(rgpropvar != NULL, "rgpropvar = NULL\n");
ok(rgpspec[0].ulKind == PRSPEC_PROPID, "rgpspec[0].ulKind = %d\n", rgpspec[0].ulKind);
ok(rgpspec[0].u.propid == PID_CODEPAGE, "rgpspec[0].propid = %d\n", rgpspec[0].u.propid);
ok(rgpspec[0].ulKind == PRSPEC_PROPID, "rgpspec[0].ulKind = %ld\n", rgpspec[0].ulKind);
ok(rgpspec[0].u.propid == PID_CODEPAGE, "rgpspec[0].propid = %ld\n", rgpspec[0].u.propid);
rgpropvar[0].vt = VT_I2;
rgpropvar[0].iVal = 1234;
} else {
CHECK_EXPECT(ReadMultiple);
ok(cpspec == 10, "cpspec = %u\n", cpspec);
ok(cpspec == 10, "cpspec = %lu\n", cpspec);
ok(rgpspec == (void*)0xdeadbeef, "rgpspec = %p\n", rgpspec);
ok(rgpropvar != NULL, "rgpropvar = NULL\n");
@ -149,10 +149,10 @@ static HRESULT WINAPI PropertyStorage_WriteMultiple(IPropertyStorage *This, ULON
{
CHECK_EXPECT(WriteMultiple);
ok(cpspec == 20, "cpspec = %d\n", cpspec);
ok(cpspec == 20, "cpspec = %ld\n", cpspec);
ok(rgpspec == (void*)0xdeadbeef, "rgpspec = %p\n", rgpspec);
ok(rgpropvar == (void*)0xdeadbeef, "rgpropvar = %p\n", rgpspec);
ok(propidNameFirst == PID_FIRST_USABLE, "propidNameFirst = %d\n", propidNameFirst);
ok(propidNameFirst == PID_FIRST_USABLE, "propidNameFirst = %ld\n", propidNameFirst);
return S_OK;
}
@ -272,8 +272,8 @@ static HRESULT WINAPI PropertySetStorage_Create(IPropertySetStorage *This,
ok(IsEqualGUID(rfmtid, &FMTID_Test) || IsEqualGUID(rfmtid, &FMTID_NotExisting),
"Incorrect rfmtid value\n");
ok(pclsid == NULL, "pclsid != NULL\n");
ok(grfFlags == PROPSETFLAG_ANSI, "grfFlags = %x\n", grfFlags);
ok(grfMode == STGM_READ, "grfMode = %x\n", grfMode);
ok(grfFlags == PROPSETFLAG_ANSI, "grfFlags = %lx\n", grfFlags);
ok(grfMode == STGM_READ, "grfMode = %lx\n", grfMode);
*ppprstg = &PropertyStorage;
return S_OK;
@ -285,7 +285,7 @@ static HRESULT WINAPI PropertySetStorage_Open(IPropertySetStorage *This,
CHECK_EXPECT(Open);
if(IsEqualGUID(rfmtid, &FMTID_Test)) {
ok(grfMode == STGM_READ, "grfMode = %x\n", grfMode);
ok(grfMode == STGM_READ, "grfMode = %lx\n", grfMode);
*ppprstg = &PropertyStorage;
return S_OK;
@ -348,14 +348,14 @@ static void test_SHPropStg_functions(void)
hres = pSHPropStgCreate(&PropertySetStorage, &FMTID_Test, NULL, PROPSETFLAG_DEFAULT,
STGM_READ, OPEN_EXISTING, &property_storage, &codepage);
ok(codepage == 1234, "codepage = %d\n", codepage);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
CHECK_CALLED(Open);
CHECK_CALLED(ReadMultipleCodePage);
SET_EXPECT(Open);
hres = pSHPropStgCreate(&PropertySetStorage, &FMTID_NotExisting, NULL,
PROPSETFLAG_DEFAULT, STGM_READ, OPEN_EXISTING, &property_storage, &codepage);
ok(hres == STG_E_FILENOTFOUND, "hres = %x\n", hres);
ok(hres == STG_E_FILENOTFOUND, "hres = %lx\n", hres);
CHECK_CALLED(Open);
SET_EXPECT(Open);
@ -366,7 +366,7 @@ static void test_SHPropStg_functions(void)
hres = pSHPropStgCreate(&PropertySetStorage, &FMTID_Test, NULL, PROPSETFLAG_ANSI,
STGM_READ, CREATE_ALWAYS, &property_storage, &codepage);
ok(codepage == 1234, "codepage = %d\n", codepage);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
CHECK_CALLED(Open);
CHECK_CALLED(Release);
CHECK_CALLED(Delete);
@ -379,7 +379,7 @@ static void test_SHPropStg_functions(void)
hres = pSHPropStgCreate(&PropertySetStorage, &FMTID_NotExisting, NULL, PROPSETFLAG_ANSI,
STGM_READ, CREATE_ALWAYS, &property_storage, &codepage);
ok(codepage == 1234, "codepage = %d\n", codepage);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
CHECK_CALLED(Open);
CHECK_CALLED(Create);
CHECK_CALLED(ReadMultipleCodePage);
@ -387,7 +387,7 @@ static void test_SHPropStg_functions(void)
SET_EXPECT(Open);
hres = pSHPropStgCreate(&PropertySetStorage, &FMTID_Test, &FMTID_NotExisting,
PROPSETFLAG_DEFAULT, STGM_READ, OPEN_EXISTING, &property_storage, NULL);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
CHECK_CALLED(Open);
SET_EXPECT(Stat);
@ -395,7 +395,7 @@ static void test_SHPropStg_functions(void)
SET_EXPECT(WriteMultiple);
codepage = 0;
hres = pSHPropStgWriteMultiple(property_storage, &codepage, 20, (void*)0xdeadbeef, (void*)0xdeadbeef, PID_FIRST_USABLE);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
ok(codepage == 1234, "codepage = %d\n", codepage);
CHECK_CALLED(Stat);
CHECK_CALLED(ReadMultipleCodePage);
@ -405,7 +405,7 @@ static void test_SHPropStg_functions(void)
SET_EXPECT(ReadMultipleCodePage);
SET_EXPECT(WriteMultiple);
hres = pSHPropStgWriteMultiple(property_storage, NULL, 20, (void*)0xdeadbeef, (void*)0xdeadbeef, PID_FIRST_USABLE);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
CHECK_CALLED(Stat);
CHECK_CALLED(ReadMultipleCodePage);
CHECK_CALLED(WriteMultiple);
@ -414,7 +414,7 @@ static void test_SHPropStg_functions(void)
SET_EXPECT(WriteMultiple);
codepage = 1000;
hres = pSHPropStgWriteMultiple(property_storage, &codepage, 20, (void*)0xdeadbeef, (void*)0xdeadbeef, PID_FIRST_USABLE);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
ok(codepage == 1000, "codepage = %d\n", codepage);
CHECK_CALLED(Stat);
CHECK_CALLED(WriteMultiple);
@ -425,7 +425,7 @@ static void test_SHPropStg_functions(void)
SET_EXPECT(ReadMultipleCodePage);
SET_EXPECT(Stat);
hres = pSHPropStgReadMultiple(property_storage, 0, 10, (void*)0xdeadbeef, read);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
CHECK_CALLED(ReadMultiple);
CHECK_CALLED(ReadMultipleCodePage);
CHECK_CALLED(Stat);
@ -433,7 +433,7 @@ static void test_SHPropStg_functions(void)
SET_EXPECT(ReadMultiple);
SET_EXPECT(Stat);
hres = pSHPropStgReadMultiple(property_storage, 1251, 10, (void*)0xdeadbeef, read);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
CHECK_CALLED(ReadMultiple);
CHECK_CALLED(Stat);
}
@ -715,19 +715,19 @@ static void test_SHCreateQueryCancelAutoPlayMoniker(void)
}
hr = pSHCreateQueryCancelAutoPlayMoniker(NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = pSHCreateQueryCancelAutoPlayMoniker(&mon);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
sys = -1;
hr = IMoniker_IsSystemMoniker(mon, &sys);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(sys == MKSYS_CLASSMONIKER, "got %d\n", sys);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(sys == MKSYS_CLASSMONIKER, "got %ld\n", sys);
memset(&clsid, 0, sizeof(clsid));
hr = IMoniker_GetClassID(mon, &clsid);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&clsid, &CLSID_ClassMoniker), "got %s\n", wine_dbgstr_guid(&clsid));
/* extract used CLSID that implements this hook */
@ -736,7 +736,7 @@ static void test_SHCreateQueryCancelAutoPlayMoniker(void)
CreateBindCtx(0, &ctxt);
hr = IMoniker_BindToObject(mon, ctxt, &test_moniker, &IID_IQueryCancelAutoPlay, (void**)&unk);
ok(hr == E_NOTIMPL, "got 0x%08x\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx\n", hr);
IBindCtx_Release(ctxt);
CHECK_CALLED(autoplay_BindToObject);
@ -778,8 +778,8 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
ok(!strcmp(filename, DROPTEST_FILENAME), "got %s\n", filename);
r = DragQueryPoint(hDrop, &pt);
ok(r == expected, "expected %d, got %d\n", expected, r);
ok(pt.x == 10, "expected 10, got %d\n", pt.x);
ok(pt.y == 20, "expected 20, got %d\n", pt.y);
ok(pt.x == 10, "expected 10, got %ld\n", pt.x);
ok(pt.y == 20, "expected 20, got %ld\n", pt.y);
DragFinish(hDrop);
return 0;
}
@ -803,13 +803,13 @@ static DWORD WINAPI drop_window_therad(void *arg)
param->hwnd = CreateWindowA("drop test", NULL, 0, 0, 0, 0, 0,
NULL, 0, NULL, 0);
ok(param->hwnd != NULL, "CreateWindow failed: %d\n", GetLastError());
ok(param->hwnd != NULL, "CreateWindow failed: %ld\n", GetLastError());
memset(&info, 0, sizeof(info));
info.cbSize = sizeof(info);
r = GetWindowInfo(param->hwnd, &info);
ok(r, "got %d\n", r);
ok(!(info.dwExStyle & WS_EX_ACCEPTFILES), "got %08x\n", info.dwExStyle);
ok(!(info.dwExStyle & WS_EX_ACCEPTFILES), "got %08lx\n", info.dwExStyle);
DragAcceptFiles(param->hwnd, TRUE);
@ -817,7 +817,7 @@ static DWORD WINAPI drop_window_therad(void *arg)
info.cbSize = sizeof(info);
r = GetWindowInfo(param->hwnd, &info);
ok(r, "got %d\n", r);
ok((info.dwExStyle & WS_EX_ACCEPTFILES), "got %08x\n", info.dwExStyle);
ok((info.dwExStyle & WS_EX_ACCEPTFILES), "got %08lx\n", info.dwExStyle);
SetEvent(param->ready);
@ -849,7 +849,7 @@ static void test_DragQueryFile(BOOL non_client_flag)
hThread = CreateThread(NULL, 0, drop_window_therad, &param, 0, NULL);
rc = WaitForSingleObject(param.ready, 5000);
ok(rc == WAIT_OBJECT_0, "got %u\n", rc);
ok(rc == WAIT_OBJECT_0, "got %lu\n", rc);
hDrop = GlobalAlloc(GHND, sizeof(DROPFILES) + (strlen(DROPTEST_FILENAME) + 2) * sizeof(WCHAR));
pDrop = GlobalLock(hDrop);
@ -873,7 +873,7 @@ static void test_DragQueryFile(BOOL non_client_flag)
ok(r, "got %d\n", r);
rc = WaitForSingleObject(hThread, 5000);
ok(rc == WAIT_OBJECT_0, "got %d\n", rc);
ok(rc == WAIT_OBJECT_0, "got %ld\n", rc);
CloseHandle(param.ready);
CloseHandle(hThread);
@ -904,14 +904,14 @@ static void test_SHCreateSessionKey(void)
hkey = (HKEY)0xdeadbeef;
hr = pSHCreateSessionKey(0, &hkey);
ok(hr == E_ACCESSDENIED, "got 0x%08x\n", hr);
ok(hr == E_ACCESSDENIED, "got 0x%08lx\n", hr);
ok(hkey == NULL, "got %p\n", hkey);
hr = pSHCreateSessionKey(KEY_READ, &hkey);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = pSHCreateSessionKey(KEY_READ, &hkey2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(hkey != hkey2, "got %p, %p\n", hkey, hkey2);
RegCloseKey(hkey);
@ -935,10 +935,10 @@ static void test_dragdrophelper(void)
HRESULT hr;
hr = CoCreateInstance(&CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER, &IID_IDropTargetHelper, (void **)&target);
ok(hr == S_OK, "Failed to create IDropTargetHelper, %#x\n", hr);
ok(hr == S_OK, "Failed to create IDropTargetHelper, %#lx\n", hr);
hr = IDropTargetHelper_QueryInterface(target, &IID_IDragSourceHelper, (void **)&dragsource);
ok(hr == S_OK, "QI failed, %#x\n", hr);
ok(hr == S_OK, "QI failed, %#lx\n", hr);
IDragSourceHelper_Release(dragsource);
IDropTargetHelper_Release(target);
@ -951,7 +951,7 @@ START_TEST(shellole)
init();
hr = CoInitialize(NULL);
ok(hr == S_OK, "CoInitialize failed (0x%08x)\n", hr);
ok(hr == S_OK, "CoInitialize failed (0x%08lx)\n", hr);
if (hr != S_OK)
return;

View file

@ -217,7 +217,7 @@ static void loadShell32(void)
{
shellVersion.cbSize = sizeof(shellVersion);
pDllGetVersion(&shellVersion);
trace("shell32 version is %d.%d\n",
trace("shell32 version is %ld.%ld\n",
shellVersion.dwMajorVersion, shellVersion.dwMinorVersion);
}
#undef GET_PROC
@ -1327,12 +1327,12 @@ static void test_parameters(void)
/* check a bogus CSIDL: */
pidl = NULL;
hr = SHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl);
ok(hr == E_INVALIDARG, "got 0x%08x, expected E_INVALIDARG\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx, expected E_INVALIDARG\n", hr);
/* check a bogus user token: */
pidl = NULL;
hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, (HANDLE)2, 0, &pidl);
ok(hr == E_FAIL || hr == E_HANDLE, "got 0x%08x, expected E_FAIL or E_HANDLE\n", hr);
ok(hr == E_FAIL || hr == E_HANDLE, "got 0x%08lx, expected E_FAIL or E_HANDLE\n", hr);
/* a NULL pidl pointer crashes, so don't test it */
@ -1343,7 +1343,7 @@ static void test_parameters(void)
SHGetSpecialFolderLocation(NULL, 0, NULL);
hr = pSHGetSpecialFolderLocation(NULL, 0xeeee, &pidl);
ok(hr == E_INVALIDARG, "got returned 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got returned 0x%08lx\n", hr);
}
if (pSHGetFolderPathA)
@ -1351,10 +1351,10 @@ static void test_parameters(void)
/* expect 2's a bogus handle, especially since we didn't open it */
hr = pSHGetFolderPathA(NULL, CSIDL_DESKTOP, (HANDLE)2, SHGFP_TYPE_DEFAULT, path);
ok(hr == E_FAIL || hr == E_HANDLE || /* Vista and 2k8 */
broken(hr == S_OK), /* W2k and Me */ "got 0x%08x, expected E_FAIL\n", hr);
broken(hr == S_OK), /* W2k and Me */ "got 0x%08lx, expected E_FAIL\n", hr);
hr = pSHGetFolderPathA(NULL, 0xeeee, NULL, SHGFP_TYPE_DEFAULT, path);
ok(hr == E_INVALIDARG, "got 0x%08x, expected E_INVALIDARG\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx, expected E_INVALIDARG\n", hr);
}
if (pSHGetSpecialFolderPathA)
@ -1437,7 +1437,7 @@ static void test_SHGetFolderPath(BOOL optional, int folder)
hr = pSHGetFolderPathA(NULL, folder, NULL, SHGFP_TYPE_CURRENT, path);
ok(hr == S_OK || optional,
"SHGetFolderPathA(NULL, %s, NULL, SHGFP_TYPE_CURRENT, path) failed: 0x%08x\n", getFolderName(folder), hr);
"SHGetFolderPathA(NULL, %s, NULL, SHGFP_TYPE_CURRENT, path) failed: 0x%08lx\n", getFolderName(folder), hr);
}
static void test_SHGetSpecialFolderPath(BOOL optional, int folder)
@ -1716,12 +1716,12 @@ static void doChild(const char *arg)
/* test some failure cases first: */
hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES, NULL, SHGFP_TYPE_CURRENT, path);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"SHGetFolderPath returned 0x%08x, expected 0x80070002\n", hr);
"SHGetFolderPath returned 0x%08lx, expected 0x80070002\n", hr);
pidl = NULL;
hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, NULL, 0, &pidl);
ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"SHGetFolderLocation returned 0x%08x\n", hr);
"SHGetFolderLocation returned 0x%08lx\n", hr);
ok(!pSHGetSpecialFolderPathA(NULL, path, CSIDL_FAVORITES, FALSE),
"SHGetSpecialFolderPath succeeded, expected failure\n");
@ -1729,12 +1729,12 @@ static void doChild(const char *arg)
pidl = NULL;
hr = pSHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidl);
ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"SHGetFolderLocation returned 0x%08x\n", hr);
"SHGetFolderLocation returned 0x%08lx\n", hr);
/* now test success: */
hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_CURRENT, path);
ok (hr == S_OK, "got 0x%08x\n", hr);
ok (hr == S_OK, "got 0x%08lx\n", hr);
if (hr == S_OK)
{
BOOL ret;
@ -1744,7 +1744,7 @@ static void doChild(const char *arg)
ok(!ret, "expected failure with ERROR_ALREADY_EXISTS\n");
if (!ret)
ok(GetLastError() == ERROR_ALREADY_EXISTS,
"got %d, expected ERROR_ALREADY_EXISTS\n", GetLastError());
"got %ld, expected ERROR_ALREADY_EXISTS\n", GetLastError());
p = path + strlen(path);
strcpy(p, "\\desktop.ini");
@ -1752,7 +1752,7 @@ static void doChild(const char *arg)
*p = 0;
SetFileAttributesA( path, FILE_ATTRIBUTE_NORMAL );
ret = RemoveDirectoryA(path);
ok( ret, "failed to remove %s error %u\n", path, GetLastError() );
ok( ret, "failed to remove %s error %lu\n", path, GetLastError() );
}
}
else if (arg[0] == '2')
@ -1761,7 +1761,7 @@ static void doChild(const char *arg)
original value of CSIDL_FAVORITES is restored. */
hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_CURRENT, path);
ok(hr == S_OK, "SHGetFolderPath failed: 0x%08x\n", hr);
ok(hr == S_OK, "SHGetFolderPath failed: 0x%08lx\n", hr);
}
}
@ -1861,17 +1861,17 @@ static void test_SHGetFolderPathEx(void)
if (0) { /* crashes */
hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, 0, NULL, NULL);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08lx\n", hr);
}
/* non-existent folder id */
path = (void *)0xdeadbeef;
hr = pSHGetKnownFolderPath(&IID_IOleObject, 0, NULL, &path);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08lx\n", hr);
ok(path == NULL, "got %p\n", path);
path = NULL;
hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, KF_FLAG_DEFAULT_PATH, NULL, &path);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path != NULL, "expected path != NULL\n");
CoTaskMemFree(path);
@ -1886,40 +1886,40 @@ if (0) { /* crashes */
ok(path == NULL, "expected path == NULL\n");
continue;
}
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path != NULL, "expected path != NULL\n");
path2 = NULL;
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_SIMPLE_IDLIST, NULL, &path2);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path2 != NULL, "expected path != NULL\n");
ok(!lstrcmpiW(path, path2), "expected equal paths: %s, %s\n", wine_dbgstr_w(path), wine_dbgstr_w(path2));
CoTaskMemFree(path2);
path2 = NULL;
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DONT_UNEXPAND, NULL, &path2);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path2 != NULL, "expected path != NULL\n");
ok(!lstrcmpiW(path, path2), "expected equal paths: %s, %s\n", wine_dbgstr_w(path), wine_dbgstr_w(path2));
CoTaskMemFree(path2);
path2 = NULL;
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_SIMPLE_IDLIST | KF_FLAG_DONT_UNEXPAND, NULL, &path2);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path2 != NULL, "expected path != NULL\n");
ok(!lstrcmpiW(path, path2), "expected equal paths: %s, %s\n", wine_dbgstr_w(path), wine_dbgstr_w(path2));
CoTaskMemFree(path2);
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DEFAULT_PATH, NULL, &path2);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path2 != NULL, "expected path != NULL\n");
CoTaskMemFree(path2);
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_NOT_PARENT_RELATIVE, NULL, &path2);
ok(hr == E_INVALIDARG, "expected S_OK, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "expected S_OK, got 0x%08lx\n", hr);
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DEFAULT_PATH | KF_FLAG_NOT_PARENT_RELATIVE, NULL, &path2);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path2 != NULL, "expected path != NULL\n");
CoTaskMemFree(path2);
@ -1928,50 +1928,50 @@ if (0) { /* crashes */
path = NULL;
hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, 0, NULL, &path);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path != NULL, "expected path != NULL\n");
hr = pSHGetFolderPathEx(&FOLDERID_Desktop, 0, NULL, buffer, MAX_PATH);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(!lstrcmpiW(path, buffer), "expected equal paths\n");
len = lstrlenW(buffer);
CoTaskMemFree(path);
hr = pSHGetFolderPathEx(&FOLDERID_Desktop, 0, NULL, buffer, 0);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08lx\n", hr);
if (0) { /* crashes */
hr = pSHGetFolderPathEx(&FOLDERID_Desktop, 0, NULL, NULL, len + 1);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08lx\n", hr);
hr = pSHGetFolderPathEx(NULL, 0, NULL, buffer, MAX_PATH);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08lx\n", hr);
}
hr = pSHGetFolderPathEx(&FOLDERID_Desktop, 0, NULL, buffer, len);
ok(hr == E_NOT_SUFFICIENT_BUFFER, "expected E_NOT_SUFFICIENT_BUFFER, got 0x%08x\n", hr);
ok(hr == E_NOT_SUFFICIENT_BUFFER, "expected E_NOT_SUFFICIENT_BUFFER, got 0x%08lx\n", hr);
hr = pSHGetFolderPathEx(&FOLDERID_Desktop, 0, NULL, buffer, len + 1);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
path = NULL;
hr = pSHGetKnownFolderPath(&FOLDERID_ProgramFilesX64, 0, NULL, &path);
#ifdef _WIN64
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(path != NULL, "path not set\n");
CoTaskMemFree(path);
#else
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08lx\n", hr);
ok(path == NULL, "path set\n");
#endif
path = NULL;
hr = pSHGetKnownFolderPath(&FOLDERID_ProgramFilesCommonX64, 0, NULL, &path);
#ifdef _WIN64
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr);
ok(path != NULL, "path not set\n");
CoTaskMemFree(path);
#else
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08lx\n", hr);
ok(path == NULL, "path set\n");
#endif
}
@ -2063,7 +2063,7 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
ok_(__FILE__, known_folder->line)(known_folder->attributes == kfd.dwAttributes ||
(known_folder->csidl & WINE_ATTRIBUTES_OPTIONAL && kfd.dwAttributes == 0),
"invalid known folder attributes for %s: 0x%08x expected, but 0x%08x retrieved\n", known_folder->sFolderId, known_folder->attributes, kfd.dwAttributes);
"invalid known folder attributes for %s: 0x%08lx expected, but 0x%08lx retrieved\n", known_folder->sFolderId, known_folder->attributes, kfd.dwAttributes);
ok_(__FILE__, known_folder->line)(!(kfd.kfdFlags & (~known_folder->definitionFlags)), "invalid known folder flags for %s: 0x%08x expected, but 0x%08x retrieved\n", known_folder->sFolderId, known_folder->definitionFlags, kfd.kfdFlags);
@ -2073,7 +2073,7 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
{
ikf_path = NULL;
hr = IKnownFolder_GetPath(folder, KF_FLAG_DEFAULT, &ikf_path);
ok_(__FILE__, known_folder->line)(hr == S_OK, "IKnownFolder::GetPath failed: 0x%08x\n", hr);
ok_(__FILE__, known_folder->line)(hr == S_OK, "IKnownFolder::GetPath failed: 0x%08lx\n", hr);
ok_(__FILE__, known_folder->line)(ikf_path != NULL, "SHGetKnownFolderPath gave NULL path\n");
/* IKnownFolder::GetPath and SHGetKnownFolderPath should be the same */
@ -2088,13 +2088,13 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
debugstr_w(kfd.pszRelativePath), debugstr_w(ikf_path));
hr = IKnownFolderManager_GetFolder(mgr, &kfd.fidParent, &kf_parent);
ok_(__FILE__, known_folder->line)(hr == S_OK, "IKnownFolderManager::GetFolder(parent) failed: 0x%08x\n", hr);
ok_(__FILE__, known_folder->line)(hr == S_OK, "IKnownFolderManager::GetFolder(parent) failed: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
ikf_parent_path = NULL;
hr = IKnownFolder_GetPath(kf_parent, KF_FLAG_DEFAULT, &ikf_parent_path);
ok_(__FILE__, known_folder->line)(hr == S_OK, "IKnownFolder::GetPath(parent) failed: 0x%08x\n", hr);
ok_(__FILE__, known_folder->line)(hr == S_OK, "IKnownFolder::GetPath(parent) failed: 0x%08lx\n", hr);
/* Parent path + pszRelativePath should give the full path */
ok_(__FILE__, known_folder->line)(memcmp(ikf_parent_path, ikf_path, lstrlenW(ikf_parent_path) * sizeof(WCHAR)) == 0,
@ -2151,7 +2151,7 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
trace(" localized name: %s\n", wine_dbgstr_w(kfd.pszLocalizedName));
trace(" icon: %s\n", wine_dbgstr_w(kfd.pszIcon));
trace(" security: %s\n", wine_dbgstr_w(kfd.pszSecurity));
trace(" attributes: 0x%08x\n", kfd.dwAttributes);
trace(" attributes: 0x%08lx\n", kfd.dwAttributes);
trace(" flags: 0x%08x\n", kfd.kfdFlags);
trace(" type: %s\n", wine_dbgstr_guid(&kfd.ftidType));
FreeKnownFolderDefinitionFields(&kfd);
@ -2214,96 +2214,96 @@ static void test_knownFolders(void)
{
IUnknown *unk;
ok(hr == S_OK, "failed to create KnownFolderManager instance: 0x%08x\n", hr);
ok(hr == S_OK, "failed to create KnownFolderManager instance: 0x%08lx\n", hr);
hr = IKnownFolderManager_QueryInterface(mgr, &IID_IMarshal, (void**)&unk);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IKnownFolderManager_FolderIdFromCsidl(mgr, CSIDL_WINDOWS, &folderId);
ok(hr == S_OK, "failed to convert CSIDL to KNOWNFOLDERID: 0x%08x\n", hr);
ok(hr == S_OK, "failed to convert CSIDL to KNOWNFOLDERID: 0x%08lx\n", hr);
ok(IsEqualGUID(&folderId, &FOLDERID_Windows)==TRUE, "invalid KNOWNFOLDERID returned\n");
hr = IKnownFolderManager_FolderIdToCsidl(mgr, &FOLDERID_Windows, &csidl);
ok(hr == S_OK, "failed to convert CSIDL to KNOWNFOLDERID: 0x%08x\n", hr);
ok(hr == S_OK, "failed to convert CSIDL to KNOWNFOLDERID: 0x%08lx\n", hr);
ok(csidl == CSIDL_WINDOWS, "invalid CSIDL returned\n");
hr = IKnownFolderManager_GetFolder(mgr, &FOLDERID_Windows, &folder);
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IKnownFolder_QueryInterface(folder, &IID_IMarshal, (void**)&unk);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IKnownFolder_GetCategory(folder, &cat);
ok(hr == S_OK, "failed to get folder category: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get folder category: 0x%08lx\n", hr);
ok(cat==KF_CATEGORY_FIXED, "invalid folder category: %d\n", cat);
hr = IKnownFolder_GetId(folder, &folderId);
ok(hr == S_OK, "failed to get folder id: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get folder id: 0x%08lx\n", hr);
ok(IsEqualGUID(&folderId, &FOLDERID_Windows)==TRUE, "invalid KNOWNFOLDERID returned\n");
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get path from known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get path from known folder: 0x%08lx\n", hr);
ok(lstrcmpiW(sWinDir, folderPath)==0, "invalid path returned: \"%s\", expected: \"%s\"\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sWinDir));
CoTaskMemFree(folderPath);
hr = IKnownFolder_GetRedirectionCapabilities(folder, &redirectionCapabilities);
ok(hr == S_OK, "failed to get redirection capabilities: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get redirection capabilities: 0x%08lx\n", hr);
todo_wine
ok(redirectionCapabilities==0, "invalid redirection capabilities returned: %d\n", redirectionCapabilities);
hr = IKnownFolder_SetPath(folder, 0, sWinDir);
todo_wine
ok(hr == E_INVALIDARG, "unexpected value from SetPath: 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "unexpected value from SetPath: 0x%08lx\n", hr);
hr = IKnownFolder_GetFolderDefinition(folder, &kfDefinition);
ok(hr == S_OK, "failed to get folder definition: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get folder definition: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
ok(kfDefinition.category==KF_CATEGORY_FIXED, "invalid folder category: 0x%08x\n", kfDefinition.category);
ok(lstrcmpW(kfDefinition.pszName, sWindows)==0, "invalid folder name: %s\n", wine_dbgstr_w(kfDefinition.pszName));
ok(kfDefinition.dwAttributes==0, "invalid folder attributes: %d\n", kfDefinition.dwAttributes);
ok(kfDefinition.dwAttributes==0, "invalid folder attributes: %ld\n", kfDefinition.dwAttributes);
FreeKnownFolderDefinitionFields(&kfDefinition);
}
hr = IKnownFolder_Release(folder);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08lx\n", hr);
}
hr = IKnownFolderManager_GetFolderByName(mgr, sWindows, &folder);
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IKnownFolder_GetId(folder, &folderId);
ok(hr == S_OK, "failed to get folder id: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get folder id: 0x%08lx\n", hr);
ok(IsEqualGUID(&folderId, &FOLDERID_Windows)==TRUE, "invalid KNOWNFOLDERID returned\n");
hr = IKnownFolder_Release(folder);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08lx\n", hr);
}
hr = IKnownFolderManager_GetFolderByName(mgr, sWindows2, &folder);
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IKnownFolder_GetId(folder, &folderId);
ok(hr == S_OK, "failed to get folder id: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get folder id: 0x%08lx\n", hr);
ok(IsEqualGUID(&folderId, &FOLDERID_Windows)==TRUE, "invalid KNOWNFOLDERID returned\n");
hr = IKnownFolder_Release(folder);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08lx\n", hr);
}
folder = (IKnownFolder *)0xdeadbeef;
hr = IKnownFolderManager_GetFolderByName(mgr, sNoSuch, &folder);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08lx\n", hr);
ok(folder == NULL, "got %p\n", folder);
for(i=0; i < ARRAY_SIZE(known_folder_found); ++i)
known_folder_found[i] = FALSE;
hr = IKnownFolderManager_GetFolderIds(mgr, &folders, &nCount);
ok(hr == S_OK, "failed to get known folders: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folders: 0x%08lx\n", hr);
for(i=0;i<nCount;++i)
check_known_folder(mgr, &folders[i]);
@ -2335,24 +2335,24 @@ static void test_knownFolders(void)
win_skip("No permissions required to register custom known folder\n");
else
{
ok(hr == S_OK, "failed to register known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to register known folder: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IKnownFolderManager_GetFolder(mgr, &newFolderId, &folder);
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IKnownFolder_GetCategory(folder, &cat);
ok(hr == S_OK, "failed to get folder category: hr=0x%0x\n", hr);
ok(hr == S_OK, "failed to get folder category: hr=0x%0lx\n", hr);
ok(cat == KF_CATEGORY_PERUSER, "invalid category returned: %d, while %d (KF_CATEGORY_PERUSER) expected\n", cat, KF_CATEGORY_PERUSER);
hr = IKnownFolder_GetId(folder, &folderId);
ok(hr == S_OK, "failed to get folder id: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get folder id: 0x%08lx\n", hr);
ok(IsEqualGUID(&folderId, &newFolderId)==TRUE, "invalid KNOWNFOLDERID returned\n");
/* current path should be Temp\Example */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get path from known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get path from known folder: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExamplePath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExamplePath));
CoTaskMemFree(folderPath);
@ -2368,45 +2368,45 @@ static void test_knownFolders(void)
kfSubDefinition.fidParent = newFolderId;
hr = IKnownFolderManager_RegisterFolder(mgr, &subFolderId, &kfSubDefinition);
ok(hr == S_OK, "failed to register known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to register known folder: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = IKnownFolderManager_GetFolder(mgr, &subFolderId, &subFolder);
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
/* check sub folder path */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolderPath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolderPath));
CoTaskMemFree(folderPath);
/* try to redirect Example to Temp\Example2 */
hr = IKnownFolderManager_Redirect(mgr, &newFolderId, NULL, 0, sExample2Path, 0, NULL, &errorMsg);
ok(hr == S_OK, "failed to redirect known folder: 0x%08x, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
ok(hr == S_OK, "failed to redirect known folder: 0x%08lx, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExample2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExample2Path));
CoTaskMemFree(folderPath);
/* verify sub folder - it should fail now, as we redirected its parent folder, but we have no sub folder in new location */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "unexpected value from GetPath(): 0x%08x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "unexpected value from GetPath(): 0x%08lx\n", hr);
ok(folderPath==NULL, "invalid known folder path retrieved: \"%s\" when NULL pointer was expected\n", wine_dbgstr_w(folderPath));
CoTaskMemFree(folderPath);
/* set Example path to original. Using SetPath() is valid here, as it also uses redirection internally */
hr = IKnownFolder_SetPath(folder, 0, sExamplePath);
ok(hr == S_OK, "SetPath() failed: 0x%08x\n", hr);
ok(hr == S_OK, "SetPath() failed: 0x%08lx\n", hr);
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExamplePath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExamplePath));
CoTaskMemFree(folderPath);
@ -2417,11 +2417,11 @@ static void test_knownFolders(void)
/* again perform that same redirection */
hr = IKnownFolderManager_Redirect(mgr, &newFolderId, NULL, 0, sExample2Path, 0, NULL, &errorMsg);
ok(hr == S_OK, "failed to redirect known folder: 0x%08x, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
ok(hr == S_OK, "failed to redirect known folder: 0x%08lx, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
/* verify sub folder. It should succeed now, as the required sub folder exists */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolder2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolder2Path));
CoTaskMemFree(folderPath);
@ -2431,7 +2431,7 @@ static void test_knownFolders(void)
/* verify subfolder. It still succeeds, so Windows does not check folder presence each time */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
todo_wine
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
todo_wine
ok(lstrcmpiW(folderPath, sSubFolder2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolder2Path));
CoTaskMemFree(folderPath);
@ -2439,17 +2439,17 @@ static void test_knownFolders(void)
/* set Example path to original */
hr = IKnownFolder_SetPath(folder, 0, sExamplePath);
ok(hr == S_OK, "SetPath() failed: 0x%08x\n", hr);
ok(hr == S_OK, "SetPath() failed: 0x%08lx\n", hr);
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExamplePath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExamplePath));
CoTaskMemFree(folderPath);
/* verify sub folder */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolderPath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolderPath));
CoTaskMemFree(folderPath);
@ -2460,17 +2460,17 @@ static void test_knownFolders(void)
/* do that same redirection, but try to exclude sub-folder */
hr = IKnownFolderManager_Redirect(mgr, &newFolderId, NULL, 0, sExample2Path, 1, &subFolderId, &errorMsg);
ok(hr == S_OK, "failed to redirect known folder: 0x%08x, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
ok(hr == S_OK, "failed to redirect known folder: 0x%08lx, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExample2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExample2Path));
CoTaskMemFree(folderPath);
/* verify sub folder. Unexpectedly, this path was also changed. So, exclusion seems to be ignored (Windows bug)? This test however will let us know, if this behavior is changed */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolder2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolder2Path));
CoTaskMemFree(folderPath);
@ -2480,34 +2480,34 @@ static void test_knownFolders(void)
/* set Example path to original */
hr = IKnownFolder_SetPath(folder, 0, sExamplePath);
ok(hr == S_OK, "SetPath() failed: 0x%08x\n", hr);
ok(hr == S_OK, "SetPath() failed: 0x%08lx\n", hr);
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExamplePath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExamplePath));
CoTaskMemFree(folderPath);
/* verify sub folder */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolderPath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolderPath));
CoTaskMemFree(folderPath);
/* do that same redirection again, but set it to copy content. It should also copy the sub folder, so checking it would succeed now */
hr = IKnownFolderManager_Redirect(mgr, &newFolderId, NULL, KF_REDIRECT_COPY_CONTENTS, sExample2Path, 0, NULL, &errorMsg);
ok(hr == S_OK, "failed to redirect known folder: 0x%08x, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
ok(hr == S_OK, "failed to redirect known folder: 0x%08lx, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExample2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExample2Path));
CoTaskMemFree(folderPath);
/* verify sub folder */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolder2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolder2Path));
CoTaskMemFree(folderPath);
@ -2517,55 +2517,55 @@ static void test_knownFolders(void)
/* set Example path to original */
hr = IKnownFolder_SetPath(folder, 0, sExamplePath);
ok(hr == S_OK, "SetPath() failed: 0x%08x\n", hr);
ok(hr == S_OK, "SetPath() failed: 0x%08lx\n", hr);
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExamplePath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExamplePath));
CoTaskMemFree(folderPath);
/* verify sub folder */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolderPath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolderPath));
CoTaskMemFree(folderPath);
/* redirect again, set it to copy content and remove originals */
hr = IKnownFolderManager_Redirect(mgr, &newFolderId, NULL, KF_REDIRECT_COPY_CONTENTS | KF_REDIRECT_DEL_SOURCE_CONTENTS, sExample2Path, 0, NULL, &errorMsg);
ok(hr == S_OK, "failed to redirect known folder: 0x%08x, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
ok(hr == S_OK, "failed to redirect known folder: 0x%08lx, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExample2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExample2Path));
CoTaskMemFree(folderPath);
/* verify sub folder */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolder2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolder2Path));
CoTaskMemFree(folderPath);
/* check if original directory was really removed */
dwAttributes = GetFileAttributesW(sExamplePath);
ok(dwAttributes==INVALID_FILE_ATTRIBUTES, "directory should not exist, but has attributes: 0x%08x\n", dwAttributes );
ok(dwAttributes==INVALID_FILE_ATTRIBUTES, "directory should not exist, but has attributes: 0x%08lx\n", dwAttributes );
/* redirect (with copy) to original path */
hr = IKnownFolderManager_Redirect(mgr, &newFolderId, NULL, KF_REDIRECT_COPY_CONTENTS, sExamplePath, 0, NULL, &errorMsg);
ok(hr == S_OK, "failed to redirect known folder: 0x%08x, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
ok(hr == S_OK, "failed to redirect known folder: 0x%08lx, errorMsg: %s\n", hr, wine_dbgstr_w(errorMsg));
/* verify */
hr = IKnownFolder_GetPath(folder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sExamplePath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExamplePath));
CoTaskMemFree(folderPath);
/* verify sub folder */
hr = IKnownFolder_GetPath(subFolder, 0, &folderPath);
ok(hr == S_OK, "failed to get known folder path: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder path: 0x%08lx\n", hr);
ok(lstrcmpiW(folderPath, sSubFolderPath)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sSubFolderPath));
CoTaskMemFree(folderPath);
@ -2578,63 +2578,63 @@ static void test_knownFolders(void)
/* try to get current known folder path */
hr = pSHGetKnownFolderPath(&newFolderId, 0, NULL, &folderPath);
todo_wine
ok(hr==S_OK, "cannot get known folder path: hr=0x%0x\n", hr);
ok(hr==S_OK, "cannot get known folder path: hr=0x%0lx\n", hr);
todo_wine
ok(lstrcmpW(folderPath, sExamplePath)==0, "invalid path returned: %s\n", wine_dbgstr_w(folderPath));
/* set it to new value */
hr = pSHSetKnownFolderPath(&newFolderId, 0, NULL, sExample2Path);
todo_wine
ok(hr==S_OK, "cannot set known folder path: hr=0x%0x\n", hr);
ok(hr==S_OK, "cannot set known folder path: hr=0x%0lx\n", hr);
/* check if it changed */
hr = pSHGetKnownFolderPath(&newFolderId, 0, NULL, &folderPath);
todo_wine
ok(hr==S_OK, "cannot get known folder path: hr=0x%0x\n", hr);
ok(hr==S_OK, "cannot get known folder path: hr=0x%0lx\n", hr);
todo_wine
ok(lstrcmpW(folderPath, sExample2Path)==0, "invalid path returned: %s\n", wine_dbgstr_w(folderPath));
/* set it back */
hr = pSHSetKnownFolderPath(&newFolderId, 0, NULL, sExamplePath);
todo_wine
ok(hr==S_OK, "cannot set known folder path: hr=0x%0x\n", hr);
ok(hr==S_OK, "cannot set known folder path: hr=0x%0lx\n", hr);
}
IKnownFolder_Release(subFolder);
}
hr = IKnownFolderManager_UnregisterFolder(mgr, &subFolderId);
ok(hr == S_OK, "failed to unregister folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to unregister folder: 0x%08lx\n", hr);
}
FreeKnownFolderDefinitionFields(&kfSubDefinition);
hr = IKnownFolder_Release(folder);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08lx\n", hr);
/* update the folder */
CoTaskMemFree(kfDefinition.pszName);
kfDefinition.pszName = CoTaskMemAlloc(sizeof(sExample2));
lstrcpyW(kfDefinition.pszName, sExample2);
hr = IKnownFolderManager_RegisterFolder(mgr, &newFolderId, &kfDefinition);
ok(hr == S_OK, "failed to re-register known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to re-register known folder: 0x%08lx\n", hr);
hr = IKnownFolderManager_GetFolder(mgr, &newFolderId, &folder);
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr);
hr = IKnownFolder_GetFolderDefinition(folder, &kfSubDefinition);
ok(hr == S_OK, "failed to get folder definition: 0x%08x\n", hr);
ok(hr == S_OK, "failed to get folder definition: 0x%08lx\n", hr);
ok(!memcmp(kfDefinition.pszName, kfSubDefinition.pszName, sizeof(sExample2)),
"Got wrong updated name: %s\n", wine_dbgstr_w(kfSubDefinition.pszName));
FreeKnownFolderDefinitionFields(&kfSubDefinition);
hr = IKnownFolder_Release(folder);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08lx\n", hr);
}
hr = IKnownFolderManager_UnregisterFolder(mgr, &newFolderId);
ok(hr == S_OK, "failed to unregister folder: 0x%08x\n", hr);
ok(hr == S_OK, "failed to unregister folder: 0x%08lx\n", hr);
}
}
FreeKnownFolderDefinitionFields(&kfDefinition);
@ -2645,7 +2645,7 @@ static void test_knownFolders(void)
RemoveDirectoryW(sExample2Path);
hr = IKnownFolderManager_Release(mgr);
ok(hr == S_OK, "failed to release KnownFolderManager instance: 0x%08x\n", hr);
ok(hr == S_OK, "failed to release KnownFolderManager instance: 0x%08lx\n", hr);
}
CoUninitialize();
}
@ -2695,14 +2695,14 @@ static void test_DoEnvironmentSubst(void)
return;
}
ok(HIWORD(res) && (LOWORD(res) == res2),
"got %d/%d (expected TRUE/%d)\n", HIWORD(res), LOWORD(res), res2);
"got %d/%d (expected TRUE/%ld)\n", HIWORD(res), LOWORD(res), res2);
ok(!lstrcmpA(bufferA, expectedA),
"got %s (expected %s)\n", bufferA, expectedA);
res2 = ExpandEnvironmentStringsW(bufferW, expectedW, MAX_PATH);
res = DoEnvironmentSubstW(bufferW, MAX_PATH);
ok(HIWORD(res) && (LOWORD(res) == res2),
"got %d/%d (expected TRUE/%d)\n", HIWORD(res), LOWORD(res), res2);
"got %d/%d (expected TRUE/%ld)\n", HIWORD(res), LOWORD(res), res2);
ok(!lstrcmpW(bufferW, expectedW),
"got %s (expected %s)\n", wine_dbgstr_w(bufferW), wine_dbgstr_w(expectedW));
winetest_pop_context();
@ -2720,14 +2720,14 @@ static void test_DoEnvironmentSubst(void)
res2 = ExpandEnvironmentStringsA(bufferA, expectedA, MAX_PATH);
res = DoEnvironmentSubstA(bufferA, len + 1);
ok(HIWORD(res) && (LOWORD(res) == res2),
"+1: got %d/%d (expected TRUE/%d)\n", HIWORD(res), LOWORD(res), res2);
"+1: got %d/%d (expected TRUE/%ld)\n", HIWORD(res), LOWORD(res), res2);
ok(!lstrcmpA(bufferA, expectedA),
"+1: got %s (expected %s)\n", bufferA, expectedA);
res2 = ExpandEnvironmentStringsW(bufferW, expectedW, MAX_PATH);
res = DoEnvironmentSubstW(bufferW, len + 1);
ok(HIWORD(res) && (LOWORD(res) == res2),
"+1: got %d/%d (expected TRUE/%d)\n", HIWORD(res), LOWORD(res), res2);
"+1: got %d/%d (expected TRUE/%ld)\n", HIWORD(res), LOWORD(res), res2);
ok(!lstrcmpW(bufferW, expectedW),
"+1: got %s (expected %s)\n", wine_dbgstr_w(bufferW), wine_dbgstr_w(expectedW));
@ -2741,7 +2741,7 @@ static void test_DoEnvironmentSubst(void)
/* ANSI version failed without an extra byte, as documented on msdn */
res = DoEnvironmentSubstA(bufferA, len);
ok(!HIWORD(res) && (LOWORD(res) == len),
" 0: got %d/%d (expected FALSE/%d)\n", HIWORD(res), LOWORD(res), len);
" 0: got %d/%d (expected FALSE/%ld)\n", HIWORD(res), LOWORD(res), len);
ok(!lstrcmpA(bufferA, names[i]),
" 0: got %s (expected %s)\n", bufferA, names[i]);
@ -2749,7 +2749,7 @@ static void test_DoEnvironmentSubst(void)
res2 = ExpandEnvironmentStringsW(bufferW, expectedW, MAX_PATH);
res = DoEnvironmentSubstW(bufferW, len);
ok(HIWORD(res) && (LOWORD(res) == res2),
" 0: got %d/%d (expected TRUE/%d)\n", HIWORD(res), LOWORD(res), res2);
" 0: got %d/%d (expected TRUE/%ld)\n", HIWORD(res), LOWORD(res), res2);
ok(!lstrcmpW(bufferW, expectedW),
" 0: got %s (expected %s)\n", wine_dbgstr_w(bufferW), wine_dbgstr_w(expectedW));
@ -2763,14 +2763,14 @@ static void test_DoEnvironmentSubst(void)
res = DoEnvironmentSubstA(bufferA, len - 1);
ok(!HIWORD(res) && (LOWORD(res) == (len - 1)),
"-1: got %d/%d (expected FALSE/%d)\n", HIWORD(res), LOWORD(res), len - 1);
"-1: got %d/%d (expected FALSE/%ld)\n", HIWORD(res), LOWORD(res), len - 1);
ok(!lstrcmpA(bufferA, names[i]),
"-1: got %s (expected %s)\n", bufferA, names[i]);
lstrcpyW(expectedW, bufferW);
res = DoEnvironmentSubstW(bufferW, len - 1);
ok(!HIWORD(res) && (LOWORD(res) == (len - 1)),
"-1: got %d/%d (expected FALSE/%d)\n", HIWORD(res), LOWORD(res), len - 1);
"-1: got %d/%d (expected FALSE/%ld)\n", HIWORD(res), LOWORD(res), len - 1);
ok(!lstrcmpW(bufferW, expectedW),
"-1: got %s (expected %s)\n", wine_dbgstr_w(bufferW), wine_dbgstr_w(expectedW));
@ -2785,13 +2785,13 @@ static void test_DoEnvironmentSubst(void)
res2 = lstrlenA(does_not_existA) + 1;
res = DoEnvironmentSubstA(bufferA, MAX_PATH);
ok(HIWORD(res) && (LOWORD(res) == res2),
"%d: got %d/%d (expected TRUE/%d)\n", i, HIWORD(res), LOWORD(res), res2);
"%d: got %d/%d (expected TRUE/%ld)\n", i, HIWORD(res), LOWORD(res), res2);
ok(!lstrcmpA(bufferA, does_not_existA),
"%d: got %s (expected %s)\n", i, bufferA, does_not_existA);
res = DoEnvironmentSubstW(bufferW, MAX_PATH);
ok(HIWORD(res) && (LOWORD(res) == res2),
"%d: got %d/%d (expected TRUE/%d)\n", i, HIWORD(res), LOWORD(res), res2);
"%d: got %d/%d (expected TRUE/%ld)\n", i, HIWORD(res), LOWORD(res), res2);
ok(!lstrcmpW(bufferW, does_not_existW),
"%d: got %s (expected %s)\n", i, wine_dbgstr_w(bufferW), wine_dbgstr_w(does_not_existW));
@ -2895,7 +2895,7 @@ static void test_SHGetKnownFolderIDList(void)
}
hr = pSHGetKnownFolderIDList(NULL, 0, NULL, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
if (0) { /* crashes on native */
pidl = (void*)0xdeadbeef;
@ -2904,36 +2904,36 @@ if (0) { /* crashes on native */
/* not a known folder */
pidl = (void*)0xdeadbeef;
hr = pSHGetKnownFolderIDList(&IID_IUnknown, 0, NULL, &pidl);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08lx\n", hr);
ok(pidl == NULL, "got %p\n", pidl);
hr = pSHGetKnownFolderIDList(&FOLDERID_Desktop, 0, NULL, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
pidl = (void*)0xdeadbeef;
hr = pSHGetKnownFolderIDList(&FOLDERID_Desktop, 0, NULL, &pidl);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08lx\n", hr);
ok(ILIsEmpty(pidl), "pidl should be empty.\n");
ok(pidl->mkid.cb == 0, "get wrong value: %d\n", pidl->mkid.cb);
ILFree(pidl);
pidl = (void*)0xdeadbeef;
hr = pSHGetKnownFolderIDList(&FOLDERID_Desktop, KF_FLAG_NO_ALIAS, NULL, &pidl);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08lx\n", hr);
todo_wine ok(!ILIsEmpty(pidl), "pidl should not be empty.\n");
todo_wine ok(pidl->mkid.cb == 20, "get wrong value: %d\n", pidl->mkid.cb);
ILFree(pidl);
pidl = (void*)0xdeadbeef;
hr = pSHGetKnownFolderIDList(&FOLDERID_Documents, 0, NULL, &pidl);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08lx\n", hr);
ok(!ILIsEmpty(pidl), "pidl should not be empty.\n");
ok(pidl->mkid.cb == 20, "get wrong value: %d\n", pidl->mkid.cb);
ILFree(pidl);
pidl = (void*)0xdeadbeef;
hr = pSHGetKnownFolderIDList(&FOLDERID_Documents, KF_FLAG_NO_ALIAS, NULL, &pidl);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr);
ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08lx\n", hr);
ok(!ILIsEmpty(pidl), "pidl should not be empty.\n");
ok(pidl->mkid.cb == 20, "get wrong value: %d\n", pidl->mkid.cb);
ILFree(pidl);
@ -3051,7 +3051,7 @@ static void test_PathResolve(void)
if (!tests[i].expected)
ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
broken(GetLastError() == ERROR_PATH_NOT_FOUND /* some win 8.1 & 10 */),
"expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
"expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
winetest_pop_context();
}

View file

@ -57,19 +57,19 @@ static void test_parse_for_entire_network(void)
DWORD expected_attr;
hr = SHGetDesktopFolder(&psfDesktop);
ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%x\n", hr);
ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%lx\n", hr);
hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, my_network_places_path, &eaten, &pidl, &attr);
ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr);
ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%lx\n", hr);
todo_wine
ok(eaten == 0xdeadbeef, "eaten should not have been set to %u\n", eaten);
ok(eaten == 0xdeadbeef, "eaten should not have been set to %lu\n", eaten);
expected_attr = SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK;
todo_wine
ok((attr == expected_attr) || /* Win9x, NT4 */
(attr == (expected_attr | SFGAO_STREAM)) || /* W2K */
(attr == (expected_attr | SFGAO_CANDELETE)) || /* XP, W2K3 */
(attr == (expected_attr | SFGAO_CANDELETE | SFGAO_NONENUMERATED)), /* Vista */
"Unexpected attributes : %08x\n", attr);
"Unexpected attributes : %08lx\n", attr);
ILFree(pidl);
@ -86,15 +86,15 @@ static void test_parse_for_entire_network(void)
win_skip("'EntireNetwork' is not available on Win9x, NT4 and Vista\n");
return;
}
ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr);
ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%lx\n", hr);
todo_wine
ok(eaten == 0xdeadbeef, "eaten should not have been set to %u\n", eaten);
ok(eaten == 0xdeadbeef, "eaten should not have been set to %lu\n", eaten);
expected_attr = SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_HASPROPSHEET|SFGAO_CANLINK;
todo_wine
ok(attr == expected_attr || /* winme, nt4 */
attr == (expected_attr | SFGAO_STREAM) || /* win2k */
attr == (expected_attr | SFGAO_STORAGEANCESTOR), /* others */
"attr should be 0x%x, not 0x%x\n", expected_attr, attr);
"attr should be 0x%lx, not 0x%lx\n", expected_attr, attr);
ILFree(pidl);
}
@ -113,18 +113,18 @@ static void test_parse_for_control_panel(void)
DWORD attr = ~0;
hr = SHGetDesktopFolder(&psfDesktop);
ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%x\n", hr);
ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%lx\n", hr);
hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, control_panel_path, &eaten, &pidl, &attr);
ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr);
todo_wine ok(eaten == 0xdeadbeef, "eaten should not have been set to %u\n", eaten);
ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%lx\n", hr);
todo_wine ok(eaten == 0xdeadbeef, "eaten should not have been set to %lu\n", eaten);
todo_wine
ok((attr == (SFGAO_CANLINK | SFGAO_FOLDER)) || /* Win9x, NT4 */
(attr == (SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_STREAM)) || /* W2K */
(attr == (SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER)) || /* W2K, XP, W2K3 */
(attr == (SFGAO_CANLINK | SFGAO_NONENUMERATED)) || /* Vista */
(attr == SFGAO_CANLINK), /* Vista, W2K8 */
"Unexpected attributes : %08x\n", attr);
"Unexpected attributes : %08lx\n", attr);
ILFree(pidl);
IShellFolder_Release(psfDesktop);
@ -160,14 +160,14 @@ if (0)
/* 5 columns defined */
hr = IShellFolder2_GetDetailsOf(folder, NULL, 6, &details);
ok(hr == E_NOTIMPL, "got 0x%08x\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx\n", hr);
hr = IShellFolder2_GetDefaultColumnState(folder, 6, &state);
ok(broken(hr == E_NOTIMPL) || hr == E_INVALIDARG /* Win7 */, "got 0x%08x\n", hr);
ok(broken(hr == E_NOTIMPL) || hr == E_INVALIDARG /* Win7 */, "got 0x%08lx\n", hr);
details.str.u.pOleStr = NULL;
hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details);
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W2K */, "got 0x%08x\n", hr);
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W2K */, "got 0x%08lx\n", hr);
if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr);
/* test every column if method is implemented */
@ -178,7 +178,7 @@ if (0)
for(i = 0; i < 6; i++)
{
hr = IShellFolder2_GetDetailsOf(folder, NULL, i, &details);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* all columns are left-aligned */
ok(details.fmt == LVCFMT_LEFT, "got 0x%x\n", details.fmt);
@ -187,33 +187,33 @@ if (0)
if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr);
hr = IShellFolder2_GetDefaultColumnState(folder, i, &state);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* all columns are string except document count */
if (i == 1)
ok(state == (SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT), "got 0x%x\n", state);
ok(state == (SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT), "got 0x%lx\n", state);
else
ok(state == (SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT), "got 0x%x\n", state);
ok(state == (SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT), "got 0x%lx\n", state);
}
}
/* default pidl */
hr = IShellFolder2_QueryInterface(folder, &IID_IPersistFolder2, (void**)&pf);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* not initialized */
pidl1 = (void*)0xdeadbeef;
hr = IPersistFolder2_GetCurFolder(pf, &pidl1);
ok(hr == S_FALSE, "got 0x%08x\n", hr);
ok(hr == S_FALSE, "got 0x%08lx\n", hr);
ok(pidl1 == NULL, "got %p\n", pidl1);
hr = SHGetSpecialFolderLocation(NULL, CSIDL_PRINTERS, &pidl2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IPersistFolder2_Initialize(pf, pidl2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IPersistFolder2_GetCurFolder(pf, &pidl1);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(ILIsEqual(pidl1, pidl2), "expected same PIDL\n");
IPersistFolder2_Release(pf);
@ -231,10 +231,10 @@ static void test_desktop_folder(void)
HRESULT hr;
hr = SHGetDesktopFolder(&psf);
ok(hr == S_OK, "Got %x\n", hr);
ok(hr == S_OK, "Got %lx\n", hr);
hr = IShellFolder_QueryInterface(psf, &IID_IShellFolder, NULL);
ok(hr == E_POINTER, "Got %x\n", hr);
ok(hr == E_POINTER, "Got %lx\n", hr);
IShellFolder_Release(psf);
}
@ -255,7 +255,7 @@ static void test_desktop_displaynameof(void)
UINT i;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%08x\n", hr);
ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%08lx\n", hr);
if (FAILED(hr)) return;
for (i = 0; i < ARRAY_SIZE(folders); i++)
@ -263,26 +263,26 @@ static void test_desktop_displaynameof(void)
WCHAR name1[MAX_PATH], name2[MAX_PATH];
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, folders[i], &eaten, &pidl, NULL);
ok(hr == S_OK, "IShellFolder::ParseDisplayName failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IShellFolder::ParseDisplayName failed with error 0x%08lx\n", hr);
if (FAILED(hr)) continue;
hr = IShellFolder_GetDisplayNameOf(desktop, pidl, SHGDN_INFOLDER, &strret);
ok(hr == S_OK, "IShellFolder::GetDisplayNameOf failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IShellFolder::GetDisplayNameOf failed with error 0x%08lx\n", hr);
hr = StrRetToBufW(&strret, pidl, name1, ARRAY_SIZE(name1));
ok(hr == S_OK, "StrRetToBuf failed with error 0x%08x\n", hr);
ok(hr == S_OK, "StrRetToBuf failed with error 0x%08lx\n", hr);
hr = IShellFolder_GetDisplayNameOf(desktop, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING | SHGDN_FORADDRESSBAR, &strret);
ok(hr == S_OK, "IShellFolder::GetDisplayNameOf failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IShellFolder::GetDisplayNameOf failed with error 0x%08lx\n", hr);
hr = StrRetToBufW(&strret, pidl, name2, ARRAY_SIZE(name2));
ok(hr == S_OK, "StrRetToBuf failed with error 0x%08x\n", hr);
ok(hr == S_OK, "StrRetToBuf failed with error 0x%08lx\n", hr);
ok(!lstrcmpW(name1, name2), "the display names are not equal: %s vs %s\n", wine_dbgstr_w(name1), wine_dbgstr_w(name2));
ok(name1[0] != ':' || name1[1] != ':', "display name is a GUID: %s\n", wine_dbgstr_w(name1));
hr = IShellFolder_GetDisplayNameOf(desktop, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &strret);
ok(hr == S_OK, "IShellFolder::GetDisplayNameOf failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IShellFolder::GetDisplayNameOf failed with error 0x%08lx\n", hr);
hr = StrRetToBufW(&strret, pidl, name1, ARRAY_SIZE(name1));
ok(hr == S_OK, "StrRetToBuf failed with error 0x%08x\n", hr);
ok(hr == S_OK, "StrRetToBuf failed with error 0x%08lx\n", hr);
ok(lstrcmpW(name1, name2), "the display names are equal: %s\n", wine_dbgstr_w(name1));
ok(name1[0] == ':' && name1[1] == ':', "display name is not a GUID: %s\n", wine_dbgstr_w(name1));

View file

@ -157,7 +157,7 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv,
DWORD size = 0;
if (winetest_debug > 2)
trace("dde_cb: %04x, %04x, %p, %p, %p, %p, %08lx, %08lx\n",
trace("dde_cb: %04x, %04x, %p, %p, %p, %p, %08Ix, %08Ix\n",
uType, uFmt, hConv, hsz1, hsz2, hData, dwData1, dwData2);
switch (uType)
@ -166,7 +166,7 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv,
if (!DdeCmpStringHandles(hsz1, hszTopic))
{
size = DdeQueryStringA(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI);
ok(size < MAX_PATH, "got size %d\n", size);
ok(size < MAX_PATH, "got size %ld\n", size);
assert(size < MAX_PATH);
return (HDDEDATA)TRUE;
}
@ -174,7 +174,7 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv,
case XTYP_EXECUTE:
size = DdeGetData(hData, (LPBYTE)ddeExec, MAX_PATH, 0);
ok(size < MAX_PATH, "got size %d\n", size);
ok(size < MAX_PATH, "got size %ld\n", size);
assert(size < MAX_PATH);
DdeFreeDataHandle(hData);
if (post_quit_on_execute)
@ -239,7 +239,7 @@ static void doChild(int argc, char** argv)
*buffer = '\0';
SetLastError(0);
GetEnvironmentVariableA("ShlexecVar", buffer, sizeof(buffer));
childPrintf(hFile, "ShlexecVarLE=%d\r\n", GetLastError());
childPrintf(hFile, "ShlexecVarLE=%ld\r\n", GetLastError());
childPrintf(hFile, "ShlexecVar=%s\r\n", encodeA(buffer));
map = OpenFileMappingA(FILE_MAP_READ, FALSE, "winetest_shlexec_dde_map");
@ -266,7 +266,7 @@ static void doChild(int argc, char** argv)
hszTopic = DdeCreateStringHandleA(ddeInst, shared_block, CP_WINANSI);
ok(hszTopic != NULL, "DdeCreateStringHandleA(%s) = NULL\n", shared_block);
hdde = DdeNameService(ddeInst, hszApplication, 0, DNS_REGISTER | DNS_FILTEROFF);
ok(hdde != NULL, "DdeNameService() failed le=%u\n", GetLastError());
ok(hdde != NULL, "DdeNameService() failed le=%lu\n", GetLastError());
timer = SetTimer(NULL, 0, CHILD_DDE_TIMEOUT, childTimeout);
@ -277,14 +277,14 @@ static void doChild(int argc, char** argv)
while (GetMessageA(&msg, NULL, 0, 0))
{
if (winetest_debug > 2)
trace("msg %d lParam=%ld wParam=%lu\n", msg.message, msg.lParam, msg.wParam);
trace("msg %d lParam=%Id wParam=%Iu\n", msg.message, msg.lParam, msg.wParam);
DispatchMessageA(&msg);
}
Sleep(500);
KillTimer(NULL, timer);
hdde = DdeNameService(ddeInst, hszApplication, 0, DNS_UNREGISTER);
ok(hdde != NULL, "DdeNameService() failed le=%u\n", GetLastError());
ok(hdde != NULL, "DdeNameService() failed le=%lu\n", GetLastError());
ok(DdeFreeStringHandle(ddeInst, hszTopic), "DdeFreeStringHandle(topic)\n");
ok(DdeFreeStringHandle(ddeInst, hszApplication), "DdeFreeStringHandle(application)\n");
ok(DdeUninitialize(ddeInst), "DdeUninitialize() failed\n");
@ -301,7 +301,7 @@ static void doChild(int argc, char** argv)
childPrintf(hFile, "ddeExec=%s\r\n", encodeA(ddeExec));
}
childPrintf(hFile, "Failures=%d\r\n", winetest_get_failures());
childPrintf(hFile, "Failures=%ld\r\n", winetest_get_failures());
CloseHandle(hFile);
init_event(filename);
@ -561,7 +561,7 @@ static INT_PTR shell_execute_(const char* file, int line, LPCSTR verb, LPCSTR fi
bad_shellexecute = 1;
okShell_(file, line)(rc == rcEmpty ||
broken(rc != rcEmpty && rcEmpty == SE_ERR_NOASSOC) /* NT4 */,
"Got different return value with empty string: %lu %lu\n", rc, rcEmpty);
"Got different return value with empty string: %Iu %Iu\n", rc, rcEmpty);
}
return rc;
@ -583,7 +583,7 @@ static INT_PTR shell_execute_ex_(const char* file, int line,
mask |= SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE;
strcpy(shell_call, "ShellExecuteEx(");
sprintf(smask, "0x%x", mask);
sprintf(smask, "0x%lx", mask);
strcat_param(shell_call, "mask", smask);
strcat_param(shell_call, "verb", verb);
strcat_param(shell_call, "file", filename);
@ -616,7 +616,7 @@ static INT_PTR shell_execute_ex_(const char* file, int line,
success=ShellExecuteExA(&sei);
rc=(INT_PTR)sei.hInstApp;
okShell_(file, line)((success && rc > 32) || (!success && rc <= 32),
"rc=%d and hInstApp=%ld is not allowed\n",
"rc=%d and hInstApp=%Id is not allowed\n",
success, rc);
if (rc > 32)
@ -626,18 +626,18 @@ static INT_PTR shell_execute_ex_(const char* file, int line,
{
wait_rc=WaitForSingleObject(sei.hProcess, 5000);
okShell_(file, line)(wait_rc==WAIT_OBJECT_0,
"WaitForSingleObject(hProcess) returned %d\n",
"WaitForSingleObject(hProcess) returned %ld\n",
wait_rc);
wait_rc = GetExitCodeProcess(sei.hProcess, &rc);
okShell_(file, line)(wait_rc, "GetExitCodeProcess() failed le=%u\n", GetLastError());
okShell_(file, line)(wait_rc, "GetExitCodeProcess() failed le=%lu\n", GetLastError());
todo_wine_if(_todo_wait)
okShell_(file, line)(rc == 0, "child returned %u\n", rc);
okShell_(file, line)(rc == 0, "child returned %lu\n", rc);
CloseHandle(sei.hProcess);
}
wait_rc=WaitForSingleObject(hEvent, 5000);
todo_wine_if(_todo_wait)
okShell_(file, line)(wait_rc==WAIT_OBJECT_0,
"WaitForSingleObject returned %d\n", wait_rc);
"WaitForSingleObject returned %ld\n", wait_rc);
}
else
okShell_(file, line)(sei.hProcess==NULL,
@ -690,19 +690,19 @@ static BOOL create_test_class(const char* class, BOOL protocol)
KEY_CREATE_SUB_KEY | KEY_SET_VALUE, NULL,
&hkey, NULL);
ok(rc == ERROR_SUCCESS || rc == ERROR_ACCESS_DENIED,
"could not create class %s (rc=%d)\n", class, rc);
"could not create class %s (rc=%ld)\n", class, rc);
if (rc != ERROR_SUCCESS)
return FALSE;
if (protocol)
{
rc = RegSetValueExA(hkey, "URL Protocol", 0, REG_SZ, (LPBYTE)"", 1);
ok(rc == ERROR_SUCCESS, "RegSetValueEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc);
ok(rc == ERROR_SUCCESS, "RegSetValueEx '%s' failed, expected ERROR_SUCCESS, got %ld\n", class, rc);
}
rc = RegCreateKeyExA(hkey, "shell", 0, NULL, 0,
KEY_CREATE_SUB_KEY, NULL, &hkey_shell, NULL);
ok(rc == ERROR_SUCCESS, "RegCreateKeyEx 'shell' failed, expected ERROR_SUCCESS, got %d\n", rc);
ok(rc == ERROR_SUCCESS, "RegCreateKeyEx 'shell' failed, expected ERROR_SUCCESS, got %ld\n", rc);
CloseHandle(hkey);
CloseHandle(hkey_shell);
@ -719,12 +719,12 @@ static BOOL create_test_association(const char* extension)
rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE,
NULL, &hkey, NULL);
ok(rc == ERROR_SUCCESS || rc == ERROR_ACCESS_DENIED,
"could not create association %s (rc=%d)\n", class, rc);
"could not create association %s (rc=%ld)\n", class, rc);
if (rc != ERROR_SUCCESS)
return FALSE;
rc=RegSetValueExA(hkey, NULL, 0, REG_SZ, (LPBYTE) class, strlen(class)+1);
ok(rc==ERROR_SUCCESS, "RegSetValueEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc);
ok(rc==ERROR_SUCCESS, "RegSetValueEx '%s' failed, expected ERROR_SUCCESS, got %ld\n", class, rc);
CloseHandle(hkey);
return create_test_class(class, FALSE);
@ -835,15 +835,15 @@ static void create_test_verb_dde(const char* classname, const char* verb,
sprintf(shell, "%s\\shell", classname);
rc=RegOpenKeyExA(HKEY_CLASSES_ROOT, shell, 0,
KEY_CREATE_SUB_KEY, &hkey_shell);
ok(rc == ERROR_SUCCESS, "%s key creation failed with %d\n", shell, rc);
ok(rc == ERROR_SUCCESS, "%s key creation failed with %ld\n", shell, rc);
rc=RegCreateKeyExA(hkey_shell, verb, 0, NULL, 0, KEY_CREATE_SUB_KEY,
NULL, &hkey_verb, NULL);
ok(rc == ERROR_SUCCESS, "%s verb key creation failed with %d\n", verb, rc);
ok(rc == ERROR_SUCCESS, "%s verb key creation failed with %ld\n", verb, rc);
rc=RegCreateKeyExA(hkey_verb, "command", 0, NULL, 0, KEY_SET_VALUE,
NULL, &hkey_cmd, NULL);
ok(rc == ERROR_SUCCESS, "\'command\' key creation failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "\'command\' key creation failed with %ld\n", rc);
if (rawcmd)
{
@ -854,7 +854,7 @@ static void create_test_verb_dde(const char* classname, const char* verb,
cmd = heap_alloc(strlen(argv0) + 10 + strlen(child_file) + 2 + strlen(cmdtail) + 1);
sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail);
rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1);
ok(rc == ERROR_SUCCESS, "setting command failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "setting command failed with %ld\n", rc);
heap_free(cmd);
}
@ -864,40 +864,40 @@ static void create_test_verb_dde(const char* classname, const char* verb,
rc=RegCreateKeyExA(hkey_verb, "ddeexec", 0, NULL, 0, KEY_SET_VALUE |
KEY_CREATE_SUB_KEY, NULL, &hkey_ddeexec, NULL);
ok(rc == ERROR_SUCCESS, "\'ddeexec\' key creation failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "\'ddeexec\' key creation failed with %ld\n", rc);
rc=RegSetValueExA(hkey_ddeexec, NULL, 0, REG_SZ, (LPBYTE)ddeexec,
strlen(ddeexec)+1);
ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "set value failed with %ld\n", rc);
if (application)
{
rc=RegCreateKeyExA(hkey_ddeexec, "application", 0, NULL, 0, KEY_SET_VALUE,
NULL, &hkey_application, NULL);
ok(rc == ERROR_SUCCESS, "\'application\' key creation failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "\'application\' key creation failed with %ld\n", rc);
rc=RegSetValueExA(hkey_application, NULL, 0, REG_SZ, (LPBYTE)application,
strlen(application)+1);
ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "set value failed with %ld\n", rc);
CloseHandle(hkey_application);
}
if (topic)
{
rc=RegCreateKeyExA(hkey_ddeexec, "topic", 0, NULL, 0, KEY_SET_VALUE,
NULL, &hkey_topic, NULL);
ok(rc == ERROR_SUCCESS, "\'topic\' key creation failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "\'topic\' key creation failed with %ld\n", rc);
rc=RegSetValueExA(hkey_topic, NULL, 0, REG_SZ, (LPBYTE)topic,
strlen(topic)+1);
ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "set value failed with %ld\n", rc);
CloseHandle(hkey_topic);
}
if (ifexec)
{
rc=RegCreateKeyExA(hkey_ddeexec, "ifexec", 0, NULL, 0, KEY_SET_VALUE,
NULL, &hkey_ifexec, NULL);
ok(rc == ERROR_SUCCESS, "\'ifexec\' key creation failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "\'ifexec\' key creation failed with %ld\n", rc);
rc=RegSetValueExA(hkey_ifexec, NULL, 0, REG_SZ, (LPBYTE)ifexec,
strlen(ifexec)+1);
ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
ok(rc == ERROR_SUCCESS, "set value failed with %ld\n", rc);
CloseHandle(hkey_ifexec);
}
CloseHandle(hkey_ddeexec);
@ -1103,48 +1103,48 @@ static void test_lpFile_parsed(void)
/* existing "drawback_file.noassoc" prevents finding "drawback_file.noassoc foo.shlexec" on Wine */
sprintf(fileA, "%s\\drawback_file.noassoc foo.shlexec", tmpdir);
rc=shell_execute(NULL, fileA, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu\n", rc);
okShell(rc > 32, "failed: rc=%Iu\n", rc);
/* if quoted, existing "drawback_file.noassoc" does not prevent finding "drawback_file.noassoc foo.shlexec" on Wine */
sprintf(fileA, "\"%s\\drawback_file.noassoc foo.shlexec\"", tmpdir);
rc=shell_execute(NULL, fileA, NULL, NULL);
okShell(rc > 32 || broken(rc == SE_ERR_FNF) /* Win95/NT4 */,
"failed: rc=%lu\n", rc);
"failed: rc=%Iu\n", rc);
/* error should be SE_ERR_FNF, not SE_ERR_NOASSOC */
sprintf(fileA, "\"%s\\drawback_file.noassoc\" foo.shlexec", tmpdir);
rc=shell_execute(NULL, fileA, NULL, NULL);
okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
/* ""command"" not works on wine (and real win9x and w2k) */
sprintf(fileA, "\"\"%s\\simple.shlexec\"\"", tmpdir);
rc=shell_execute(NULL, fileA, NULL, NULL);
todo_wine okShell(rc > 32 || broken(rc == SE_ERR_FNF) /* Win9x/2000 */,
"failed: rc=%lu\n", rc);
"failed: rc=%Iu\n", rc);
/* nonexistent "drawback_nonexist.noassoc" does not prevent finding "drawback_nonexist.noassoc foo.shlexec" on Wine */
sprintf(fileA, "%s\\drawback_nonexist.noassoc foo.shlexec", tmpdir);
rc=shell_execute(NULL, fileA, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu\n", rc);
okShell(rc > 32, "failed: rc=%Iu\n", rc);
/* is SEE_MASK_DOENVSUBST default flag? Should only be when XP emulates 9x (XP bug or real 95 or ME behavior ?) */
rc=shell_execute(NULL, "%TMPDIR%\\simple.shlexec", NULL, NULL);
todo_wine okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
todo_wine okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
/* quoted */
rc=shell_execute(NULL, "\"%TMPDIR%\\simple.shlexec\"", NULL, NULL);
todo_wine okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
todo_wine okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
/* test SEE_MASK_DOENVSUBST works */
rc=shell_execute_ex(SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI,
NULL, "%TMPDIR%\\simple.shlexec", NULL, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu\n", rc);
okShell(rc > 32, "failed: rc=%Iu\n", rc);
/* quoted lpFile does not work on real win95 and nt4 */
rc=shell_execute_ex(SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI,
NULL, "\"%TMPDIR%\\simple.shlexec\"", NULL, NULL, NULL);
okShell(rc > 32 || broken(rc == SE_ERR_FNF) /* Win95/NT4 */,
"failed: rc=%lu\n", rc);
"failed: rc=%Iu\n", rc);
}
typedef struct
@ -1376,12 +1376,12 @@ static void test_commandline2argv(void)
SetLastError(0xdeadbeef);
args = CommandLineToArgvW(exeW, NULL);
le = GetLastError();
ok(args == NULL && le == ERROR_INVALID_PARAMETER, "expected NULL with ERROR_INVALID_PARAMETER got %p with %u\n", args, le);
ok(args == NULL && le == ERROR_INVALID_PARAMETER, "expected NULL with ERROR_INVALID_PARAMETER got %p with %lu\n", args, le);
SetLastError(0xdeadbeef);
args = CommandLineToArgvW(NULL, NULL);
le = GetLastError();
ok(args == NULL && le == ERROR_INVALID_PARAMETER, "expected NULL with ERROR_INVALID_PARAMETER got %p with %u\n", args, le);
ok(args == NULL && le == ERROR_INVALID_PARAMETER, "expected NULL with ERROR_INVALID_PARAMETER got %p with %lu\n", args, le);
*strW = 0;
args = CommandLineToArgvW(strW, &numargs);
@ -1558,7 +1558,7 @@ static void test_argify(void)
/* We need NOZONECHECKS on Win2003 to block a dialog */
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, argv0, params, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu\n", rc);
okShell(rc > 32, "failed: rc=%Iu\n", rc);
okChildInt("argcA", 4);
okChildPath("argvA3", fileA);
@ -1584,7 +1584,7 @@ static void test_argify(void)
bad = test->broken ? test->broken : test->cmd;
rc = shell_execute_ex(SEE_MASK_DOENVSUBST, test->verb, fileA, test->params, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu\n", rc);
okShell(rc > 32, "failed: rc=%Iu\n", rc);
cmd = getChildString("Child", "cmdlineA");
/* Our commands are such that the verb immediately precedes the
@ -1652,7 +1652,7 @@ static void test_filename(void)
rc=33;
okShell(rc==test->rc ||
broken(quotedfile && rc == SE_ERR_FNF), /* NT4 */
"failed: rc=%ld err=%u\n", rc, GetLastError());
"failed: rc=%Id err=%lu\n", rc, GetLastError());
if (rc == 33)
{
const char* verb;
@ -1675,7 +1675,7 @@ static void test_filename(void)
if (rc > 32)
rc=33;
todo_wine_if(test->todo & 0x1)
okShell(rc==test->rc, "failed: rc=%ld err=%u\n", rc, GetLastError());
okShell(rc==test->rc, "failed: rc=%Id err=%lu\n", rc, GetLastError());
if (rc==0)
{
int count;
@ -1719,7 +1719,7 @@ static void test_filename(void)
*/
sprintf(filename, "\"%s\\test file.shlexec\"", tmpdir);
rc=shell_execute(NULL, filename, NULL, NULL);
okShell(rc > 32, "failed: rc=%ld err=%u\n", rc, GetLastError());
okShell(rc > 32, "failed: rc=%Id err=%lu\n", rc, GetLastError());
okChildInt("argcA", 5);
okChildString("argvA3", "Open");
sprintf(filename, "%s\\test file.shlexec", tmpdir);
@ -1728,7 +1728,7 @@ static void test_filename(void)
sprintf(filename, "\"%s\\test file.sha\"", tmpdir);
rc=shell_execute(NULL, filename, NULL, NULL);
todo_wine okShell(rc > 32, "failed: rc=%ld err=%u\n", rc, GetLastError());
todo_wine okShell(rc > 32, "failed: rc=%Id err=%lu\n", rc, GetLastError());
okChildInt("argcA", 5);
todo_wine okChildString("argvA3", "averb");
sprintf(filename, "%s\\test file.sha", tmpdir);
@ -1827,7 +1827,7 @@ static void test_fileurls(void)
/* Test it first with FindExecutable() */
rc = (INT_PTR)FindExecutableA(fileurl, NULL, command);
ok(rc == SE_ERR_FNF, "FindExecutable(%s) failed: bad rc=%lu\n", fileurl, rc);
ok(rc == SE_ERR_FNF, "FindExecutable(%s) failed: bad rc=%Iu\n", fileurl, rc);
/* Then ShellExecute() */
if ((test->todo & 0x10) == 0)
@ -1842,14 +1842,14 @@ static void test_fileurls(void)
if (test->flags & URL_SUCCESS)
{
todo_wine_if(test->todo & 0x1)
okShell(rc > 32, "failed: bad rc=%lu\n", rc);
okShell(rc > 32, "failed: bad rc=%Iu\n", rc);
}
else
{
todo_wine_if(test->todo & 0x1)
okShell(rc == SE_ERR_FNF || rc == SE_ERR_PNF ||
broken(rc == SE_ERR_ACCESSDENIED) /* win2000 */,
"failed: bad rc=%lu\n", rc);
"failed: bad rc=%Iu\n", rc);
}
if (rc == 33)
{
@ -1884,15 +1884,15 @@ static void test_urls(void)
/* Protocols must be properly declared */
rc = shell_execute(NULL, "notaproto://foo", NULL, NULL);
ok(rc == SE_ERR_NOASSOC || broken(rc == SE_ERR_ACCESSDENIED),
"%s returned %lu\n", shell_call, rc);
"%s returned %Iu\n", shell_call, rc);
rc = shell_execute(NULL, "fakeproto://foo/bar", NULL, NULL);
todo_wine ok(rc == SE_ERR_NOASSOC || broken(rc == SE_ERR_ACCESSDENIED),
"%s returned %lu\n", shell_call, rc);
"%s returned %Iu\n", shell_call, rc);
/* Here's a real live one */
rc = shell_execute(NULL, "shlproto://foo/bar", NULL, NULL);
ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc);
ok(rc > 32, "%s failed: rc=%Iu\n", shell_call, rc);
okChildInt("argcA", 5);
okChildString("argvA3", "URL");
okChildString("argvA4", "shlproto://foo/bar");
@ -1901,7 +1901,7 @@ static void test_urls(void)
rc = shell_execute(NULL, "shlpaverb://foo/bar", NULL, NULL);
todo_wine ok(rc > 32 || /* XP+IE7 - Win10 */
broken(rc == SE_ERR_NOASSOC), /* XP+IE6 */
"%s failed: rc=%lu\n", shell_call, rc);
"%s failed: rc=%Iu\n", shell_call, rc);
if (rc > 32)
{
okChildInt("argcA", 5);
@ -1913,7 +1913,7 @@ static void test_urls(void)
rc = shell_execute("averb", "shlproto://foo/bar", NULL, NULL);
ok(rc > 32 || /* Win8 - Win10 */
broken(rc == SE_ERR_ACCESSDENIED), /* XP - Win7 */
"%s failed: rc=%lu\n", shell_call, rc);
"%s failed: rc=%Iu\n", shell_call, rc);
if (rc > 32)
{
okChildString("argvA3", "AVerb");
@ -1922,21 +1922,21 @@ static void test_urls(void)
/* A .lnk ending does not turn a URL into a shortcut */
rc = shell_execute(NULL, "shlproto://foo/bar.lnk", NULL, NULL);
ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc);
ok(rc > 32, "%s failed: rc=%Iu\n", shell_call, rc);
okChildInt("argcA", 5);
okChildString("argvA3", "URL");
okChildString("argvA4", "shlproto://foo/bar.lnk");
/* Neither does a .exe extension */
rc = shell_execute(NULL, "shlproto://foo/bar.exe", NULL, NULL);
ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc);
ok(rc > 32, "%s failed: rc=%Iu\n", shell_call, rc);
okChildInt("argcA", 5);
okChildString("argvA3", "URL");
okChildString("argvA4", "shlproto://foo/bar.exe");
/* But a class name overrides it */
rc = shell_execute(NULL, "shlproto://foo/bar", "shlexec.shlexec", NULL);
ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc);
ok(rc > 32, "%s failed: rc=%Iu\n", shell_call, rc);
okChildInt("argcA", 5);
okChildString("argvA3", "URL");
okChildString("argvA4", "shlproto://foo/bar");
@ -1944,7 +1944,7 @@ static void test_urls(void)
/* Environment variables are expanded in URLs (but not in file URLs!) */
rc = shell_execute_ex(SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI,
NULL, "shlproto://%TMPDIR%/bar", NULL, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu\n", rc);
okShell(rc > 32, "failed: rc=%Iu\n", rc);
okChildInt("argcA", 5);
sprintf(url, "shlproto://%s/bar", tmpdir);
okChildString("argvA3", "URL");
@ -1953,7 +1953,7 @@ static void test_urls(void)
/* But only after the path has been identified as a URL */
SetEnvironmentVariableA("urlprefix", "shlproto:///");
rc = shell_execute(NULL, "%urlprefix%foo", NULL, NULL);
todo_wine ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc);
todo_wine ok(rc == SE_ERR_FNF, "%s returned %Iu\n", shell_call, rc);
SetEnvironmentVariableA("urlprefix", NULL);
delete_test_class("fakeproto");
@ -1981,7 +1981,7 @@ static void test_find_executable(void)
if (0) /* Can crash on Vista! */
{
rc=(INT_PTR)FindExecutableA(NULL, NULL, command);
ok(rc == SE_ERR_FNF || rc > 32 /* nt4 */, "FindExecutable(NULL) returned %ld\n", rc);
ok(rc == SE_ERR_FNF || rc > 32 /* nt4 */, "FindExecutable(NULL) returned %Id\n", rc);
ok(strcmp(command, "your word") != 0, "FindExecutable(NULL) returned command=[%s]\n", command);
}
@ -1991,30 +1991,30 @@ static void test_find_executable(void)
/* Search for something that should be in the system-wide search path (no default directory) */
strcpy(command, "your word");
rc=(INT_PTR)FindExecutableA("notepad.exe", NULL, command);
ok(rc > 32, "FindExecutable(%s) returned %ld\n", "notepad.exe", rc);
ok(rc > 32, "FindExecutable(%s) returned %Id\n", "notepad.exe", rc);
ok(strcasecmp(command, notepad_path) == 0, "FindExecutable(%s) returned command=[%s]\n", "notepad.exe", command);
/* Search for something that should be in the system-wide search path (with default directory) */
strcpy(command, "your word");
rc=(INT_PTR)FindExecutableA("notepad.exe", tmpdir, command);
ok(rc > 32, "FindExecutable(%s) returned %ld\n", "notepad.exe", rc);
ok(rc > 32, "FindExecutable(%s) returned %Id\n", "notepad.exe", rc);
ok(strcasecmp(command, notepad_path) == 0, "FindExecutable(%s) returned command=[%s]\n", "notepad.exe", command);
strcpy(command, "your word");
rc=(INT_PTR)FindExecutableA(tmpdir, NULL, command);
ok(rc == SE_ERR_NOASSOC /* >= win2000 */ || rc > 32 /* win98, nt4 */, "FindExecutable(NULL) returned %ld\n", rc);
ok(rc == SE_ERR_NOASSOC /* >= win2000 */ || rc > 32 /* win98, nt4 */, "FindExecutable(NULL) returned %Id\n", rc);
ok(strcmp(command, "your word") != 0, "FindExecutable(NULL) returned command=[%s]\n", command);
sprintf(filename, "%s\\test file.sfe", tmpdir);
rc=(INT_PTR)FindExecutableA(filename, NULL, command);
ok(rc > 32, "FindExecutable(%s) returned %ld\n", filename, rc);
ok(rc > 32, "FindExecutable(%s) returned %Id\n", filename, rc);
/* Depending on the platform, command could be '%1' or 'test file.sfe' */
rc=(INT_PTR)FindExecutableA("test file.sfe", tmpdir, command);
ok(rc > 32, "FindExecutable(%s) returned %ld\n", filename, rc);
ok(rc > 32, "FindExecutable(%s) returned %Id\n", filename, rc);
rc=(INT_PTR)FindExecutableA("test file.sfe", NULL, command);
ok(rc == SE_ERR_FNF, "FindExecutable(%s) returned %ld\n", filename, rc);
ok(rc == SE_ERR_FNF, "FindExecutable(%s) returned %Id\n", filename, rc);
delete_test_association(".sfe");
@ -2027,7 +2027,7 @@ static void test_find_executable(void)
sprintf(filename, "%s\\test file.shl", tmpdir);
rc=(INT_PTR)FindExecutableA(filename, NULL, command);
ok(rc == SE_ERR_FNF /* NT4 */ || rc > 32, "FindExecutable(%s) returned %ld\n", filename, rc);
ok(rc == SE_ERR_FNF /* NT4 */ || rc > 32, "FindExecutable(%s) returned %Id\n", filename, rc);
sprintf(filename, "%s\\test file.shlfoo", tmpdir);
rc=(INT_PTR)FindExecutableA(filename, NULL, command);
@ -2075,7 +2075,7 @@ static void test_find_executable(void)
if (rc > 32)
rc=33;
todo_wine_if(test->todo & 0x10)
ok(rc==test->rc, "FindExecutable(%s) failed: rc=%ld\n", filename, rc);
ok(rc==test->rc, "FindExecutable(%s) failed: rc=%Id\n", filename, rc);
if (rc > 32)
{
BOOL equal;
@ -2121,7 +2121,7 @@ static void test_lnks(void)
/* Should open through our association */
sprintf(filename, "%s\\test_shortcut_shlexec.lnk", tmpdir);
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError());
okShell(rc > 32, "failed: rc=%Iu err=%lu\n", rc, GetLastError());
okChildInt("argcA", 5);
okChildString("argvA3", "Open");
sprintf(params, "%s\\test file.shlexec", tmpdir);
@ -2129,7 +2129,7 @@ static void test_lnks(void)
okChildPath("argvA4", filename);
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError());
okShell(rc > 32, "failed: rc=%Iu err=%lu\n", rc, GetLastError());
okChildInt("argcA", 5);
okChildString("argvA3", "Open");
sprintf(params, "%s\\test file.shlexec", tmpdir);
@ -2140,7 +2140,7 @@ static void test_lnks(void)
/* Should just run our executable */
sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir);
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError());
okShell(rc > 32, "failed: rc=%Iu err=%lu\n", rc, GetLastError());
okChildInt("argcA", 4);
okChildString("argvA3", "Lnk");
@ -2148,7 +2148,7 @@ static void test_lnks(void)
{
/* An explicit class overrides lnk's ContextMenuHandler */
rc=shell_execute_ex(SEE_MASK_CLASSNAME | SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, "shlexec.shlexec");
okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError());
okShell(rc > 32, "failed: rc=%Iu err=%lu\n", rc, GetLastError());
okChildInt("argcA", 5);
okChildString("argvA3", "Open");
okChildPath("argvA4", filename);
@ -2169,7 +2169,7 @@ static void test_lnks(void)
c++;
}
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL);
okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError());
okShell(rc > 32, "failed: rc=%Iu err=%lu\n", rc, GetLastError());
okChildInt("argcA", 4);
okChildString("argvA3", "Lnk");
}
@ -2186,7 +2186,7 @@ static void test_lnks(void)
if (rc > 32)
rc=33;
todo_wine_if(test->todo & 0x1)
okShell(rc==test->rc, "failed: rc=%lu err=%u\n", rc, GetLastError());
okShell(rc==test->rc, "failed: rc=%Iu err=%lu\n", rc, GetLastError());
if (rc==0)
{
todo_wine_if(test->todo & 0x2)
@ -2212,7 +2212,7 @@ static void test_exes(void)
/* We need NOZONECHECKS on Win2003 to block a dialog */
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, argv0, params,
NULL, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okShell(rc > 32, "returned %Iu\n", rc);
okChildInt("argcA", 4);
okChildString("argvA3", "Exec");
@ -2223,7 +2223,7 @@ static void test_exes(void)
{
rc=shell_execute(NULL, filename, params, NULL);
todo_wine {
okShell(rc==SE_ERR_NOASSOC, "returned %lu\n", rc);
okShell(rc==SE_ERR_NOASSOC, "returned %Iu\n", rc);
}
}
}
@ -2235,16 +2235,16 @@ static void test_exes(void)
/* test combining executable and parameters */
sprintf(filename, "%s shlexec \"%s\" Exec", argv0, child_file);
rc = shell_execute(NULL, filename, NULL, NULL);
okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
sprintf(filename, "\"%s\" shlexec \"%s\" Exec", argv0, child_file);
rc = shell_execute(NULL, filename, NULL, NULL);
okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
/* A verb, even if invalid, overrides the normal handling of executables */
todo_wait rc = shell_execute_ex(SEE_MASK_FLAG_NO_UI,
"notaverb", argv0, NULL, NULL, NULL);
todo_wine okShell(rc == SE_ERR_NOASSOC, "returned %lu\n", rc);
todo_wine okShell(rc == SE_ERR_NOASSOC, "returned %Iu\n", rc);
if (!skip_shlexec_tests)
{
@ -2252,7 +2252,7 @@ static void test_exes(void)
/* FIXME SEE_MASK_FLAG_NO_UI is only needed due to Wine's bug */
rc = shell_execute_ex(SEE_MASK_CLASSNAME | SEE_MASK_FLAG_NO_UI,
NULL, argv0, NULL, NULL, ".shlexec");
todo_wine okShell(rc > 32, "returned %lu\n", rc);
todo_wine okShell(rc > 32, "returned %Iu\n", rc);
okChildInt("argcA", 5);
todo_wine okChildString("argvA3", "Open");
todo_wine okChildPath("argvA4", argv0);
@ -2304,7 +2304,7 @@ static DWORD WINAPI hooked_WaitForInputIdle(HANDLE process, DWORD timeout)
{
waitforinputidle_count++;
if (winetest_debug > 1)
trace("WaitForInputIdle() waiting for dde event timeout=min(%u,5s)\n", timeout);
trace("WaitForInputIdle() waiting for dde event timeout=min(%lu,5s)\n", timeout);
timeout = timeout < 5000 ? timeout : 5000;
return WaitForSingleObject(dde_ready_event, timeout);
}
@ -2444,7 +2444,7 @@ static void test_dde(void)
Sleep(CHILD_DDE_TIMEOUT);
continue;
}
okShell(32 < rc, "failed: rc=%lu err=%u\n", rc, GetLastError());
okShell(32 < rc, "failed: rc=%Iu err=%lu\n", rc, GetLastError());
if (test->ddeexec)
okShell(waitforinputidle_count == 1 ||
broken(waitforinputidle_count == 0) /* Win10 race */,
@ -2564,7 +2564,7 @@ static void test_dde_default_app(void)
ddeInst = 0;
rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES |
CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0);
ok(rc == DMLERR_NO_ERROR, "got %lx\n", rc);
ok(rc == DMLERR_NO_ERROR, "got %Ix\n", rc);
sprintf(filename, "%s\\test file.sde", tmpdir);
@ -2621,7 +2621,7 @@ static void test_dde_default_app(void)
}
todo_wine_if(test->todo & 0x1)
okShell(rc==test->rc[which], "failed: rc=%lu err=%u\n",
okShell(rc==test->rc[which], "failed: rc=%Iu err=%lu\n",
rc, GetLastError());
if (rc == 33)
{
@ -2664,7 +2664,7 @@ static void init_test(void)
{
dllver.cbSize=sizeof(dllver);
pDllGetVersion(&dllver);
trace("major=%d minor=%d build=%d platform=%d\n",
trace("major=%ld minor=%ld build=%ld platform=%ld\n",
dllver.dwMajorVersion, dllver.dwMinorVersion,
dllver.dwBuildNumber, dllver.dwPlatformID);
}
@ -2674,12 +2674,12 @@ static void init_test(void)
}
r = CoInitialize(NULL);
ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r);
ok(r == S_OK, "CoInitialize failed (0x%08lx)\n", r);
if (FAILED(r))
exit(1);
rc=GetModuleFileNameA(NULL, argv0, sizeof(argv0));
ok(rc != 0 && rc < sizeof(argv0), "got %d\n", rc);
ok(rc != 0 && rc < sizeof(argv0), "got %ld\n", rc);
if (GetFileAttributesA(argv0)==INVALID_FILE_ATTRIBUTES)
{
strcat(argv0, ".so");
@ -2703,7 +2703,7 @@ static void init_test(void)
DeleteFileA( tmpdir );
rc = CreateDirectoryA( tmpdir, NULL );
ok( rc || GetLastError() == ERROR_ALREADY_EXISTS,
"failed to create %s err %u\n", tmpdir, GetLastError() );
"failed to create %s err %lu\n", tmpdir, GetLastError() );
/* Set %TMPDIR% for the tests */
SetEnvironmentVariableA("TMPDIR", tmpdir);
@ -2722,7 +2722,7 @@ static void init_test(void)
FILE_ATTRIBUTE_NORMAL, NULL);
if (hfile==INVALID_HANDLE_VALUE)
{
trace("unable to create '%s': err=%u\n", filename, GetLastError());
trace("unable to create '%s': err=%lu\n", filename, GetLastError());
assert(0);
}
CloseHandle(hfile);
@ -2828,7 +2828,7 @@ static void test_directory(void)
SetCurrentDirectoryA(tmpdir);
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, "test2.exe", params, NULL, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okShell(rc > 32, "returned %Iu\n", rc);
okChildInt("argcA", 4);
todo_wine okChildString("argvA0", path);
okChildString("argvA3", "Exec");
@ -2837,12 +2837,12 @@ static void test_directory(void)
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, "test2.exe", params, NULL, NULL);
okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
/* Explicitly specify the directory to use */
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, "test2.exe", params, tmpdir, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okShell(rc > 32, "returned %Iu\n", rc);
okChildInt("argcA", 4);
okChildString("argvA0", path);
okChildString("argvA3", "Exec");
@ -2851,11 +2851,11 @@ static void test_directory(void)
/* Specify it through an environment variable */
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, "test2.exe", params, "%TMPDIR%", NULL);
todo_wine okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
todo_wine okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
rc=shell_execute_ex(SEE_MASK_DOENVSUBST|SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, "test2.exe", params, "%TMPDIR%", NULL);
okShell(rc > 32, "returned %lu\n", rc);
okShell(rc > 32, "returned %Iu\n", rc);
okChildInt("argcA", 4);
okChildString("argvA0", path);
okChildString("argvA3", "Exec");
@ -2865,14 +2865,14 @@ static void test_directory(void)
sprintf(dirpath, "%s:%s", curdir, tmpdir);
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, "test2.exe", params, dirpath, NULL);
okShell(rc == SE_ERR_FNF, "returned %lu\n", rc);
okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
/* Same-named executable in different directory */
snprintf(path, ARRAY_SIZE(path), "%s%s", tmpdir, strrchr(argv0, '\\'));
CopyFileA(argv0, path, FALSE);
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, strrchr(argv0, '\\') + 1, params, tmpdir, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okShell(rc > 32, "returned %Iu\n", rc);
okChildInt("argcA", 4);
okChildString("argvA0", path);
okChildString("argvA3", "Exec");
@ -2880,10 +2880,10 @@ static void test_directory(void)
SetCurrentDirectoryA(tmpdir);
ret = CreateDirectoryA( "tmp", NULL );
ok(ret || GetLastError() == ERROR_ALREADY_EXISTS, "Failed to create 'tmp' err %u\n", GetLastError());
ok(ret || GetLastError() == ERROR_ALREADY_EXISTS, "Failed to create 'tmp' err %lu\n", GetLastError());
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
NULL, path, params, "tmp", NULL);
okShell(rc > 32, "returned %lu\n", rc);
okShell(rc > 32, "returned %Iu\n", rc);
DeleteFileA(path);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -633,13 +633,13 @@ static void test_CreateViewWindow(void)
IUnknown *unk;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellView_QueryInterface(view, &IID_CDefView, (void **)&unk);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(unk == (IUnknown *)view, "got %p\n", unk);
IUnknown_Release(unk);
@ -653,51 +653,51 @@ if (0)
settings.fFlags = 0;
hwnd_view = (HWND)0xdeadbeef;
hr = IShellView_CreateViewWindow(view, NULL, &settings, NULL, NULL, &hwnd_view);
ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr);
ok(hr == E_UNEXPECTED, "got (0x%08lx)\n", hr);
ok(hwnd_view == 0, "got %p\n", hwnd_view);
hwnd_view = (HWND)0xdeadbeef;
hr = IShellView_CreateViewWindow(view, NULL, &settings, NULL, &r, &hwnd_view);
ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr);
ok(hr == E_UNEXPECTED, "got (0x%08lx)\n", hr);
ok(hwnd_view == 0, "got %p\n", hwnd_view);
hwnd_view = NULL;
hr = IShellView_CreateViewWindow(view, NULL, &settings, &test_shellbrowser, &r, &hwnd_view);
ok(hr == S_OK || broken(hr == S_FALSE), "got (0x%08x)\n", hr);
ok(hr == S_OK || broken(hr == S_FALSE), "got (0x%08lx)\n", hr);
ok(hwnd_view != 0, "got %p\n", hwnd_view);
hwnd2 = (HWND)0xdeadbeef;
hr = IShellView_CreateViewWindow(view, NULL, &settings, &test_shellbrowser, &r, &hwnd2);
ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr);
ok(hr == E_UNEXPECTED, "got (0x%08lx)\n", hr);
ok(hwnd2 == NULL, "got %p\n", hwnd2);
/* ::DragLeave without drag operation */
hr = IShellView_QueryInterface(view, &IID_IDropTarget, (void**)&dt);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IDropTarget_DragLeave(dt);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
IDropTarget_Release(dt);
IShellView_AddRef(view);
ref1 = IShellView_Release(view);
hr = IShellView_DestroyViewWindow(view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(!IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view);
ref2 = IShellView_Release(view);
ok(ref1 > ref2, "expected %u > %u\n", ref1, ref2);
ok(ref1 > ref2, "expected %lu > %lu\n", ref1, ref2);
ref1 = ref2;
/* Show that releasing the shell view does not destroy the window */
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hwnd_view = NULL;
hr = IShellView_CreateViewWindow(view, NULL, &settings, &test_shellbrowser, &r, &hwnd_view);
ok(hr == S_OK || broken(hr == S_FALSE), "got (0x%08x)\n", hr);
ok(hr == S_OK || broken(hr == S_FALSE), "got (0x%08lx)\n", hr);
ok(hwnd_view != NULL, "got %p\n", hwnd_view);
ok(IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view);
ref2 = IShellView_Release(view);
ok(ref2 != 0, "ref2 = %u\n", ref2);
ok(ref2 > ref1, "expected %u > %u\n", ref2, ref1);
ok(ref2 != 0, "ref2 = %lu\n", ref2);
ok(ref2 > ref1, "expected %lu > %lu\n", ref2, ref1);
ok(IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view);
DestroyWindow(hwnd_view);
@ -721,10 +721,10 @@ static void test_IFolderView(void)
RECT r;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellView_QueryInterface(view, &IID_IFolderView, (void**)&fv);
if (hr != S_OK)
@ -737,11 +737,11 @@ static void test_IFolderView(void)
/* call methods before window creation */
hr = IFolderView_GetSpacing(fv, NULL);
ok(hr == S_FALSE || broken(hr == S_OK) /* win7 */, "got (0x%08x)\n", hr);
ok(hr == S_FALSE || broken(hr == S_OK) /* win7 */, "got (0x%08lx)\n", hr);
pidl = (void*)0xdeadbeef;
hr = IFolderView_Item(fv, 0, &pidl);
ok(hr == E_INVALIDARG || broken(hr == E_FAIL) /* < Vista */, "got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG || broken(hr == E_FAIL) /* < Vista */, "got (0x%08lx)\n", hr);
ok(pidl == 0 || broken(pidl == (void*)0xdeadbeef) /* < Vista */, "got %p\n", pidl);
if (0)
@ -764,7 +764,7 @@ if (0)
hwnd_view = (HWND)0xdeadbeef;
SetRect(&r, 0, 0, 100, 100);
hr = IShellView_CreateViewWindow(view, NULL, &settings, browser, &r, &hwnd_view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(IsWindow(hwnd_view), "got %p\n", hwnd_view);
hwnd_list = subclass_listview(hwnd_view);
@ -781,18 +781,18 @@ if (0)
/* IFolderView::GetSpacing */
flush_sequences(sequences, NUM_MSG_SEQUENCES);
hr = IFolderView_GetSpacing(fv, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok_sequence(sequences, LISTVIEW_SEQ_INDEX, empty_seq, "IFolderView::GetSpacing, empty", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
hr = IFolderView_GetSpacing(fv, &pt);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
/* fails with empty sequence on win7 for unknown reason */
if (sequences[LISTVIEW_SEQ_INDEX]->count)
{
ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getspacing_seq, "IFolderView::GetSpacing", FALSE);
ok(pt.x > 0, "got %d\n", pt.x);
ok(pt.y > 0, "got %d\n", pt.y);
ok(pt.x > 0, "got %ld\n", pt.x);
ok(pt.y > 0, "got %ld\n", pt.y);
ret = SendMessageA(hwnd_list, LVM_GETITEMSPACING, 0, 0);
ok(pt.x == LOWORD(ret) && pt.y == HIWORD(ret), "got (%d, %d)\n", LOWORD(ret), HIWORD(ret));
}
@ -817,9 +817,9 @@ if (0)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
hr = IFolderView_GetSelectionMarkedItem(fv, &ret);
if (count)
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
else
ok(hr == S_FALSE, "got (0x%08x)\n", hr);
ok(hr == S_FALSE, "got (0x%08lx)\n", hr);
ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getselectionmarked_seq,
"IFolderView::GetSelectionMarkedItem", FALSE);
@ -827,9 +827,9 @@ if (0)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
hr = IFolderView_GetFocusedItem(fv, &ret);
if (count)
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
else
ok(hr == S_FALSE, "got (0x%08x)\n", hr);
ok(hr == S_FALSE, "got (0x%08lx)\n", hr);
ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getfocused_seq,
"IFolderView::GetFocusedItem", FALSE);
@ -842,15 +842,15 @@ if (0)
}
hr = IFolderView_GetFolder(fv, &IID_IShellFolder, NULL);
ok(hr == E_POINTER, "got (0x%08x)\n", hr);
ok(hr == E_POINTER, "got (0x%08lx)\n", hr);
hr = IFolderView_GetFolder(fv, &IID_IShellFolder, (void**)&folder);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(desktop == folder, "\n");
if (folder) IShellFolder_Release(folder);
hr = IFolderView_GetFolder(fv, &IID_IUnknown, (void**)&unk);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
if (unk) IUnknown_Release(unk);
hr = IFolderView_QueryInterface(fv, &IID_IFolderView2, (void**)&fv2);
@ -859,7 +859,7 @@ if (0)
if (fv2) IFolderView2_Release(fv2);
hr = IShellView_DestroyViewWindow(view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(!IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view);
IShellBrowser_Release(browser);
@ -876,30 +876,30 @@ static void test_GetItemObject(void)
HRESULT hr;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
/* from documentation three interfaces are supported for SVGIO_BACKGROUND:
IContextMenu, IDispatch, IPersistHistory */
hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IContextMenu, (void**)&unk);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
IUnknown_Release(unk);
unk = NULL;
hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IDispatch, (void**)&unk);
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* NT4 */, "got (0x%08x)\n", hr);
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* NT4 */, "got (0x%08lx)\n", hr);
if (unk) IUnknown_Release(unk);
unk = NULL;
hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IPersistHistory, (void**)&unk);
todo_wine ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W9x, NT4 */, "got (0x%08x)\n", hr);
todo_wine ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W9x, NT4 */, "got (0x%08lx)\n", hr);
if (unk) IUnknown_Release(unk);
/* example of unsupported interface, base for IPersistHistory */
hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IPersist, (void**)&unk);
ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL) /* W2K */, "got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL) /* W2K */, "got (0x%08lx)\n", hr);
IShellView_Release(view);
IShellFolder_Release(desktop);
@ -915,10 +915,10 @@ static void test_IShellFolderView(void)
HRESULT hr;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellView_QueryInterface(view, &IID_IShellFolderView, (void**)&folderview);
if (hr != S_OK)
@ -932,25 +932,25 @@ static void test_IShellFolderView(void)
/* ::MoveIcons */
obj = IDataObjectImpl_Construct();
hr = IShellFolderView_MoveIcons(folderview, obj);
ok(hr == E_NOTIMPL || broken(hr == S_OK) /* W98 */, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL || broken(hr == S_OK) /* W98 */, "got (0x%08lx)\n", hr);
IDataObject_Release(obj);
/* ::SetRedraw without list created */
hr = IShellFolderView_SetRedraw(folderview, TRUE);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
/* ::QuerySupport */
hr = IShellFolderView_QuerySupport(folderview, NULL);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
i = 0xdeadbeef;
hr = IShellFolderView_QuerySupport(folderview, &i);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(i == 0xdeadbeef, "got %d\n", i);
/* ::RemoveObject */
i = 0xdeadbeef;
hr = IShellFolderView_RemoveObject(folderview, NULL, &i);
ok(hr == S_OK || hr == E_FAIL, "got (0x%08x)\n", hr);
ok(hr == S_OK || hr == E_FAIL, "got (0x%08lx)\n", hr);
if (hr == S_OK) ok(i == 0 || broken(i == 0xdeadbeef) /* Vista, 2k8 */,
"got %d\n", i);
@ -968,19 +968,19 @@ static void test_IOleWindow(void)
HRESULT hr;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellView_QueryInterface(view, &IID_IOleWindow, (void**)&wnd);
ok(hr == E_NOINTERFACE, "got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "got (0x%08lx)\n", hr);
/* IShellView::ContextSensitiveHelp */
hr = IShellView_ContextSensitiveHelp(view, TRUE);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
hr = IShellView_ContextSensitiveHelp(view, FALSE);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr);
IShellView_Release(view);
IShellFolder_Release(desktop);
@ -1090,19 +1090,19 @@ static void test_GetSetCurrentViewMode(void)
static const int win7_res[11] = {1, 1, 1, 3, 4, 1, 6, 1, 8, 8, 8};
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&sview);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
fs.ViewMode = 1;
fs.fFlags = 0;
browser = IShellBrowserImpl_Construct();
hr = IShellView_CreateViewWindow(sview, NULL, &fs, browser, &rc, &hwnd);
ok(hr == S_OK || broken(hr == S_FALSE /*Win2k*/ ), "got (0x%08x)\n", hr);
ok(hr == S_OK || broken(hr == S_FALSE /*Win2k*/ ), "got (0x%08lx)\n", hr);
hr = IShellView_QueryInterface(sview, &IID_IFolderView, (void**)&fview);
ok(hr == S_OK || broken(hr == E_NOINTERFACE), "got (0x%08x)\n", hr);
ok(hr == S_OK || broken(hr == E_NOINTERFACE), "got (0x%08lx)\n", hr);
if(SUCCEEDED(hr))
{
HWND hwnd_lv;
@ -1115,27 +1115,27 @@ static void test_GetSetCurrentViewMode(void)
}
hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(viewmode == 1, "ViewMode was %d\n", viewmode);
hr = IFolderView_SetCurrentViewMode(fview, FVM_AUTO);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IFolderView_SetCurrentViewMode(fview, 0);
ok(hr == E_INVALIDARG || broken(hr == S_OK),
"got (0x%08x)\n", hr);
"got (0x%08lx)\n", hr);
hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
for(i = 1; i < 9; i++)
{
hr = IFolderView_SetCurrentViewMode(fview, i);
ok(hr == S_OK || (i == 8 && hr == E_INVALIDARG /*Vista*/),
"(%d) got (0x%08x)\n", i, hr);
"(%d) got (0x%08lx)\n", i, hr);
hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
ok(hr == S_OK, "(%d) got (0x%08x)\n", i, hr);
ok(hr == S_OK, "(%d) got (0x%08lx)\n", i, hr);
/* Wine currently behaves like winxp here. */
ok((viewmode == win7_res[i]) || (viewmode == vista_res[i]) ||
@ -1145,7 +1145,7 @@ static void test_GetSetCurrentViewMode(void)
hr = IFolderView_SetCurrentViewMode(fview, 9);
ok(hr == E_INVALIDARG || broken(hr == S_OK),
"got (0x%08x)\n", hr);
"got (0x%08lx)\n", hr);
/* Test messages */
hwnd_lv = subclass_listview(hwnd);
@ -1164,7 +1164,7 @@ static void test_GetSetCurrentViewMode(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
hr = IFolderView_SetCurrentViewMode(fview, 1);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* WM_SETREDRAW is not sent in versions before Vista. */
vista_plus = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, WM_SETREDRAW);
@ -1175,7 +1175,7 @@ static void test_GetSetCurrentViewMode(void)
"IFolderView::SetCurrentViewMode(1)", TRUE);
hr = IFolderView_SetCurrentViewMode(fview, 2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
if(vista_plus)
verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
else
@ -1183,7 +1183,7 @@ static void test_GetSetCurrentViewMode(void)
"IFolderView::SetCurrentViewMode(2)", TRUE);
hr = IFolderView_SetCurrentViewMode(fview, 3);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
if(vista_plus)
verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
else
@ -1191,7 +1191,7 @@ static void test_GetSetCurrentViewMode(void)
"IFolderView::SetCurrentViewMode(3)", TRUE);
hr = IFolderView_SetCurrentViewMode(fview, 4);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
if(vista_plus)
verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
else
@ -1199,7 +1199,7 @@ static void test_GetSetCurrentViewMode(void)
"IFolderView::SetCurrentViewMode(4)", TRUE);
hr = IFolderView_SetCurrentViewMode(fview, 5);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
todo_wine
{
if(vista_plus)
@ -1217,7 +1217,7 @@ static void test_GetSetCurrentViewMode(void)
}
hr = IFolderView_SetCurrentViewMode(fview, 6);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
todo_wine
{
if(vista_plus)
@ -1235,7 +1235,7 @@ static void test_GetSetCurrentViewMode(void)
}
hr = IFolderView_SetCurrentViewMode(fview, 7);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
todo_wine
{
if(vista_plus)
@ -1253,7 +1253,7 @@ static void test_GetSetCurrentViewMode(void)
}
hr = IFolderView_SetCurrentViewMode(fview, 8);
ok(hr == S_OK || broken(hr == E_INVALIDARG /* Vista */), "got 0x%08x\n", hr);
ok(hr == S_OK || broken(hr == E_INVALIDARG /* Vista */), "got 0x%08lx\n", hr);
todo_wine
{
if(vista_plus)
@ -1297,31 +1297,31 @@ static void test_IOleCommandTarget(void)
HRESULT hr;
hr = SHGetDesktopFolder(&psf_desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
hr = IShellFolder_CreateViewObject(psf_desktop, NULL, &IID_IShellView, (void**)&psv);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
if(SUCCEEDED(hr))
{
hr = IShellView_QueryInterface(psv, &IID_IOleCommandTarget, (void**)&poct);
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win95/NT4 */, "Got 0x%08x\n", hr);
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win95/NT4 */, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
OLECMD oc;
hr = IOleCommandTarget_QueryStatus(poct, NULL, 0, NULL, NULL);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
oc.cmdID = 1;
hr = IOleCommandTarget_QueryStatus(poct, NULL, 0, &oc, NULL);
ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08x\n", hr);
ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08lx\n", hr);
oc.cmdID = 1;
hr = IOleCommandTarget_QueryStatus(poct, NULL, 1, &oc, NULL);
ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08x\n", hr);
ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08lx\n", hr);
hr = IOleCommandTarget_Exec(poct, NULL, 0, 0, NULL, NULL);
ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08x\n", hr);
ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08lx\n", hr);
IOleCommandTarget_Release(poct);
}
@ -1342,7 +1342,7 @@ static void test_SHCreateShellFolderView(void)
HRESULT hr;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
if (0)
{
@ -1352,27 +1352,27 @@ static void test_SHCreateShellFolderView(void)
psv = (void *)0xdeadbeef;
hr = SHCreateShellFolderView(NULL, &psv);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
ok(psv == NULL, "psv = %p\n", psv);
memset(&sfvc, 0, sizeof(sfvc));
psv = (void *)0xdeadbeef;
hr = SHCreateShellFolderView(&sfvc, &psv);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
ok(psv == NULL, "psv = %p\n", psv);
memset(&sfvc, 0, sizeof(sfvc));
sfvc.cbSize = sizeof(sfvc) - 1;
psv = (void *)0xdeadbeef;
hr = SHCreateShellFolderView(&sfvc, &psv);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
ok(psv == NULL, "psv = %p\n", psv);
memset(&sfvc, 0, sizeof(sfvc));
sfvc.cbSize = sizeof(sfvc) + 1;
psv = (void *)0xdeadbeef;
hr = SHCreateShellFolderView(&sfvc, &psv);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
ok(psv == NULL, "psv = %p\n", psv);
if (0)
@ -1382,7 +1382,7 @@ if (0)
sfvc.cbSize = sizeof(sfvc);
psv = (void *)0xdeadbeef;
hr = SHCreateShellFolderView(&sfvc, &psv);
ok(hr == E_UNEXPECTED, "Got 0x%08x\n", hr);
ok(hr == E_UNEXPECTED, "Got 0x%08lx\n", hr);
ok(psv == NULL, "psv = %p\n", psv);
}
memset(&sfvc, 0, sizeof(sfvc));
@ -1390,7 +1390,7 @@ if (0)
sfvc.pshf = desktop;
psv = (void *)0xdeadbeef;
hr = SHCreateShellFolderView(&sfvc, &psv);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
ok(psv == NULL, "psv = %p\n", psv);
memset(&sfvc, 0, sizeof(sfvc));
@ -1398,16 +1398,16 @@ if (0)
sfvc.pshf = desktop;
psv = NULL;
hr = SHCreateShellFolderView(&sfvc, &psv);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(psv != NULL, "psv = %p\n", psv);
hr = IShellView_QueryInterface(psv, &IID_CDefView, (void **)&unk);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(unk == (IUnknown *)psv, "got %p\n", unk);
IUnknown_Release(unk);
refCount = IShellView_Release(psv);
ok(refCount == 0, "refCount = %u\n", refCount);
ok(refCount == 0, "refCount = %lu\n", refCount);
IShellFolder_Release(desktop);
}
@ -1422,7 +1422,7 @@ static void test_SHCreateShellFolderViewEx(void)
CSFV csfv;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
if (0)
{
@ -1436,16 +1436,16 @@ static void test_SHCreateShellFolderViewEx(void)
csfv.pshf = desktop;
psv = NULL;
hr = SHCreateShellFolderViewEx(&csfv, &psv);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(psv != NULL, "psv = %p\n", psv);
hr = IShellView_QueryInterface(psv, &IID_CDefView, (void **)&unk);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(hr == S_OK, "got (0x%08lx)\n", hr);
ok(unk == (IUnknown *)psv, "got %p\n", unk);
IUnknown_Release(unk);
refCount = IShellView_Release(psv);
ok(refCount == 0, "refCount = %u\n", refCount);
ok(refCount == 0, "refCount = %lu\n", refCount);
if (0)
{
@ -1454,7 +1454,7 @@ if (0)
csfv.pshf = NULL;
psv = (void *)0xdeadbeef;
hr = SHCreateShellFolderViewEx(&csfv, &psv);
ok(hr == E_UNEXPECTED, "Got 0x%08x\n", hr);
ok(hr == E_UNEXPECTED, "Got 0x%08lx\n", hr);
ok(psv == NULL, "psv = %p\n", psv);
}
memset(&csfv, 0, sizeof(csfv));
@ -1462,12 +1462,12 @@ if (0)
csfv.pshf = desktop;
psv = NULL;
hr = SHCreateShellFolderViewEx(&csfv, &psv);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(psv != NULL, "psv = %p\n", psv);
if (psv)
{
refCount = IShellView_Release(psv);
ok(refCount == 0, "refCount = %u\n", refCount);
ok(refCount == 0, "refCount = %lu\n", refCount);
}
IShellFolder_Release(desktop);
@ -1480,7 +1480,7 @@ static void test_newmenu(void)
hr = CoCreateInstance(&CLSID_NewMenu, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
todo_wine
ok(hr == S_OK, "Failed to create NewMenu object, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to create NewMenu object, hr %#lx.\n", hr);
if (hr != S_OK)
{
skip("NewMenu is not supported.\n");
@ -1488,15 +1488,15 @@ static void test_newmenu(void)
}
hr = IUnknown_QueryInterface(unk, &IID_IShellExtInit, (void **)&unk2);
ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get IShellExtInit, hr %#lx.\n", hr);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_IContextMenu3, (void **)&unk2);
ok(hr == S_OK, "Failed to get IContextMenu3, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get IContextMenu3, hr %#lx.\n", hr);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_IObjectWithSite, (void **)&unk2);
ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#lx.\n", hr);
IUnknown_Release(unk2);
IUnknown_Release(unk);