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

comdlg32/tests: Compile with -D__WINESRC__.

parent 947977f6
TESTDLL = comdlg32.dll TESTDLL = comdlg32.dll
IMPORTS = uuid shell32 ole32 comdlg32 winspool user32 gdi32 IMPORTS = uuid shell32 ole32 comdlg32 winspool user32 gdi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \ C_SRCS = \
filedlg.c \ filedlg.c \
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
#include "shlguid.h" #include "shlguid.h"
#define COBJMACROS #define COBJMACROS
#include "shobjidl.h" #include "shobjidl.h"
#include "commdlg.h"
#include "cderr.h"
#include "dlgs.h"
/* ##### */ /* ##### */
...@@ -41,14 +44,14 @@ static void toolbarcheck( HWND hDlg) ...@@ -41,14 +44,14 @@ static void toolbarcheck( HWND hDlg)
for( ctrl = GetWindow( hDlg, GW_CHILD); for( ctrl = GetWindow( hDlg, GW_CHILD);
ctrl ; ctrl = GetWindow( ctrl, GW_HWNDNEXT)) { ctrl ; ctrl = GetWindow( ctrl, GW_HWNDNEXT)) {
GetClassName( ctrl, classname, 10); GetClassNameA( ctrl, classname, 10);
classname[7] = '\0'; classname[7] = '\0';
if( !strcmp( classname, "Toolbar")) break; if( !strcmp( classname, "Toolbar")) break;
} }
ok( ctrl != NULL, "could not get the toolbar control\n"); ok( ctrl != NULL, "could not get the toolbar control\n");
ret = SendMessage( ctrl, TB_ADDSTRING, 0, (LPARAM)"winetestwinetest\0\0"); ret = SendMessageA( ctrl, TB_ADDSTRINGA, 0, (LPARAM)"winetestwinetest\0\0");
ok( ret == 0, "addstring returned %d (expected 0)\n", ret); ok( ret == 0, "addstring returned %d (expected 0)\n", ret);
maxtextrows = SendMessage( ctrl, TB_GETTEXTROWS, 0, 0); maxtextrows = SendMessageA( ctrl, TB_GETTEXTROWS, 0, 0);
ok( maxtextrows == 0 || broken(maxtextrows == 1), /* Win2k and below */ ok( maxtextrows == 0 || broken(maxtextrows == 1), /* Win2k and below */
"Get(Max)TextRows returned %d (expected 0)\n", maxtextrows); "Get(Max)TextRows returned %d (expected 0)\n", maxtextrows);
} }
...@@ -63,14 +66,14 @@ static UINT_PTR CALLBACK OFNHookProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM ...@@ -63,14 +66,14 @@ static UINT_PTR CALLBACK OFNHookProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM
nmh = (LPNMHDR) lParam; nmh = (LPNMHDR) lParam;
if( nmh->code == CDN_INITDONE) if( nmh->code == CDN_INITDONE)
{ {
PostMessage( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE); PostMessageA( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE);
} else if (nmh->code == CDN_FOLDERCHANGE ) } else if (nmh->code == CDN_FOLDERCHANGE )
{ {
char buf[1024]; char buf[1024];
int ret; int ret;
memset(buf, 0x66, sizeof(buf)); memset(buf, 0x66, sizeof(buf));
ret = SendMessage( GetParent(hDlg), CDM_GETFOLDERIDLIST, 5, (LPARAM)buf); ret = SendMessageA( GetParent(hDlg), CDM_GETFOLDERIDLIST, 5, (LPARAM)buf);
ok(ret > 0, "CMD_GETFOLDERIDLIST not implemented\n"); ok(ret > 0, "CMD_GETFOLDERIDLIST not implemented\n");
if (ret > 5) if (ret > 5)
ok(buf[0] == 0x66 && buf[1] == 0x66, "CMD_GETFOLDERIDLIST: The buffer was touched on failure\n"); ok(buf[0] == 0x66 && buf[1] == 0x66, "CMD_GETFOLDERIDLIST: The buffer was touched on failure\n");
...@@ -89,7 +92,7 @@ static void test_DialogCancel(void) ...@@ -89,7 +92,7 @@ static void test_DialogCancel(void)
char szFileName[MAX_PATH] = ""; char szFileName[MAX_PATH] = "";
char szInitialDir[MAX_PATH]; char szInitialDir[MAX_PATH];
GetWindowsDirectory(szInitialDir, MAX_PATH); GetWindowsDirectoryA(szInitialDir, MAX_PATH);
ZeroMemory(&ofn, sizeof(ofn)); ZeroMemory(&ofn, sizeof(ofn));
...@@ -161,7 +164,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa ...@@ -161,7 +164,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
{ {
if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE)
{ {
IShellBrowser *shell_browser = (IShellBrowser *)SendMessage(GetParent(dlg), WM_USER + 7 /* WM_GETISHELLBROWSER */, 0, 0); IShellBrowser *shell_browser = (IShellBrowser *)SendMessageA(GetParent(dlg), WM_USER + 7 /* WM_GETISHELLBROWSER */, 0, 0);
IShellView *shell_view = NULL; IShellView *shell_view = NULL;
IShellView2 *shell_view2 = NULL; IShellView2 *shell_view2 = NULL;
SV2CVW2_PARAMS view_params; SV2CVW2_PARAMS view_params;
...@@ -233,7 +236,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa ...@@ -233,7 +236,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
cleanup: cleanup:
if (shell_view2) IShellView2_Release(shell_view2); if (shell_view2) IShellView2_Release(shell_view2);
if (shell_view) IShellView_Release(shell_view); if (shell_view) IShellView_Release(shell_view);
PostMessage(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0);
} }
} }
return 0; return 0;
...@@ -249,13 +252,13 @@ static UINT_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM l ...@@ -249,13 +252,13 @@ static UINT_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM l
ok(p!=NULL, "Failed to get parent of template\n"); ok(p!=NULL, "Failed to get parent of template\n");
cb = GetDlgItem(p,0x470); cb = GetDlgItem(p,0x470);
ok(cb!=NULL, "Failed to get filter combobox\n"); ok(cb!=NULL, "Failed to get filter combobox\n");
sel = SendMessage(cb, CB_GETCURSEL, 0, 0); sel = SendMessageA(cb, CB_GETCURSEL, 0, 0);
ok (sel != -1, "Failed to get selection from filter listbox\n"); ok (sel != -1, "Failed to get selection from filter listbox\n");
} }
if (msg == WM_NOTIFY) if (msg == WM_NOTIFY)
{ {
if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE)
PostMessage(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0);
} }
return 0; return 0;
} }
...@@ -337,16 +340,16 @@ static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L ...@@ -337,16 +340,16 @@ static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
{ {
DWORD style; DWORD style;
index = ((OPENFILENAME*)lParam)->lCustData; index = ((OPENFILENAMEA*)lParam)->lCustData;
count = 0; count = 0;
gotSWP_bottom = gotShowWindow = 0; gotSWP_bottom = gotShowWindow = 0;
/* test style */ /* test style */
style = GetWindowLong( parent, GWL_STYLE); style = GetWindowLongA( parent, GWL_STYLE);
if( resize_testcases[index].flags & OFN_ENABLESIZING) if( resize_testcases[index].flags & OFN_ENABLESIZING)
if( !(style & WS_SIZEBOX)) { if( !(style & WS_SIZEBOX)) {
win_skip( "OFN_ENABLESIZING flag not supported.\n"); win_skip( "OFN_ENABLESIZING flag not supported.\n");
resizesupported = FALSE; resizesupported = FALSE;
PostMessage( parent, WM_COMMAND, IDCANCEL, 0); PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
} else } else
ok( style & WS_SIZEBOX, ok( style & WS_SIZEBOX,
"testid %d: dialog should have a WS_SIZEBOX style.\n", index); "testid %d: dialog should have a WS_SIZEBOX style.\n", index);
...@@ -503,7 +506,7 @@ todo_wine ...@@ -503,7 +506,7 @@ todo_wine
} }
} }
KillTimer( dlg, 0); KillTimer( dlg, 0);
PostMessage( parent, WM_COMMAND, IDCANCEL, 0); PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
} }
count++; count++;
} }
...@@ -531,7 +534,7 @@ todo_wine ...@@ -531,7 +534,7 @@ todo_wine
static void test_resize(void) static void test_resize(void)
{ {
OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
char filename[1024] = {0}; char filename[1024] = {0};
DWORD ret; DWORD ret;
int i; int i;
...@@ -539,13 +542,13 @@ static void test_resize(void) ...@@ -539,13 +542,13 @@ static void test_resize(void)
ofn.lpstrFile = filename; ofn.lpstrFile = filename;
ofn.nMaxFile = 1024; ofn.nMaxFile = 1024;
ofn.lpfnHook = resize_template_hook; ofn.lpfnHook = resize_template_hook;
ofn.hInstance = GetModuleHandle(NULL); ofn.hInstance = GetModuleHandleA(NULL);
ofn.lpTemplateName = "template_sz"; ofn.lpTemplateName = "template_sz";
for( i = 0; resize_testcases[i].flags != 0xffffffff; i++) { for( i = 0; resize_testcases[i].flags != 0xffffffff; i++) {
ofn.lCustData = i; ofn.lCustData = i;
ofn.Flags = resize_testcases[i].flags | ofn.Flags = resize_testcases[i].flags |
OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE | OFN_SHOWHELP ; OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE | OFN_SHOWHELP ;
ret = GetOpenFileName(&ofn); ret = GetOpenFileNameA(&ofn);
ok(!ret, "GetOpenFileName returned %#x\n", ret); ok(!ret, "GetOpenFileName returned %#x\n", ret);
ret = CommDlgExtendedError(); ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret); ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
...@@ -588,14 +591,14 @@ static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM ...@@ -588,14 +591,14 @@ static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM
static UINT msgFILEOKSTRING; static UINT msgFILEOKSTRING;
if (msg == WM_INITDIALOG) if (msg == WM_INITDIALOG)
{ {
testcase = (ok_wndproc_testcase*)((OPENFILENAME*)lParam)->lCustData; testcase = (ok_wndproc_testcase*)((OPENFILENAMEA*)lParam)->lCustData;
testcase->actclose = TRUE; testcase->actclose = TRUE;
msgFILEOKSTRING = RegisterWindowMessageA( FILEOKSTRING); msgFILEOKSTRING = RegisterWindowMessageA( FILEOKSTRINGA);
} }
if( msg == WM_NOTIFY) { if( msg == WM_NOTIFY) {
if(((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) { if(((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) {
SetTimer( dlg, 0, 100, 0); SetTimer( dlg, 0, 100, 0);
PostMessage( parent, WM_COMMAND, IDOK, 0); PostMessageA( parent, WM_COMMAND, IDOK, 0);
return FALSE; return FALSE;
} else if(((LPNMHDR)lParam)->code == CDN_FILEOK) { } else if(((LPNMHDR)lParam)->code == CDN_FILEOK) {
if( testcase->usemsgokstr) if( testcase->usemsgokstr)
...@@ -616,11 +619,11 @@ static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM ...@@ -616,11 +619,11 @@ static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM
/* the dialog did not close automatically */ /* the dialog did not close automatically */
testcase->actclose = FALSE; testcase->actclose = FALSE;
KillTimer( dlg, 0); KillTimer( dlg, 0);
PostMessage( parent, WM_COMMAND, IDCANCEL, 0); PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
return FALSE; return FALSE;
} }
if( testcase && testcase->do_subclass) if( testcase && testcase->do_subclass)
return DefWindowProc( dlg, msg, wParam, lParam); return DefWindowProcA( dlg, msg, wParam, lParam);
return FALSE; return FALSE;
} }
...@@ -633,7 +636,7 @@ static UINT_PTR WINAPI ok_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARA ...@@ -633,7 +636,7 @@ static UINT_PTR WINAPI ok_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARA
static void test_ok(void) static void test_ok(void)
{ {
OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
char filename[1024] = {0}; char filename[1024] = {0};
char tmpfilename[ MAX_PATH]; char tmpfilename[ MAX_PATH];
char curdir[MAX_PATH]; char curdir[MAX_PATH];
...@@ -649,7 +652,7 @@ static void test_ok(void) ...@@ -649,7 +652,7 @@ static void test_ok(void)
} }
ofn.lpstrFile = filename; ofn.lpstrFile = filename;
ofn.nMaxFile = 1024; ofn.nMaxFile = 1024;
ofn.hInstance = GetModuleHandle(NULL); ofn.hInstance = GetModuleHandleA(NULL);
ofn.lpTemplateName = "template1"; ofn.lpTemplateName = "template1";
ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE ; ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE ;
for( i = 0; ok_testcases[i].retval != -1; i++) { for( i = 0; ok_testcases[i].retval != -1; i++) {
...@@ -714,7 +717,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa ...@@ -714,7 +717,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
dlgParent = GetParent( dlgChild); dlgParent = GetParent( dlgChild);
if (msg == WM_INITDIALOG) { if (msg == WM_INITDIALOG) {
index = ((OPENFILENAME*)lParam)->lCustData; index = ((OPENFILENAMEA*)lParam)->lCustData;
/* get the positions before rearrangement */ /* get the positions before rearrangement */
GetClientRect( dlgParent, &clrcParent); GetClientRect( dlgParent, &clrcParent);
GetClientRect( dlgChild, &clrcChild); GetClientRect( dlgChild, &clrcChild);
...@@ -769,7 +772,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa ...@@ -769,7 +772,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
else else
expectx += clrcChild.right - ( rcStc32.right - rcStc32.left) ; expectx += clrcChild.right - ( rcStc32.right - rcStc32.left) ;
} }
style = GetWindowLong( dlgParent, GWL_STYLE); style = GetWindowLongA( dlgParent, GWL_STYLE);
if( !(style & WS_SIZEBOX)) { if( !(style & WS_SIZEBOX)) {
/* without the OFN_ENABLESIZING flag */ /* without the OFN_ENABLESIZING flag */
ok( wrcParent.bottom - wrcParent.top == expecty, ok( wrcParent.bottom - wrcParent.top == expecty,
...@@ -789,7 +792,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa ...@@ -789,7 +792,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
} }
} }
PostMessage( dlgParent, WM_COMMAND, IDCANCEL, 0); PostMessageA( dlgParent, WM_COMMAND, IDCANCEL, 0);
} }
return 0; return 0;
} }
...@@ -807,8 +810,8 @@ static void test_arrange(void) ...@@ -807,8 +810,8 @@ static void test_arrange(void)
int i; int i;
/* load subdialog template into memory */ /* load subdialog template into memory */
hRes = FindResource( GetModuleHandle(NULL), "template_stc32", (LPSTR)RT_DIALOG); hRes = FindResourceA( GetModuleHandleA(NULL), "template_stc32", (LPSTR)RT_DIALOG);
hDlgTmpl = LoadResource( GetModuleHandle(NULL), hRes ); hDlgTmpl = LoadResource( GetModuleHandleA(NULL), hRes );
/* get pointers to the structures for the dialog and the controls */ /* get pointers to the structures for the dialog and the controls */
pv = LockResource( hDlgTmpl ); pv = LockResource( hDlgTmpl );
template = (DLGTEMPLATE*)pv; template = (DLGTEMPLATE*)pv;
...@@ -882,7 +885,7 @@ static UINT_PTR CALLBACK path_hook_proc( HWND hDlg, UINT msg, WPARAM wParam, LPA ...@@ -882,7 +885,7 @@ static UINT_PTR CALLBACK path_hook_proc( HWND hDlg, UINT msg, WPARAM wParam, LPA
nmh = (LPNMHDR) lParam; nmh = (LPNMHDR) lParam;
if( nmh->code == CDN_INITDONE) if( nmh->code == CDN_INITDONE)
{ {
PostMessage( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE); PostMessageA( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE);
} }
else if ( nmh->code == CDN_FOLDERCHANGE) else if ( nmh->code == CDN_FOLDERCHANGE)
{ {
...@@ -909,7 +912,7 @@ static void test_getfolderpath(void) ...@@ -909,7 +912,7 @@ static void test_getfolderpath(void)
/* We need to pick a different directory as the other tests because of new /* We need to pick a different directory as the other tests because of new
* Windows 7 behavior. * Windows 7 behavior.
*/ */
GetSystemDirectory(szInitialDir, MAX_PATH); GetSystemDirectoryA(szInitialDir, MAX_PATH);
lstrcpyA(SYSDIR, szInitialDir); lstrcpyA(SYSDIR, szInitialDir);
ZeroMemory(&ofn, sizeof(ofn)); ZeroMemory(&ofn, sizeof(ofn));
...@@ -964,7 +967,7 @@ static void test_resizable2(void) ...@@ -964,7 +967,7 @@ static void test_resizable2(void)
ret = CommDlgExtendedError(); ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret); ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ofn.Flags = OFN_EXPLORER | OFN_ENABLETEMPLATEHANDLE; ofn.Flags = OFN_EXPLORER | OFN_ENABLETEMPLATEHANDLE;
ofn.hInstance = LoadResource( GetModuleHandle(NULL), FindResource( GetModuleHandle(NULL), "template1", (LPSTR)RT_DIALOG)); ofn.hInstance = LoadResource( GetModuleHandleA(NULL), FindResourceA( GetModuleHandleA(NULL), "template1", (LPSTR)RT_DIALOG));
ofn.lpTemplateName = NULL; ofn.lpTemplateName = NULL;
ret = GetOpenFileNameA(&ofn); ret = GetOpenFileNameA(&ofn);
ok( ret != ISSIZABLE, "File Dialog should NOT have been sizable\n"); ok( ret != ISSIZABLE, "File Dialog should NOT have been sizable\n");
...@@ -981,7 +984,7 @@ static void test_resizable2(void) ...@@ -981,7 +984,7 @@ static void test_resizable2(void)
static void test_mru(void) static void test_mru(void)
{ {
ok_wndproc_testcase testcase = {0}; ok_wndproc_testcase testcase = {0};
OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
const char *test_dir_name = "C:\\mru_test"; const char *test_dir_name = "C:\\mru_test";
const char *test_file_name = "test.txt"; const char *test_file_name = "test.txt";
const char *test_full_path = "C:\\mru_test\\test.txt"; const char *test_full_path = "C:\\mru_test\\test.txt";
...@@ -991,7 +994,7 @@ static void test_mru(void) ...@@ -991,7 +994,7 @@ static void test_mru(void)
ofn.lpstrFile = filename_buf; ofn.lpstrFile = filename_buf;
ofn.nMaxFile = sizeof(filename_buf); ofn.nMaxFile = sizeof(filename_buf);
ofn.lpTemplateName = "template1"; ofn.lpTemplateName = "template1";
ofn.hInstance = GetModuleHandle(NULL); ofn.hInstance = GetModuleHandleA(NULL);
ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_NOCHANGEDIR; ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_NOCHANGEDIR;
ofn.lCustData = (LPARAM)&testcase; ofn.lCustData = (LPARAM)&testcase;
ofn.lpfnHook = test_ok_wndproc; ofn.lpfnHook = test_ok_wndproc;
...@@ -1032,19 +1035,19 @@ static UINT_PTR WINAPI test_extension_wndproc(HWND dlg, UINT msg, WPARAM wParam, ...@@ -1032,19 +1035,19 @@ static UINT_PTR WINAPI test_extension_wndproc(HWND dlg, UINT msg, WPARAM wParam,
HWND parent = GetParent( dlg); HWND parent = GetParent( dlg);
if( msg == WM_NOTIFY) { if( msg == WM_NOTIFY) {
SetTimer( dlg, 0, 1000, 0); SetTimer( dlg, 0, 1000, 0);
PostMessage( parent, WM_COMMAND, IDOK, 0); PostMessageA( parent, WM_COMMAND, IDOK, 0);
} }
if( msg == WM_TIMER) { if( msg == WM_TIMER) {
/* the dialog did not close automatically */ /* the dialog did not close automatically */
KillTimer( dlg, 0); KillTimer( dlg, 0);
PostMessage( parent, WM_COMMAND, IDCANCEL, 0); PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
} }
return FALSE; return FALSE;
} }
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
static void test_extension_helper(OPENFILENAME* ofn, const char *filter, static void test_extension_helper(OPENFILENAMEA* ofn, const char *filter,
const char *expected_filename) const char *expected_filename)
{ {
char *filename_ptr; char *filename_ptr;
...@@ -1067,7 +1070,7 @@ static void test_extension_helper(OPENFILENAME* ofn, const char *filter, ...@@ -1067,7 +1070,7 @@ static void test_extension_helper(OPENFILENAME* ofn, const char *filter,
static void test_extension(void) static void test_extension(void)
{ {
OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
char filename[1024] = {0}; char filename[1024] = {0};
char curdir[MAX_PATH]; char curdir[MAX_PATH];
unsigned int i; unsigned int i;
...@@ -1139,7 +1142,7 @@ static BOOL WINAPI test_null_enum(HWND hwnd, LPARAM lParam) ...@@ -1139,7 +1142,7 @@ static BOOL WINAPI test_null_enum(HWND hwnd, LPARAM lParam)
CHAR className[20]; CHAR className[20];
if(GetClassNameA(hwnd, className, sizeof(className)) > 0 && !strcmp("Edit",className)) if(GetClassNameA(hwnd, className, sizeof(className)) > 0 && !strcmp("Edit",className))
{ {
SetWindowText(hwnd, "testfile"); SetWindowTextA(hwnd, "testfile");
return FALSE; /* break window enumeration */ return FALSE; /* break window enumeration */
} }
return TRUE; return TRUE;
...@@ -1155,11 +1158,11 @@ static UINT_PTR WINAPI test_null_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPAR ...@@ -1155,11 +1158,11 @@ static UINT_PTR WINAPI test_null_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPAR
} }
if( msg == WM_TIMER) { if( msg == WM_TIMER) {
if(!wParam) if(!wParam)
PostMessage( parent, WM_COMMAND, IDOK, 0); PostMessageA( parent, WM_COMMAND, IDOK, 0);
else { else {
/* the dialog did not close automatically */ /* the dialog did not close automatically */
KillTimer( dlg, 0); KillTimer( dlg, 0);
PostMessage( parent, WM_COMMAND, IDCANCEL, 0); PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
} }
} }
return FALSE; return FALSE;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "windows.h" #include "windows.h"
#include "commdlg.h" #include "commdlg.h"
#include "cderr.h"
#include "wine/test.h" #include "wine/test.h"
static UINT ID_FINDMSGSTRING; static UINT ID_FINDMSGSTRING;
...@@ -35,7 +36,7 @@ static LRESULT CALLBACK OwnerWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ...@@ -35,7 +36,7 @@ static LRESULT CALLBACK OwnerWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if(msg == ID_FINDMSGSTRING) { if(msg == ID_FINDMSGSTRING) {
return handle_findmsg((FINDREPLACEA*)lParam); return handle_findmsg((FINDREPLACEA*)lParam);
} }
return DefWindowProc(hwnd, msg, wParam, lParam); return DefWindowProcA(hwnd, msg, wParam, lParam);
} }
static void test_param_check(void) static void test_param_check(void)
...@@ -126,7 +127,7 @@ static void test_param_check(void) ...@@ -126,7 +127,7 @@ static void test_param_check(void)
CHECK_FINDREPLACE_FAIL(CDERR_FINDRESFAILURE); CHECK_FINDREPLACE_FAIL(CDERR_FINDRESFAILURE);
fr.Flags = FR_ENABLETEMPLATEHANDLE; fr.Flags = FR_ENABLETEMPLATEHANDLE;
CHECK_FINDREPLACE_FAIL(CDERR_NOHINSTANCE); CHECK_FINDREPLACE_FAIL(CDERR_NOHINSTANCE);
fr.hInstance = GetModuleHandle(NULL); fr.hInstance = GetModuleHandleA(NULL);
/* invalid lpTemplateName (NULL) when Flags has FR_ENABLETEMPLATE */ /* invalid lpTemplateName (NULL) when Flags has FR_ENABLETEMPLATE */
fr.Flags = FR_ENABLETEMPLATE; fr.Flags = FR_ENABLETEMPLATE;
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include "cderr.h" #include "cderr.h"
#include "commdlg.h" #include "commdlg.h"
#include "dlgs.h"
#include "winspool.h"
#include "wine/test.h" #include "wine/test.h"
...@@ -131,7 +133,7 @@ static UINT_PTR CALLBACK print_hook_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM ...@@ -131,7 +133,7 @@ static UINT_PTR CALLBACK print_hook_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM
/* some driver popup a dialog and hung the test or silently limit the number of copies, /* some driver popup a dialog and hung the test or silently limit the number of copies,
when trying to set more than 999 copies */ when trying to set more than 999 copies */
SetDlgItemInt(hdlg, edt3, 123, FALSE); SetDlgItemInt(hdlg, edt3, 123, FALSE);
PostMessage(hdlg, WM_COMMAND, IDOK, FALSE); PostMessageA(hdlg, WM_COMMAND, IDOK, FALSE);
} }
return 0; return 0;
} }
...@@ -146,7 +148,7 @@ static void test_PrintDlgA(void) ...@@ -146,7 +148,7 @@ static void test_PrintDlgA(void)
LPCSTR port; LPCSTR port;
CHAR buffer[MAX_PATH]; CHAR buffer[MAX_PATH];
LPSTR ptr; LPSTR ptr;
DEVMODE *dm; DEVMODEA *dm;
pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2); pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2);
if (!pDlg) return; if (!pDlg) return;
...@@ -230,7 +232,7 @@ static void test_PrintDlgA(void) ...@@ -230,7 +232,7 @@ static void test_PrintDlgA(void)
ok( lstrcmpiA(driver, buffer) == 0, ok( lstrcmpiA(driver, buffer) == 0,
"got driver '%s' (expected '%s')\n", driver, buffer); "got driver '%s' (expected '%s')\n", driver, buffer);
n_copies = DeviceCapabilities(device, port, DC_COPIES, NULL, NULL); n_copies = DeviceCapabilitiesA(device, port, DC_COPIES, NULL, NULL);
ok(n_copies > 0, "DeviceCapabilities(DC_COPIES) failed\n"); ok(n_copies > 0, "DeviceCapabilities(DC_COPIES) failed\n");
} }
...@@ -249,7 +251,7 @@ static void test_PrintDlgA(void) ...@@ -249,7 +251,7 @@ static void test_PrintDlgA(void)
pDlg->lStructSize = sizeof(*pDlg); pDlg->lStructSize = sizeof(*pDlg);
pDlg->Flags = PD_ENABLEPRINTHOOK; pDlg->Flags = PD_ENABLEPRINTHOOK;
pDlg->lpfnPrintHook = print_hook_proc; pDlg->lpfnPrintHook = print_hook_proc;
res = PrintDlg(pDlg); res = PrintDlgA(pDlg);
ok(res, "PrintDlg error %#x\n", CommDlgExtendedError()); ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
/* Version of Microsoft XPS Document Writer driver shipped before Win7 /* Version of Microsoft XPS Document Writer driver shipped before Win7
* reports that it can print multiple copies, but returns 1. * reports that it can print multiple copies, but returns 1.
...@@ -268,7 +270,7 @@ static void test_PrintDlgA(void) ...@@ -268,7 +270,7 @@ static void test_PrintDlgA(void)
pDlg->lStructSize = sizeof(*pDlg); pDlg->lStructSize = sizeof(*pDlg);
pDlg->Flags = PD_ENABLEPRINTHOOK | PD_USEDEVMODECOPIES; pDlg->Flags = PD_ENABLEPRINTHOOK | PD_USEDEVMODECOPIES;
pDlg->lpfnPrintHook = print_hook_proc; pDlg->lpfnPrintHook = print_hook_proc;
res = PrintDlg(pDlg); res = PrintDlgA(pDlg);
ok(res, "PrintDlg error %#x\n", CommDlgExtendedError()); ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
ok(pDlg->nCopies == 1, "expected nCopies 1, got %d\n", pDlg->nCopies); ok(pDlg->nCopies == 1, "expected nCopies 1, got %d\n", pDlg->nCopies);
ok(pDlg->hDevMode != 0, "hDevMode should not be 0\n"); ok(pDlg->hDevMode != 0, "hDevMode should not be 0\n");
...@@ -390,7 +392,7 @@ static void test_PrintDlgExW(void) ...@@ -390,7 +392,7 @@ static void test_PrintDlgExW(void)
} }
/* Set CommDlgExtendedError != 0 */ /* Set CommDlgExtendedError != 0 */
PrintDlg(NULL); PrintDlgA(NULL);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = pPrintDlgExW(NULL); res = pPrintDlgExW(NULL);
ok( (res == E_INVALIDARG), ok( (res == E_INVALIDARG),
...@@ -404,7 +406,7 @@ static void test_PrintDlgExW(void) ...@@ -404,7 +406,7 @@ static void test_PrintDlgExW(void)
/* lStructSize must be exact */ /* lStructSize must be exact */
ZeroMemory(pDlg, sizeof(PRINTDLGEXW)); ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
pDlg->lStructSize = sizeof(PRINTDLGEXW) - 1; pDlg->lStructSize = sizeof(PRINTDLGEXW) - 1;
PrintDlg(NULL); PrintDlgA(NULL);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = pPrintDlgExW(pDlg); res = pPrintDlgExW(pDlg);
ok( (res == E_INVALIDARG), ok( (res == E_INVALIDARG),
...@@ -414,7 +416,7 @@ static void test_PrintDlgExW(void) ...@@ -414,7 +416,7 @@ static void test_PrintDlgExW(void)
ZeroMemory(pDlg, sizeof(PRINTDLGEXW)); ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
pDlg->lStructSize = sizeof(PRINTDLGEXW) + 1; pDlg->lStructSize = sizeof(PRINTDLGEXW) + 1;
PrintDlg(NULL); PrintDlgA(NULL);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = pPrintDlgExW(pDlg); res = pPrintDlgExW(pDlg);
ok( (res == E_INVALIDARG), ok( (res == E_INVALIDARG),
......
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