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
2abe8348
Commit
2abe8348
authored
Oct 07, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Don't fail in OleCreate if created object doesn't implement IRunnableObject or IOleChache.
parent
06ec62d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
26 deletions
+70
-26
ole2.c
dlls/ole32/ole2.c
+10
-7
ole2.c
dlls/ole32/tests/ole2.c
+60
-19
No files found.
dlls/ole32/ole2.c
View file @
2abe8348
...
...
@@ -2378,21 +2378,24 @@ HRESULT WINAPI OleCreate(
{
IRunnableObject
*
pRunnable
;
IOleCache
*
pOleCache
;
HRESULT
hres2
;
hres
=
IUnknown_QueryInterface
(
pUnk
,
&
IID_IRunnableObject
,
(
void
**
)
&
pRunnable
);
if
(
SUCCEEDED
(
hres
))
hres
2
=
IUnknown_QueryInterface
(
pUnk
,
&
IID_IRunnableObject
,
(
void
**
)
&
pRunnable
);
if
(
SUCCEEDED
(
hres
2
))
{
hres
=
IRunnableObject_Run
(
pRunnable
,
NULL
);
IRunnableObject_Release
(
pRunnable
);
}
if
(
SUCCEEDED
(
hres
))
hres
=
IUnknown_QueryInterface
(
pUnk
,
&
IID_IOleCache
,
(
void
**
)
&
pOleCache
);
if
(
SUCCEEDED
(
hres
))
{
DWORD
dwConnection
;
hres
=
IOleCache_Cache
(
pOleCache
,
pFormatEtc
,
ADVF_PRIMEFIRST
,
&
dwConnection
);
IOleCache_Release
(
pOleCache
);
hres2
=
IUnknown_QueryInterface
(
pUnk
,
&
IID_IOleCache
,
(
void
**
)
&
pOleCache
);
if
(
SUCCEEDED
(
hres2
))
{
DWORD
dwConnection
;
hres
=
IOleCache_Cache
(
pOleCache
,
pFormatEtc
,
ADVF_PRIMEFIRST
,
&
dwConnection
);
IOleCache_Release
(
pOleCache
);
}
}
}
...
...
dlls/ole32/tests/ole2.c
View file @
2abe8348
...
...
@@ -32,8 +32,8 @@
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08lx\n", hr)
static
IPersistStorage
OleObjectPersistStg
;
static
IOleCache
OleObjectC
ache
;
static
IRunnableObject
OleObjectR
unnable
;
static
IOleCache
*
c
ache
;
static
IRunnableObject
*
r
unnable
;
static
char
const
*
const
*
expected_method_list
;
...
...
@@ -52,33 +52,24 @@ static char const * const *expected_method_list;
static
HRESULT
WINAPI
OleObject_QueryInterface
(
IOleObject
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
CHECK_EXPECTED_METHOD
(
"OleObject_QueryInterface"
);
*
ppv
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IOleObject
))
{
*
ppv
=
(
void
*
)
iface
;
IUnknown_AddRef
(
iface
);
return
S_OK
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IPersistStorage
))
{
*
ppv
=
&
OleObjectPersistStg
;
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IOleCache
))
{
*
ppv
=
&
OleObjectCache
;
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
*
ppv
=
cache
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IRunnableObject
))
{
*
ppv
=
&
OleObjectRunnable
;
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
*
ppv
=
runnable
;
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
trace
(
"OleObject_QueryInterface: returning E_NOINTERFACE
\n
"
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
...
...
@@ -722,7 +713,41 @@ static void test_OleCreate(IStorage *pStorage)
"OleObject_Release"
,
NULL
};
static
const
char
*
methods_olerender_draw_no_runnable
[]
=
{
"OleObject_QueryInterface"
,
"OleObject_AddRef"
,
"OleObject_QueryInterface"
,
"OleObjectPersistStg_AddRef"
,
"OleObjectPersistStg_InitNew"
,
"OleObjectPersistStg_Release"
,
"OleObject_QueryInterface"
,
"OleObject_QueryInterface"
,
"OleObjectCache_AddRef"
,
"OleObjectCache_Cache"
,
"OleObjectCache_Release"
,
"OleObject_Release"
,
NULL
};
static
const
char
*
methods_olerender_draw_no_cache
[]
=
{
"OleObject_QueryInterface"
,
"OleObject_AddRef"
,
"OleObject_QueryInterface"
,
"OleObjectPersistStg_AddRef"
,
"OleObjectPersistStg_InitNew"
,
"OleObjectPersistStg_Release"
,
"OleObject_QueryInterface"
,
"OleObjectRunnable_AddRef"
,
"OleObjectRunnable_Run"
,
"OleObjectRunnable_Release"
,
"OleObject_QueryInterface"
,
"OleObject_Release"
,
NULL
};
runnable
=
&
OleObjectRunnable
;
cache
=
&
OleObjectCache
;
expected_method_list
=
methods_olerender_none
;
trace
(
"OleCreate with OLERENDER_NONE:
\n
"
);
hr
=
OleCreate
(
&
CLSID_Equation3
,
&
IID_IOleObject
,
OLERENDER_NONE
,
NULL
,
NULL
,
pStorage
,
(
void
**
)
&
pObject
);
...
...
@@ -756,6 +781,22 @@ static void test_OleCreate(IStorage *pStorage)
IOleObject_Release
(
pObject
);
ok
(
!*
expected_method_list
,
"Method sequence starting from %s not called
\n
"
,
*
expected_method_list
);
runnable
=
NULL
;
expected_method_list
=
methods_olerender_draw_no_runnable
;
trace
(
"OleCreate with OLERENDER_DRAW (no IOlObjectRunnable):
\n
"
);
hr
=
OleCreate
(
&
CLSID_Equation3
,
&
IID_IOleObject
,
OLERENDER_DRAW
,
NULL
,
NULL
,
pStorage
,
(
void
**
)
&
pObject
);
ok_ole_success
(
hr
,
"OleCreate"
);
IOleObject_Release
(
pObject
);
ok
(
!*
expected_method_list
,
"Method sequence starting from %s not called
\n
"
,
*
expected_method_list
);
runnable
=
&
OleObjectRunnable
;
cache
=
NULL
;
expected_method_list
=
methods_olerender_draw_no_cache
;
trace
(
"OleCreate with OLERENDER_DRAW (no IOlObjectRunnable):
\n
"
);
hr
=
OleCreate
(
&
CLSID_Equation3
,
&
IID_IOleObject
,
OLERENDER_DRAW
,
NULL
,
NULL
,
pStorage
,
(
void
**
)
&
pObject
);
ok_ole_success
(
hr
,
"OleCreate"
);
IOleObject_Release
(
pObject
);
ok
(
!*
expected_method_list
,
"Method sequence starting from %s not called
\n
"
,
*
expected_method_list
);
trace
(
"end
\n
"
);
}
...
...
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