Commit 4a8397a5 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Register InternetExplorer class factory in IEWinMain.

Based on a patch by Mike McCormack.
parent c51aefdb
......@@ -138,3 +138,28 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
/* As a last resort, figure if the CLSID belongs to a 'Shell Instance Object' */
return SHDOCVW_GetShellInstanceObjectClassObject(rclsid, riid, ppv);
}
HRESULT register_class_object(BOOL do_reg)
{
HRESULT hres;
static DWORD cookie;
static IClassFactoryImpl IEClassFactory = {&WBCF_Vtbl, InternetExplorer_Create};
if(do_reg) {
hres = CoRegisterClassObject(&CLSID_InternetExplorer, (IUnknown*)FACTORY(&IEClassFactory),
CLSCTX_SERVER, REGCLS_MULTIPLEUSE|REGCLS_SUSPENDED, &cookie);
if (FAILED(hres)) {
ERR("failed to register object %08lx\n", hres);
return hres;
}
hres = CoResumeClassObjects();
if(SUCCEEDED(hres))
return hres;
ERR("failed to resume object %08lx\n", hres);
}
return CoRevokeClassObject(cookie);
}
......@@ -590,11 +590,18 @@ DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow)
{
LPWSTR url;
DWORD len;
HRESULT hres;
FIXME("%s %d\n", debugstr_a(szCommandLine), nShowWindow);
CoInitialize(NULL);
hres = register_class_object(TRUE);
if(FAILED(hres)) {
CoUninitialize();
ExitProcess(1);
}
/* FIXME: parse the command line properly, handle -Embedding */
len = MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, NULL, 0);
......@@ -605,7 +612,9 @@ DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow)
HeapFree(GetProcessHeap(), 0, url);
CoUninitialize();
register_class_object(FALSE);
CoUninitialize();
ExitProcess(0);
return 0;
......
......@@ -200,4 +200,6 @@ extern void register_iewindow_class(void);
extern void unregister_iewindow_class(void);
extern BOOL create_ie_window(LPCWSTR url);
HRESULT register_class_object(BOOL);
#endif /* __WINE_SHDOCVW_H */
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