68 "returned %lu with %lu and 0x%lx (expected '0' and "
76 "returned %lu with %lu and 0x%lx (expected '0' and "
85 "returned %lu with %lu and 0x%lx (expected '0' and CDERR_STRUCTSIZE)\n",
95 "returned %lu with %lu and 0x%lx (expected '!= 0' or '0' and "
99 skip(
"No printer configured.\n");
105 "got %p and %p (expected '!= NULL' for both)\n",
148 "returned %ld with 0x%lx and 0x%lx (expected '0' and "
156 "returned %ld with 0x%lx and 0x%lx (expected '0' and "
165 "returned %lu with %lu and 0x%lx (expected '0' and "
175 "returned %ld with 0x%lx and 0x%lx (expected '!= 0' or '0' and "
179 skip(
"No printer configured.\n");
186 ok(pDevNames !=
NULL,
"(expected '!= NULL')\n");
215 "got %lu with %lu and %p for '%s' (expected '>1' and '!= NULL')\n",
223 ok(n_copies > 0,
"DeviceCapabilities(DC_COPIES) failed\n");
247 ok(pDlg->
hDevMode != 0,
"hDevMode should not be 0\n");
251 "expected dm->dmCopies 1, got %d\n", dm->
dmCopies);
263 ok(pDlg->
hDevMode != 0,
"hDevMode should not be 0\n");
285 trace(
"callback_AddRef\n");
291 trace(
"callback_Release\n");
297 trace(
"callback_InitDone\n");
303 trace(
"callback_SelectionChange\n");
310 trace(
"callback_HandleMessage %p,%04x,%Ix,%Ix,%p\n", hdlg,
msg, wp, lp,
res);
349 trace(
"unknown_AddRef\n");
355 trace(
"unknown_Release\n");
370 PRINTPAGERANGE pagerange[2];
377 win_skip(
"PrintDlgExW not available\n");
388 "got 0x%lx with %lu and %lu (expected 'E_INVALIDARG')\n",
392 pDlg =
malloc(
sizeof(PRINTDLGEXW) + 8);
397 pDlg->lStructSize =
sizeof(PRINTDLGEXW) - 1;
400 res = pPrintDlgExW(pDlg);
402 "got 0x%lx with %lu and %lu (expected 'E_INVALIDARG')\n",
407 pDlg->lStructSize =
sizeof(PRINTDLGEXW) + 1;
410 res = pPrintDlgExW(pDlg);
412 "got 0x%lx with %lu and %lu (expected 'E_INVALIDARG')\n",
417 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
419 res = pPrintDlgExW(pDlg);
421 "got 0x%lx with %lu and %lu (expected 'E_HANDLE')\n",
426 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
429 res = pPrintDlgExW(pDlg);
434 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
438 res = pPrintDlgExW(pDlg);
443 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
446 pDlg->lpPageRanges = pagerange;
448 res = pPrintDlgExW(pDlg);
453 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
456 pDlg->nMaxPageRanges = 1;
458 res = pPrintDlgExW(pDlg);
463 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
466 pDlg->nMaxPageRanges = 1;
467 pDlg->lpPageRanges = pagerange;
469 res = pPrintDlgExW(pDlg);
472 skip(
"No printer configured.\n");
480 ok(dn !=
NULL,
"expected '!= NULL' for GlobalLock(%p)\n",pDlg->hDevNames);
495 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
499 res = pPrintDlgExW(pDlg);
506 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
510 res = pPrintDlgExW(pDlg);
512 ok(pDlg->hDC !=
NULL,
"HDC missing for PD_RETURNDC\n");
519 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
523 res = pPrintDlgExW(pDlg);
525 ok(pDlg->hDC !=
NULL,
"HDC missing for PD_RETURNIC\n");
534 skip(
"interactive PrintDlgEx tests (set WINETEST_INTERACTIVE=1)\n");
540 pDlg->lStructSize =
sizeof(PRINTDLGEXW);
545 pDlg->dwResultAction =
S_OK;
546 res = pPrintDlgExW(pDlg);
548 ok(pDlg->dwResultAction ==
PD_RESULT_PRINT,
"expected PD_RESULT_PRINT, got %#lx\n", pDlg->dwResultAction);
549 ok(pDlg->hDC !=
NULL,
"HDC missing for PD_RETURNIC\n");
570 skip(
"Failed to create a temporary file name\n");
582 skip(
"No default printer available.\n");
588 ok(pd.
hDC !=
NULL,
"PrintDlg didn't return a DC.\n");
589 if (!(print_dc = pd.
hDC))
596 doc_info.
cbSize =
sizeof(doc_info);
604 "StartDocA failed ret %d gle %ld\n", job_id,
GetLastError());
608 skip(
"StartDoc failed\n");
621 ok(
EndPage(print_dc) > 0,
"EndPage failed\n");
622 ok(
EndDoc(print_dc) > 0,
"EndDoc failed\n");
#define PDERR_NODEFAULTPRN
#define CDERR_INITIALIZATION
DWORD WINAPI CommDlgExtendedError(void)
struct tagPSDA PAGESETUPDLGA
#define START_PAGE_GENERAL
#define PD_USEDEVMODECOPIES
#define PD_ENABLEPRINTHOOK
#define PSD_RETURNDEFAULT
BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg)
BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
#define GetProcAddress(x, y)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
INT WINAPI GetProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
_ACRTIMP char *__cdecl strchr(const char *, int)
_ACRTIMP char *__cdecl strrchr(const char *, int)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
static ERESOURCE GlobalLock
static IPrintDialogCallback callback
static const IPrintDialogCallbackVtbl callback_Vtbl
static BOOL CALLBACK abort_proc(HDC hdc, int error)
static HRESULT WINAPI callback_InitDone(IPrintDialogCallback *iface)
static HRESULT WINAPI callback_SelectionChange(IPrintDialogCallback *iface)
static const CHAR PrinterPortsA[]
static const IUnknownVtbl unknown_Vtbl
static ULONG WINAPI unknown_AddRef(IUnknown *iface)
static HRESULT WINAPI callback_HandleMessage(IPrintDialogCallback *iface, HWND hdlg, UINT msg, WPARAM wp, LPARAM lp, LRESULT *res)
static UINT_PTR CALLBACK print_hook_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM lp)
static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static void test_PrintDlgExW(void)
static ULONG WINAPI callback_AddRef(IPrintDialogCallback *iface)
static void test_PageSetupDlgA(void)
static BOOL abort_proc_called
static ULONG WINAPI unknown_Release(IUnknown *iface)
static const CHAR emptyA[]
static ULONG WINAPI callback_Release(IPrintDialogCallback *iface)
static HRESULT WINAPI callback_QueryInterface(IPrintDialogCallback *iface, REFIID riid, void **ppv)
static void test_abort_proc(void)
const IID IID_IObjectWithSite
static void test_PrintDlgA(void)
unsigned __int3264 UINT_PTR
#define IsEqualGUID(rguid1, rguid2)
HWND WINAPI GetDesktopWindow(void)
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static __inline const char * wine_dbgstr_guid(const GUID *id)
LPPRINTHOOKPROC lpfnPrintHook
static WORD const char * driver
DWORD WINAPI GetLastError(void)
#define ERROR_SPL_NO_STARTDOC
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)
int WINAPI EndPage(_In_ HDC)
int WINAPI EndDoc(_In_ HDC)
int WINAPI StartDocA(_In_ HDC, _In_ const DOCINFOA *)
int WINAPI StartPage(_In_ HDC)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetAbortProc(_In_ HDC, _In_ ABORTPROC)
BOOL WINAPI DeleteDC(_In_ HDC)