* Sync with Wine 1.7.17.
* Speedup build.
CORE-8080
svn path=/trunk/; revision=62838
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
-add_definitions(-D__ROS_LONG64__)
-
list(APPEND SOURCE
appbar.c
assoc.c
rsrc.rc)
add_executable(shell32_winetest ${SOURCE})
-target_link_libraries(shell32_winetest wine uuid)
+target_link_libraries(shell32_winetest uuid)
set_module_type(shell32_winetest win32cui)
-add_importlibs(shell32_winetest shell32 ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll)
+add_importlibs(shell32_winetest shell32 ole32 oleaut32 user32 advapi32 msvcrt kernel32)
+if(MSVC)
+ add_importlibs(shell32_winetest ntdll)
+endif()
add_cd_file(TARGET shell32_winetest DESTINATION reactos/bin FOR all)
#include <stdarg.h>
#include <windows.h>
+#include "shellapi.h"
#include "wine/test.h"
static void testwindow_setpos(HWND hwnd)
{
- struct testwindow_info* info = (struct testwindow_info*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ struct testwindow_info* info = (struct testwindow_info*)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
APPBARDATA abd;
BOOL ret;
}
}
- return DefWindowProc(hwnd, msg, wparam, lparam);
+ return DefWindowProcA(hwnd, msg, wparam, lparam);
}
/* process pending messages until a condition is true or 3 seconds pass */
cls.style = 0;
cls.lpfnWndProc = testwindow_wndproc;
cls.hInstance = NULL;
- cls.hCursor = LoadCursor(0, IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
cls.hbrBackground = (HBRUSH) COLOR_WINDOW;
cls.lpszClassName = testwindow_class;
windows[0].desired_rect.right = screen_width;
windows[0].desired_rect.top = screen_height - 15;
windows[0].desired_rect.bottom = screen_height;
- SetWindowLongPtr(windows[0].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[0]);
+ SetWindowLongPtrA(windows[0].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[0]);
testwindow_setpos(windows[0].hwnd);
do_events();
windows[1].desired_rect.right = screen_width;
windows[1].desired_rect.top = screen_height - 10;
windows[1].desired_rect.bottom = screen_height;
- SetWindowLongPtr(windows[1].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[1]);
+ SetWindowLongPtrA(windows[1].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[1]);
testwindow_setpos(windows[1].hwnd);
/* the windows are adjusted to they don't overlap */
windows[2].desired_rect.right = screen_width;
windows[2].desired_rect.top = screen_height - 10;
windows[2].desired_rect.bottom = screen_height;
- SetWindowLongPtr(windows[2].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[2]);
+ SetWindowLongPtrA(windows[2].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[2]);
testwindow_setpos(windows[2].hwnd);
do_events_until(no_appbars_intersect);
IUnknown *unk;
HRESULT hr;
- /* this works since XP */
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&qa);
-
- if (FAILED(hr)) {
- win_skip("CoCreateInstance for IQueryAssociations returned 0x%x\n", hr);
- return;
- }
+ ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IQueryAssociations_QueryInterface(qa, &IID_IQueryAssociations, (void**)&qa2);
ok(hr == S_OK, "QueryInterface (IQueryAssociations) returned 0x%x\n", hr);
IApplicationAssociationRegistration_Release(appreg);
}
+struct assoc_getstring_test
+{
+ const WCHAR *key;
+ ASSOCF flags;
+ ASSOCSTR str;
+ DWORD len;
+ HRESULT hr;
+ HRESULT brokenhr;
+};
+
+static const WCHAR httpW[] = {'h','t','t','p',0};
+static const WCHAR httpsW[] = {'h','t','t','p','s',0};
+static const WCHAR badW[] = {'b','a','d','b','a','d',0};
+
+static struct assoc_getstring_test getstring_tests[] =
+{
+ { httpW, 0, ASSOCSTR_EXECUTABLE, 2, 0x8007007a /* E_NOT_SUFFICIENT_BUFFER */, S_OK },
+ { httpW, ASSOCF_NOTRUNCATE, ASSOCSTR_EXECUTABLE, 2, E_POINTER },
+ { NULL }
+};
+
+static void test_IQueryAssociations_GetString(void)
+{
+ struct assoc_getstring_test *ptr = getstring_tests;
+ IQueryAssociations *assoc;
+ HRESULT hr;
+ DWORD len;
+ int i = 0;
+
+ hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc);
+ ok(hr == S_OK, "failed to create object, 0x%x\n", hr);
+
+ hr = IQueryAssociations_Init(assoc, 0, httpW, NULL, NULL);
+ ok(hr == S_OK, "Init failed, 0x%x\n", hr);
+
+ len = 0;
+ hr = IQueryAssociations_GetString(assoc, 0, ASSOCSTR_EXECUTABLE, NULL, NULL, &len);
+ ok(hr == S_FALSE, "got 0x%08x\n", hr);
+ ok(len > 0, "got wrong needed length, %d\n", len);
+
+ while (ptr->key)
+ {
+ WCHAR buffW[MAX_PATH];
+ DWORD len;
+
+ hr = IQueryAssociations_Init(assoc, 0, ptr->key, NULL, NULL);
+ ok(hr == S_OK, "%d: Init failed, 0x%x\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);
+ 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);
+ }
+
+ /* even with ASSOCF_NOTRUNCATE it's null terminated */
+ if ((ptr->flags & ASSOCF_NOTRUNCATE) && (ptr->len > 0))
+ ok(buffW[0] == 0 || broken(buffW[0] == 0x1) /* pre win7 */, "%d: got %x\n", i, buffW[0]);
+
+ if (!(ptr->flags & ASSOCF_NOTRUNCATE) && ptr->len && FAILED(ptr->hr))
+ ok(buffW[0] != 0, "%d: got %x\n", i, buffW[0]);
+
+ i++;
+ ptr++;
+ }
+
+ IQueryAssociations_Release(assoc);
+}
+
+static void test_IQueryAssociations_Init(void)
+{
+ IQueryAssociations *assoc;
+ HRESULT hr;
+ 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);
+
+ hr = IQueryAssociations_Init(assoc, 0, NULL, NULL, NULL);
+ ok(hr == E_INVALIDARG, "Init failed, 0x%08x\n", hr);
+
+ hr = IQueryAssociations_Init(assoc, 0, httpW, NULL, NULL);
+ ok(hr == S_OK, "Init failed, 0x%08x\n", hr);
+
+ hr = IQueryAssociations_Init(assoc, 0, badW, NULL, NULL);
+ ok(hr == S_OK || broken(hr == S_FALSE) /* pre-vista */, "Init failed, 0x%08x\n", hr);
+
+ len = 0;
+ hr = IQueryAssociations_GetString(assoc, 0, ASSOCSTR_EXECUTABLE, NULL, NULL, &len);
+ ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) || broken(hr == E_FAIL) /* pre-vista */, "got 0x%08x\n", hr);
+
+ IQueryAssociations_Release(assoc);
+}
START_TEST(assoc)
{
+ IQueryAssociations *qa;
+ HRESULT hr;
+
CoInitialize(NULL);
- test_IQueryAssociations_QueryInterface();
+ /* this works since XP */
+ hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&qa);
+ if (hr == S_OK)
+ {
+ test_IQueryAssociations_QueryInterface();
+ test_IQueryAssociations_GetString();
+ test_IQueryAssociations_Init();
+
+ IQueryAssociations_Release(qa);
+ }
+ else
+ win_skip("IQueryAssociations not supported, 0x%x\n", hr);
+
test_IApplicationAssociationRegistration_QueryInterface();
CoUninitialize();
switch(msg) {
case WM_CREATE:
/* create edit control */
- hEdit = CreateWindowEx(0, "EDIT", "Some text", 0, 10, 10, 300, 300,
+ hEdit = CreateWindowExA(0, "EDIT", "Some text", 0, 10, 10, 300, 300,
hWnd, NULL, hinst, NULL);
ok(hEdit != NULL, "Can't create edit control\n");
break;
wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandleA(NULL);
wc.hIcon = NULL;
- wc.hCursor = LoadCursorA(NULL, IDC_IBEAM);
+ wc.hCursor = LoadCursorA(NULL, (LPSTR)IDC_IBEAM);
wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = "MyTestWnd";
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
+#define COBJMACROS
+
#include <windows.h>
#include <shlobj.h>
#include <shobjidl.h>
#include <string.h>
+#include "shellapi.h"
#include "wine/test.h"
#define IDD_MAKENEWFOLDER 0x3746 /* From "../shresdef.h" */
{
int number_of_folders = 0;
char path_search_string[MAX_PATH];
- WIN32_FIND_DATA find_data;
+ WIN32_FIND_DATAA find_data;
HANDLE find_handle;
- strncpy(path_search_string, path, MAX_PATH);
+ lstrcpynA(path_search_string, path, MAX_PATH);
strncat(path_search_string, "*", 1);
- find_handle = FindFirstFile(path_search_string, &find_data);
+ find_handle = FindFirstFileA(path_search_string, &find_data);
if (find_handle == INVALID_HANDLE_VALUE)
return -1;
number_of_folders++;
}
}
- while (FindNextFile(find_handle, &find_data) != 0);
+ while (FindNextFileA(find_handle, &find_data) != 0);
FindClose(find_handle);
return number_of_folders;
{
case 0:
/* Click "Make New Folder" button */
- PostMessage(hwnd, WM_COMMAND, IDD_MAKENEWFOLDER, 0);
+ PostMessageA(hwnd, WM_COMMAND, IDD_MAKENEWFOLDER, 0);
break;
case 1:
/* Set the new folder name to foo by replacing text in edit control */
- SendMessage(GetFocus(), EM_REPLACESEL, 0, (LPARAM) new_folder_name);
+ SendMessageA(GetFocus(), EM_REPLACESEL, 0, (LPARAM) new_folder_name);
SetFocus(hwnd);
break;
case 2:
case 4:
KillTimer(hwnd, idEvent);
/* Close dialog box */
- SendMessage(hwnd, WM_COMMAND, IDOK, 0);
+ SendMessageA(hwnd, WM_COMMAND, IDOK, 0);
break;
default:
break;
static void test_click_make_new_folder_button(void)
{
HRESULT resCoInit, hr;
- BROWSEINFO bi;
+ BROWSEINFOA bi;
LPITEMIDLIST pidl = NULL;
LPITEMIDLIST test_folder_pidl;
IShellFolder *test_folder_object;
char selected_folder[MAX_PATH];
const CHAR title[] = "test_click_make_new_folder_button";
int number_of_folders = -1;
- SHFILEOPSTRUCT shfileop;
+ SHFILEOPSTRUCTA shfileop;
if (does_folder_or_file_exist(title))
{
/* Initialize browse info struct for SHBrowseForFolder */
bi.hwndOwner = NULL;
- bi.pszDisplayName = (LPTSTR) &selected_folder;
- bi.lpszTitle = (LPTSTR) title;
+ bi.pszDisplayName = selected_folder;
+ bi.lpszTitle = title;
bi.ulFlags = BIF_NEWDIALOGSTYLE;
bi.lpfn = create_new_folder_callback;
/* Use test folder as the root folder for dialog box */
bi.pidlRoot = test_folder_pidl;
/* Display dialog box and let callback click the buttons */
- pidl = SHBrowseForFolder(&bi);
+ pidl = SHBrowseForFolderA(&bi);
number_of_folders = get_number_of_folders(test_folder_path);
ok(number_of_folders == 1 || broken(number_of_folders == 0) /* W95, W98 */,
shfileop.pFrom = test_folder_path;
shfileop.pTo = NULL;
shfileop.fFlags = FOF_NOCONFIRMATION|FOF_NOERRORUI|FOF_SILENT;
- SHFileOperation(&shfileop);
+ SHFileOperationA(&shfileop);
if (pidl)
CoTaskMemFree(pidl);
{
case BFFM_INITIALIZED:
/* test with zero values */
- ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 0, 0);
+ ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 0, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
- ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 0, 0);
+ ret = SendMessageA(hwnd, BFFM_SETSELECTIONW, 0, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
- ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 1, 0);
+ ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
if(0)
{
/* Crashes on NT4 */
- ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 1, 0);
+ ret = SendMessageA(hwnd, BFFM_SETSELECTIONW, 1, 0);
ok(!ret, "SendMessage returned: %u\n", ret);
}
- ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 0, (LPARAM)selected_folder_pidl);
+ ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 0, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
- ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 0, (LPARAM)selected_folder_pidl);
+ ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 0, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
- ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)selected_folder_pidl);
+ ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
- ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)selected_folder_pidl);
+ ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)selected_folder_pidl);
ok(!ret, "SendMessage returned: %u\n", ret);
- ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)new_folder_name);
+ ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)new_folder_name);
ok(!ret, "SendMessage returned: %u\n", ret);
- ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)new_folder_name);
+ ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)new_folder_name);
ok(!ret, "SendMessage returned: %u\n", ret);
- SendMessage(hwnd, WM_COMMAND, IDOK, 0);
- return TRUE;
+ SendMessageA(hwnd, WM_COMMAND, IDOK, 0);
+ return 1;
default:
- return FALSE;
+ return 0;
}
}
static void test_selection(void)
{
HRESULT resCoInit, hr;
- BROWSEINFO bi;
+ BROWSEINFOA bi;
LPITEMIDLIST pidl = NULL;
IShellFolder *desktop_object;
WCHAR selected_folderW[MAX_PATH];
/* Initialize browse info struct for SHBrowseForFolder */
bi.hwndOwner = NULL;
bi.pszDisplayName = NULL;
- bi.lpszTitle = (LPTSTR) title;
+ bi.lpszTitle = title;
bi.lpfn = selection_callback;
hr = SHGetDesktopFolder(&desktop_object);
/* test without flags */
bi.ulFlags = 0;
- pidl = SHBrowseForFolder(&bi);
+ pidl = SHBrowseForFolderA(&bi);
if (pidl)
CoTaskMemFree(pidl);
/* test with flag */
bi.ulFlags = BIF_NEWDIALOGSTYLE;
- pidl = SHBrowseForFolder(&bi);
+ pidl = SHBrowseForFolderA(&bi);
if (pidl)
CoTaskMemFree(pidl);
- desktop_object->lpVtbl->Release(desktop_object);
+ IShellFolder_Release(desktop_object);
CoUninitialize();
}
DEFINE_GUID(IID_UnknownInterface8, 0xD3B1CAF5, 0xEC4F, 0x4B2E, 0xBC,0xB0, 0x60,0xD7,0x15,0xC9,0x3C,0xB2);
DEFINE_GUID(IID_UnknownInterface9, 0x9536CA39, 0x1ACB, 0x4AE6, 0xAD,0x27, 0x24,0x03,0xD0,0x4C,0xA2,0x8F);
DEFINE_GUID(IID_UnknownInterface10, 0xB722BE00, 0x4E68, 0x101B, 0xA2,0xBC, 0x00,0xAA,0x00,0x40,0x47,0x70);
+DEFINE_GUID(IID_UnknownInterface11, 0x691ecf9f, 0x6b9c, 0x4311, 0xa1,0x7b, 0xad,0x15,0x4c,0x30,0xe9,0x1f);
+DEFINE_GUID(IID_UnknownInterface12, 0x7e3159f5, 0x21ca, 0x4ec2, 0x8f,0xbe, 0x66,0x2d,0x08,0x2c,0xa3,0xeb);
+DEFINE_GUID(IID_UnknownInterface13, 0xa36a3ace, 0x8332, 0x45ce, 0xaa,0x29, 0x50,0x3c,0xb7,0x6b,0x25,0x87);
+DEFINE_GUID(IID_UnknownInterface14, 0x16770868, 0x239c, 0x445b, 0xa0,0x1d, 0xf2,0x6c,0x7f,0xbb,0xf2,0x6c);
+DEFINE_GUID(IID_UnknownInterface15, 0x05a89298, 0x6246, 0x4c63, 0xbb,0x0d, 0x9b,0xda,0xf1,0x40,0xbf,0x3b);
+DEFINE_GUID(IID_UnknownInterface16, 0x35094a87, 0x8bb1, 0x4237, 0x96,0xc6, 0xc4,0x17,0xee,0xbd,0xb0,0x78);
+DEFINE_GUID(IID_UnknownInterface17, 0x3d5d8c60, 0x21e4, 0x4b03, 0x83,0xb8, 0xc7,0x3f,0x8c,0x94,0x00,0x78);
+DEFINE_GUID(IID_UnknownInterface18, 0x1fc45c07, 0x9e35, 0x4276, 0xad,0x7f, 0x08,0x60,0x3a,0xa0,0xf6,0x0f);
+DEFINE_GUID(IID_UnknownInterface19, 0xacd9b67a, 0xceab, 0x4c6c, 0x90,0xa1, 0xe8,0x57,0xc6,0x59,0xe3,0x9d);
+DEFINE_GUID(IID_UnknownInterface20, 0xd0fe6f62, 0xdea4, 0x46c9, 0x9d,0xae, 0x36,0xcb,0x13,0x99,0x78,0xfa);
static HWND hwnd;
static void process_msgs(void)
{
MSG msg;
- while(PeekMessage( &msg, NULL, 0, 0, PM_REMOVE))
+ while(PeekMessageA( &msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
}
-static void dbg_print_guid(const GUID *guid) {
- WCHAR buf[MAX_PATH];
-
- StringFromGUID2(guid, buf, MAX_PATH);
- printf("guid:[%s]\n", wine_dbgstr_wn(buf, lstrlenW(buf)));
-}
-
/*********************************************************************
* IExplorerBrowserEvents implementation
*/
static HRESULT WINAPI IExplorerPaneVisibility_fnQueryInterface(IExplorerPaneVisibility *iface,
REFIID riid, LPVOID *ppvObj)
{
- ok(0, "Not called.\n");
- trace("REFIID:"); dbg_print_guid(riid);
+ ok(0, "unexpected, %s\n", wine_dbgstr_guid(riid));
*ppvObj = NULL;
return E_NOINTERFACE;
}
else if(IsEqualGUID(&EP_AdvQueryPane, ep)) This->aqp++;
else
{
- trace("Unknown explorer pane: "); dbg_print_guid(ep);
+ trace("Unknown explorer pane: %s\n", wine_dbgstr_guid(ep));
This->unk++;
}
static HRESULT WINAPI ICommDlgBrowser3_fnQueryInterface(ICommDlgBrowser3 *iface, REFIID riid, LPVOID *ppvObj)
{
- ok(0, "Not called.\n");
- trace("riid:"); dbg_print_guid(riid);
+ ok(0, "unexpected %s\n", wine_dbgstr_guid(riid));
*ppvObj = NULL;
return E_NOINTERFACE;
}
return E_NOINTERFACE;
}
- ok(0, "Unexpected interface requested.\n");
- trace("riid: "); dbg_print_guid(riid);
+ ok(0, "Unexpected interface requested, %s\n", wine_dbgstr_guid(riid));
return E_NOINTERFACE;
}
}
}
- ok(was_in_list, "-- Unknown service requested --\n");
- if(!was_in_list)
- {
- trace("guidService: "); dbg_print_guid(guidService);
- trace("riid: "); dbg_print_guid(riid);
- }
+ ok(was_in_list, "unknown service, serviceID: %s, riid: %s\n", wine_dbgstr_guid(guidService), wine_dbgstr_guid(riid));
/* Give back an interface, if any. */
if(punk)
}
/* Some unimplemented methods */
- retHwnd = (HWND)0xDEADBEEF;
+ retHwnd = (HWND)0xdeadbeef;
hr = IShellBrowser_GetControlWindow(psb, FCW_TOOLBAR, &retHwnd);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
- ok(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n");
+ 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(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n");
+ 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(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n");
+ 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(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n");
+ ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd);
/* ::InsertMenuSB */
hr = IShellBrowser_InsertMenusSB(psb, NULL, NULL);
{ &IID_UnknownInterface4, &IID_IUnknown, 0, NULL },
{ &IID_UnknownInterface6, &IID_UnknownInterface7, 0, NULL },
{ &IID_IBrowserWithActivationNotification, &IID_IBrowserWithActivationNotification, 0, NULL },
+ /* Win 8 */
+ { &IID_ICommDlgBrowser, &IID_UnknownInterface11, 0, NULL },
+ { &IID_ICommDlgBrowser, &IID_UnknownInterface12, 0, NULL },
+ { &IID_ICommDlgBrowser, &IID_UnknownInterface20, 0, NULL },
+ { &IID_UnknownInterface13, &IID_IUnknown, 0, NULL },
+ { &IID_UnknownInterface13, &IID_UnknownInterface13, 0, NULL },
+ { &IID_UnknownInterface13, &IID_UnknownInterface18, 0, NULL },
+ { &IID_UnknownInterface14, &IID_UnknownInterface14, 0, NULL },
+ { &IID_UnknownInterface15, &IID_UnknownInterface15, 0, NULL },
+ { &IID_UnknownInterface16, &IID_UnknownInterface16, 0, NULL },
+ { &IID_UnknownInterface17, &IID_UnknownInterface17, 0, NULL },
+ { &IID_UnknownInterface17, &IID_UnknownInterface19, 0, NULL },
/* Other services requested in Vista, Windows 2008 but not in Windows 7 */
{ &IID_IBrowserSettings_Vista, &IID_IBrowserSettings_Vista, 0, NULL },
}
static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
- const struct message *expected, const char *context, int todo,
+ const struct message *expected, const char *context, BOOL todo,
const char *file, int line)
{
struct msg_sequence *msg_seq = seq[sequence_index];
* window creation happened were not encouraging (not including
* SetWindowsHookEx).
*/
-static void CheckWindowCreated(const char *winName, int closeWindow, int testParams)
+static void CheckWindowCreated(const char *winName, BOOL closeWindow, int testParams)
{
HWND window = NULL;
int i;
/* Check for Existence (or non-existence) of a file or group
* When testing for existence of a group, groupName is not needed
*/
-static void CheckFileExistsInProgramGroups(const char *nameToCheck, int shouldExist, int isGroup,
+static void CheckFileExistsInProgramGroups(const char *nameToCheck, BOOL shouldExist, BOOL isGroup,
const char *groupName, int testParams)
{
char path[MAX_PATH];
}
strcat(path, "\\");
strcat(path, nameToCheck);
- attributes = GetFileAttributes(path);
+ attributes = GetFileAttributesA(path);
if (!shouldExist)
{
ok (attributes == INVALID_FILE_ATTRIBUTES , "File exists and shouldn't %s.%s\n",
* 1. window is open
*/
static void ShowGroupTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result,
- const char *groupName, const char *windowTitle, int closeAfterShowing, int testParams)
+ const char *groupName, const char *windowTitle, BOOL closeAfterShowing, int testParams)
{
HDDEDATA hData;
UINT error;
init_strings();
/* Initialize DDE Instance */
- err = DdeInitialize(&instance, DdeCallback, APPCMD_CLIENTONLY, 0);
+ err = DdeInitializeA(&instance, DdeCallback, APPCMD_CLIENTONLY, 0);
ok (err == DMLERR_NO_ERROR, "DdeInitialize Error %s\n", GetStringFromError(err));
/* Create Connection */
- hszProgman = DdeCreateStringHandle(instance, "PROGMAN", CP_WINANSI);
+ hszProgman = DdeCreateStringHandleA(instance, "PROGMAN", CP_WINANSI);
ok (hszProgman != NULL, "DdeCreateStringHandle Error %s\n", GetDdeLastErrorStr(instance));
hConv = DdeConnect(instance, hszProgman, hszProgman, NULL);
ok (DdeFreeStringHandle(instance, hszProgman), "DdeFreeStringHandle failure\n");
/* 2nd Instance (Followup Tests) */
/* Initialize DDE Instance */
instance = 0;
- err = DdeInitialize(&instance, DdeCallback, APPCMD_CLIENTONLY, 0);
+ err = DdeInitializeA(&instance, DdeCallback, APPCMD_CLIENTONLY, 0);
ok (err == DMLERR_NO_ERROR, "DdeInitialize Error %s\n", GetStringFromError(err));
/* Create Connection */
- hszProgman = DdeCreateStringHandle(instance, "PROGMAN", CP_WINANSI);
+ hszProgman = DdeCreateStringHandleA(instance, "PROGMAN", CP_WINANSI);
ok (hszProgman != NULL, "DdeCreateStringHandle Error %s\n", GetDdeLastErrorStr(instance));
hConv = DdeConnect(instance, hszProgman, hszProgman, NULL);
ok (hConv != NULL, "DdeConnect Error %s\n", GetDdeLastErrorStr(instance));
#include "shlguid.h"
#include "shobjidl.h"
#include "shlobj.h"
+#include "shellapi.h"
#include "wine/test.h"
#include "shell32_test.h"
static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*);
static HRESULT (WINAPI *pSHDefExtractIconA)(LPCSTR, int, UINT, HICON*, HICON*, UINT);
-
+static HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID, UINT, SHSTOCKICONINFO *);
static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD);
static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD);
+static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT);
static const GUID _IID_IShellLinkDataList = {
0x45e2b4ae, 0xb1c3, 0x11d0,
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
- ok(lstrcmp(buffer,str)==0, "GetDescription returned '%s'\n", buffer);
+ 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);
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
- ok(*buffer=='\0' || broken(lstrcmp(buffer,str)==0), "GetDescription returned '%s'\n", buffer); /* NT4 */
-
+ ok(*buffer=='\0' || broken(strcmp(buffer,str)==0), "GetDescription returned '%s'\n", buffer); /* NT4 */
/* Test Getting / Setting the work directory */
strcpy(buffer,"garbage");
strcpy(buffer,"garbage");
r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r);
- ok(lstrcmpi(buffer,str)==0, "GetWorkingDirectory returned '%s'\n", buffer);
+ ok(lstrcmpiA(buffer,str)==0, "GetWorkingDirectory returned '%s'\n", buffer);
/* Test Getting / Setting the path */
strcpy(buffer,"garbage");
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_OK, "GetPath failed (0x%08x)\n", r);
- ok(lstrcmpi(buffer,str)==0, "GetPath returned '%s'\n", buffer);
+ ok(lstrcmpiA(buffer,str)==0, "GetPath returned '%s'\n", buffer);
/* Get some real path to play with */
GetWindowsDirectoryA( mypath, sizeof(mypath)-12 );
ret = SHGetPathFromIDListA(tmp_pidl, buffer);
ok(ret, "SHGetPathFromIDListA failed\n");
if (ret)
- ok(lstrcmpi(buffer,str)==0, "GetIDList returned '%s'\n", buffer);
+ ok(lstrcmpiA(buffer,str)==0, "GetIDList returned '%s'\n", buffer);
pILFree(tmp_pidl);
}
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_OK, "GetPath failed (0x%08x)\n", r);
todo_wine
- ok(lstrcmpi(buffer, mypath)==0, "GetPath returned '%s'\n", buffer);
-
+ ok(lstrcmpiA(buffer, mypath)==0, "GetPath returned '%s'\n", buffer);
}
/* test path with quotes (IShellLinkA_SetPath returns S_FALSE on W2K and below and S_OK on XP and above */
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r==S_OK, "GetPath failed (0x%08x)\n", r);
- ok(!lstrcmp(buffer, "C:\\nonexistent\\file") ||
- broken(!lstrcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */
+ ok(!strcmp(buffer, "C:\\nonexistent\\file") ||
+ broken(!strcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */
"case doesn't match\n");
r = IShellLinkA_SetPath(sl, "\"c:\\foo");
strcpy(buffer,"garbage");
r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetArguments failed (0x%08x)\n", r);
- ok(lstrcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer);
+ 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);
r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer));
ok(r == S_OK, "GetArguments failed (0x%08x)\n", r);
- ok(!buffer[0] || lstrcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer);
+ ok(!buffer[0] || strcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer);
strcpy(buffer,"garbage");
r = IShellLinkA_SetArguments(sl, "");
i=0xdeadbeef;
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
- ok(lstrcmpi(buffer,str)==0, "GetIconLocation returned '%s'\n", buffer);
+ ok(lstrcmpiA(buffer,str)==0, "GetIconLocation returned '%s'\n", buffer);
ok(i==0xbabecafe, "GetIconLocation returned %d'\n", i);
/* Test Getting / Setting the hot key */
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
lok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
- lok_todo_4(0x1, lstrcmp(buffer, desc->description)==0,
+ lok_todo_4(0x1, strcmp(buffer, desc->description)==0,
"GetDescription returned '%s' instead of '%s'\n",
buffer, desc->description);
}
strcpy(buffer,"garbage");
r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
lok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r);
- lok_todo_4(0x2, lstrcmpi(buffer, desc->workdir)==0,
+ lok_todo_4(0x2, lstrcmpiA(buffer, desc->workdir)==0,
"GetWorkingDirectory returned '%s' instead of '%s'\n",
buffer, desc->workdir);
}
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
lok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
- lok_todo_4(0x4, lstrcmpi(buffer, desc->path)==0,
+ lok_todo_4(0x4, lstrcmpiA(buffer, desc->path)==0,
"GetPath returned '%s' instead of '%s'\n",
buffer, desc->path);
}
strcpy(buffer,"garbage");
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
lok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
- lok_todo_4(0x20, lstrcmpi(buffer, desc->icon)==0,
+ lok_todo_4(0x20, lstrcmpiA(buffer, desc->icon)==0,
"GetIconLocation returned '%s' instead of '%s'\n",
buffer, desc->icon);
lok_todo_4(0x20, i==desc->icon_id,
create_lnk(lnkfile, &desc, 0);
check_lnk(lnkfile, &desc, 0x0);
- r=GetModuleFileName(NULL, mypath, sizeof(mypath));
+ r=GetModuleFileNameA(NULL, mypath, sizeof(mypath));
ok(r<sizeof(mypath), "GetModuleFileName failed (%d)\n", r);
strcpy(mydir, mypath);
p=strrchr(mydir, '\\');
check_lnk(lnkfile, &desc, 0x4);
/* Create a temporary non-executable file */
- r=GetTempPath(sizeof(mypath), mypath);
+ r=GetTempPathA(sizeof(mypath), mypath);
ok(r<sizeof(mypath), "GetTempPath failed (%d), err %d\n", r, GetLastError());
r=pGetLongPathNameA(mypath, mydir, sizeof(mydir));
ok(r<sizeof(mydir), "GetLongPathName failed (%d), err %d\n", r, GetLastError());
strcpy(mypath, mydir);
strcat(mypath, "\\test.txt");
- hf = CreateFile(mypath, GENERIC_WRITE, 0, NULL,
- CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ hf = CreateFileA(mypath, GENERIC_WRITE, 0, NULL,
+ CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
CloseHandle(hf);
/* Overwrite the existing lnk file and test link to an existing non-executable file */
/* Create a temporary .bat file */
strcpy(mypath, mydir);
strcat(mypath, "\\test.bat");
- hf = CreateFile(mypath, GENERIC_WRITE, 0, NULL,
- CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ hf = CreateFileA(mypath, GENERIC_WRITE, 0, NULL,
+ CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
CloseHandle(hf);
strcpy(realpath, mypath);
i = 0xdeadbeef;
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
- ok(lstrcmpi(buffer,str) == 0, "GetIconLocation returned '%s'\n", buffer);
+ ok(lstrcmpiA(buffer,str) == 0, "GetIconLocation returned '%s'\n", buffer);
ok(i == 0xbabecafe, "GetIconLocation returned %d'\n", i);
IShellLinkA_Release(sl);
}
+static void test_SHGetStockIconInfo(void)
+{
+ BYTE buffer[sizeof(SHSTOCKICONINFO) + 16];
+ SHSTOCKICONINFO *sii = (SHSTOCKICONINFO *) buffer;
+ BOOL atleast_win7;
+ HRESULT hr;
+ INT i;
+
+ /* not present before vista */
+ if (!pSHGetStockIconInfo)
+ {
+ win_skip("SHGetStockIconInfo not available\n");
+ return;
+ }
+
+ /* negative values are handled */
+ memset(buffer, '#', sizeof(buffer));
+ sii->cbSize = sizeof(SHSTOCKICONINFO);
+ hr = pSHGetStockIconInfo(-1, SHGSI_ICONLOCATION, sii);
+ ok(hr == E_INVALIDARG, "-1: got 0x%x (expected E_INVALIDARG)\n", hr);
+
+ /* max. id for vista is 140 (no definition exists for this value) */
+ for (i = 0; i <= 140; i++)
+ {
+ memset(buffer, '#', sizeof(buffer));
+ sii->cbSize = sizeof(SHSTOCKICONINFO);
+ hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii);
+
+ ok(hr == S_OK,
+ "%3d: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n",
+ i, hr, sii->iSysImageIndex, sii->iIcon);
+
+ if ((hr == S_OK) && (winetest_debug > 1))
+ trace("%3d: got iSysImageIndex %3d, iIcon %3d and %s\n", i, sii->iSysImageIndex,
+ sii->iIcon, wine_dbgstr_w(sii->szPath));
+ }
+
+ /* there are more icons since win7 */
+ memset(buffer, '#', sizeof(buffer));
+ sii->cbSize = sizeof(SHSTOCKICONINFO);
+ hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii);
+ atleast_win7 = (!hr);
+
+ for (; i < (SIID_MAX_ICONS + 25) ; i++)
+ {
+ memset(buffer, '#', sizeof(buffer));
+ sii->cbSize = sizeof(SHSTOCKICONINFO);
+ hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii);
+
+ if (atleast_win7 && (i == (SIID_MAX_ICONS - 1)) && broken(hr == E_INVALIDARG))
+ {
+ /* Off by one windows bug: there are SIID_MAX_ICONS icons from 0
+ * up to SIID_MAX_ICONS-1 on Windows 8, but the last one is missing
+ * on Windows 7.
+ */
+ trace("%3d: got E_INVALIDARG (windows bug: off by one)\n", i);
+ }
+ else if (atleast_win7 && (i < (SIID_MAX_ICONS)))
+ {
+ ok(hr == S_OK,
+ "%3d: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n",
+ i, hr, sii->iSysImageIndex, sii->iIcon);
+
+ if ((hr == S_OK) && (winetest_debug > 1))
+ trace("%3d: got iSysImageIndex %3d, iIcon %3d and %s\n", i, sii->iSysImageIndex,
+ sii->iIcon, wine_dbgstr_w(sii->szPath));
+ }
+ else
+ ok(hr == E_INVALIDARG, "%3d: got 0x%x (expected E_INVALIDARG)\n", i, hr);
+ }
+
+ /* test more returned SHSTOCKICONINFO elements without extra flags */
+ 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(!sii->hIcon, "got %p (expected NULL)\n", sii->hIcon);
+ ok(sii->iSysImageIndex == -1, "got %d (expected -1)\n", sii->iSysImageIndex);
+
+ /* the exact size is required of the struct */
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ /* 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);
+}
+
+static void test_SHExtractIcons(void)
+{
+ static const WCHAR notepadW[] = {'n','o','t','e','p','a','d','.','e','x','e',0};
+ static const WCHAR shell32W[] = {'s','h','e','l','l','3','2','.','d','l','l',0};
+ static const WCHAR emptyW[] = {0};
+ UINT ret, ret2;
+ HICON icons[256];
+ UINT ids[256], i;
+
+ if (!pSHExtractIconsW)
+ {
+ win_skip("SHExtractIconsW not available\n");
+ return;
+ }
+
+ ret = pSHExtractIconsW(emptyW, 0, 16, 16, icons, ids, 1, 0);
+ ok(ret == ~0u, "got %u\n", ret);
+
+ ret = pSHExtractIconsW(notepadW, 0, 16, 16, NULL, NULL, 1, 0);
+ ok(ret == 1 || broken(ret == 2) /* win2k */, "got %u\n", ret);
+
+ icons[0] = (HICON)0xdeadbeef;
+ ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, NULL, 1, 0);
+ ok(ret == 1, "got %u\n", ret);
+ ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n");
+ DestroyIcon(icons[0]);
+
+ icons[0] = (HICON)0xdeadbeef;
+ ids[0] = 0xdeadbeef;
+ ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, ids, 1, 0);
+ ok(ret == 1, "got %u\n", ret);
+ ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n");
+ ok(ids[0] != 0xdeadbeef, "id not set\n");
+ DestroyIcon(icons[0]);
+
+ ret = pSHExtractIconsW(shell32W, 0, 16, 16, NULL, NULL, 0, 0);
+ ret2 = pSHExtractIconsW(shell32W, 4, MAKELONG(32,16), MAKELONG(32,16), NULL, NULL, 256, 0);
+ ok(ret && ret == ret2,
+ "icon count should be independent of requested icon sizes and base icon index\n");
+
+ ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 0, 0);
+ ok(ret == ~0u || !ret /* < vista */, "got %u\n", ret);
+
+ ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 3, 0);
+ ok(ret == 3, "got %u\n", ret);
+ for (i = 0; i < ret; i++) DestroyIcon(icons[i]);
+
+ /* count must be a multiple of two when getting two sizes */
+ ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 3, 0);
+ ok(!ret /* vista */ || ret == 4, "got %u\n", ret);
+ for (i = 0; i < ret; i++) DestroyIcon(icons[i]);
+
+ ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 4, 0);
+ ok(ret == 4, "got %u\n", ret);
+ for (i = 0; i < ret; i++) DestroyIcon(icons[i]);
+}
+
START_TEST(shelllink)
{
HRESULT r;
pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21);
pSHILCreateFromPath = (void *)GetProcAddress(hmod, (LPSTR)28);
pSHDefExtractIconA = (void *)GetProcAddress(hmod, "SHDefExtractIconA");
-
+ pSHGetStockIconInfo = (void *)GetProcAddress(hmod, "SHGetStockIconInfo");
pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA");
pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA");
+ pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW");
r = CoInitialize(NULL);
ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r);
test_datalink();
test_shdefextracticon();
test_GetIconLocation();
+ test_SHGetStockIconInfo();
+ test_SHExtractIcons();
CoUninitialize();
}
DEFINE_GUID(FMTID_Test,0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12);
DEFINE_GUID(FMTID_NotExisting, 0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x13);
+DEFINE_GUID(CLSID_ClassMoniker, 0x0000031a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
DEFINE_EXPECT(Stat);
DEFINE_EXPECT(WriteMultiple);
+DEFINE_EXPECT(autoplay_BindToObject);
+DEFINE_EXPECT(autoplay_GetClassObject);
+
static HRESULT (WINAPI *pSHPropStgCreate)(IPropertySetStorage*, REFFMTID, const CLSID*,
DWORD, DWORD, DWORD, IPropertyStorage**, UINT*);
static HRESULT (WINAPI *pSHPropStgReadMultiple)(IPropertyStorage*, UINT,
ULONG, const PROPSPEC*, PROPVARIANT*);
static HRESULT (WINAPI *pSHPropStgWriteMultiple)(IPropertyStorage*, UINT*,
ULONG, const PROPSPEC*, PROPVARIANT*, PROPID);
+static HRESULT (WINAPI *pSHCreateQueryCancelAutoPlayMoniker)(IMoniker**);
static void init(void)
{
pSHPropStgCreate = (void*)GetProcAddress(hmod, "SHPropStgCreate");
pSHPropStgReadMultiple = (void*)GetProcAddress(hmod, "SHPropStgReadMultiple");
pSHPropStgWriteMultiple = (void*)GetProcAddress(hmod, "SHPropStgWriteMultiple");
+ pSHCreateQueryCancelAutoPlayMoniker = (void*)GetProcAddress(hmod, "SHCreateQueryCancelAutoPlayMoniker");
}
static HRESULT WINAPI PropertyStorage_QueryInterface(IPropertyStorage *This,
CHECK_CALLED(Stat);
}
+static HRESULT WINAPI test_activator_QI(IClassActivator *iface, REFIID riid, void **ppv)
+{
+ *ppv = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IClassActivator))
+ {
+ *ppv = iface;
+ }
+
+ if (!*ppv) return E_NOINTERFACE;
+
+ IClassActivator_AddRef(iface);
+
+ return S_OK;
+}
+
+static ULONG WINAPI test_activator_AddRef(IClassActivator *iface)
+{
+ return 2;
+}
+
+static ULONG WINAPI test_activator_Release(IClassActivator *iface)
+{
+ return 1;
+}
+
+static HRESULT WINAPI test_activator_GetClassObject(IClassActivator *iface, REFCLSID clsid,
+ DWORD context, LCID locale, REFIID riid, void **ppv)
+{
+ CHECK_EXPECT(autoplay_GetClassObject);
+ ok(IsEqualGUID(clsid, &CLSID_QueryCancelAutoPlay), "clsid %s\n", wine_dbgstr_guid(clsid));
+ ok(IsEqualIID(riid, &IID_IQueryCancelAutoPlay), "riid %s\n", wine_dbgstr_guid(riid));
+ return E_NOTIMPL;
+}
+
+static const IClassActivatorVtbl test_activator_vtbl = {
+ test_activator_QI,
+ test_activator_AddRef,
+ test_activator_Release,
+ test_activator_GetClassObject
+};
+
+static IClassActivator test_activator = { &test_activator_vtbl };
+
+static HRESULT WINAPI test_moniker_QueryInterface(IMoniker* iface, REFIID riid, void **ppvObject)
+{
+ *ppvObject = 0;
+
+ if (IsEqualIID(&IID_IUnknown, riid) ||
+ IsEqualIID(&IID_IPersist, riid) ||
+ IsEqualIID(&IID_IPersistStream, riid) ||
+ IsEqualIID(&IID_IMoniker, riid))
+ {
+ *ppvObject = iface;
+ }
+
+ if (!*ppvObject)
+ return E_NOINTERFACE;
+
+ return S_OK;
+}
+
+static ULONG WINAPI test_moniker_AddRef(IMoniker* iface)
+{
+ return 2;
+}
+
+static ULONG WINAPI test_moniker_Release(IMoniker* iface)
+{
+ return 1;
+}
+
+static HRESULT WINAPI test_moniker_GetClassID(IMoniker* iface, CLSID *pClassID)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_IsDirty(IMoniker* iface)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_Load(IMoniker* iface, IStream* pStm)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_BindToObject(IMoniker* iface,
+ IBindCtx* pbc,
+ IMoniker* moniker_to_left,
+ REFIID riid,
+ void** ppv)
+{
+ CHECK_EXPECT(autoplay_BindToObject);
+ ok(pbc != NULL, "got %p\n", pbc);
+ ok(moniker_to_left == NULL, "got %p\n", moniker_to_left);
+ ok(IsEqualIID(riid, &IID_IClassActivator), "got riid %s\n", wine_dbgstr_guid(riid));
+
+ if (IsEqualIID(riid, &IID_IClassActivator))
+ {
+ *ppv = &test_activator;
+ return S_OK;
+ }
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_BindToStorage(IMoniker* iface,
+ IBindCtx* pbc,
+ IMoniker* pmkToLeft,
+ REFIID riid,
+ VOID** ppvResult)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_Reduce(IMoniker* iface,
+ IBindCtx* pbc,
+ DWORD dwReduceHowFar,
+ IMoniker** ppmkToLeft,
+ IMoniker** ppmkReduced)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_ComposeWith(IMoniker* iface,
+ IMoniker* pmkRight,
+ BOOL fOnlyIfNotGeneric,
+ IMoniker** ppmkComposite)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_IsEqual(IMoniker* iface, IMoniker* pmkOtherMoniker)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_Hash(IMoniker* iface, DWORD* pdwHash)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_IsRunning(IMoniker* iface,
+ IBindCtx* pbc,
+ IMoniker* pmkToLeft,
+ IMoniker* pmkNewlyRunning)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_GetTimeOfLastChange(IMoniker* iface,
+ IBindCtx* pbc,
+ IMoniker* pmkToLeft,
+ FILETIME* pItemTime)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_Inverse(IMoniker* iface, IMoniker** ppmk)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_GetDisplayName(IMoniker* iface,
+ IBindCtx* pbc,
+ IMoniker* pmkToLeft,
+ LPOLESTR *ppszDisplayName)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_ParseDisplayName(IMoniker* iface,
+ IBindCtx* pbc,
+ IMoniker* pmkToLeft,
+ LPOLESTR pszDisplayName,
+ ULONG* pchEaten,
+ IMoniker** ppmkOut)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI test_moniker_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
+{
+ ok(0, "unexpected call\n");
+ return E_NOTIMPL;
+}
+
+static const IMonikerVtbl test_moniker_vtbl =
+{
+ test_moniker_QueryInterface,
+ test_moniker_AddRef,
+ test_moniker_Release,
+ test_moniker_GetClassID,
+ test_moniker_IsDirty,
+ test_moniker_Load,
+ test_moniker_Save,
+ test_moniker_GetSizeMax,
+ test_moniker_BindToObject,
+ test_moniker_BindToStorage,
+ test_moniker_Reduce,
+ test_moniker_ComposeWith,
+ test_moniker_Enum,
+ test_moniker_IsEqual,
+ test_moniker_Hash,
+ test_moniker_IsRunning,
+ test_moniker_GetTimeOfLastChange,
+ test_moniker_Inverse,
+ test_moniker_CommonPrefixWith,
+ test_moniker_RelativePathTo,
+ test_moniker_GetDisplayName,
+ test_moniker_ParseDisplayName,
+ test_moniker_IsSystemMoniker
+};
+
+static IMoniker test_moniker = { &test_moniker_vtbl };
+
+static void test_SHCreateQueryCancelAutoPlayMoniker(void)
+{
+ IBindCtx *ctxt;
+ IMoniker *mon;
+ IUnknown *unk;
+ CLSID clsid;
+ HRESULT hr;
+ DWORD sys;
+
+ if (!pSHCreateQueryCancelAutoPlayMoniker)
+ {
+ win_skip("SHCreateQueryCancelAutoPlayMoniker is not available, skipping tests.\n");
+ return;
+ }
+
+ hr = pSHCreateQueryCancelAutoPlayMoniker(NULL);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ hr = pSHCreateQueryCancelAutoPlayMoniker(&mon);
+ ok(hr == S_OK, "got 0x%08x\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);
+
+ memset(&clsid, 0, sizeof(clsid));
+ hr = IMoniker_GetClassID(mon, &clsid);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(IsEqualGUID(&clsid, &CLSID_ClassMoniker), "got %s\n", wine_dbgstr_guid(&clsid));
+
+ /* extract used CLSID that implements this hook */
+ SET_EXPECT(autoplay_BindToObject);
+ SET_EXPECT(autoplay_GetClassObject);
+
+ CreateBindCtx(0, &ctxt);
+ hr = IMoniker_BindToObject(mon, ctxt, &test_moniker, &IID_IQueryCancelAutoPlay, (void**)&unk);
+ ok(hr == E_NOTIMPL, "got 0x%08x\n", hr);
+ IBindCtx_Release(ctxt);
+
+ CHECK_CALLED(autoplay_BindToObject);
+ CHECK_CALLED(autoplay_GetClassObject);
+
+ IMoniker_Release(mon);
+}
+
START_TEST(shellole)
{
init();
test_SHPropStg_functions();
+ test_SHCreateQueryCancelAutoPlayMoniker();
}
#include "winbase.h"
#include "shlguid.h"
#include "shlobj.h"
-#include "shellapi.h"
#include "shlwapi.h"
#include "knownfolders.h"
+#include "shellapi.h"
#include "wine/test.h"
#include "initguid.h"
}
}
-static const char *printGUID(const GUID *guid, char * guidSTR)
-{
- if (!guid) return NULL;
-
- sprintf(guidSTR, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- guid->Data1, guid->Data2, guid->Data3,
- guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
- guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
- return guidSTR;
-}
-
static void test_parameters(void)
{
LPITEMIDLIST pidl = NULL;
pidlLast->mkid.abID[0] == PT_GUID))
{
GUID *shellGuid = (GUID *)(pidlLast->mkid.abID + 2);
- char shellGuidStr[39], guidStr[39], guid_altStr[39];
if (!guid_alt)
ok(IsEqualIID(shellGuid, guid),
"%s: got GUID %s, expected %s\n", getFolderName(folder),
- printGUID(shellGuid, shellGuidStr), printGUID(guid, guidStr));
+ wine_dbgstr_guid(shellGuid), wine_dbgstr_guid(guid));
else
ok(IsEqualIID(shellGuid, guid) ||
IsEqualIID(shellGuid, guid_alt),
"%s: got GUID %s, expected %s or %s\n", getFolderName(folder),
- printGUID(shellGuid, shellGuidStr), printGUID(guid, guidStr),
- printGUID(guid_alt, guid_altStr));
+ wine_dbgstr_guid(shellGuid), wine_dbgstr_guid(guid), wine_dbgstr_guid(guid_alt));
}
IMalloc_Free(pMalloc, pidl);
}
static char base[MAX_PATH];
static char selfname[MAX_PATH];
-static int init(void)
+static BOOL init(void)
{
myARGC = winetest_get_mainargs(&myARGV);
- if (!GetCurrentDirectoryA(sizeof(base), base)) return 0;
+ if (!GetCurrentDirectoryA(sizeof(base), base)) return FALSE;
strcpy(selfname, myARGV[0]);
- return 1;
+ return TRUE;
}
static void doChild(const char *arg)
IKnownFolder *folder;
WCHAR sName[1024], sRelativePath[MAX_PATH], sParsingName[MAX_PATH];
BOOL validPath;
- char sParentGuid[39];
BOOL *current_known_folder_found = &known_folder_found[0];
BOOL found = FALSE;
const char *srcParsingName;
ok_(__FILE__, known_folder->line)(kfd.category == known_folder->category, "invalid known folder category for %s: %d expected, but %d retrieved\n", known_folder->sFolderId, known_folder->category, kfd.category);
- printGUID(&kfd.fidParent, sParentGuid);
- ok_(__FILE__, known_folder->line)(IsEqualGUID(known_folder->fidParent, &kfd.fidParent), "invalid known folder parent for %s: %s expected, but %s retrieved\n", known_folder->sFolderId, known_folder->sParent, sParentGuid);
+ ok_(__FILE__, known_folder->line)(IsEqualGUID(known_folder->fidParent, &kfd.fidParent),
+ "invalid known folder parent for %s: %s expected, but %s retrieved\n",
+ known_folder->sFolderId, known_folder->sParent, wine_dbgstr_guid(&kfd.fidParent));
if(!known_folder->sRelativePath)
validPath = (kfd.pszRelativePath==NULL);
if(!found)
{
- printGUID(folderId, sParentGuid);
- trace("unknown known folder found: %s\n", sParentGuid);
+ trace("unknown known folder found: %s\n", wine_dbgstr_guid(folderId));
hr = IKnownFolderManager_GetFolder(mgr, folderId, &folder);
- ok(hr == S_OK, "cannot get known folder for %s\n", sParentGuid);
+ ok(hr == S_OK, "cannot get known folder for %s\n", wine_dbgstr_guid(folderId));
if(SUCCEEDED(hr))
{
hr = IKnownFolder_GetFolderDefinition(folder, &kfd);
todo_wine
- ok(hr == S_OK, "cannot get known folder definition for %s\n", sParentGuid);
+ ok(hr == S_OK, "cannot get known folder definition for %s\n", wine_dbgstr_guid(folderId));
if(SUCCEEDED(hr))
{
trace(" category: %d\n", kfd.category);
trace(" name: %s\n", wine_dbgstr_w(kfd.pszName));
trace(" description: %s\n", wine_dbgstr_w(kfd.pszDescription));
- printGUID(&kfd.fidParent, sParentGuid);
- trace(" parent: %s\n", sParentGuid);
+ trace(" parent: %s\n", wine_dbgstr_guid(&kfd.fidParent));
trace(" relative path: %s\n", wine_dbgstr_w(kfd.pszRelativePath));
trace(" parsing name: %s\n", wine_dbgstr_w(kfd.pszParsingName));
trace(" tooltip: %s\n", wine_dbgstr_w(kfd.pszTooltip));
trace(" security: %s\n", wine_dbgstr_w(kfd.pszSecurity));
trace(" attributes: 0x%08x\n", kfd.dwAttributes);
trace(" flags: 0x%08x\n", kfd.kfdFlags);
- printGUID(&kfd.ftidType, sParentGuid);
- trace(" type: %s\n", sParentGuid);
+ trace(" type: %s\n", wine_dbgstr_guid(&kfd.ftidType));
FreeKnownFolderDefinitionFields(&kfd);
}
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 it's parent folder, but we have no sub folder in new location */
+ /* 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(folderPath==NULL, "invalid known folder path retrieved: \"%s\" when NULL pointer was expected\n", wine_dbgstr_w(folderPath));
" 0: got %s (expected %s)\n", wine_dbgstr_w(bufferW), wine_dbgstr_w(expectedW));
- /* buffer to small */
+ /* Buffer too small */
/* result: FALSE / provided buffer length / the buffer is untouched */
memset(bufferA, '#', MAX_PATH - 1);
bufferA[len + 2] = 0;
#include "wtypes.h"
#include "winbase.h"
#include "windef.h"
-#include "ddeml.h"
#include "shellapi.h"
#include "shlwapi.h"
+#include "ddeml.h"
#include "wine/test.h"
#include "shell32_test.h"
static char tmpdir[MAX_PATH];
static char child_file[MAX_PATH];
static DLLVERSIONINFO dllver;
+static BOOL skip_shlexec_tests = FALSE;
static BOOL skip_noassoc_tests = FALSE;
static HANDLE dde_ready_event;
{
char* event_name;
event_name=strrchr(child_file, '\\')+1;
- hEvent=CreateEvent(NULL, FALSE, FALSE, event_name);
+ hEvent=CreateEventA(NULL, FALSE, FALSE, event_name);
}
static void strcat_param(char* str, const char* name, const char* param)
if (winetest_debug > 1)
trace("%s\n", shell_call);
- DeleteFile(child_file);
+ DeleteFileA(child_file);
SetLastError(0xcafebabe);
/* FIXME: We cannot use ShellExecuteEx() here because if there is no
* association it displays the 'Open With' dialog and I could not find
* a flag to prevent this.
*/
- rc=(INT_PTR)ShellExecute(NULL, verb, file, parameters, directory, SW_SHOWNORMAL);
+ rc=(INT_PTR)ShellExecuteA(NULL, verb, file, parameters, directory, SW_SHOWNORMAL);
if (rc > 32)
{
HWND wnd = FindWindowA("#32770", "Windows");
if (wnd != NULL)
{
- SendMessage(wnd, WM_CLOSE, 0, 0);
+ SendMessageA(wnd, WM_CLOSE, 0, 0);
win_skip("Skipping shellexecute of file with unassociated extension\n");
skip_noassoc_tests = TRUE;
rc = SE_ERR_NOASSOC;
LPCSTR parameters, LPCSTR directory,
LPCSTR class)
{
- SHELLEXECUTEINFO sei;
+ SHELLEXECUTEINFOA sei;
BOOL success;
INT_PTR rc;
U(sei).hIcon=NULL;
sei.hProcess=NULL; /* Out */
- DeleteFile(child_file);
+ DeleteFileA(child_file);
SetLastError(0xcafebabe);
- success=ShellExecuteEx(&sei);
+ success=ShellExecuteExA(&sei);
rc=(INT_PTR)sei.hInstApp;
ok((success && rc > 32) || (!success && rc <= 32),
"%s rc=%d and hInstApp=%ld is not allowed\n", shell_call, success, rc);
LONG rc;
sprintf(class, "shlexec%s", extension);
- rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE,
- NULL, &hkey, NULL);
+ rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE,
+ NULL, &hkey, NULL);
if (rc != ERROR_SUCCESS)
return FALSE;
- rc=RegSetValueEx(hkey, NULL, 0, REG_SZ, (LPBYTE) class, strlen(class)+1);
+ 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);
CloseHandle(hkey);
- rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, class, 0, NULL, 0,
- KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS, NULL, &hkey, NULL);
+ rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, class, 0, NULL, 0,
+ KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS, NULL, &hkey, NULL);
ok(rc==ERROR_SUCCESS, "RegCreateKeyEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc);
- rc=RegCreateKeyEx(hkey, "shell", 0, NULL, 0,
- KEY_CREATE_SUB_KEY, NULL, &hkey_shell, NULL);
+ 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);
CloseHandle(hkey);
LONG rc;
sprintf(shell, "shlexec%s\\shell", extension);
- rc=RegOpenKeyEx(HKEY_CLASSES_ROOT, shell, 0,
- KEY_CREATE_SUB_KEY, &hkey_shell);
- assert(rc==ERROR_SUCCESS);
- rc=RegCreateKeyEx(hkey_shell, verb, 0, NULL, 0, KEY_CREATE_SUB_KEY,
- NULL, &hkey_verb, NULL);
- assert(rc==ERROR_SUCCESS);
- rc=RegCreateKeyEx(hkey_verb, "command", 0, NULL, 0, KEY_SET_VALUE,
- NULL, &hkey_cmd, NULL);
- assert(rc==ERROR_SUCCESS);
+ 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);
+
+ 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);
+
+ 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);
if (rawcmd)
{
- rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmdtail, strlen(cmdtail)+1);
+ rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmdtail, strlen(cmdtail)+1);
}
else
{
cmd=HeapAlloc(GetProcessHeap(), 0, strlen(argv0)+10+strlen(child_file)+2+strlen(cmdtail)+1);
sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail);
- rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1);
- assert(rc==ERROR_SUCCESS);
+ rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1);
+ ok(rc == ERROR_SUCCESS, "setting command failed with %d\n", rc);
HeapFree(GetProcessHeap(), 0, cmd);
}
{
HKEY hkey_ddeexec, hkey_application, hkey_topic, hkey_ifexec;
- rc=RegCreateKeyEx(hkey_verb, "ddeexec", 0, NULL, 0, KEY_SET_VALUE |
- KEY_CREATE_SUB_KEY, NULL, &hkey_ddeexec, NULL);
- assert(rc==ERROR_SUCCESS);
- rc=RegSetValueEx(hkey_ddeexec, NULL, 0, REG_SZ, (LPBYTE)ddeexec,
- strlen(ddeexec)+1);
- assert(rc==ERROR_SUCCESS);
+ 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);
+ rc=RegSetValueExA(hkey_ddeexec, NULL, 0, REG_SZ, (LPBYTE)ddeexec,
+ strlen(ddeexec)+1);
+ ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
+
if (application)
{
- rc=RegCreateKeyEx(hkey_ddeexec, "application", 0, NULL, 0, KEY_SET_VALUE,
- NULL, &hkey_application, NULL);
- assert(rc==ERROR_SUCCESS);
- rc=RegSetValueEx(hkey_application, NULL, 0, REG_SZ, (LPBYTE)application,
- strlen(application)+1);
- assert(rc==ERROR_SUCCESS);
+ 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);
+
+ rc=RegSetValueExA(hkey_application, NULL, 0, REG_SZ, (LPBYTE)application,
+ strlen(application)+1);
+ ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
CloseHandle(hkey_application);
}
if (topic)
{
- rc=RegCreateKeyEx(hkey_ddeexec, "topic", 0, NULL, 0, KEY_SET_VALUE,
- NULL, &hkey_topic, NULL);
- assert(rc==ERROR_SUCCESS);
- rc=RegSetValueEx(hkey_topic, NULL, 0, REG_SZ, (LPBYTE)topic,
- strlen(topic)+1);
- assert(rc==ERROR_SUCCESS);
+ 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);
+ rc=RegSetValueExA(hkey_topic, NULL, 0, REG_SZ, (LPBYTE)topic,
+ strlen(topic)+1);
+ ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
CloseHandle(hkey_topic);
}
if (ifexec)
{
- rc=RegCreateKeyEx(hkey_ddeexec, "ifexec", 0, NULL, 0, KEY_SET_VALUE,
- NULL, &hkey_ifexec, NULL);
- assert(rc==ERROR_SUCCESS);
- rc=RegSetValueEx(hkey_ifexec, NULL, 0, REG_SZ, (LPBYTE)ifexec,
- strlen(ifexec)+1);
- assert(rc==ERROR_SUCCESS);
+ 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);
+ rc=RegSetValueExA(hkey_ifexec, NULL, 0, REG_SZ, (LPBYTE)ifexec,
+ strlen(ifexec)+1);
+ ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc);
CloseHandle(hkey_ifexec);
}
CloseHandle(hkey_ddeexec);
case XTYP_CONNECT:
if (!DdeCmpStringHandles(hsz1, hszTopic))
{
- size = DdeQueryString(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI);
+ size = DdeQueryStringA(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI);
+ ok(size < MAX_PATH, "got size %d\n", size);
assert(size < MAX_PATH);
return (HDDEDATA)TRUE;
}
return (HDDEDATA)FALSE;
case XTYP_EXECUTE:
- size = DdeGetData(hData, (LPBYTE)ddeExec, MAX_PATH, 0L);
+ size = DdeGetData(hData, (LPBYTE)ddeExec, MAX_PATH, 0);
+ ok(size < MAX_PATH, "got size %d\n", size);
assert(size < MAX_PATH);
DdeFreeDataHandle(hData);
if (post_quit_on_execute)
post_quit_on_execute = TRUE;
ddeInst = 0;
rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES |
- CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0L);
- assert(rc == DMLERR_NO_ERROR);
+ CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0);
+ ok(rc == DMLERR_NO_ERROR, "got %d\n", rc);
hszApplication = DdeCreateStringHandleA(ddeInst, shared_block, CP_WINANSI);
hszTopic = DdeCreateStringHandleA(ddeInst, shared_block + strlen(shared_block) + 1, CP_WINANSI);
assert(hszApplication && hszTopic);
- assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_REGISTER | DNS_FILTEROFF));
+ assert(DdeNameService(ddeInst, hszApplication, 0, DNS_REGISTER | DNS_FILTEROFF));
timer = SetTimer(NULL, 0, 2500, childTimeout);
- dde_ready = OpenEvent(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready");
+ dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready");
SetEvent(dde_ready);
CloseHandle(dde_ready);
- while (GetMessage(&msg, NULL, 0, 0))
- DispatchMessage(&msg);
+ while (GetMessageA(&msg, NULL, 0, 0))
+ DispatchMessageA(&msg);
Sleep(500);
KillTimer(NULL, timer);
- assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_UNREGISTER));
+ assert(DdeNameService(ddeInst, hszApplication, 0, DNS_UNREGISTER));
assert(DdeFreeStringHandle(ddeInst, hszTopic));
assert(DdeFreeStringHandle(ddeInst, hszApplication));
assert(DdeUninitialize(ddeInst));
}
else
{
- dde_ready = OpenEvent(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready");
+ dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready");
SetEvent(dde_ready);
CloseHandle(dde_ready);
}
"%s expected %d, but got %d\n", key, expected, result);
}
+static void _okChildIntBroken(const char* file, int line, const char* key, int expected)
+{
+ INT result;
+ result=GetPrivateProfileIntA("Arguments", key, expected, child_file);
+ ok_(file, line)(result == expected || broken(result != expected),
+ "%s expected %d, but got %d\n", key, expected, result);
+}
+
#define okChildString(key, expected) _okChildString(__FILE__, __LINE__, (key), (expected), (expected))
#define okChildStringBroken(key, expected, broken) _okChildString(__FILE__, __LINE__, (key), (expected), (broken))
#define okChildPath(key, expected) _okChildPath(__FILE__, __LINE__, (key), (expected))
-#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected))
+#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected))
+#define okChildIntBroken(key, expected) _okChildIntBroken(__FILE__, __LINE__, (key), (expected))
/***
*
}
for (; *p && *p != '/' && *p != '\\'; p++);
tmplen = p - (shortpath + sp);
- lstrcpyn(tmplongpath + lp, shortpath + sp, tmplen + 1);
+ lstrcpynA(tmplongpath + lp, shortpath + sp, tmplen + 1);
/* Check if the file exists and use the existing file name */
goit = FindFirstFileA(tmplongpath, &wfd);
if (goit == INVALID_HANDLE_VALUE)
char fileA[MAX_PATH];
INT_PTR rc;
+ if (skip_shlexec_tests)
+ {
+ skip("No filename parsing tests due to lack of .shlexec association\n");
+ return;
+ }
+
/* 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);
const char* cmd;
unsigned i, count;
+ if (skip_shlexec_tests)
+ {
+ skip("No argify tests due to lack of .shlexec association\n");
+ return;
+ }
+
create_test_verb(".shlexec", "Params232S", 0, "Params232S %2 %3 \"%2\" \"%*\"");
create_test_verb(".shlexec", "Params23456", 0, "Params23456 \"%2\" \"%3\" \"%4\" \"%5\" \"%6\"");
create_test_verb(".shlexec", "Params23456789", 0, "Params23456789 \"%2\" \"%3\" \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\"");
char* c;
INT_PTR rc;
+ if (skip_shlexec_tests)
+ {
+ skip("No ShellExecute/filename tests due to lack of .shlexec association\n");
+ return;
+ }
+
test=filename_tests;
while (test->basename)
{
char *s;
INT_PTR rc;
- rc = (INT_PTR)ShellExecute(NULL, NULL, "file:///nosuchfile.shlexec", NULL, NULL, SW_SHOWNORMAL);
+ if (skip_shlexec_tests)
+ {
+ skip("No file URL tests due to lack of .shlexec association\n");
+ return;
+ }
+
+ rc = (INT_PTR)ShellExecuteA(NULL, NULL, "file:///nosuchfile.shlexec", NULL, NULL, SW_SHOWNORMAL);
if (rc > 32)
{
win_skip("shell32 is too old (likely < 4.72). Skipping the file URL tests\n");
}
get_long_path_name(tmpdir, longtmpdir, sizeof(longtmpdir)/sizeof(*longtmpdir));
- SetEnvironmentVariable("urlprefix", "file:///");
+ SetEnvironmentVariableA("urlprefix", "file:///");
test=fileurl_tests;
while (test->basename)
test++;
}
- SetEnvironmentVariable("urlprefix", NULL);
+ SetEnvironmentVariableA("urlprefix", NULL);
}
static void test_find_executable(void)
return;
}
+ if (skip_shlexec_tests)
+ {
+ skip("No FindExecutable/filename tests due to lack of .shlexec association\n");
+ return;
+ }
+
test=filename_tests;
while (test->basename)
{
}
if (rc > 32)
{
- int equal;
+ BOOL equal;
equal=strcmp(command, argv0) == 0 ||
/* NT4 returns an extra 0x8 character! */
(strlen(command) == strlen(argv0)+1 && strncmp(command, argv0, strlen(argv0)) == 0);
const filename_tests_t* test;
INT_PTR rc;
- /* 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);
- ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError());
- okChildInt("argcA", 5);
- okChildString("argvA3", "Open");
- sprintf(params, "%s\\test file.shlexec", tmpdir);
- get_long_path_name(params, filename, sizeof(filename));
- okChildPath("argvA4", filename);
+ if (skip_shlexec_tests)
+ skip("No FindExecutable/filename tests due to lack of .shlexec association\n");
+ else
+ {
+ /* 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);
+ ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError());
+ okChildInt("argcA", 5);
+ okChildString("argvA3", "Open");
+ sprintf(params, "%s\\test file.shlexec", tmpdir);
+ get_long_path_name(params, filename, sizeof(filename));
+ okChildPath("argvA4", filename);
- todo_wait rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL);
- ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError());
- okChildInt("argcA", 5);
- todo_wine okChildString("argvA3", "Open");
- sprintf(params, "%s\\test file.shlexec", tmpdir);
- get_long_path_name(params, filename, sizeof(filename));
- todo_wine okChildPath("argvA4", filename);
+ todo_wait rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL);
+ ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError());
+ okChildInt("argcA", 5);
+ todo_wine okChildString("argvA3", "Open");
+ sprintf(params, "%s\\test file.shlexec", tmpdir);
+ get_long_path_name(params, filename, sizeof(filename));
+ todo_wine okChildPath("argvA4", filename);
+ }
/* Should just run our executable */
sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir);
if (! skip_noassoc_tests)
{
sprintf(filename, "%s\\test file.noassoc", tmpdir);
- if (CopyFile(argv0, filename, FALSE))
+ if (CopyFileA(argv0, filename, FALSE))
{
rc=shell_execute(NULL, filename, params, NULL);
todo_wine {
const char* ifexec;
int expectedArgs;
const char* expectedDdeExec;
- int todo;
+ BOOL broken;
} dde_tests_t;
static dde_tests_t dde_tests[] =
{
/* Test passing and not passing command-line
* argument, no DDE */
- {"", NULL, NULL, NULL, NULL, FALSE, "", 0x0},
- {"\"%1\"", NULL, NULL, NULL, NULL, TRUE, "", 0x0},
+ {"", NULL, NULL, NULL, NULL, FALSE, ""},
+ {"\"%1\"", NULL, NULL, NULL, NULL, TRUE, ""},
/* Test passing and not passing command-line
* argument, with DDE */
- {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]", 0x0},
- {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]", 0x0},
+ {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]"},
+ {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]"},
/* Test unquoted %1 in command and ddeexec
* (test filename has space) */
- {"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", 0x0},
+ {"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", TRUE /* before vista */},
/* Test ifexec precedence over ddeexec */
- {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]", 0x0},
+ {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]"},
/* Test default DDE topic */
- {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]", 0x0},
+ {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]"},
/* Test default DDE application */
- {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]", 0x0},
+ {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]"},
- {NULL, NULL, NULL, NULL, NULL, 0, 0x0}
+ {NULL}
};
static DWORD WINAPI hooked_WaitForInputIdle(HANDLE process, DWORD timeout)
dde_ready_event = CreateEventA(NULL, FALSE, FALSE, "winetest_shlexec_dde_ready");
rc = shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, filename, NULL, NULL, NULL);
CloseHandle(dde_ready_event);
- if ((test->todo & 0x1)==0)
- {
- ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call,
- rc, GetLastError());
- }
- else todo_wine
- {
- ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call,
- rc, GetLastError());
- }
+ ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError());
+
if (32 < rc)
{
- if ((test->todo & 0x2)==0)
- {
- okChildInt("argcA", test->expectedArgs + 3);
- }
- else todo_wine
- {
+ if (test->broken)
+ okChildIntBroken("argcA", test->expectedArgs + 3);
+ else
okChildInt("argcA", test->expectedArgs + 3);
- }
- if (test->expectedArgs == 1)
- {
- if ((test->todo & 0x4) == 0)
- {
- okChildPath("argvA3", filename);
- }
- else todo_wine
- {
- okChildPath("argvA3", filename);
- }
- }
- if ((test->todo & 0x8) == 0)
- {
- sprintf(params, test->expectedDdeExec, filename);
- okChildPath("ddeExec", params);
- }
- else todo_wine
- {
- sprintf(params, test->expectedDdeExec, filename);
- okChildPath("ddeExec", params);
- }
+
+ if (test->expectedArgs == 1) okChildPath("argvA3", filename);
+
+ sprintf(params, test->expectedDdeExec, filename);
+ okChildPath("ddeExec", params);
}
delete_test_association(".sde");
{
dde_thread_info_t *info = arg;
assert(info && info->filename);
- PostThreadMessage(info->threadIdParent,
- WM_QUIT,
- shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, info->filename, NULL, NULL, NULL),
- 0L);
+ PostThreadMessageA(info->threadIdParent,
+ WM_QUIT,
+ shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, info->filename, NULL, NULL, NULL),
+ 0);
ExitThread(0);
}
MSG msg;
INT_PTR rc;
int which = 0;
+ HDDEDATA ret;
+ BOOL b;
post_quit_on_execute = FALSE;
ddeInst = 0;
rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES |
- CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0L);
- assert(rc == DMLERR_NO_ERROR);
+ CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0);
+ ok(rc == DMLERR_NO_ERROR, "got %lx\n", rc);
sprintf(filename, "%s\\test file.sde", tmpdir);
/* It is strictly not necessary to register an application name here, but wine's
- * DdeNameService implementation complains if 0L is passed instead of
+ * DdeNameService implementation complains if 0 is passed instead of
* hszApplication with DNS_FILTEROFF */
hszApplication = DdeCreateStringHandleA(ddeInst, "shlexec", CP_WINANSI);
hszTopic = DdeCreateStringHandleA(ddeInst, "shlexec", CP_WINANSI);
- assert(hszApplication && hszTopic);
- assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_REGISTER | DNS_FILTEROFF));
+ ok(hszApplication && hszTopic, "got %p and %p\n", hszApplication, hszTopic);
+ ret = DdeNameService(ddeInst, hszApplication, 0, DNS_REGISTER | DNS_FILTEROFF);
+ ok(ret != 0, "got %p\n", ret);
test = dde_default_app_tests;
while (test->command)
{
+ HANDLE thread;
+
if (!create_test_association(".sde"))
{
skip("Unable to create association for '.sde'\n");
* so don't wait for it */
SetEvent(hEvent);
- assert(CreateThread(NULL, 0, ddeThread, &info, 0, &threadId));
- while (GetMessage(&msg, NULL, 0, 0)) DispatchMessage(&msg);
+ thread = CreateThread(NULL, 0, ddeThread, &info, 0, &threadId);
+ ok(thread != NULL, "got %p\n", thread);
+ while (GetMessageA(&msg, NULL, 0, 0)) DispatchMessageA(&msg);
rc = msg.wParam > 32 ? 33 : msg.wParam;
/* First test, find which set of test data we expect to see */
test++;
}
- assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_UNREGISTER));
- assert(DdeFreeStringHandle(ddeInst, hszTopic));
- assert(DdeFreeStringHandle(ddeInst, hszApplication));
- assert(DdeUninitialize(ddeInst));
+ ret = DdeNameService(ddeInst, hszApplication, 0, DNS_UNREGISTER);
+ ok(ret != 0, "got %p\n", ret);
+ b = DdeFreeStringHandle(ddeInst, hszTopic);
+ ok(b, "got %d\n", b);
+ b = DdeFreeStringHandle(ddeInst, hszApplication);
+ ok(b, "got %d\n", b);
+ b = DdeUninitialize(ddeInst);
+ ok(b, "got %d\n", b);
}
static void init_test(void)
if (FAILED(r))
exit(1);
- rc=GetModuleFileName(NULL, argv0, sizeof(argv0));
- assert(rc!=0 && rc<sizeof(argv0));
- if (GetFileAttributes(argv0)==INVALID_FILE_ATTRIBUTES)
+ rc=GetModuleFileNameA(NULL, argv0, sizeof(argv0));
+ ok(rc != 0 && rc < sizeof(argv0), "got %d\n", rc);
+ if (GetFileAttributesA(argv0)==INVALID_FILE_ATTRIBUTES)
{
strcat(argv0, ".so");
- ok(GetFileAttributes(argv0)!=INVALID_FILE_ATTRIBUTES,
+ ok(GetFileAttributesA(argv0)!=INVALID_FILE_ATTRIBUTES,
"unable to find argv0!\n");
}
GetTempPathA(sizeof(filename), filename);
GetTempFileNameA(filename, "wt", 0, tmpdir);
+ GetLongPathNameA(tmpdir, tmpdir, sizeof(tmpdir));
DeleteFileA( tmpdir );
rc = CreateDirectoryA( tmpdir, NULL );
ok( rc, "failed to create %s err %u\n", tmpdir, GetLastError() );
SetEnvironmentVariableA("TMPDIR", tmpdir);
rc = GetTempFileNameA(tmpdir, "wt", 0, child_file);
- assert(rc != 0);
+ ok(rc != 0, "got %d\n", rc);
init_event(child_file);
/* Set up the test files */
HANDLE hfile;
sprintf(filename, *testfile, tmpdir);
- hfile=CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ hfile=CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hfile==INVALID_HANDLE_VALUE)
{
/* Create a basic association suitable for most tests */
if (!create_test_association(".shlexec"))
{
+ skip_shlexec_tests = TRUE;
skip("Unable to create association for '.shlexec'\n");
return;
}
{
sprintf(filename, *testfile, tmpdir);
/* Make sure we can delete the files ('test file.noassoc' is read-only now) */
- SetFileAttributes(filename, FILE_ATTRIBUTE_NORMAL);
- DeleteFile(filename);
+ SetFileAttributesA(filename, FILE_ATTRIBUTE_NORMAL);
+ DeleteFileA(filename);
testfile++;
}
- DeleteFile(child_file);
+ DeleteFileA(child_file);
RemoveDirectoryA(tmpdir);
/* Delete the test association */
/* Wine does not have a default icon for text files, and Windows 98 fails
* if we give it an empty executable. So use notepad.exe as the test
*/
- if (SearchPath(NULL, "notepad.exe", NULL, sizeof(notepad), notepad, NULL))
+ if (SearchPathA(NULL, "notepad.exe", NULL, sizeof(notepad), notepad, NULL))
{
strcpy(shfi.szDisplayName, "dummy");
shfi.iIcon=0xdeadbeef;
- rc=SHGetFileInfoA(notepad, GetFileAttributes(notepad),
+ rc=SHGetFileInfoA(notepad, GetFileAttributesA(notepad),
&shfi, sizeof(shfi),
SHGFI_ICONLOCATION | SHGFI_USEFILEATTRIBUTES);
ok(rc == 1, "SHGetFileInfoA(%s, SHGFI_USEFILEATTRIBUTES) should return 1, got 0x%x\n", notepad, rc);
ok(rc2 == 1, "SHGetFileInfoA(%s) failed %x\n", notepad, rc2);
if (rc && rc2)
{
- ok(lstrcmpi(shfi2.szDisplayName, shfi.szDisplayName) == 0, "wrong display name %s != %s\n", shfi.szDisplayName, shfi2.szDisplayName);
+ ok(lstrcmpiA(shfi2.szDisplayName, shfi.szDisplayName) == 0, "wrong display name %s != %s\n", shfi.szDisplayName, shfi2.szDisplayName);
ok(shfi2.iIcon == shfi.iIcon, "wrong icon index %d != %d\n", shfi.iIcon, shfi2.iIcon);
}
}
/* with a directory now */
strcpy(shfi.szDisplayName, "dummy");
shfi.iIcon=0xdeadbeef;
- rc=SHGetFileInfoA("test4.txt", GetFileAttributes("test4.txt"),
+ rc=SHGetFileInfoA("test4.txt", GetFileAttributesA("test4.txt"),
&shfi, sizeof(shfi),
SHGFI_ICONLOCATION | SHGFI_USEFILEATTRIBUTES);
ok(rc == 1, "SHGetFileInfoA(test4.txt/, SHGFI_USEFILEATTRIBUTES) should return 1, got 0x%x\n", rc);
ok(rc2 == 1, "SHGetFileInfoA(test4.txt/) should return 1, got 0x%x\n", rc2);
if (rc && rc2)
{
- ok(lstrcmpi(shfi2.szDisplayName, shfi.szDisplayName) == 0, "wrong display name %s != %s\n", shfi.szDisplayName, shfi2.szDisplayName);
+ ok(lstrcmpiA(shfi2.szDisplayName, shfi.szDisplayName) == 0, "wrong display name %s != %s\n", shfi.szDisplayName, shfi2.szDisplayName);
ok(shfi2.iIcon == shfi.iIcon, "wrong icon index %d != %d\n", shfi.iIcon, shfi2.iIcon);
}
/* with drive root directory */
rc=SHGetFileInfoA("c:\\", 0, &shfi, sizeof(shfi),
SHGFI_TYPENAME | SHGFI_DISPLAYNAME | SHGFI_ICON | SHGFI_SMALLICON);
ok(rc == 1, "SHGetFileInfoA(c:\\) should return 1, got 0x%x\n", rc);
- ok(lstrcmp(shfi.szDisplayName, "dummy") != 0, "display name was expected to change\n");
- ok(lstrcmp(shfi.szTypeName, "dummy") != 0, "type name was expected to change\n");
+ ok(strcmp(shfi.szDisplayName, "dummy") != 0, "display name was expected to change\n");
+ ok(strcmp(shfi.szTypeName, "dummy") != 0, "type name was expected to change\n");
ok(shfi.hIcon != (HICON) 0xdeadbeef, "hIcon was expected to change\n");
ok(shfi.iIcon != 0xdeadbeef, "iIcon was expected to change\n");
}
init_shfo_tests();
shfo.fFlags |= FOF_FILESONLY;
shfo.pFrom = "*.txt\0";
- ok(!SHFileOperation(&shfo), "Failed to delete files\n");
+ ok(!SHFileOperationA(&shfo), "Failed to delete files\n");
ok(!file_exists("test1.txt"), "test1.txt should have been removed\n");
ok(!file_exists("test_5.txt"), "test_5.txt should have been removed\n");
ok(dir_exists("test4.txt"), "test4.txt should not have been removed\n");
/* FOF_FILESONLY only deletes a dir if explicitly specified */
init_shfo_tests();
shfo.pFrom = "test_?.txt\0test4.txt\0";
- ok(!SHFileOperation(&shfo), "Failed to delete files and directory\n");
+ ok(!SHFileOperationA(&shfo), "Failed to delete files and directory\n");
ok(!dir_exists("test4.txt") ||
broken(dir_exists("test4.txt")), /* NT4 */
"test4.txt should have been removed\n");
shfo.pFrom = "\0";
shfo.fFlags &= ~FOF_FILESONLY;
shfo.fAnyOperationsAborted = FALSE;
- ret = SHFileOperation(&shfo);
+ ret = SHFileOperationA(&shfo);
ok(ret == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED, got %d\n", ret);
ok(!shfo.fAnyOperationsAborted, "Expected no aborted operations\n");
ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
init_shfo_tests();
shfo.pFrom = "test1.txt\0";
shfo.wFunc = 0;
- ret = SHFileOperation(&shfo);
+ ret = SHFileOperationA(&shfo);
ok(ret == ERROR_INVALID_PARAMETER ||
broken(ret == ERROR_SUCCESS), /* Win9x, NT4 */
"Expected ERROR_INVALID_PARAMETER, got %d\n", ret);
init_shfo_tests();
shfo.pFrom = "";
shfo.wFunc = FO_DELETE;
- ret = SHFileOperation(&shfo);
+ ret = SHFileOperationA(&shfo);
ok(ret == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED, got %d\n", ret);
ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
}
/* delete a nonexistent file */
shfo.pFrom = "nonexistent.txt\0";
shfo.wFunc = FO_DELETE;
- ret = SHFileOperation(&shfo);
+ ret = SHFileOperationA(&shfo);
todo_wine
ok(ret == 1026 ||
ret == ERROR_FILE_NOT_FOUND || /* Vista */
/* Vista would throw up a dialog box that we can't suppress */
init_shfo_tests();
shfo.pFrom = "testdir2\0testdir2\\one.txt\0";
- ret = SHFileOperation(&shfo);
+ ret = SHFileOperationA(&shfo);
ok(ret == ERROR_PATH_NOT_FOUND ||
broken(ret == ERROR_SUCCESS), /* NT4 */
"Expected ERROR_PATH_NOT_FOUND, got %d\n", ret);
else
skip("Test would show a dialog box\n");
+ /* delete an existent file and a nonexistent file */
+ init_shfo_tests();
+ shfo.pFrom = "test1.txt\0nonexistent.txt\0test2.txt\0";
+ shfo.wFunc = FO_DELETE;
+ ret = SHFileOperationA(&shfo);
+ todo_wine
+ ok(ret == 1026 ||
+ ret == ERROR_FILE_NOT_FOUND || /* Vista */
+ broken(ret == ERROR_SUCCESS), /* NT4 */
+ "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", ret);
+ todo_wine
+ ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
+ ok(file_exists("test2.txt"), "Expected test2.txt to exist\n");
+
+ /* delete a nonexistent file in an existent dir or a nonexistent dir */
+ init_shfo_tests();
+ shfo.pFrom = "testdir2\\nonexistent.txt\0";
+ ret = SHFileOperationA(&shfo);
+ todo_wine
+ ok(ret == ERROR_FILE_NOT_FOUND || /* Vista */
+ broken(ret == 0x402) || /* XP */
+ broken(ret == ERROR_SUCCESS), /* NT4 */
+ "Expected 0x402 or ERROR_FILE_NOT_FOUND, got %x\n", ret);
+ shfo.pFrom = "nonexistent\\one.txt\0";
+ ret = SHFileOperationA(&shfo);
+ todo_wine
+ ok(ret == DE_INVALIDFILES || /* Vista or later */
+ broken(ret == 0x402), /* XP */
+ "Expected 0x402 or DE_INVALIDFILES, got %x\n", ret);
+
/* try the FOF_NORECURSION flag, continues deleting subdirs */
init_shfo_tests();
shfo.pFrom = "testdir2\0";
shfo.fFlags |= FOF_NORECURSION;
- ret = SHFileOperation(&shfo);
+ ret = SHFileOperationA(&shfo);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
ok(!file_exists("testdir2\\one.txt"), "Expected testdir2\\one.txt to not exist\n");
ok(!dir_exists("testdir2\\nested"), "Expected testdir2\\nested to not exist\n");
shfo.fFlags = FOF_NOCONFIRMMKDIR;
set_curr_dir_path(from, "test1.txt\0");
set_curr_dir_path(to, "nonexistent\\notreal\\test2.txt\0");
- retval= SHFileOperation(&shfo);
+ retval= SHFileOperationA(&shfo);
ok(!retval, "Error copying into nonexistent directory\n");
ok(file_exists("nonexistent"), "nonexistent not created\n");
ok(file_exists("nonexistent\\notreal"), "nonexistent\\notreal not created\n");
init_shfo_tests();
shfo.pFrom = "test1.txt\0test2.txt\0test3.txt\0";
shfo.pTo = "testdir2\0";
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1 to exist\n");
set_curr_dir_path(from, "test1.txt\0test2.txt\0");
set_curr_dir_path(to, "test3.txt\0");
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(shfo.fAnyOperationsAborted != 0xdeadbeef ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
ok(!file_exists("test3.txt\\test2.txt"), "Expected test3.txt\\test2.txt to not exist\n");
/* try to copy many files to nonexistent directory */
- DeleteFile(to);
+ DeleteFileA(to);
shfo.fFlags &= ~FOF_NOERRORUI;
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(!shfo.fAnyOperationsAborted ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Didn't expect aborted operations\n");
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
- ok(DeleteFile("test3.txt\\test1.txt"), "Expected test3.txt\\test1.txt to exist\n");
- ok(DeleteFile("test3.txt\\test2.txt"), "Expected test3.txt\\test1.txt to exist\n");
- ok(RemoveDirectory(to), "Expected test3.txt to exist\n");
+ ok(DeleteFileA("test3.txt\\test1.txt"), "Expected test3.txt\\test1.txt to exist\n");
+ ok(DeleteFileA("test3.txt\\test2.txt"), "Expected test3.txt\\test1.txt to exist\n");
+ ok(RemoveDirectoryA(to), "Expected test3.txt to exist\n");
/* send in FOF_MULTIDESTFILES with too many destination files */
init_shfo_tests();
shfo.pTo = "testdir2\\a.txt\0testdir2\\b.txt\0testdir2\\c.txt\0testdir2\\d.txt\0";
shfo.fFlags |= FOF_NOERRORUI | FOF_MULTIDESTFILES;
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(shfo.fAnyOperationsAborted != 0xdeadbeef ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n");
- ok(DeleteFile("testdir2\\a.txt\\test1.txt"), "Expected testdir2\\a.txt\\test1.txt to exist\n");
- RemoveDirectory("testdir2\\a.txt");
- ok(DeleteFile("testdir2\\b.txt\\test2.txt"), "Expected testdir2\\b.txt\\test2.txt to exist\n");
- RemoveDirectory("testdir2\\b.txt");
- ok(DeleteFile("testdir2\\c.txt\\test3.txt"), "Expected testdir2\\c.txt\\test3.txt to exist\n");
- RemoveDirectory("testdir2\\c.txt");
+ ok(DeleteFileA("testdir2\\a.txt\\test1.txt"), "Expected testdir2\\a.txt\\test1.txt to exist\n");
+ RemoveDirectoryA("testdir2\\a.txt");
+ ok(DeleteFileA("testdir2\\b.txt\\test2.txt"), "Expected testdir2\\b.txt\\test2.txt to exist\n");
+ RemoveDirectoryA("testdir2\\b.txt");
+ ok(DeleteFileA("testdir2\\c.txt\\test3.txt"), "Expected testdir2\\c.txt\\test3.txt to exist\n");
+ RemoveDirectoryA("testdir2\\c.txt");
ok(!file_exists("testdir2\\d.txt"), "Expected testdir2\\d.txt to not exist\n");
}
else
shfo.pFrom = "test1.txt\0test2.txt\0test3.txt\0";
shfo.pTo = "e.txt\0f.txt\0";
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(shfo.fAnyOperationsAborted != 0xdeadbeef ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
/* Vista and W2K8 (broken or new behavior ?) */
ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n");
ok(retval == DE_SAMEFILE, "Expected DE_SAMEFILE, got %d\n", retval);
- ok(DeleteFile("e.txt\\test1.txt"), "Expected e.txt\\test1.txt to exist\n");
- RemoveDirectory("e.txt");
- ok(DeleteFile("f.txt\\test2.txt"), "Expected f.txt\\test2.txt to exist\n");
- RemoveDirectory("f.txt");
+ ok(DeleteFileA("e.txt\\test1.txt"), "Expected e.txt\\test1.txt to exist\n");
+ RemoveDirectoryA("e.txt");
+ ok(DeleteFileA("f.txt\\test2.txt"), "Expected f.txt\\test2.txt to exist\n");
+ RemoveDirectoryA("f.txt");
}
else
{
shfo.pFrom = "test1.txt\0test2.txt\0test4.txt\0";
shfo.pTo = "testdir2\\a.txt\0testdir2\\b.txt\0testdir2\\c.txt\0";
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(!shfo.fAnyOperationsAborted ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Didn't expect aborted operations\n");
ok(retval == ERROR_SUCCESS ||
broken(retval == 0x100a1), /* WinMe */
"Expected ERROR_SUCCESS, got %d\n", retval);
- ok(DeleteFile("testdir2\\a.txt"), "Expected testdir2\\a.txt to exist\n");
- ok(DeleteFile("testdir2\\b.txt"), "Expected testdir2\\b.txt to exist\n");
+ ok(DeleteFileA("testdir2\\a.txt"), "Expected testdir2\\a.txt to exist\n");
+ ok(DeleteFileA("testdir2\\b.txt"), "Expected testdir2\\b.txt to exist\n");
if (retval == ERROR_SUCCESS)
- ok(RemoveDirectory("testdir2\\c.txt"), "Expected testdir2\\c.txt to exist\n");
+ ok(RemoveDirectoryA("testdir2\\c.txt"), "Expected testdir2\\c.txt to exist\n");
/* try many dest files without FOF_MULTIDESTFILES flag */
shfo.pFrom = "test1.txt\0test2.txt\0test3.txt\0";
shfo.pTo = "a.txt\0b.txt\0c.txt\0";
shfo.fAnyOperationsAborted = 0xdeadbeef;
shfo.fFlags &= ~FOF_MULTIDESTFILES;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(shfo.fAnyOperationsAborted != 0xdeadbeef ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n");
- ok(DeleteFile("a.txt\\test1.txt"), "Expected a.txt\\test1.txt to exist\n");
- ok(DeleteFile("a.txt\\test2.txt"), "Expected a.txt\\test2.txt to exist\n");
- ok(DeleteFile("a.txt\\test3.txt"), "Expected a.txt\\test3.txt to exist\n");
- RemoveDirectory("a.txt");
+ ok(DeleteFileA("a.txt\\test1.txt"), "Expected a.txt\\test1.txt to exist\n");
+ ok(DeleteFileA("a.txt\\test2.txt"), "Expected a.txt\\test2.txt to exist\n");
+ ok(DeleteFileA("a.txt\\test3.txt"), "Expected a.txt\\test3.txt to exist\n");
+ RemoveDirectoryA("a.txt");
}
else
{
shfo.pFrom = "test?.txt\0";
shfo.pTo = "testdir2\0";
shfo.fFlags &= ~FOF_MULTIDESTFILES;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
broken(retval == 0x100a1), /* WinMe */
"Expected ERROR_SUCCESS, got %d\n", retval);
init_shfo_tests();
shfo.pFrom = "test?.txt\0";
shfo.fFlags |= FOF_FILESONLY;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
ok(!dir_exists("testdir2\\test4.txt"), "Expected testdir2\\test4.txt to not exist\n");
shfo.pTo = "testdir2\\a.txt\0testdir2\\b.txt\0testdir2\\c.txt\0testdir2\\d.txt\0";
shfo.fFlags &= ~FOF_FILESONLY;
shfo.fFlags |= FOF_MULTIDESTFILES;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (dir_exists("testdir2\\a.txt"))
{
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
- ok(DeleteFile("testdir2\\a.txt\\test1.txt"), "Expected testdir2\\a.txt\\test1.txt to exist\n");
- ok(DeleteFile("testdir2\\a.txt\\test2.txt"), "Expected testdir2\\a.txt\\test2.txt to exist\n");
- ok(DeleteFile("testdir2\\a.txt\\test3.txt"), "Expected testdir2\\a.txt\\test3.txt to exist\n");
- ok(RemoveDirectory("testdir2\\a.txt\\test4.txt"), "Expected testdir2\\a.txt\\test4.txt to exist\n");
- RemoveDirectory("testdir2\\a.txt");
+ ok(DeleteFileA("testdir2\\a.txt\\test1.txt"), "Expected testdir2\\a.txt\\test1.txt to exist\n");
+ ok(DeleteFileA("testdir2\\a.txt\\test2.txt"), "Expected testdir2\\a.txt\\test2.txt to exist\n");
+ ok(DeleteFileA("testdir2\\a.txt\\test3.txt"), "Expected testdir2\\a.txt\\test3.txt to exist\n");
+ ok(RemoveDirectoryA("testdir2\\a.txt\\test4.txt"), "Expected testdir2\\a.txt\\test4.txt to exist\n");
+ RemoveDirectoryA("testdir2\\a.txt");
}
else
{
"Expected aborted operations\n");
ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\test1.txt to not exist\n");
}
- ok(!RemoveDirectory("b.txt"), "b.txt should not exist\n");
+ ok(!RemoveDirectoryA("b.txt"), "b.txt should not exist\n");
/* copy one file to two others, second is ignored */
clean_after_shfo_tests();
shfo.pFrom = "test1.txt\0";
shfo.pTo = "b.txt\0c.txt\0";
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(!shfo.fAnyOperationsAborted ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Didn't expect aborted operations\n");
else
{
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
- ok(DeleteFile("b.txt"), "Expected b.txt to exist\n");
+ ok(DeleteFileA("b.txt"), "Expected b.txt to exist\n");
}
- ok(!DeleteFile("c.txt"), "Expected c.txt to not exist\n");
+ ok(!DeleteFileA("c.txt"), "Expected c.txt to not exist\n");
/* copy two file to three others, all fail */
shfo.pFrom = "test1.txt\0test2.txt\0";
shfo.pTo = "b.txt\0c.txt\0d.txt\0";
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (dir_exists("b.txt"))
{
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n");
- ok(DeleteFile("b.txt\\test1.txt"), "Expected b.txt\\test1.txt to exist\n");
- RemoveDirectory("b.txt");
- ok(DeleteFile("c.txt\\test2.txt"), "Expected c.txt\\test2.txt to exist\n");
- RemoveDirectory("c.txt");
+ ok(DeleteFileA("b.txt\\test1.txt"), "Expected b.txt\\test1.txt to exist\n");
+ RemoveDirectoryA("b.txt");
+ ok(DeleteFileA("c.txt\\test2.txt"), "Expected c.txt\\test2.txt to exist\n");
+ RemoveDirectoryA("c.txt");
}
else
{
ok(shfo.fAnyOperationsAborted ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Expected aborted operations\n");
- ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n");
+ ok(!DeleteFileA("b.txt"), "Expected b.txt to not exist\n");
}
/* copy one file and one directory to three others */
shfo.pFrom = "test1.txt\0test4.txt\0";
shfo.pTo = "b.txt\0c.txt\0d.txt\0";
shfo.fAnyOperationsAborted = 0xdeadbeef;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (dir_exists("b.txt"))
{
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n");
- ok(DeleteFile("b.txt\\test1.txt"), "Expected b.txt\\test1.txt to exist\n");
- RemoveDirectory("b.txt");
- ok(RemoveDirectory("c.txt\\test4.txt"), "Expected c.txt\\test4.txt to exist\n");
- RemoveDirectory("c.txt");
+ ok(DeleteFileA("b.txt\\test1.txt"), "Expected b.txt\\test1.txt to exist\n");
+ RemoveDirectoryA("b.txt");
+ ok(RemoveDirectoryA("c.txt\\test4.txt"), "Expected c.txt\\test4.txt to exist\n");
+ RemoveDirectoryA("c.txt");
}
else
{
ok(shfo.fAnyOperationsAborted ||
broken(shfo.fAnyOperationsAborted == 0xdeadbeef), /* NT4 */
"Expected aborted operations\n");
- ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n");
- ok(!DeleteFile("c.txt"), "Expected c.txt to not exist\n");
+ ok(!DeleteFileA("b.txt"), "Expected b.txt to not exist\n");
+ ok(!DeleteFileA("c.txt"), "Expected c.txt to not exist\n");
}
/* copy a directory with a file beneath it, plus some files */
shfo.pTo = "testdir2\0";
shfo.fFlags &= ~FOF_MULTIDESTFILES;
shfo.fAnyOperationsAborted = FALSE;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
broken(retval == 0x100a1), /* WinMe */
"Expected ERROR_SUCCESS, got %d\n", retval);
if (retval == ERROR_SUCCESS)
{
- ok(DeleteFile("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
- ok(DeleteFile("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
- ok(RemoveDirectory("testdir2\\test4.txt"), "Expected testdir2\\test4.txt to exist\n");
+ ok(DeleteFileA("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
+ ok(DeleteFileA("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
+ ok(RemoveDirectoryA("testdir2\\test4.txt"), "Expected testdir2\\test4.txt to exist\n");
}
/* copy one directory and a file in that dir to another dir */
shfo.pFrom = "test4.txt\0test4.txt\\a.txt\0";
shfo.pTo = "testdir2\0";
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
broken(retval == 0x100a1), /* WinMe */
"Expected ERROR_SUCCESS, got %d\n", retval);
if (retval == ERROR_SUCCESS)
{
- ok(DeleteFile("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
- ok(DeleteFile("testdir2\\a.txt"), "Expected testdir2\\a.txt to exist\n");
+ ok(DeleteFileA("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
+ ok(DeleteFileA("testdir2\\a.txt"), "Expected testdir2\\a.txt to exist\n");
}
/* copy a file in a directory first, and then the directory to a nonexistent dir */
shfo.pFrom = "test4.txt\\a.txt\0test4.txt\0";
shfo.pTo = "nonexistent\0";
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (dir_exists("nonexistent"))
{
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
- ok(DeleteFile("nonexistent\\test4.txt\\a.txt"), "Expected nonexistent\\test4.txt\\a.txt to exist\n");
- RemoveDirectory("nonexistent\\test4.txt");
- ok(DeleteFile("nonexistent\\a.txt"), "Expected nonexistent\\a.txt to exist\n");
- RemoveDirectory("nonexistent");
+ ok(DeleteFileA("nonexistent\\test4.txt\\a.txt"), "Expected nonexistent\\test4.txt\\a.txt to exist\n");
+ RemoveDirectoryA("nonexistent\\test4.txt");
+ ok(DeleteFileA("nonexistent\\a.txt"), "Expected nonexistent\\a.txt to exist\n");
+ RemoveDirectoryA("nonexistent");
}
else
{
"Expected aborted operations\n");
ok(!file_exists("nonexistent\\test4.txt"), "Expected nonexistent\\test4.txt to not exist\n");
}
- DeleteFile("test4.txt\\a.txt");
+ DeleteFileA("test4.txt\\a.txt");
/* destination is same as source file */
shfo.pFrom = "test1.txt\0test2.txt\0test3.txt\0";
shfo.pTo = "b.txt\0test2.txt\0c.txt\0";
shfo.fAnyOperationsAborted = FALSE;
shfo.fFlags = FOF_NOERRORUI | FOF_MULTIDESTFILES;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (retval == DE_OPCANCELLED)
{
/* NT4 fails and doesn't copy any files */
else
{
ok(retval == DE_SAMEFILE, "Expected DE_SAMEFILE, got %d\n", retval);
- ok(DeleteFile("b.txt"), "Expected b.txt to exist\n");
+ ok(DeleteFileA("b.txt"), "Expected b.txt to exist\n");
}
ok(!shfo.fAnyOperationsAborted, "Expected no operations to be aborted\n");
ok(!file_exists("c.txt"), "Expected c.txt to not exist\n");
shfo.pFrom = "test1.txt\0test4.txt\0test3.txt\0";
shfo.pTo = "b.txt\0test4.txt\0c.txt\0";
shfo.fAnyOperationsAborted = FALSE;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (retval == DE_OPCANCELLED)
{
/* NT4 fails and doesn't copy any files */
ok(retval == ERROR_SUCCESS ||
retval == DE_DESTSAMETREE, /* Vista */
"Expected ERROR_SUCCESS or DE_DESTSAMETREE, got %d\n", retval);
- ok(DeleteFile("b.txt"), "Expected b.txt to exist\n");
+ ok(DeleteFileA("b.txt"), "Expected b.txt to exist\n");
}
ok(!file_exists("c.txt"), "Expected c.txt to not exist\n");
shfo.pTo = "test4.txt\\newdir\0";
shfo.fFlags &= ~FOF_MULTIDESTFILES;
shfo.fAnyOperationsAborted = FALSE;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
retval == DE_DESTSUBTREE, /* Vista */
"Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
- ok(!RemoveDirectory("test4.txt\\newdir"), "Expected test4.txt\\newdir to not exist\n");
+ ok(!RemoveDirectoryA("test4.txt\\newdir"), "Expected test4.txt\\newdir to not exist\n");
/* copy a directory to itself, error displayed in UI */
shfo.pFrom = "test4.txt\0";
shfo.pTo = "test4.txt\0";
shfo.fAnyOperationsAborted = FALSE;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
retval == DE_DESTSUBTREE, /* Vista */
"Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
shfo.pTo = "test4.txt\0";
shfo.fAnyOperationsAborted = FALSE;
shfo.fFlags |= FOF_NOCONFIRMATION;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
retval == DE_DESTSUBTREE, /* Vista */
"Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
- ok(DeleteFile("test4.txt\\test1.txt"), "Expected test4.txt\\test1.txt to exist\n");
+ ok(DeleteFileA("test4.txt\\test1.txt"), "Expected test4.txt\\test1.txt to exist\n");
/* copy a file to a file, and the directory into itself */
shfo.pFrom = "test1.txt\0test4.txt\0";
shfo.pTo = "test4.txt\\a.txt\0";
shfo.fAnyOperationsAborted = FALSE;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (dir_exists("test4.txt\\a.txt"))
{
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == DE_DESTSUBTREE, "Expected DE_DESTSUBTREE, got %d\n", retval);
- ok(DeleteFile("test4.txt\\a.txt\\test1.txt"), "Expected test4.txt\\a.txt\\test1.txt to exist\n");
- RemoveDirectory("test4.txt\\a.txt");
+ ok(DeleteFileA("test4.txt\\a.txt\\test1.txt"), "Expected test4.txt\\a.txt\\test1.txt to exist\n");
+ RemoveDirectoryA("test4.txt\\a.txt");
}
else
{
shfo.pFrom = "e.txt\0";
shfo.pTo = "nonexistent\0";
shfo.fAnyOperationsAborted = FALSE;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == 1026 ||
retval == ERROR_FILE_NOT_FOUND || /* Vista */
broken(retval == ERROR_SUCCESS), /* NT4 */
shfo.pTo = "test2.txt\0";
shfo.fAnyOperationsAborted = 0xdeadbeef;
/* without FOF_NOCONFIRMATION the confirmation is Yes/No */
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n");
ok(file_has_content("test2.txt", "test1.txt\n"), "The file was not copied\n");
shfo.pTo = "test2.txt\0one.txt\0";
shfo.fFlags = FOF_NOCONFIRMATION | FOF_MULTIDESTFILES;
/* without FOF_NOCONFIRMATION the confirmation is Yes/Yes to All/No/Cancel */
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(file_has_content("test2.txt", "test3.txt\n"), "The file was not copied\n");
shfo.pTo = "testdir2\0";
shfo.fFlags = FOF_NOCONFIRMATION;
/* without FOF_NOCONFIRMATION the confirmation is Yes/No */
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == 0, "Expected 0, got %d\n", retval);
ok(file_has_content("testdir2\\one.txt", "test1.txt\n"), "The file was not copied\n");
}
shfo.pTo = "testdir2\0";
/* WinMe needs FOF_NOERRORUI */
shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
broken(retval == 0x100a1), /* WinMe */
"Expected ERROR_SUCCESS, got %d\n", retval);
{
createTestFile("test4.txt\\.\\test1.txt"); /* modify the content of the file */
/* without FOF_NOCONFIRMATION the confirmation is "This folder already contains a folder named ..." */
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == 0, "Expected 0, got %d\n", retval);
ok(file_has_content("testdir2\\test4.txt\\test1.txt", "test4.txt\\.\\test1.txt\n"), "The file was not copied\n");
}
shfo.pFrom = from;
shfo.pTo = "two.txt\0";
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == 1148 || retval == 1026 ||
retval == ERROR_ACCESS_DENIED || /* win2k */
retval == DE_INVALIDFILES, /* Vista */
ok(DeleteFileA("one.txt"), "Expected file to exist\n");
if (dir_exists("two.txt"))
/* Vista and W2K8 (broken or new behavior ?) */
- ok(RemoveDirectory("two.txt"), "Expected two.txt to exist\n");
+ ok(RemoveDirectoryA("two.txt"), "Expected two.txt to exist\n");
else
ok(!DeleteFileA("two.txt"), "Expected file to not exist\n");
shfo.pFrom = "one.txt\0";
shfo.pTo = to;
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (retval == DE_OPCANCELLED)
{
/* NT4 fails and doesn't copy any files */
shfo.pFrom = "one.txt\0";
shfo.pTo = "two.txt\0three.txt\0";
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (retval == DE_OPCANCELLED)
{
/* NT4 fails and doesn't copy any files */
shfo.pFrom = from;
shfo.pTo = to;
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == 1148 || retval == 1026 ||
retval == ERROR_ACCESS_DENIED || /* win2k */
retval == DE_INVALIDFILES, /* Vista */
ok(DeleteFileA("one.txt"), "Expected file to exist\n");
if (dir_exists("two.txt"))
/* Vista and W2K8 (broken or new behavior ?) */
- ok(RemoveDirectory("two.txt"), "Expected two.txt to exist\n");
+ ok(RemoveDirectoryA("two.txt"), "Expected two.txt to exist\n");
else
ok(!DeleteFileA("two.txt"), "Expected file to not exist\n");
shfo.pTo = to;
shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION |
FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (retval == DE_OPCANCELLED)
{
/* NT4 fails and doesn't copy any files */
shfo.pFrom = "one.txt\0two.txt\0";
shfo.pTo = to;
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
if (dir_exists("threedir"))
{
/* Vista and W2K8 (broken or new behavior ?) */
shfo.pFrom = "one.txt\0two.txt\0";
shfo.pTo = to;
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(DeleteFileA("threedir\\one.txt"), "Expected file to exist\n");
ok(DeleteFileA("threedir\\two.txt"), "Expected file to exist\n");
shfo.pTo = to;
shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION |
FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_CANCELLED ||
retval == ERROR_SUCCESS, /* win2k3 */
"Expected ERROR_CANCELLED or ERROR_SUCCESS, got %d\n", retval);
shfo.pTo = to;
shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION |
FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(DeleteFileA("one.txt"), "Expected file to exist\n");
ok(DeleteFileA("two.txt"), "Expected file to exist\n");
shfo.pTo = "threedir\0fourdir\0";
shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION |
FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_CANCELLED ||
retval == DE_FILEDESTISFLD || /* Vista */
broken(retval == DE_OPCANCELLED), /* Win9x, NT4 */
shfo.pTo = "threedir\0fourdir\0five\0";
shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION |
FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(DeleteFileA("one.txt"), "Expected file to exist\n");
ok(DeleteFileA("two.txt"), "Expected file to exist\n");
shfo.pFrom = "a*.txt\0";
shfo.pTo = "one\0two\0";
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
ok(DeleteFileA("one\\aa.txt"), "Expected file to exist\n");
ok(DeleteFileA("one\\ab.txt"), "Expected file to exist\n");
shfo.pFrom = "dir\\abcdefgh.abc\0";
shfo.pTo = "\0";
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
- retval = SHFileOperation(&shfo);
+ retval = SHFileOperationA(&shfo);
ok(retval == ERROR_SUCCESS ||
broken(retval == DE_OPCANCELLED), /* NT4 */
"Expected ERROR_SUCCESS, got %d\n", retval);
init_shfo_tests();
- /* number of sources do not correspond to number of targets */
+ /* number of sources do not correspond to number of targets,
+ include directories */
set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0");
set_curr_dir_path(to, "test6.txt\0test7.txt\0");
retval = SHFileOperationA(&shfo2);
"specified as a target\n");
}
+ init_shfo_tests();
+ /* number of sources do not correspond to number of targets,
+ files only,
+ from exceeds to */
+ set_curr_dir_path(from, "test1.txt\0test2.txt\0test3.txt\0");
+ set_curr_dir_path(to, "test6.txt\0test7.txt\0");
+ retval = SHFileOperationA(&shfo2);
+ if (dir_exists("test6.txt"))
+ {
+ if (retval == ERROR_SUCCESS)
+ {
+ /* Old shell32 */
+ DeleteFileA("test6.txt\\test1.txt");
+ DeleteFileA("test6.txt\\test2.txt");
+ RemoveDirectoryA("test6.txt\\test4.txt");
+ RemoveDirectoryA("test6.txt");
+ }
+ else
+ {
+ /* Vista and W2K8 (broken or new behavior ?) */
+ ok(retval == DE_SAMEFILE, "Expected DE_SAMEFILE, got %d\n", retval);
+ ok(DeleteFileA("test6.txt\\test1.txt"), "The file is not moved\n");
+ RemoveDirectoryA("test6.txt");
+ ok(DeleteFileA("test7.txt\\test2.txt"), "The file is not moved\n");
+ RemoveDirectoryA("test7.txt");
+ ok(file_exists("test3.txt"), "File should not be moved\n");
+ }
+ }
+ else
+ {
+ expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
+ ok(!file_exists("test6.txt"), "The file is not moved - many files are "
+ "specified as a target\n");
+ }
+
+ init_shfo_tests();
+ /* number of sources do not correspond to number of targets,
+ files only,
+ too exceeds from */
+ set_curr_dir_path(from, "test1.txt\0test2.txt\0");
+ set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0");
+ retval = SHFileOperationA(&shfo2);
+ if (dir_exists("test6.txt"))
+ {
+ ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
+ ok(DeleteFileA("test6.txt\\test1.txt"),"The file is not moved\n");
+ ok(DeleteFileA("test7.txt\\test2.txt"),"The file is not moved\n");
+ ok(!dir_exists("test8.txt") && !file_exists("test8.txt"),
+ "Directory should not be created\n");
+ RemoveDirectoryA("test6.txt");
+ RemoveDirectoryA("test7.txt");
+ }
+ else
+ {
+ expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* WinXp, Win2k */);
+ ok(!file_exists("test6.txt"), "The file is not moved - many files are "
+ "specified as a target\n");
+ }
+
+ init_shfo_tests();
+ /* number of sources do not correspond to number of targets,
+ target directories */
+ set_curr_dir_path(from, "test1.txt\0test2.txt\0test3.txt\0");
+ set_curr_dir_path(to, "test4.txt\0test5.txt\0");
+ retval = SHFileOperationA(&shfo2);
+ if (dir_exists("test5.txt"))
+ {
+ ok(retval == DE_SAMEFILE, "Expected DE_SAMEFILE, got %d\n", retval);
+ ok(DeleteFileA("test4.txt\\test1.txt"),"The file is not moved\n");
+ ok(DeleteFileA("test5.txt\\test2.txt"),"The file is not moved\n");
+ ok(file_exists("test3.txt"), "The file is not moved\n");
+ RemoveDirectoryA("test4.txt");
+ RemoveDirectoryA("test5.txt");
+ }
+ else
+ {
+ ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
+ ok(DeleteFileA("test4.txt\\test1.txt"),"The file is not moved\n");
+ ok(DeleteFileA("test4.txt\\test2.txt"),"The file is not moved\n");
+ ok(DeleteFileA("test4.txt\\test3.txt"),"The file is not moved\n");
+ }
+
+
+ init_shfo_tests();
+ /* 0 incomming files */
+ set_curr_dir_path(from, "\0\0");
+ set_curr_dir_path(to, "test6.txt\0\0");
+ retval = SHFileOperationA(&shfo2);
+ ok(retval == ERROR_SUCCESS || retval == ERROR_ACCESS_DENIED
+ , "Expected ERROR_SUCCESS || ERROR_ACCESS_DENIED, got %d\n", retval);
+ ok(!file_exists("test6.txt"), "The file should not exist\n");
+
+ init_shfo_tests();
+ /* 0 outgoing files */
+ set_curr_dir_path(from, "test1\0\0");
+ set_curr_dir_path(to, "\0\0");
+ retval = SHFileOperationA(&shfo2);
+ ok(retval == ERROR_FILE_NOT_FOUND ||
+ broken(retval == 1026)
+ , "Expected ERROR_FILE_NOT_FOUND, got %d\n", retval);
+ ok(!file_exists("test6.txt"), "The file should not exist\n");
+
init_shfo_tests();
set_curr_dir_path(from, "test3.txt\0");
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
if (old_shell32)
{
- DeleteFile("a.txt\\a.txt");
+ DeleteFileA("a.txt\\a.txt");
RemoveDirectoryA("a.txt");
}
else
- ok(DeleteFile("a.txt"), "Expected a.txt to exist\n");
+ ok(DeleteFileA("a.txt"), "Expected a.txt to exist\n");
ok(!file_exists("test1.txt"), "Expected test1.txt to not exist\n");
}
ok(!file_exists("b.txt"), "Expected b.txt to not exist\n");
ok(retval == ERROR_SUCCESS ||
retval == DE_DESTSUBTREE, /* Vista */
"Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
- ok(!RemoveDirectory("test4.txt\\b.txt"), "Expected test4.txt\\b.txt to not exist\n");
+ ok(!RemoveDirectoryA("test4.txt\\b.txt"), "Expected test4.txt\\b.txt to not exist\n");
ok(dir_exists("test4.txt"), "Expected test4.txt to exist\n");
/* move many files without FOF_MULTIDESTFILES */
else
{
expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
- ok(!DeleteFile("d.txt"), "Expected d.txt to not exist\n");
- ok(!DeleteFile("e.txt"), "Expected e.txt to not exist\n");
+ ok(!DeleteFileA("d.txt"), "Expected d.txt to not exist\n");
+ ok(!DeleteFileA("e.txt"), "Expected e.txt to not exist\n");
}
/* number of sources != number of targets */
else
{
expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
- ok(!DeleteFile("d.txt"), "Expected d.txt to not exist\n");
+ ok(!DeleteFileA("d.txt"), "Expected d.txt to not exist\n");
}
/* FO_MOVE does not create dest directories */
static HRESULT (WINAPI *pSHCreateShellFolderView)(const SFV_CREATE *pcsfv, IShellView **ppsv);
static HRESULT (WINAPI *pSHCreateShellFolderViewEx)(LPCSFV psvcbi, IShellView **ppv);
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- riid->Data1, riid->Data2, riid->Data3, riid->Data4[0],
- riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4],
- riid->Data4[5], riid->Data4[6], riid->Data4[7]);
-
- return buf;
-}
-
static WCHAR *make_wstr(const char *str)
{
WCHAR *ret;
/* Tests crash on W2K and below (SHCreateShellItem available as of XP) */
if (pSHCreateShellItem)
{
- /* null name and pidl */
- hr = IShellFolder_ParseDisplayName(IDesktopFolder,
- NULL, NULL, NULL, NULL, NULL, 0);
- ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
+ if (0)
+ {
+ /* null name and pidl, also crashes on Windows 8 */
+ hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL,
+ NULL, NULL, NULL, 0);
+ ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
+ }
/* null name */
newPIDL = (ITEMIDLIST*)0xdeadbeef;
ok(hr == S_OK, "Got 0x%08x\n", hr);
/* CLSID_ShellFSFolder on some w2k systems */
ok(IsEqualIID(&id, &CLSID_ShellDocObjView) || broken(IsEqualIID(&id, &CLSID_ShellFSFolder)),
- "Unexpected classid %s\n", debugstr_guid(&id));
+ "Unexpected classid %s\n", wine_dbgstr_guid(&id));
IPersist_Release(pp);
}
BOOL delret;
DWORD dwret;
int i;
- static char wine[] = "wine";
- static char winetemp[] = "wine\\temp";
+ static const char wine[] = "wine";
+ static const char winetemp[] = "wine\\temp";
static char appdata[MAX_PATH];
static char testpath[MAX_PATH];
static char toolongpath[MAX_PATH+1];
"expected %s to start with %s\n", testpath, appdata);
ok(!lstrcmpA(&testpath[1 + strlen(appdata)], winetemp),
"expected %s to end with %s\n", testpath, winetemp);
- dwret = GetFileAttributes(testpath);
+ dwret = GetFileAttributesA(testpath);
ok(FILE_ATTRIBUTE_DIRECTORY | dwret, "expected %x to contain FILE_ATTRIBUTE_DIRECTORY\n", dwret);
/* cleanup */
static HRESULT WINAPI unk_fnQueryInterface(IUnknown *iunk, REFIID riid, void** punk)
{
IUnknownImpl *This = impl_from_IUnknown(iunk);
- UINT i, found;
- for(i = found = 0; This->ifaces[i].id != NULL; i++)
+ UINT i;
+ BOOL found = FALSE;
+ for(i = 0; This->ifaces[i].id != NULL; i++)
{
if(IsEqualIID(This->ifaces[i].id, riid))
{
This->ifaces[i].count++;
- found = 1;
+ found = TRUE;
break;
}
}
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
- /* BHID_Transfer */
- hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_IUnknown, (void**)&punk);
- ok(hr == E_NOINTERFACE || broken(hr == MK_E_NOOBJECT /* XP */), "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr)) IUnknown_Release(punk);
+ /* BHID_Transfer
+ ITransferSource and ITransferDestination are accessible starting Vista, IUnknown is
+ supported start Win8. */
+ hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_ITransferSource, (void**)&punk);
+ ok(hr == S_OK || broken(FAILED(hr)) /* pre-Vista */, "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr))
+ {
+ IUnknown_Release(punk);
+
+ hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_ITransferDestination, (void**)&punk);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr)) IUnknown_Release(punk);
+
+ hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_IUnknown, (void**)&punk);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* pre-Win8 */, "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr)) IUnknown_Release(punk);
+ }
/* BHID_EnumItems */
hr = IShellItem_BindToHandler(psi, NULL, &BHID_EnumItems, &IID_IEnumShellItems, (void**)&punk);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
+ const int baseItem = 0x40;
HMENU hmenu = CreatePopupMenu();
INT max_id, max_id_check;
UINT count, i;
const int id_upper_limit = 32767;
- hr = IContextMenu_QueryContextMenu(pcm, hmenu, 0, 0, id_upper_limit, CMF_NORMAL);
+ hr = IContextMenu_QueryContextMenu(pcm, hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL);
ok(SUCCEEDED(hr), "Got 0x%08x\n", hr);
max_id = HRESULT_CODE(hr) - 1; /* returns max_id + 1 */
ok(max_id <= id_upper_limit, "Got %d\n", max_id);
{
MENUITEMINFOA mii;
INT res;
+ char buf[255], buf2[255];
ZeroMemory(&mii, sizeof(MENUITEMINFOA));
mii.cbSize = sizeof(MENUITEMINFOA);
- mii.fMask = MIIM_ID | MIIM_FTYPE;
+ mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING;
+ mii.dwTypeData = buf2;
+ mii.cch = sizeof(buf2);
SetLastError(0);
res = GetMenuItemInfoA(hmenu, i, TRUE, &mii);
ok( (mii.wID <= id_upper_limit) || (mii.fType & MFT_SEPARATOR),
"Got non-separator ID out of range: %d (type: %x)\n", mii.wID, mii.fType);
if(!(mii.fType & MFT_SEPARATOR))
+ {
max_id_check = (mii.wID>max_id_check)?mii.wID:max_id_check;
+ hr = IContextMenu_GetCommandString(pcm, mii.wID - baseItem, GCS_VERBA, 0, buf, sizeof(buf));
+ ok(SUCCEEDED(hr) || hr == E_NOTIMPL, "for id 0x%x got 0x%08x (menustr: %s)\n", mii.wID - baseItem, hr, mii.dwTypeData);
+ if (SUCCEEDED(hr))
+ trace("for id 0x%x got string %s (menu string: %s)\n", mii.wID - baseItem, buf, mii.dwTypeData);
+ else if (hr == E_NOTIMPL)
+ trace("for id 0x%x got E_NOTIMPL (menu string: %s)\n", mii.wID - baseItem, mii.dwTypeData);
+ }
}
+ max_id_check -= baseItem;
ok((max_id_check == max_id) ||
(max_id_check == max_id-1 /* Win 7 */),
"Not equal (or near equal), got %d and %d\n", max_id_check, max_id);
ok(0, "Didn't expect a WM_USER_NOTIFY message (event: %x)\n", signal);
return 0;
}
- return DefWindowProc(hwnd, msg, wparam, lparam);
+ return DefWindowProcA(hwnd, msg, wparam, lparam);
}
static void register_testwindow_class(void)
"STRRET_OFFSET: dup failed, ret=%d\n", ret);
/* The next test crashes on W2K, WinXP and W2K3, so we don't test. */
-#if 0
+if (0)
+{
/* Invalid dest - should return FALSE, except NT4 does not, so we don't check. */
strret.uType = STRRET_WSTR;
U(strret).pOleStr = CoDupStrW("Test");
pStrRetToStrNAW(NULL, sizeof(buff)/sizeof(WCHAR), &strret, NULL);
trace("NULL dest: ret=%d\n", ret);
-#endif
+}
}
START_TEST(string)
nidW.hWnd = hMainWnd;
nidW.uID = 1;
nidW.uFlags = NIF_ICON|NIF_MESSAGE;
- nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+ nidW.hIcon = LoadIconA(NULL, (LPSTR)IDI_APPLICATION);
nidW.uCallbackMessage = WM_USER+17;
ret = pShell_NotifyIconW(NIM_ADD, &nidW);
/* using an invalid cbSize does work */
nidA.hWnd = hMainWnd;
nidA.uID = 1;
nidA.uFlags = NIF_ICON|NIF_MESSAGE;
- nidA.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+ nidA.hIcon = LoadIconA(NULL, (LPSTR)IDI_APPLICATION);
nidA.uCallbackMessage = WM_USER+17;
ok(Shell_NotifyIconA(NIM_ADD, &nidA), "NIM_ADD failed!\n");
wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandleA(NULL);
wc.hIcon = NULL;
- wc.hCursor = LoadCursorA(NULL, IDC_IBEAM);
+ wc.hCursor = LoadCursorA(NULL, (LPSTR)IDC_IBEAM);
wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = "MyTestWnd";
- wc.lpfnWndProc = DefWindowProc;
+ wc.lpfnWndProc = DefWindowProcA;
RegisterClassA(&wc);
hMainWnd = CreateWindowExA(0, "MyTestWnd", "Blah", WS_OVERLAPPEDWINDOW,
/* Automatically generated file; DO NOT EDIT!! */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
#define STANDALONE
-#include "wine/test.h"
+#include <wine/test.h>
extern void func_appbar(void);
extern void func_assoc(void);