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 \
......
...@@ -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