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
dedcd30c
Commit
dedcd30c
authored
Oct 21, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Pass requested interface IID to CreateInstance in CoCreateInstanceEx.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
80751014
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
8 deletions
+43
-8
compobj.c
dlls/ole32/compobj.c
+16
-8
compobj.c
dlls/ole32/tests/compobj.c
+27
-0
No files found.
dlls/ole32/compobj.c
View file @
dedcd30c
...
...
@@ -3271,18 +3271,26 @@ static void init_multi_qi(DWORD count, MULTI_QI *mqi)
}
}
static
HRESULT
return_multi_qi
(
IUnknown
*
unk
,
DWORD
count
,
MULTI_QI
*
mqi
)
static
HRESULT
return_multi_qi
(
IUnknown
*
unk
,
DWORD
count
,
MULTI_QI
*
mqi
,
BOOL
include_unk
)
{
ULONG
index
,
fetched
=
0
;
ULONG
index
=
0
,
fetched
=
0
;
for
(
index
=
0
;
index
<
count
;
index
++
)
if
(
include_unk
)
{
mqi
[
0
].
hr
=
S_OK
;
mqi
[
0
].
pItf
=
unk
;
index
=
fetched
=
1
;
}
for
(;
index
<
count
;
index
++
)
{
mqi
[
index
].
hr
=
IUnknown_QueryInterface
(
unk
,
mqi
[
index
].
pIID
,
(
void
**
)
&
mqi
[
index
].
pItf
);
if
(
mqi
[
index
].
hr
==
S_OK
)
fetched
++
;
}
IUnknown_Release
(
unk
);
if
(
!
include_unk
)
IUnknown_Release
(
unk
);
if
(
fetched
==
0
)
return
E_NOINTERFACE
;
...
...
@@ -3321,13 +3329,13 @@ HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstanceEx(
hr
=
CoCreateInstance
(
rclsid
,
pUnkOuter
,
dwClsContext
,
&
IID_IUnknown
,
pResults
[
0
].
pIID
,
(
VOID
**
)
&
pUnk
);
if
(
hr
!=
S_OK
)
return
hr
;
return
return_multi_qi
(
pUnk
,
cmq
,
pResults
);
return
return_multi_qi
(
pUnk
,
cmq
,
pResults
,
TRUE
);
}
/***********************************************************************
...
...
@@ -3390,7 +3398,7 @@ HRESULT WINAPI CoGetInstanceFromFile(
IPersistFile_Release
(
pf
);
}
return
return_multi_qi
(
unk
,
count
,
results
);
return
return_multi_qi
(
unk
,
count
,
results
,
FALSE
);
}
/***********************************************************************
...
...
@@ -3453,7 +3461,7 @@ HRESULT WINAPI CoGetInstanceFromIStorage(
IPersistStorage_Release
(
ps
);
}
return
return_multi_qi
(
unk
,
count
,
results
);
return
return_multi_qi
(
unk
,
count
,
results
,
FALSE
);
}
/***********************************************************************
...
...
dlls/ole32/tests/compobj.c
View file @
dedcd30c
...
...
@@ -152,6 +152,7 @@ static ULONG WINAPI Test_IClassFactory_Release(LPCLASSFACTORY iface)
return
1
;
/* non-heap-based object */
}
static
IID
create_instance_iid
;
static
HRESULT
WINAPI
Test_IClassFactory_CreateInstance
(
LPCLASSFACTORY
iface
,
IUnknown
*
pUnkOuter
,
...
...
@@ -159,6 +160,7 @@ static HRESULT WINAPI Test_IClassFactory_CreateInstance(
LPVOID
*
ppvObj
)
{
*
ppvObj
=
NULL
;
create_instance_iid
=
*
riid
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
return
E_NOINTERFACE
;
}
...
...
@@ -789,6 +791,30 @@ static void test_CoGetClassObject(void)
CoUninitialize
();
}
static
void
test_CoCreateInstanceEx
(
void
)
{
MULTI_QI
qi_res
=
{
&
IID_IMoniker
};
DWORD
cookie
;
HRESULT
hr
;
CoInitialize
(
NULL
);
hr
=
CoRegisterClassObject
(
&
CLSID_WineOOPTest
,
(
IUnknown
*
)
&
Test_ClassFactory
,
CLSCTX_INPROC_SERVER
,
REGCLS_MULTIPLEUSE
,
&
cookie
);
ok_ole_success
(
hr
,
"CoRegisterClassObject"
);
create_instance_iid
=
IID_NULL
;
hr
=
CoCreateInstanceEx
(
&
CLSID_WineOOPTest
,
NULL
,
CLSCTX_INPROC_SERVER
,
NULL
,
1
,
&
qi_res
);
ok
(
hr
==
E_NOINTERFACE
,
"CoCreateInstanceEx failed: %08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
create_instance_iid
,
qi_res
.
pIID
),
"Unexpected CreateInstance iid %s
\n
"
,
wine_dbgstr_guid
(
&
create_instance_iid
));
hr
=
CoRevokeClassObject
(
cookie
);
ok_ole_success
(
hr
,
"CoRevokeClassObject"
);
CoUninitialize
();
}
static
ATOM
register_dummy_class
(
void
)
{
WNDCLASSA
wc
=
...
...
@@ -2636,6 +2662,7 @@ START_TEST(compobj)
test_CoCreateInstance
();
test_ole_menu
();
test_CoGetClassObject
();
test_CoCreateInstanceEx
();
test_CoRegisterMessageFilter
();
test_CoRegisterPSClsid
();
test_CoGetPSClsid
();
...
...
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