68 "returned %u with %u and 0x%x (expected '0' and " 76 "returned %u with %u and 0x%x (expected '0' and " 85 "returned %u with %u and 0x%x (expected '0' and CDERR_STRUCTSIZE)\n",
95 "returned %u with %u and 0x%x (expected '!= 0' or '0' and " 99 skip(
"No printer configured.\n");
105 "got %p and %p (expected '!= NULL' for both)\n",
149 "returned %d with 0x%x and 0x%x (expected '0' and " 157 "returned %d with 0x%x and 0x%x (expected '0' and " 166 "returned %u with %u and 0x%x (expected '0' and " 176 "returned %d with 0x%x and 0x%x (expected '!= 0' or '0' and " 180 skip(
"No printer configured.\n");
187 ok(pDevNames !=
NULL,
"(expected '!= NULL')\n");
216 "got %u with %u and %p for '%s' (expected '>1' and '!= NULL')\n",
224 ok(n_copies > 0,
"DeviceCapabilities(DC_COPIES) failed\n");
248 ok(pDlg->
hDevMode != 0,
"hDevMode should not be 0\n");
252 "expected dm->dmCopies 1, got %d\n",
S1(
U1(*dm)).dmCopies);
264 ok(pDlg->
hDevMode != 0,
"hDevMode should not be 0\n");
266 ok(
S1(
U1(*dm)).dmCopies == 123,
"expected dm->dmCopies 123, got %d\n",
S1(
U1(*dm)).dmCopies);
286 trace(
"callback_AddRef\n");
292 trace(
"callback_Release\n");
298 trace(
"callback_InitDone\n");
304 trace(
"callback_SelectionChange\n");
311 trace(
"callback_HandleMessage %p,%04x,%lx,%lx,%p\n", hdlg,
msg, wp, lp,
res);
350 trace(
"unknown_AddRef\n");
356 trace(
"unknown_Release\n");
371 PRINTPAGERANGE pagerange[2];
378 skip(
"PrintDlgExW not available\n");
389 "got 0x%x with %u and %u (expected 'E_INVALIDARG')\n",
398 pDlg->lStructSize =
sizeof(PRINTDLGEXW) - 1;
401 res = pPrintDlgExW(pDlg);
403 "got 0x%x with %u and %u (expected 'E_INVALIDARG')\n",
408 pDlg->lStructSize =
sizeof(PRINTDLGEXW) + 1;
411 res = pPrintDlgExW(pDlg);
413 "got 0x%x with %u and %u (expected 'E_INVALIDARG')\n",
418 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
420 res = pPrintDlgExW(pDlg);
422 "got 0x%x with %u and %u (expected 'E_HANDLE')\n",
427 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
430 res = pPrintDlgExW(pDlg);
435 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
439 res = pPrintDlgExW(pDlg);
444 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
447 pDlg->lpPageRanges = pagerange;
449 res = pPrintDlgExW(pDlg);
454 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
457 pDlg->nMaxPageRanges = 1;
459 res = pPrintDlgExW(pDlg);
464 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
467 pDlg->nMaxPageRanges = 1;
468 pDlg->lpPageRanges = pagerange;
470 res = pPrintDlgExW(pDlg);
473 skip(
"No printer configured.\n");
481 ok(dn !=
NULL,
"expected '!= NULL' for GlobalLock(%p)\n",pDlg->hDevNames);
496 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
500 res = pPrintDlgExW(pDlg);
507 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
511 res = pPrintDlgExW(pDlg);
513 ok(pDlg->hDC !=
NULL,
"HDC missing for PD_RETURNDC\n");
520 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
524 res = pPrintDlgExW(pDlg);
526 ok(pDlg->hDC !=
NULL,
"HDC missing for PD_RETURNIC\n");
535 skip(
"interactive PrintDlgEx tests (set WINETEST_INTERACTIVE=1)\n");
541 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
546 pDlg->dwResultAction =
S_OK;
547 res = pPrintDlgExW(pDlg);
549 ok(pDlg->dwResultAction ==
PD_RESULT_PRINT,
"expected PD_RESULT_PRINT, got %#x\n", pDlg->dwResultAction);
550 ok(pDlg->hDC !=
NULL,
"HDC missing for PD_RETURNIC\n");
571 skip(
"Failed to create a temporary file name\n");
583 skip(
"No default printer available.\n");
589 ok(pd.
hDC !=
NULL,
"PrintDlg didn't return a DC.\n");
590 if (!(print_dc = pd.
hDC))
597 doc_info.
cbSize =
sizeof(doc_info);
605 "StartDocA failed ret %d gle %d\n", job_id,
GetLastError());
609 skip(
"StartDoc failed\n");
622 ok(
EndPage(print_dc) > 0,
"EndPage failed\n");
623 ok(
EndDoc(print_dc) > 0,
"EndDoc failed\n");
static UINT_PTR CALLBACK print_hook_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM lp)
static ULONG WINAPI callback_Release(IPrintDialogCallback *iface)
static void test_PageSetupDlgA(void)
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
static void test_PrintDlgExW(void)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
const char * wine_dbgstr_guid(const GUID *guid)
DWORD WINAPI GetLastError(VOID)
static ULONG WINAPI callback_AddRef(IPrintDialogCallback *iface)
static const CHAR emptyA[]
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg)
int WINAPI EndPage(_In_ HDC)
int WINAPI StartPage(_In_ HDC)
static ULONG WINAPI unknown_Release(IUnknown *iface)
#define PDERR_NODEFAULTPRN
static const IUnknownVtbl unknown_Vtbl
#define ERROR_SPL_NO_STARTDOC
HWND WINAPI GetDesktopWindow(void)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
INT WINAPI GetProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len)
static HRESULT WINAPI callback_QueryInterface(IPrintDialogCallback *iface, REFIID riid, void **ppv)
LPPRINTHOOKPROC lpfnPrintHook
static HRESULT(WINAPI *pPrintDlgExW)(LPPRINTDLGEXW)
static const IPrintDialogCallbackVtbl callback_Vtbl
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static void test_PrintDlgA(void)
static ULONG WINAPI unknown_AddRef(IUnknown *iface)
#define CDERR_INITIALIZATION
#define PD_ENABLEPRINTHOOK
const IID IID_IObjectWithSite
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
DWORD WINAPI DeviceCapabilitiesA(_In_ LPCSTR pDevice, _In_opt_ LPCSTR pPort, _In_ WORD fwCapability, _Out_writes_opt_(_Inexpressible_(1)) LPSTR pOutput, _In_opt_ const DEVMODEA *pDevMode)
unsigned __int3264 UINT_PTR
struct tagPSDA PAGESETUPDLGA
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
#define PD_USEDEVMODECOPIES
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
static HRESULT WINAPI callback_HandleMessage(IPrintDialogCallback *iface, HWND hdlg, UINT msg, WPARAM wp, LPARAM lp, LRESULT *res)
struct @1632::@1633 driver
int WINAPI StartDocA(_In_ HDC, _In_ const DOCINFOA *)
#define START_PAGE_GENERAL
static BOOL abort_proc_called
static const CHAR PrinterPortsA[]
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
char * strchr(const char *String, int ch)
#define PSD_RETURNDEFAULT
int WINAPI SetAbortProc(_In_ HDC, _In_ ABORTPROC)
#define GetProcAddress(x, y)
static BOOL CALLBACK abort_proc(HDC hdc, int error)
static IPrintDialogCallback callback
static void test_abort_proc(void)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
DWORD WINAPI CommDlgExtendedError(void)
static HRESULT WINAPI callback_InitDone(IPrintDialogCallback *iface)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
#define HeapFree(x, y, z)
static HRESULT WINAPI callback_SelectionChange(IPrintDialogCallback *iface)
int WINAPI EndDoc(_In_ HDC)