comdlg32: Delay OleInitialize() until after file dialog window is created.
This fixes a problem exposed by commit
f65e04770d
.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5dda6495eb
commit
1707df3da2
|
@ -252,7 +252,6 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
|
|||
void *template;
|
||||
HRSRC hRes;
|
||||
HANDLE hDlgTmpl = 0;
|
||||
HRESULT hr;
|
||||
|
||||
/* test for missing functionality */
|
||||
if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS)
|
||||
|
@ -297,9 +296,6 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
|
|||
fodInfos->HookMsg.sharevistring = RegisterWindowMessageW(SHAREVISTRINGW);
|
||||
}
|
||||
|
||||
/* Some shell namespace extensions depend on COM being initialized. */
|
||||
hr = OleInitialize(NULL);
|
||||
|
||||
if (fodInfos->unicode)
|
||||
lRes = DialogBoxIndirectParamW(COMDLG32_hInstance,
|
||||
template,
|
||||
|
@ -312,7 +308,7 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
|
|||
fodInfos->ofnInfos->hwndOwner,
|
||||
FileOpenDlgProc95,
|
||||
(LPARAM) fodInfos);
|
||||
if (SUCCEEDED(hr))
|
||||
if (fodInfos->ole_initialized)
|
||||
OleUninitialize();
|
||||
|
||||
/* Unable to create the dialog */
|
||||
|
@ -1262,6 +1258,10 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
int gripx = GetSystemMetrics( SM_CYHSCROLL);
|
||||
int gripy = GetSystemMetrics( SM_CYVSCROLL);
|
||||
|
||||
/* Some shell namespace extensions depend on COM being initialized. */
|
||||
if (SUCCEEDED(OleInitialize(NULL)))
|
||||
fodInfos->ole_initialized = TRUE;
|
||||
|
||||
/* Adds the FileOpenDlgInfos in the property list of the dialog
|
||||
so it will be easily accessible through a GetPropA(...) */
|
||||
SetPropA(hwnd, FileOpenDlgInfosStr, fodInfos);
|
||||
|
|
|
@ -92,6 +92,7 @@ typedef struct
|
|||
UINT sharevistring;
|
||||
} HookMsg;
|
||||
|
||||
BOOL ole_initialized;
|
||||
} FileOpenDlgInfos;
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -1296,7 +1296,6 @@ static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp)
|
|||
* after GetOpenFileA() is a file dialog window. Mark Vista+
|
||||
* behavior as broken. */
|
||||
hr = OleInitialize(NULL);
|
||||
todo_wine_if(first_dlg)
|
||||
ok((first_dlg ? hr == S_OK : hr == S_FALSE)
|
||||
|| broken(first_dlg && hr == S_FALSE),
|
||||
"OleInitialize() returned %#x (first dialog %#x)\n", hr, first_dlg);
|
||||
|
|
Loading…
Reference in New Issue