comdlg32: Don't use the instance of the owner window for dialog boxes.

This commit is contained in:
Alexandre Julliard 2009-12-23 17:55:04 +01:00
parent 0e00a61a38
commit 82016c19ef
2 changed files with 6 additions and 8 deletions

View file

@ -3867,7 +3867,6 @@ static BOOL GetFileName31A(LPOPENFILENAMEA lpofn, /* address of structure with d
UINT dlgType /* type dialogue : open/save */
)
{
HINSTANCE hInst;
BOOL bRet = FALSE;
PFD31_DATA lfs;
@ -3877,8 +3876,7 @@ static BOOL GetFileName31A(LPOPENFILENAMEA lpofn, /* address of structure with d
lfs = FD31_AllocPrivate((LPARAM) lpofn, dlgType, FALSE);
if (lfs)
{
hInst = (HINSTANCE)GetWindowLongPtrW( lpofn->hwndOwner, GWLP_HINSTANCE );
bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner,
bRet = DialogBoxIndirectParamA( COMDLG32_hInstance, lfs->template, lpofn->hwndOwner,
FD32_FileOpenDlgProc, (LPARAM)lfs);
FD31_DestroyPrivate(lfs);
}
@ -3896,7 +3894,6 @@ static BOOL GetFileName31W(LPOPENFILENAMEW lpofn, /* address of structure with d
UINT dlgType /* type dialogue : open/save */
)
{
HINSTANCE hInst;
BOOL bRet = FALSE;
PFD31_DATA lfs;
@ -3905,8 +3902,7 @@ static BOOL GetFileName31W(LPOPENFILENAMEW lpofn, /* address of structure with d
lfs = FD31_AllocPrivate((LPARAM) lpofn, dlgType, TRUE);
if (lfs)
{
hInst = (HINSTANCE)GetWindowLongPtrW( lpofn->hwndOwner, GWLP_HINSTANCE );
bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner,
bRet = DialogBoxIndirectParamW( COMDLG32_hInstance, lfs->template, lpofn->hwndOwner,
FD32_FileOpenDlgProc, (LPARAM)lfs);
FD31_DestroyPrivate(lfs);
}

View file

@ -2080,7 +2080,6 @@ BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
return FALSE;
}
hInst = (HINSTANCE)GetWindowLongPtrA( lppd->hwndOwner, GWLP_HINSTANCE );
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";
const struct pd_flags *pflag = pd_flags;
@ -2173,6 +2172,8 @@ BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
/* and create & process the dialog .
* -1 is failure, 0 is broken hwnd, everything else is ok.
*/
hInst = COMDLG32_hInstance;
if (lppd->Flags & (PD_ENABLESETUPTEMPLATE | PD_ENABLEPRINTTEMPLATE)) hInst = lppd->hInstance;
bRet = (0<DialogBoxIndirectParamA(hInst, ptr, lppd->hwndOwner,
PrintDlgProcA,
(LPARAM)PrintStructures));
@ -2230,7 +2231,6 @@ BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
return FALSE;
}
hInst = (HINSTANCE)GetWindowLongPtrW( lppd->hwndOwner, GWLP_HINSTANCE );
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";
const struct pd_flags *pflag = pd_flags;
@ -2323,6 +2323,8 @@ BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
/* and create & process the dialog .
* -1 is failure, 0 is broken hwnd, everything else is ok.
*/
hInst = COMDLG32_hInstance;
if (lppd->Flags & (PD_ENABLESETUPTEMPLATE | PD_ENABLEPRINTTEMPLATE)) hInst = lppd->hInstance;
bRet = (0<DialogBoxIndirectParamW(hInst, ptr, lppd->hwndOwner,
PrintDlgProcW,
(LPARAM)PrintStructures));