Commit 2c531ade authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

comdlg32: Fix PrintDlg(NULL) and reenable a test that was in an '#if 0'.

Fix the test so it compiles without warnings.
parent 458ebf42
......@@ -1994,9 +1994,16 @@ static BOOL PRINTDLG_CreateDCW(LPPRINTDLGW lppd)
BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
{
BOOL bRet = FALSE;
LPVOID ptr;
HINSTANCE hInst = (HINSTANCE)GetWindowLongPtrA( lppd->hwndOwner, GWLP_HINSTANCE );
LPVOID ptr;
HINSTANCE hInst;
if (!lppd)
{
COMDLG32_SetCommDlgExtendedError(CDERR_INITIALIZATION);
return FALSE;
}
hInst = (HINSTANCE)GetWindowLongPtrA( lppd->hwndOwner, GWLP_HINSTANCE );
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";
const struct pd_flags *pflag = pd_flags;
......@@ -2131,14 +2138,19 @@ BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
*
* See PrintDlgA.
*/
BOOL WINAPI PrintDlgW(
LPPRINTDLGW lppd /* [in/out] ptr to PRINTDLG32 struct */
)
BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
{
BOOL bRet = FALSE;
LPVOID ptr;
HINSTANCE hInst = (HINSTANCE)GetWindowLongPtrW( lppd->hwndOwner, GWLP_HINSTANCE );
LPVOID ptr;
HINSTANCE hInst;
if (!lppd)
{
COMDLG32_SetCommDlgExtendedError(CDERR_INITIALIZATION);
return FALSE;
}
hInst = (HINSTANCE)GetWindowLongPtrW( lppd->hwndOwner, GWLP_HINSTANCE );
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";
const struct pd_flags *pflag = pd_flags;
......
......@@ -46,15 +46,12 @@ static void test_PrintDlgA(void)
if (!pDlg) return;
#if 0
/* will crash with unpatched wine */
SetLastError(0xdeadbeef);
res = PrintDlgA(NULL);
ok( !res && (CommDlgExtendedError() == CDERR_INITIALIZATION),
"returned %ld with 0x%lx and 0x%lx (expected '0' and " \
"returned %d with 0x%x and 0x%x (expected '0' and " \
"CDERR_INITIALIZATION)\n", res, GetLastError(), CommDlgExtendedError());
}
#endif
ZeroMemory(pDlg, sizeof(PRINTDLGA));
pDlg->lStructSize = sizeof(PRINTDLGA) - 1;
......
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