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
e67da117
Commit
e67da117
authored
Jun 25, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Jun 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Implement OleCreateEmbeddingHelper.
Based on a patch by Rob Shearman.
parent
114f8c1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
6 deletions
+65
-6
defaulthandler.c
dlls/ole32/defaulthandler.c
+64
-5
ole32.spec
dlls/ole32/ole32.spec
+1
-1
No files found.
dlls/ole32/defaulthandler.c
View file @
e67da117
...
...
@@ -137,6 +137,11 @@ struct DefaultHandler
/* storage passed to Load or InitNew */
IStorage
*
storage
;
enum
storage_state
storage_state
;
/* optional class factory for object */
IClassFactory
*
pCFObject
;
/* TRUE if acting as an inproc server instead of an inproc handler */
BOOL
inproc_server
;
};
typedef
struct
DefaultHandler
DefaultHandler
;
...
...
@@ -223,6 +228,12 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
if
(
FAILED
(
hr
))
FIXME
(
"interface %s not implemented by data cache
\n
"
,
debugstr_guid
(
riid
));
return
hr
;
}
else
if
(
This
->
inproc_server
&&
This
->
pOleDelegate
)
{
HRESULT
hr
=
IUnknown_QueryInterface
(
This
->
pOleDelegate
,
riid
,
ppvObject
);
if
(
SUCCEEDED
(
hr
))
return
hr
;
}
/* Check that we obtained an interface. */
if
(
*
ppvObject
==
NULL
)
...
...
@@ -1901,7 +1912,9 @@ static const IPersistStorageVtbl DefaultHandler_IPersistStorage_VTable =
*/
static
DefaultHandler
*
DefaultHandler_Construct
(
REFCLSID
clsid
,
LPUNKNOWN
pUnkOuter
)
LPUNKNOWN
pUnkOuter
,
DWORD
flags
,
IClassFactory
*
pCF
)
{
DefaultHandler
*
This
=
NULL
;
HRESULT
hr
;
...
...
@@ -1918,6 +1931,8 @@ static DefaultHandler* DefaultHandler_Construct(
This
->
lpvtblIAdviseSink
=
&
DefaultHandler_IAdviseSink_VTable
;
This
->
lpvtblIPersistStorage
=
&
DefaultHandler_IPersistStorage_VTable
;
This
->
inproc_server
=
(
flags
&
EMBDHLP_INPROC_SERVER
)
?
TRUE
:
FALSE
;
/*
* Start with one reference count. The caller of this function
* must release the interface pointer when it is done.
...
...
@@ -1964,6 +1979,30 @@ static DefaultHandler* DefaultHandler_Construct(
This
->
storage
=
NULL
;
This
->
storage_state
=
storage_state_uninitialised
;
if
(
This
->
inproc_server
&&
!
(
flags
&
EMBDHLP_DELAYCREATE
))
{
HRESULT
hr
;
This
->
pCFObject
=
NULL
;
if
(
pCF
)
hr
=
IClassFactory_CreateInstance
(
pCF
,
NULL
,
&
IID_IOleObject
,
(
void
**
)
&
This
->
pOleDelegate
);
else
hr
=
CoCreateInstance
(
&
This
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IOleObject
,
(
void
**
)
&
This
->
pOleDelegate
);
if
(
SUCCEEDED
(
hr
))
hr
=
IOleObject_QueryInterface
(
This
->
pOleDelegate
,
&
IID_IPersistStorage
,
(
void
**
)
&
This
->
pPSDelegate
);
if
(
SUCCEEDED
(
hr
))
hr
=
IOleObject_QueryInterface
(
This
->
pOleDelegate
,
&
IID_IDataObject
,
(
void
**
)
&
This
->
pDataDelegate
);
if
(
SUCCEEDED
(
hr
))
This
->
object_state
=
object_state_running
;
if
(
FAILED
(
hr
))
WARN
(
"object creation failed with error %08x
\n
"
,
hr
);
}
else
{
This
->
pCFObject
=
pCF
;
if
(
pCF
)
IClassFactory_AddRef
(
pCF
);
}
return
This
;
}
...
...
@@ -2011,22 +2050,30 @@ static void DefaultHandler_Destroy(
This
->
storage
=
NULL
;
}
if
(
This
->
pCFObject
)
{
IClassFactory_Release
(
This
->
pCFObject
);
This
->
pCFObject
=
NULL
;
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
/******************************************************************************
* OleCreate
DefaultHandl
er [OLE32.@]
* OleCreate
EmbeddingHelp
er [OLE32.@]
*/
HRESULT
WINAPI
OleCreate
DefaultHandl
er
(
HRESULT
WINAPI
OleCreate
EmbeddingHelp
er
(
REFCLSID
clsid
,
LPUNKNOWN
pUnkOuter
,
DWORD
flags
,
IClassFactory
*
pCF
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
DefaultHandler
*
newHandler
=
NULL
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%s, %p, %
s, %p)
\n
"
,
debugstr_guid
(
clsid
),
pUnkOuter
,
debugstr_guid
(
riid
),
ppvObj
);
TRACE
(
"(%s, %p, %
08x, %p, %s, %p)
\n
"
,
debugstr_guid
(
clsid
),
pUnkOuter
,
flags
,
pCF
,
debugstr_guid
(
riid
),
ppvObj
);
if
(
!
ppvObj
)
return
E_POINTER
;
...
...
@@ -2045,7 +2092,7 @@ HRESULT WINAPI OleCreateDefaultHandler(
/*
* Try to construct a new instance of the class.
*/
newHandler
=
DefaultHandler_Construct
(
clsid
,
pUnkOuter
);
newHandler
=
DefaultHandler_Construct
(
clsid
,
pUnkOuter
,
flags
,
pCF
);
if
(
!
newHandler
)
return
E_OUTOFMEMORY
;
...
...
@@ -2063,3 +2110,15 @@ HRESULT WINAPI OleCreateDefaultHandler(
return
hr
;
}
/******************************************************************************
* OleCreateDefaultHandler [OLE32.@]
*/
HRESULT
WINAPI
OleCreateDefaultHandler
(
REFCLSID
clsid
,
LPUNKNOWN
pUnkOuter
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
TRACE
(
"(%s, %p, %s, %p)
\n
"
,
debugstr_guid
(
clsid
),
pUnkOuter
,
debugstr_guid
(
riid
),
ppvObj
);
return
OleCreateEmbeddingHelper
(
clsid
,
pUnkOuter
,
EMBDHLP_INPROC_HANDLER
|
EMBDHLP_CREATENOW
,
NULL
,
riid
,
ppvObj
);
}
dlls/ole32/ole32.spec
View file @
e67da117
...
...
@@ -180,7 +180,7 @@
@ stub OleConvertOLESTREAMToIStorageEx
@ stdcall OleCreate(ptr ptr long ptr ptr ptr ptr)
@ stdcall OleCreateDefaultHandler(ptr ptr ptr ptr)
@ st
ub OleCreateEmbeddingHelper
@ st
dcall OleCreateEmbeddingHelper(ptr ptr long ptr ptr ptr)
@ stub OleCreateEx
@ stdcall OleCreateFromData(ptr ptr long ptr ptr ptr ptr)
@ stdcall OleCreateFromDataEx(ptr ptr long long long ptr ptr ptr ptr ptr ptr ptr)
...
...
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