Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
d95e2dbd
Commit
d95e2dbd
authored
Oct 18, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Oct 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: OleLoad should not fail even if IOleObject::GetMiscStatus fails.
parent
1f437a93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
9 deletions
+44
-9
ole2.c
dlls/ole32/ole2.c
+6
-7
ole2.c
dlls/ole32/tests/ole2.c
+38
-2
No files found.
dlls/ole32/ole2.c
View file @
d95e2dbd
...
...
@@ -1181,13 +1181,12 @@ HRESULT WINAPI OleLoad(
}
}
if
(
SUCCEEDED
(
hres
))
/*
* Initialize the object with it's IPersistStorage interface.
*/
hres
=
IOleObject_QueryInterface
(
pUnk
,
&
IID_IPersistStorage
,
(
void
**
)
&
persistStorage
);
/*
* Initialize the object with its IPersistStorage interface.
*/
hres
=
IOleObject_QueryInterface
(
pUnk
,
&
IID_IPersistStorage
,
(
void
**
)
&
persistStorage
);
if
(
SUCCEEDED
(
hres
))
{
...
...
dlls/ole32/tests/ole2.c
View file @
d95e2dbd
...
...
@@ -57,6 +57,7 @@ static FORMATETC *g_expected_fetc = NULL;
static
BOOL
g_showRunnable
=
TRUE
;
static
BOOL
g_isRunning
=
TRUE
;
static
BOOL
g_failGetMiscStatus
;
#define CHECK_EXPECTED_METHOD(method_name) \
do { \
...
...
@@ -328,8 +329,16 @@ static HRESULT WINAPI OleObject_GetMiscStatus
)
{
CHECK_EXPECTED_METHOD
(
"OleObject_GetMiscStatus"
);
*
pdwStatus
=
DVASPECT_CONTENT
;
return
S_OK
;
if
(
!
g_failGetMiscStatus
)
{
*
pdwStatus
=
OLEMISC_RECOMPOSEONRESIZE
;
return
S_OK
;
}
else
{
*
pdwStatus
=
0x1234
;
return
E_FAIL
;
}
}
static
HRESULT
WINAPI
OleObject_SetColorScheme
...
...
@@ -899,10 +908,32 @@ static void test_OleLoad(IStorage *pStorage)
{
"OleObject_SetClientSite"
,
0
},
{
"OleObject_Release"
,
0
},
{
"OleObject_QueryInterface"
,
0
},
{
"OleObject_GetMiscStatus"
,
0
},
{
"OleObject_Release"
,
0
},
{
NULL
,
0
}
};
/* Test once with IOleObject_GetMiscStatus failing */
expected_method_list
=
methods_oleload
;
g_failGetMiscStatus
=
TRUE
;
trace
(
"OleLoad:
\n
"
);
hr
=
OleLoad
(
pStorage
,
&
IID_IOleObject
,
(
IOleClientSite
*
)
0xdeadbeef
,
(
void
**
)
&
pObject
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_INVALIDARG
),
/* win98 and win2k */
"OleLoad failed with error 0x%08x
\n
"
,
hr
);
if
(
pObject
)
{
DWORD
dwStatus
=
0xdeadbeef
;
hr
=
IOleObject_GetMiscStatus
(
pObject
,
DVASPECT_CONTENT
,
&
dwStatus
);
ok
(
hr
==
E_FAIL
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
dwStatus
==
0x1234
,
"Got 0x%08x
\n
"
,
dwStatus
);
IOleObject_Release
(
pObject
);
CHECK_NO_EXTRA_METHODS
();
}
/* Test again, let IOleObject_GetMiscStatus succeed. */
g_failGetMiscStatus
=
FALSE
;
expected_method_list
=
methods_oleload
;
trace
(
"OleLoad:
\n
"
);
hr
=
OleLoad
(
pStorage
,
&
IID_IOleObject
,
(
IOleClientSite
*
)
0xdeadbeef
,
(
void
**
)
&
pObject
);
...
...
@@ -911,6 +942,11 @@ static void test_OleLoad(IStorage *pStorage)
"OleLoad failed with error 0x%08x
\n
"
,
hr
);
if
(
pObject
)
{
DWORD
dwStatus
=
0xdeadbeef
;
hr
=
IOleObject_GetMiscStatus
(
pObject
,
DVASPECT_CONTENT
,
&
dwStatus
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
dwStatus
==
1
,
"Got 0x%08x
\n
"
,
dwStatus
);
IOleObject_Release
(
pObject
);
CHECK_NO_EXTRA_METHODS
();
}
...
...
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