mirror of
https://github.com/reactos/reactos.git
synced 2025-06-09 11:20:39 +00:00
[SHELL32_WINETEST] Sync with Wine Staging 1.9.14.
svn path=/trunk/; revision=71900
This commit is contained in:
parent
d86051a8c3
commit
94cda5e077
5 changed files with 41 additions and 46 deletions
|
@ -196,9 +196,8 @@ static void register_testwindow_class(void)
|
||||||
|
|
||||||
#define test_window_rects(a, b) \
|
#define test_window_rects(a, b) \
|
||||||
ok(!IntersectRect(&rc, &windows[a].allocated_rect, &windows[b].allocated_rect), \
|
ok(!IntersectRect(&rc, &windows[a].allocated_rect, &windows[b].allocated_rect), \
|
||||||
"rectangles intersect (%i,%i,%i,%i)/(%i,%i,%i,%i)\n", \
|
"rectangles intersect %s / %s\n", wine_dbgstr_rect(&windows[a].allocated_rect), \
|
||||||
windows[a].allocated_rect.left, windows[a].allocated_rect.top, windows[a].allocated_rect.right, windows[a].allocated_rect.bottom, \
|
wine_dbgstr_rect(&windows[b].allocated_rect))
|
||||||
windows[b].allocated_rect.left, windows[b].allocated_rect.top, windows[b].allocated_rect.right, windows[b].allocated_rect.bottom)
|
|
||||||
|
|
||||||
static void test_setpos(void)
|
static void test_setpos(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,31 +104,36 @@ static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCW
|
||||||
{
|
{
|
||||||
IQueryAssociations *assoc;
|
IQueryAssociations *assoc;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
WCHAR *buffer;
|
WCHAR *buffer = NULL;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc);
|
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%x\n", hr);
|
||||||
hr = IQueryAssociations_Init(assoc, 0, assocName, progIdKey, NULL);
|
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%x\n", hr);
|
||||||
|
|
||||||
hr = IQueryAssociations_GetString(assoc, 0, str, NULL, NULL, &len);
|
hr = IQueryAssociations_GetString(assoc, ASSOCF_NONE, str, NULL, NULL, &len);
|
||||||
if (hr != S_FALSE) {
|
|
||||||
if (expected_string) {
|
|
||||||
ok_(__FILE__, line)(SUCCEEDED(hr), "GetString returned 0x%x, expected success\n", hr);
|
|
||||||
} else {
|
|
||||||
ok_(__FILE__, line)(FAILED(hr), "GetString returned 0x%x, expected failure\n", hr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
|
||||||
ok_(__FILE__, line)(buffer != NULL, "out of memory\n");
|
|
||||||
hr = IQueryAssociations_GetString(assoc, 0, str, NULL, buffer, &len);
|
|
||||||
|
|
||||||
if (expected_string) {
|
if (expected_string) {
|
||||||
|
ok_(__FILE__, line)(hr == S_FALSE, "GetString returned 0x%x, expected S_FALSE\n", hr);
|
||||||
|
if (hr != S_FALSE) {
|
||||||
|
/* don't try to allocate memory using uninitialized len */
|
||||||
|
IQueryAssociations_Release(assoc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer = HeapAlloc(GetProcessHeap(), 0, 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)(lstrcmpW(buffer, expected_string) == 0, "GetString returned %s, expected %s\n",
|
ok_(__FILE__, line)(lstrcmpW(buffer, expected_string) == 0, "GetString returned %s, expected %s\n",
|
||||||
wine_dbgstr_w(buffer), wine_dbgstr_w(expected_string));
|
wine_dbgstr_w(buffer), wine_dbgstr_w(expected_string));
|
||||||
|
} else {
|
||||||
|
ok_(__FILE__, line)(FAILED(hr), "GetString returned 0x%x, expected failure\n", hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IQueryAssociations_Release(assoc);
|
||||||
|
HeapFree(GetProcessHeap(), 0, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_IQueryAssociations_GetString(void)
|
static void test_IQueryAssociations_GetString(void)
|
||||||
|
@ -176,17 +181,18 @@ static void test_IQueryAssociations_GetString(void)
|
||||||
getstring_test(test_progidW, 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__);
|
getstring_test(NULL, test_progid_key, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__);
|
||||||
|
|
||||||
RegDeleteKeyW(HKEY_CLASSES_ROOT, test_extensionW);
|
RegDeleteKeyW(test_progid_key, DefaultIconW);
|
||||||
RegDeleteKeyW(HKEY_CLASSES_ROOT, test_progidW);
|
RegDeleteKeyW(HKEY_CLASSES_ROOT, test_progidW);
|
||||||
|
RegDeleteKeyW(HKEY_CLASSES_ROOT, test_extensionW);
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc);
|
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%x\n", hr);
|
||||||
|
|
||||||
hr = IQueryAssociations_Init(assoc, 0, httpW, NULL, NULL);
|
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%x\n", hr);
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
hr = IQueryAssociations_GetString(assoc, 0, ASSOCSTR_EXECUTABLE, NULL, NULL, &len);
|
hr = IQueryAssociations_GetString(assoc, ASSOCF_NONE, ASSOCSTR_EXECUTABLE, NULL, NULL, &len);
|
||||||
ok(hr == S_FALSE, "got 0x%08x\n", hr);
|
ok(hr == S_FALSE, "got 0x%08x\n", hr);
|
||||||
ok(len > 0, "got wrong needed length, %d\n", len);
|
ok(len > 0, "got wrong needed length, %d\n", len);
|
||||||
|
|
||||||
|
@ -195,7 +201,7 @@ static void test_IQueryAssociations_GetString(void)
|
||||||
WCHAR buffW[MAX_PATH];
|
WCHAR buffW[MAX_PATH];
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
|
||||||
hr = IQueryAssociations_Init(assoc, 0, ptr->key, NULL, NULL);
|
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%x\n", i, hr);
|
||||||
|
|
||||||
len = ptr->len;
|
len = ptr->len;
|
||||||
|
@ -232,17 +238,17 @@ static void test_IQueryAssociations_Init(void)
|
||||||
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc);
|
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%x\n", hr);
|
||||||
|
|
||||||
hr = IQueryAssociations_Init(assoc, 0, NULL, NULL, NULL);
|
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%08x\n", hr);
|
||||||
|
|
||||||
hr = IQueryAssociations_Init(assoc, 0, httpW, NULL, NULL);
|
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%08x\n", hr);
|
||||||
|
|
||||||
hr = IQueryAssociations_Init(assoc, 0, badW, NULL, NULL);
|
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%08x\n", hr);
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
hr = IQueryAssociations_GetString(assoc, 0, ASSOCSTR_EXECUTABLE, NULL, NULL, &len);
|
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%08x\n", hr);
|
||||||
|
|
||||||
IQueryAssociations_Release(assoc);
|
IQueryAssociations_Release(assoc);
|
||||||
|
|
|
@ -248,10 +248,8 @@ static void test_click_make_new_folder_button(void)
|
||||||
shfileop.fFlags = FOF_NOCONFIRMATION|FOF_NOERRORUI|FOF_SILENT;
|
shfileop.fFlags = FOF_NOCONFIRMATION|FOF_NOERRORUI|FOF_SILENT;
|
||||||
SHFileOperationA(&shfileop);
|
SHFileOperationA(&shfileop);
|
||||||
|
|
||||||
if (pidl)
|
CoTaskMemFree(pidl);
|
||||||
CoTaskMemFree(pidl);
|
CoTaskMemFree(test_folder_pidl);
|
||||||
if (test_folder_pidl)
|
|
||||||
CoTaskMemFree(test_folder_pidl);
|
|
||||||
test_folder_object->lpVtbl->Release(test_folder_object);
|
test_folder_object->lpVtbl->Release(test_folder_object);
|
||||||
|
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
|
@ -346,16 +344,12 @@ static void test_selection(void)
|
||||||
/* test without flags */
|
/* test without flags */
|
||||||
bi.ulFlags = 0;
|
bi.ulFlags = 0;
|
||||||
pidl = SHBrowseForFolderA(&bi);
|
pidl = SHBrowseForFolderA(&bi);
|
||||||
|
CoTaskMemFree(pidl);
|
||||||
if (pidl)
|
|
||||||
CoTaskMemFree(pidl);
|
|
||||||
|
|
||||||
/* test with flag */
|
/* test with flag */
|
||||||
bi.ulFlags = BIF_NEWDIALOGSTYLE;
|
bi.ulFlags = BIF_NEWDIALOGSTYLE;
|
||||||
pidl = SHBrowseForFolderA(&bi);
|
pidl = SHBrowseForFolderA(&bi);
|
||||||
|
CoTaskMemFree(pidl);
|
||||||
if (pidl)
|
|
||||||
CoTaskMemFree(pidl);
|
|
||||||
|
|
||||||
IShellFolder_Release(desktop_object);
|
IShellFolder_Release(desktop_object);
|
||||||
|
|
||||||
|
|
|
@ -818,8 +818,7 @@ static void test_initialization(void)
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
|
|
||||||
GetClientRect(eb_hwnd, &eb_rc);
|
GetClientRect(eb_hwnd, &eb_rc);
|
||||||
ok(EqualRect(&eb_rc, &exp_rc), "Got client rect (%d, %d)-(%d, %d)\n",
|
ok(EqualRect(&eb_rc, &exp_rc), "Got client rect %s\n", wine_dbgstr_rect(&eb_rc));
|
||||||
eb_rc.left, eb_rc.top, eb_rc.right, eb_rc.bottom);
|
|
||||||
|
|
||||||
GetWindowRect(eb_hwnd, &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.right - eb_rc.left == 50, "Got window width %d\n", eb_rc.right - eb_rc.left);
|
||||||
|
@ -1142,8 +1141,7 @@ static void test_basics(void)
|
||||||
|
|
||||||
GetClientRect(eb_hwnd, &eb_rc);
|
GetClientRect(eb_hwnd, &eb_rc);
|
||||||
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
|
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
|
||||||
ok(EqualRect(&eb_rc, &exp_rc), "Got rect (%d, %d) - (%d, %d)\n",
|
ok(EqualRect(&eb_rc, &exp_rc), "Got rect %s\n", wine_dbgstr_rect(&eb_rc));
|
||||||
eb_rc.left, eb_rc.top, eb_rc.right, eb_rc.bottom);
|
|
||||||
|
|
||||||
/* Try resizing with invalid hdwp */
|
/* Try resizing with invalid hdwp */
|
||||||
rc.bottom = 25;
|
rc.bottom = 25;
|
||||||
|
@ -1152,16 +1150,14 @@ static void test_basics(void)
|
||||||
ok(hr == E_FAIL, "Got 0x%08x\n", hr);
|
ok(hr == E_FAIL, "Got 0x%08x\n", hr);
|
||||||
GetClientRect(eb_hwnd, &eb_rc);
|
GetClientRect(eb_hwnd, &eb_rc);
|
||||||
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
|
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
|
||||||
ok(EqualRect(&eb_rc, &exp_rc), "Got rect (%d, %d) - (%d, %d)\n",
|
ok(EqualRect(&eb_rc, &exp_rc), "Got rect %s\n", wine_dbgstr_rect(&eb_rc));
|
||||||
eb_rc.left, eb_rc.top, eb_rc.right, eb_rc.bottom);
|
|
||||||
|
|
||||||
hdwp = NULL;
|
hdwp = NULL;
|
||||||
hr = IExplorerBrowser_SetRect(peb, &hdwp, rc);
|
hr = IExplorerBrowser_SetRect(peb, &hdwp, rc);
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
GetClientRect(eb_hwnd, &eb_rc);
|
GetClientRect(eb_hwnd, &eb_rc);
|
||||||
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
|
MapWindowPoints(eb_hwnd, hwnd, (POINT*)&eb_rc, 2);
|
||||||
ok(EqualRect(&eb_rc, &exp_rc2), "Got rect (%d, %d) - (%d, %d)\n",
|
ok(EqualRect(&eb_rc, &exp_rc2), "Got rect %s\n", wine_dbgstr_rect(&eb_rc));
|
||||||
eb_rc.left, eb_rc.top, eb_rc.right, eb_rc.bottom);
|
|
||||||
|
|
||||||
IShellBrowser_Release(psb);
|
IShellBrowser_Release(psb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3088,7 +3088,7 @@ static void test_SHGetIDListFromObject(void)
|
||||||
punkimpl->ifaces = ifaces;
|
punkimpl->ifaces = ifaces;
|
||||||
punkimpl->unknown = 0;
|
punkimpl->unknown = 0;
|
||||||
|
|
||||||
hres = pSHGetIDListFromObject((IUnknown*)punkimpl, &pidl);
|
hres = pSHGetIDListFromObject(&punkimpl->IUnknown_iface, &pidl);
|
||||||
ok(hres == E_NOINTERFACE, "Got %x\n", hres);
|
ok(hres == E_NOINTERFACE, "Got %x\n", hres);
|
||||||
ok(ifaces[0].count, "interface not requested.\n");
|
ok(ifaces[0].count, "interface not requested.\n");
|
||||||
ok(ifaces[1].count, "interface not requested.\n");
|
ok(ifaces[1].count, "interface not requested.\n");
|
||||||
|
@ -3260,7 +3260,7 @@ static void test_SHGetItemFromObject(void)
|
||||||
punkimpl->unknown = 0;
|
punkimpl->unknown = 0;
|
||||||
|
|
||||||
/* The same as SHGetIDListFromObject */
|
/* The same as SHGetIDListFromObject */
|
||||||
hres = pSHGetIDListFromObject((IUnknown*)punkimpl, &pidl);
|
hres = pSHGetIDListFromObject(&punkimpl->IUnknown_iface, &pidl);
|
||||||
ok(hres == E_NOINTERFACE, "Got %x\n", hres);
|
ok(hres == E_NOINTERFACE, "Got %x\n", hres);
|
||||||
ok(ifaces[0].count, "interface not requested.\n");
|
ok(ifaces[0].count, "interface not requested.\n");
|
||||||
ok(ifaces[1].count, "interface not requested.\n");
|
ok(ifaces[1].count, "interface not requested.\n");
|
||||||
|
|
Loading…
Reference in a new issue