Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c48c50f5
Commit
c48c50f5
authored
Apr 19, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Move DllGetClassObject implementation to factory.c.
parent
b26ed166
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
39 deletions
+35
-39
factory.c
dlls/shdocvw/factory.c
+22
-5
shdocvw.h
dlls/shdocvw/shdocvw.h
+2
-1
shdocvw_main.c
dlls/shdocvw/shdocvw_main.c
+11
-33
No files found.
dlls/shdocvw/factory.c
View file @
c48c50f5
...
...
@@ -30,10 +30,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
* (Based on implementation in ddraw/main.c)
*/
#define FACTORY(x) ((IClassFactory*) &(x)->lpClassFactoryVtbl)
typedef
struct
{
/* IUnknown fields */
const
IClassFactoryVtbl
*
lpVtbl
;
const
IClassFactoryVtbl
*
lp
ClassFactory
Vtbl
;
HRESULT
(
*
cf
)(
LPUNKNOWN
,
REFIID
,
LPVOID
*
);
LONG
ref
;
}
IClassFactoryImpl
;
...
...
@@ -115,9 +117,24 @@ static const IClassFactoryVtbl WBCF_Vtbl =
WBCF_LockServer
};
static
IClassFactoryImpl
SHDOCVW_WBClassFactory
=
{
&
WBCF_Vtbl
,
WebBrowser_Create
};
IClassFactory
*
get_class_factory
(
void
)
/*************************************************************************
* DllGetClassObject (SHDOCVW.@)
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
ppv
)
{
return
(
IClassFactory
*
)
&
SHDOCVW_WBClassFactory
;
HRESULT
hres
;
static
IClassFactoryImpl
WBClassFactory
=
{
&
WBCF_Vtbl
,
WebBrowser_Create
};
TRACE
(
"
\n
"
);
if
(
IsEqualGUID
(
&
CLSID_WebBrowser
,
rclsid
))
{
hres
=
create_mozctl
(
riid
,
ppv
);
if
(
SUCCEEDED
(
hres
))
return
hres
;
return
IClassFactory_QueryInterface
(
FACTORY
(
&
WBClassFactory
),
riid
,
ppv
);
}
/* As a last resort, figure if the CLSID belongs to a 'Shell Instance Object' */
return
SHDOCVW_GetShellInstanceObjectClassObject
(
rclsid
,
riid
,
ppv
);
}
dlls/shdocvw/shdocvw.h
View file @
c48c50f5
...
...
@@ -169,6 +169,8 @@ void deactivate_document(DocHost*);
void
call_sink
(
ConnectionPoint
*
,
DISPID
,
DISPPARAMS
*
);
HRESULT
navigate_url
(
DocHost
*
,
LPCWSTR
,
PBYTE
,
ULONG
,
LPWSTR
);
HRESULT
create_mozctl
(
REFIID
,
void
**
);
#define WB_WM_NAVIGATE2 (WM_USER+100)
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
...
...
@@ -184,6 +186,5 @@ extern HINSTANCE shdocvw_hinstance;
extern
void
register_iewindow_class
(
void
);
extern
void
unregister_iewindow_class
(
void
);
extern
BOOL
create_ie_window
(
LPCWSTR
url
);
extern
IClassFactory
*
get_class_factory
(
void
);
#endif
/* __WINE_SHDOCVW_H */
dlls/shdocvw/shdocvw_main.c
View file @
c48c50f5
...
...
@@ -444,46 +444,24 @@ static BOOL SHDOCVW_TryLoadMozillaControl(void)
}
}
/*************************************************************************
* DllGetClassObject (SHDOCVW.@)
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
HRESULT
create_mozctl
(
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"
\n
"
);
if
(
IsEqualGUID
(
&
CLSID_WebBrowser
,
rclsid
)
&&
SHDOCVW_TryLoadMozillaControl
()
)
{
HRESULT
r
;
fnGetClassObject
pGetClassObject
;
TRACE
(
"WebBrowser class %s
\n
"
,
debugstr_guid
(
rclsid
)
);
fnGetClassObject
pGetClassObject
;
HRESULT
hres
;
pGetClassObject
=
(
fnGetClassObject
)
GetProcAddress
(
hMozCtl
,
"DllGetClassObject"
)
;
if
(
!
SHDOCVW_TryLoadMozillaControl
()
)
return
CLASS_E_CLASSNOTAVAILABLE
;
if
(
!
pGetClassObject
)
return
CLASS_E_CLASSNOTAVAILABLE
;
r
=
pGetClassObject
(
&
CLSID_MozillaBrowser
,
riid
,
ppv
);
pGetClassObject
=
(
fnGetClassObject
)
GetProcAddress
(
hMozCtl
,
"DllGetClassObject"
);
TRACE
(
"r = %08lx *ppv = %p
\n
"
,
r
,
*
ppv
);
if
(
!
pGetClassObject
)
return
CLASS_E_CLASSNOTAVAILABLE
;
return
r
;
}
if
(
IsEqualCLSID
(
&
CLSID_WebBrowser
,
rclsid
)
&&
IsEqualIID
(
&
IID_IClassFactory
,
riid
))
{
/* Pass back our shdocvw class factory */
IClassFactory
*
cf
=
get_class_factory
();
IClassFactory_AddRef
(
cf
);
*
ppv
=
cf
;
hres
=
pGetClassObject
(
&
CLSID_MozillaBrowser
,
riid
,
ppv
);
return
S_OK
;
}
TRACE
(
"hres = %08lx *ppv = %p
\n
"
,
hres
,
*
ppv
);
/* As a last resort, figure if the CLSID belongs to a 'Shell Instance Object' */
return
SHDOCVW_GetShellInstanceObjectClassObject
(
rclsid
,
riid
,
ppv
);
return
hres
;
}
/***********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment