Commit fa93dadf authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32/tests: Fix compilation with -D__WINESRC__.

parent 9c6ab0f3
TESTDLL = shell32.dll
IMPORTS = shell32 ole32 oleaut32 user32 advapi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \
appbar.c \
......
......@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <windows.h>
#include "shellapi.h"
#include "wine/test.h"
......@@ -47,7 +48,7 @@ static int expected_bottom;
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;
......@@ -113,7 +114,7 @@ static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L
}
}
return DefWindowProc(hwnd, msg, wparam, lparam);
return DefWindowProcA(hwnd, msg, wparam, lparam);
}
/* process pending messages until a condition is true or 3 seconds pass */
......@@ -185,7 +186,7 @@ static void register_testwindow_class(void)
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;
......@@ -234,7 +235,7 @@ static void test_setpos(void)
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();
......@@ -255,7 +256,7 @@ static void test_setpos(void)
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 */
......@@ -287,7 +288,7 @@ static void test_setpos(void)
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);
......
......@@ -194,7 +194,7 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
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;
......@@ -214,7 +214,7 @@ static void createMainWnd(void)
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";
......
......@@ -18,10 +18,14 @@
* 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" */
......@@ -37,13 +41,13 @@ static int get_number_of_folders(LPCSTR path)
{
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;
......@@ -56,7 +60,7 @@ static int get_number_of_folders(LPCSTR path)
number_of_folders++;
}
}
while (FindNextFile(find_handle, &find_data) != 0);
while (FindNextFileA(find_handle, &find_data) != 0);
FindClose(find_handle);
return number_of_folders;
......@@ -81,11 +85,11 @@ static void CALLBACK make_new_folder_timer_callback(HWND hwnd, UINT uMsg,
{
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:
......@@ -104,7 +108,7 @@ static void CALLBACK make_new_folder_timer_callback(HWND hwnd, UINT uMsg,
case 4:
KillTimer(hwnd, idEvent);
/* Close dialog box */
SendMessage(hwnd, WM_COMMAND, IDOK, 0);
SendMessageA(hwnd, WM_COMMAND, IDOK, 0);
break;
default:
break;
......@@ -150,7 +154,7 @@ static int CALLBACK create_new_folder_callback(HWND hwnd, UINT uMsg,
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;
......@@ -161,7 +165,7 @@ static void test_click_make_new_folder_button(void)
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))
{
......@@ -195,8 +199,8 @@ static void test_click_make_new_folder_button(void)
/* 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 */
......@@ -213,7 +217,7 @@ static void test_click_make_new_folder_button(void)
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 */,
......@@ -242,7 +246,7 @@ static void test_click_make_new_folder_button(void)
shfileop.pFrom = test_folder_path;
shfileop.pTo = NULL;
shfileop.fFlags = FOF_NOCONFIRMATION|FOF_NOERRORUI|FOF_SILENT;
SHFileOperation(&shfileop);
SHFileOperationA(&shfileop);
if (pidl)
CoTaskMemFree(pidl);
......@@ -265,37 +269,37 @@ static int CALLBACK selection_callback(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR
{
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);
SendMessageA(hwnd, WM_COMMAND, IDOK, 0);
return 1;
default:
return 0;
......@@ -305,7 +309,7 @@ static int CALLBACK selection_callback(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR
static void test_selection(void)
{
HRESULT resCoInit, hr;
BROWSEINFO bi;
BROWSEINFOA bi;
LPITEMIDLIST pidl = NULL;
IShellFolder *desktop_object;
WCHAR selected_folderW[MAX_PATH];
......@@ -326,7 +330,7 @@ static void test_selection(void)
/* 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);
......@@ -341,19 +345,19 @@ static void test_selection(void)
/* 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();
}
......
......@@ -114,10 +114,10 @@ static HRESULT ebrowser_browse_to_desktop(IExplorerBrowser *peb)
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);
}
}
......
......@@ -411,7 +411,7 @@ static void CheckFileExistsInProgramGroups(const char *nameToCheck, int shouldEx
}
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",
......@@ -705,11 +705,11 @@ START_TEST(progman_dde)
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");
......@@ -730,11 +730,11 @@ START_TEST(progman_dde)
/* 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));
......
......@@ -25,6 +25,7 @@
#include "shldisp.h"
#include "shlobj.h"
#include "shlwapi.h"
#include "winsvc.h"
#include "wine/test.h"
#define EXPECT_HR(hr,hr_exp) \
......
......@@ -26,6 +26,7 @@
#include "shlguid.h"
#include "shobjidl.h"
#include "shlobj.h"
#include "shellapi.h"
#include "wine/test.h"
#include "shell32_test.h"
......@@ -126,7 +127,7 @@ static void test_get_set(void)
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);
......@@ -134,8 +135,7 @@ static void test_get_set(void)
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");
......@@ -150,7 +150,7 @@ static void test_get_set(void)
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");
......@@ -187,7 +187,7 @@ static void test_get_set(void)
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r == S_OK, "GetPath failed (0x%08x)\n", r);
ok(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 );
......@@ -205,7 +205,7 @@ static void test_get_set(void)
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);
}
......@@ -239,8 +239,7 @@ static void test_get_set(void)
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 */
......@@ -250,8 +249,8 @@ static void test_get_set(void)
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r==S_OK, "GetPath failed (0x%08x)\n", r);
ok(!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");
......@@ -282,14 +281,14 @@ static void test_get_set(void)
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, "");
......@@ -327,7 +326,7 @@ static void test_get_set(void)
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 */
......@@ -535,7 +534,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
lok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
lok_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);
}
......@@ -544,7 +543,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
strcpy(buffer,"garbage");
r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
lok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r);
lok_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);
}
......@@ -553,7 +552,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
lok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
lok_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);
}
......@@ -580,7 +579,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
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,
......@@ -650,7 +649,7 @@ static void test_load_save(void)
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, '\\');
......@@ -724,7 +723,7 @@ static void test_load_save(void)
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());
......@@ -734,7 +733,7 @@ static void test_load_save(void)
strcpy(mypath, mydir);
strcat(mypath, "\\test.txt");
hf = CreateFile(mypath, GENERIC_WRITE, 0, NULL,
hf = CreateFileA(mypath, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
CloseHandle(hf);
......@@ -778,7 +777,7 @@ static void test_load_save(void)
/* Create a temporary .bat file */
strcpy(mypath, mydir);
strcat(mypath, "\\test.bat");
hf = CreateFile(mypath, GENERIC_WRITE, 0, NULL,
hf = CreateFileA(mypath, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
CloseHandle(hf);
......@@ -985,7 +984,7 @@ static void test_GetIconLocation(void)
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);
......
......@@ -31,6 +31,7 @@
#include "shlobj.h"
#include "shlwapi.h"
#include "knownfolders.h"
#include "shellapi.h"
#include "wine/test.h"
#include "initguid.h"
......
......@@ -45,6 +45,7 @@
#include "windef.h"
#include "shellapi.h"
#include "shlwapi.h"
#include "ddeml.h"
#include "wine/test.h"
#include "shell32_test.h"
......@@ -72,7 +73,7 @@ static void init_event(const char* child_file)
{
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)
......@@ -109,14 +110,14 @@ static INT_PTR shell_execute(LPCSTR verb, LPCSTR file, LPCSTR parameters, LPCSTR
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)
{
......@@ -127,7 +128,7 @@ static INT_PTR shell_execute(LPCSTR verb, LPCSTR file, LPCSTR parameters, LPCSTR
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;
......@@ -160,7 +161,7 @@ static INT_PTR shell_execute_ex(DWORD mask, LPCSTR verb, LPCSTR file,
LPCSTR parameters, LPCSTR directory,
LPCSTR class)
{
SHELLEXECUTEINFO sei;
SHELLEXECUTEINFOA sei;
BOOL success;
INT_PTR rc;
......@@ -196,9 +197,9 @@ static INT_PTR shell_execute_ex(DWORD mask, LPCSTR verb, LPCSTR file,
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);
......@@ -242,20 +243,20 @@ static BOOL create_test_association(const char* extension)
LONG rc;
sprintf(class, "shlexec%s", extension);
rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE,
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,
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,
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);
......@@ -352,25 +353,25 @@ static void create_test_verb_dde(const char* extension, const char* verb,
LONG rc;
sprintf(shell, "shlexec%s\\shell", extension);
rc=RegOpenKeyEx(HKEY_CLASSES_ROOT, shell, 0,
rc=RegOpenKeyExA(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,
rc=RegCreateKeyExA(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,
rc=RegCreateKeyExA(hkey_verb, "command", 0, NULL, 0, KEY_SET_VALUE,
NULL, &hkey_cmd, NULL);
assert(rc==ERROR_SUCCESS);
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);
rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1);
assert(rc==ERROR_SUCCESS);
HeapFree(GetProcessHeap(), 0, cmd);
}
......@@ -379,38 +380,38 @@ static void create_test_verb_dde(const char* extension, const char* verb,
{
HKEY hkey_ddeexec, hkey_application, hkey_topic, hkey_ifexec;
rc=RegCreateKeyEx(hkey_verb, "ddeexec", 0, NULL, 0, KEY_SET_VALUE |
rc=RegCreateKeyExA(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,
rc=RegSetValueExA(hkey_ddeexec, NULL, 0, REG_SZ, (LPBYTE)ddeexec,
strlen(ddeexec)+1);
assert(rc==ERROR_SUCCESS);
if (application)
{
rc=RegCreateKeyEx(hkey_ddeexec, "application", 0, NULL, 0, KEY_SET_VALUE,
rc=RegCreateKeyExA(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,
rc=RegSetValueExA(hkey_application, NULL, 0, REG_SZ, (LPBYTE)application,
strlen(application)+1);
assert(rc==ERROR_SUCCESS);
CloseHandle(hkey_application);
}
if (topic)
{
rc=RegCreateKeyEx(hkey_ddeexec, "topic", 0, NULL, 0, KEY_SET_VALUE,
rc=RegCreateKeyExA(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,
rc=RegSetValueExA(hkey_topic, NULL, 0, REG_SZ, (LPBYTE)topic,
strlen(topic)+1);
assert(rc==ERROR_SUCCESS);
CloseHandle(hkey_topic);
}
if (ifexec)
{
rc=RegCreateKeyEx(hkey_ddeexec, "ifexec", 0, NULL, 0, KEY_SET_VALUE,
rc=RegCreateKeyExA(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,
rc=RegSetValueExA(hkey_ifexec, NULL, 0, REG_SZ, (LPBYTE)ifexec,
strlen(ifexec)+1);
assert(rc==ERROR_SUCCESS);
CloseHandle(hkey_ifexec);
......@@ -517,7 +518,7 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv,
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);
assert(size < MAX_PATH);
return (HDDEDATA)TRUE;
}
......@@ -601,12 +602,12 @@ static void doChild(int argc, char** argv)
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);
......@@ -617,7 +618,7 @@ static void doChild(int argc, char** argv)
}
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);
}
......@@ -792,7 +793,7 @@ static DWORD get_long_path_name(const char* shortpath, char* longpath, DWORD lon
}
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)
......@@ -1685,7 +1686,7 @@ static void test_fileurls(void)
char *s;
INT_PTR rc;
rc = (INT_PTR)ShellExecute(NULL, NULL, "file:///nosuchfile.shlexec", NULL, NULL, SW_SHOWNORMAL);
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");
......@@ -1693,7 +1694,7 @@ static void test_fileurls(void)
}
get_long_path_name(tmpdir, longtmpdir, sizeof(longtmpdir)/sizeof(*longtmpdir));
SetEnvironmentVariable("urlprefix", "file:///");
SetEnvironmentVariableA("urlprefix", "file:///");
test=fileurl_tests;
while (test->basename)
......@@ -1764,7 +1765,7 @@ static void test_fileurls(void)
test++;
}
SetEnvironmentVariable("urlprefix", NULL);
SetEnvironmentVariableA("urlprefix", NULL);
}
static void test_find_executable(void)
......@@ -2052,7 +2053,7 @@ static void test_exes(void)
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 {
......@@ -2336,10 +2337,10 @@ static DWORD CALLBACK ddeThread(LPVOID arg)
{
dde_thread_info_t *info = arg;
assert(info && info->filename);
PostThreadMessage(info->threadIdParent,
PostThreadMessageA(info->threadIdParent,
WM_QUIT,
shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, info->filename, NULL, NULL, NULL),
0L);
0);
ExitThread(0);
}
......@@ -2389,7 +2390,7 @@ static void test_dde_default_app(void)
SetEvent(hEvent);
assert(CreateThread(NULL, 0, ddeThread, &info, 0, &threadId));
while (GetMessage(&msg, NULL, 0, 0)) DispatchMessage(&msg);
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 */
......@@ -2476,12 +2477,12 @@ static void init_test(void)
if (FAILED(r))
exit(1);
rc=GetModuleFileName(NULL, argv0, sizeof(argv0));
rc=GetModuleFileNameA(NULL, argv0, sizeof(argv0));
assert(rc!=0 && rc<sizeof(argv0));
if (GetFileAttributes(argv0)==INVALID_FILE_ATTRIBUTES)
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");
}
......@@ -2504,7 +2505,7 @@ static void init_test(void)
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)
{
......@@ -2569,11 +2570,11 @@ static void cleanup_test(void)
{
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 */
......
......@@ -258,11 +258,11 @@ static void test_get_file_info(void)
/* 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);
......@@ -274,7 +274,7 @@ static void test_get_file_info(void)
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);
}
}
......@@ -282,7 +282,7 @@ static void test_get_file_info(void)
/* 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);
......@@ -294,7 +294,7 @@ static void test_get_file_info(void)
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 */
......@@ -306,8 +306,8 @@ static void test_get_file_info(void)
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");
}
......@@ -569,7 +569,7 @@ static void test_delete(void)
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");
......@@ -577,7 +577,7 @@ static void test_delete(void)
/* 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");
......@@ -591,7 +591,7 @@ static void test_delete(void)
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");
......@@ -601,7 +601,7 @@ static void test_delete(void)
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);
......@@ -613,7 +613,7 @@ static void test_delete(void)
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");
}
......@@ -621,7 +621,7 @@ static void test_delete(void)
/* 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 */
......@@ -636,7 +636,7 @@ static void test_delete(void)
/* 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);
......@@ -650,7 +650,7 @@ static void test_delete(void)
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");
......@@ -950,7 +950,7 @@ static void test_copy(void)
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");
......@@ -962,7 +962,7 @@ static void test_copy(void)
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");
......@@ -996,7 +996,7 @@ static void test_copy(void)
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");
......@@ -1014,17 +1014,17 @@ static void test_copy(void)
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();
......@@ -1032,7 +1032,7 @@ static void test_copy(void)
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");
......@@ -1041,12 +1041,12 @@ static void test_copy(void)
/* 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
......@@ -1062,7 +1062,7 @@ static void test_copy(void)
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");
......@@ -1071,10 +1071,10 @@ static void test_copy(void)
/* 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
{
......@@ -1089,24 +1089,24 @@ static void test_copy(void)
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");
......@@ -1115,10 +1115,10 @@ static void test_copy(void)
/* 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
{
......@@ -1134,7 +1134,7 @@ static void test_copy(void)
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);
......@@ -1145,7 +1145,7 @@ static void test_copy(void)
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");
......@@ -1158,16 +1158,16 @@ static void test_copy(void)
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
{
......@@ -1177,7 +1177,7 @@ static void test_copy(void)
"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();
......@@ -1185,7 +1185,7 @@ static void test_copy(void)
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");
......@@ -1200,24 +1200,24 @@ static void test_copy(void)
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
{
......@@ -1225,23 +1225,23 @@ static void test_copy(void)
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
{
......@@ -1249,8 +1249,8 @@ static void test_copy(void)
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 */
......@@ -1259,42 +1259,42 @@ static void test_copy(void)
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
{
......@@ -1304,14 +1304,14 @@ static void test_copy(void)
"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 */
......@@ -1320,7 +1320,7 @@ static void test_copy(void)
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");
......@@ -1329,7 +1329,7 @@ static void test_copy(void)
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 */
......@@ -1340,7 +1340,7 @@ static void test_copy(void)
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");
......@@ -1349,17 +1349,17 @@ static void test_copy(void)
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);
......@@ -1369,23 +1369,23 @@ static void test_copy(void)
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
{
......@@ -1397,7 +1397,7 @@ static void test_copy(void)
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 */
......@@ -1418,7 +1418,7 @@ static void test_copy(void)
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");
......@@ -1427,7 +1427,7 @@ static void test_copy(void)
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");
......@@ -1435,7 +1435,7 @@ static void test_copy(void)
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");
}
......@@ -1445,7 +1445,7 @@ static void test_copy(void)
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);
......@@ -1454,7 +1454,7 @@ static void test_copy(void)
{
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");
}
......@@ -1468,7 +1468,7 @@ static void test_copy(void)
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 */
......@@ -1476,7 +1476,7 @@ static void test_copy(void)
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");
......@@ -1489,7 +1489,7 @@ static void test_copy(void)
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 */
......@@ -1508,7 +1508,7 @@ static void test_copy(void)
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 */
......@@ -1533,7 +1533,7 @@ static void test_copy(void)
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 */
......@@ -1541,7 +1541,7 @@ static void test_copy(void)
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");
......@@ -1555,7 +1555,7 @@ static void test_copy(void)
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 */
......@@ -1581,7 +1581,7 @@ static void test_copy(void)
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 ?) */
......@@ -1615,7 +1615,7 @@ static void test_copy(void)
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");
......@@ -1640,7 +1640,7 @@ static void test_copy(void)
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);
......@@ -1672,7 +1672,7 @@ static void test_copy(void)
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");
......@@ -1704,7 +1704,7 @@ static void test_copy(void)
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 */
......@@ -1734,7 +1734,7 @@ static void test_copy(void)
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");
......@@ -1765,7 +1765,7 @@ static void test_copy(void)
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");
......@@ -1782,7 +1782,7 @@ static void test_copy(void)
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);
......@@ -1937,11 +1937,11 @@ static void test_move(void)
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");
......@@ -1976,7 +1976,7 @@ static void test_move(void)
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 */
......@@ -1997,8 +1997,8 @@ static void test_move(void)
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 */
......@@ -2028,7 +2028,7 @@ static void test_move(void)
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 */
......
......@@ -2063,7 +2063,7 @@ static void test_SHGetFolderPathAndSubDirA(void)
"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 */
......@@ -4417,7 +4417,7 @@ static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L
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)
......
......@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <windows.h>
#include "shellapi.h"
#include "wine/test.h"
......@@ -41,7 +42,7 @@ static void test_cbsize(void)
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 */
......@@ -61,7 +62,7 @@ static void test_cbsize(void)
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");
......@@ -91,11 +92,11 @@ START_TEST(systray)
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,
......
......@@ -50,14 +50,45 @@ extern "C" {
#define EXPENTRY CALLBACK
#define SZDDESYS_TOPIC TEXT("System")
#define SZDDESYS_ITEM_TOPICS TEXT("Topics")
#define SZDDESYS_ITEM_SYSITEMS TEXT("SysItems")
#define SZDDESYS_ITEM_RTNMSG TEXT("ReturnMessage")
#define SZDDESYS_ITEM_STATUS TEXT("Status")
#define SZDDESYS_ITEM_FORMATS TEXT("Formats")
#define SZDDESYS_ITEM_HELP TEXT("Help")
#define SZDDE_ITEM_ITEMLIST TEXT("TopicItemList")
#ifdef UNICODE
#if defined(_MSC_VER)
#define SZDDESYS_TOPIC L"System"
#define SZDDESYS_ITEM_TOPICS L"Topics"
#define SZDDESYS_ITEM_SYSITEMS L"SysItems"
#define SZDDESYS_ITEM_RTNMSG L"ReturnMessage"
#define SZDDESYS_ITEM_STATUS L"Status"
#define SZDDESYS_ITEM_FORMATS L"Formats"
#define SZDDESYS_ITEM_HELP L"Help"
#define SZDDE_ITEM_ITEMLIST L"TopicItemList"
#elif defined(__GNUC__)
#define SZDDESYS_TOPIC (const WCHAR []){'S','y','s','t','e','m',0}
#define SZDDESYS_ITEM_TOPICS (const WCHAR []){'T','o','p','i','c','s',0}
#define SZDDESYS_ITEM_SYSITEMS (const WCHAR []){'S','y','s','I','t','e','m','s',0}
#define SZDDESYS_ITEM_RTNMSG (const WCHAR []){'R','e','t','u','r','n','M','e','s','s','a','g','e',0}
#define SZDDESYS_ITEM_STATUS (const WCHAR []){'S','t','a','t','u','s',0}
#define SZDDESYS_ITEM_FORMATS (const WCHAR []){'F','o','r','m','a','t','s',0}
#define SZDDESYS_ITEM_HELP (const WCHAR []){'H','e','l','p',0}
#define SZDDE_ITEM_ITEMLIST (const WCHAR []){'T','o','p','i','c','I','t','e','m','L','i','s','t',0}
#else /* _MSC_VER/__GNUC__ */
static const WCHAR SZDDESYS_TOPIC[] = {'S','y','s','t','e','m',0};
static const WCHAR SZDDESYS_ITEM_TOPICS[] = {'T','o','p','i','c','s',0};
static const WCHAR SZDDESYS_ITEM_SYSITEMS[] = {'S','y','s','I','t','e','m','s',0};
static const WCHAR SZDDESYS_ITEM_RTNMSG[] = {'R','e','t','u','r','n','M','e','s','s','a','g','e',0};
static const WCHAR SZDDESYS_ITEM_STATUS[] = {'S','t','a','t','u','s',0};
static const WCHAR SZDDESYS_ITEM_FORMATS[] = {'F','o','r','m','a','t','s',0};
static const WCHAR SZDDESYS_ITEM_HELP[] = {'H','e','l','p',0};
static const WCHAR SZDDE_ITEM_ITEMLIST[] = {'T','o','p','i','c','I','t','e','m','L','i','s','t',0};
#endif
#else /* UNICODE */
#define SZDDESYS_TOPIC "System"
#define SZDDESYS_ITEM_TOPICS "Topics"
#define SZDDESYS_ITEM_SYSITEMS "SysItems"
#define SZDDESYS_ITEM_RTNMSG "ReturnMessage"
#define SZDDESYS_ITEM_STATUS "Status"
#define SZDDESYS_ITEM_FORMATS "Formats"
#define SZDDESYS_ITEM_HELP "Help"
#define SZDDE_ITEM_ITEMLIST "TopicItemList"
#endif
/***************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment