Commit a131886a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fixed unsafe cast in CreateChromeWindow2 implementation.

parent f52e0a77
...@@ -705,6 +705,7 @@ void ConnectionPointContainer_Destroy(ConnectionPointContainer*); ...@@ -705,6 +705,7 @@ void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
NSContainer *NSContainer_Create(HTMLDocumentObj*,NSContainer*); NSContainer *NSContainer_Create(HTMLDocumentObj*,NSContainer*);
void NSContainer_Release(NSContainer*); void NSContainer_Release(NSContainer*);
nsresult create_chrome_window(nsIWebBrowserChrome*,nsIWebBrowserChrome**);
void init_mutation(HTMLDocumentNode*); void init_mutation(HTMLDocumentNode*);
void release_mutation(HTMLDocumentNode*); void release_mutation(HTMLDocumentNode*);
......
...@@ -1150,8 +1150,6 @@ static nsresult NSAPI nsWebBrowserChrome_ExitModalEventLoop(nsIWebBrowserChrome ...@@ -1150,8 +1150,6 @@ static nsresult NSAPI nsWebBrowserChrome_ExitModalEventLoop(nsIWebBrowserChrome
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
#undef NSWBCHROME_THIS
static const nsIWebBrowserChromeVtbl nsWebBrowserChromeVtbl = { static const nsIWebBrowserChromeVtbl nsWebBrowserChromeVtbl = {
nsWebBrowserChrome_QueryInterface, nsWebBrowserChrome_QueryInterface,
nsWebBrowserChrome_AddRef, nsWebBrowserChrome_AddRef,
...@@ -1711,6 +1709,17 @@ static const nsISupportsWeakReferenceVtbl nsSupportsWeakReferenceVtbl = { ...@@ -1711,6 +1709,17 @@ static const nsISupportsWeakReferenceVtbl nsSupportsWeakReferenceVtbl = {
nsSupportsWeakReference_GetWeakReference nsSupportsWeakReference_GetWeakReference
}; };
nsresult create_chrome_window(nsIWebBrowserChrome *parent, nsIWebBrowserChrome **ret)
{
NSContainer *new_container;
if(parent->lpVtbl != &nsWebBrowserChromeVtbl)
return NS_ERROR_UNEXPECTED;
new_container = NSContainer_Create(NULL, NSWBCHROME_THIS(parent));
*ret = NSWBCHROME(new_container);
return NS_OK;
}
NSContainer *NSContainer_Create(HTMLDocumentObj *doc, NSContainer *parent) NSContainer *NSContainer_Create(HTMLDocumentObj *doc, NSContainer *parent)
{ {
......
...@@ -99,8 +99,7 @@ static nsresult NSAPI nsWindowCreator_CreateChromeWindow2(nsIWindowCreator2 *ifa ...@@ -99,8 +99,7 @@ static nsresult NSAPI nsWindowCreator_CreateChromeWindow2(nsIWindowCreator2 *ifa
if(cancel) if(cancel)
*cancel = FALSE; *cancel = FALSE;
*_retval = NSWBCHROME(NSContainer_Create(NULL, (NSContainer*)parent)); return create_chrome_window(parent, _retval);
return NS_OK;
} }
static const nsIWindowCreator2Vtbl nsWindowCreatorVtbl = { static const nsIWindowCreator2Vtbl nsWindowCreatorVtbl = {
......
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