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
0e99d795
Commit
0e99d795
authored
Aug 16, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Aug 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add some more tests for failure cases of Co* functions and make builtin ole32 pass them.
parent
31726e38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
23 deletions
+58
-23
compobj.c
dlls/ole32/compobj.c
+21
-6
compobj.c
dlls/ole32/tests/compobj.c
+37
-0
marshal.c
dlls/ole32/tests/marshal.c
+0
-17
No files found.
dlls/ole32/compobj.c
View file @
0e99d795
...
...
@@ -915,6 +915,9 @@ HRESULT WINAPI CLSIDFromString(LPOLESTR idstr, CLSID *id )
{
HRESULT
ret
;
if
(
!
id
)
return
E_INVALIDARG
;
ret
=
__CLSIDFromString
(
idstr
,
id
);
if
(
ret
!=
S_OK
)
{
/* It appears a ProgID is also valid */
ret
=
CLSIDFromProgID
(
idstr
,
id
);
...
...
@@ -1057,21 +1060,27 @@ HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY
*
* PARAMS
* clsid [I] Class ID, as found in registry.
*
lpl
pszProgID [O] Associated ProgID.
*
p
pszProgID [O] Associated ProgID.
*
* RETURNS
* S_OK
* E_OUTOFMEMORY
* REGDB_E_CLASSNOTREG if the given clsid has no associated ProgID
*/
HRESULT
WINAPI
ProgIDFromCLSID
(
REFCLSID
clsid
,
LPOLESTR
*
lpl
pszProgID
)
HRESULT
WINAPI
ProgIDFromCLSID
(
REFCLSID
clsid
,
LPOLESTR
*
p
pszProgID
)
{
static
const
WCHAR
wszProgID
[]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'I'
,
'D'
,
0
};
HKEY
hkey
;
HRESULT
ret
;
LONG
progidlen
=
0
;
*
lplpszProgID
=
NULL
;
if
(
!
ppszProgID
)
{
ERR
(
"ppszProgId isn't optional
\n
"
);
return
E_INVALIDARG
;
}
*
ppszProgID
=
NULL
;
ret
=
COM_OpenKeyForCLSID
(
clsid
,
wszProgID
,
KEY_READ
,
&
hkey
);
if
(
FAILED
(
ret
))
return
ret
;
...
...
@@ -1081,10 +1090,10 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID)
if
(
ret
==
S_OK
)
{
*
lpl
pszProgID
=
CoTaskMemAlloc
(
progidlen
*
sizeof
(
WCHAR
));
if
(
*
lpl
pszProgID
)
*
p
pszProgID
=
CoTaskMemAlloc
(
progidlen
*
sizeof
(
WCHAR
));
if
(
*
p
pszProgID
)
{
if
(
RegQueryValueW
(
hkey
,
NULL
,
*
lpl
pszProgID
,
&
progidlen
))
if
(
RegQueryValueW
(
hkey
,
NULL
,
*
p
pszProgID
,
&
progidlen
))
ret
=
REGDB_E_CLASSNOTREG
;
}
else
...
...
@@ -1200,6 +1209,12 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
return
CO_E_NOTINITIALIZED
;
}
if
(
!
pclsid
)
{
ERR
(
"pclsid isn't optional
\n
"
);
return
E_INVALIDARG
;
}
EnterCriticalSection
(
&
apt
->
cs
);
LIST_FOR_EACH_ENTRY
(
registered_psclsid
,
&
apt
->
psclsids
,
struct
registered_psclsid
,
entry
)
...
...
dlls/ole32/tests/compobj.c
View file @
0e99d795
...
...
@@ -73,6 +73,9 @@ static void test_ProgIDFromCLSID(void)
hr
=
ProgIDFromCLSID
(
&
CLSID_non_existent
,
&
progid
);
ok
(
hr
==
REGDB_E_CLASSNOTREG
,
"ProgIDFromCLSID returned %08lx
\n
"
,
hr
);
ok
(
progid
==
NULL
,
"ProgIDFromCLSID returns with progid %p
\n
"
,
progid
);
hr
=
ProgIDFromCLSID
(
&
CLSID_CDeviceMoniker
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ProgIDFromCLSID should return E_INVALIDARG instead of 0x%08lx
\n
"
,
hr
);
}
static
void
test_CLSIDFromProgID
(
void
)
...
...
@@ -106,6 +109,10 @@ static void test_CLSIDFromString(void)
HRESULT
hr
=
CLSIDFromString
((
LPOLESTR
)
wszCLSID_CDeviceMoniker
,
&
clsid
);
ok_ole_success
(
hr
,
"CLSIDFromString"
);
ok
(
IsEqualCLSID
(
&
clsid
,
&
CLSID_CDeviceMoniker
),
"clsid wasn't equal to CLSID_CDeviceMoniker
\n
"
);
hr
=
CLSIDFromString
(
NULL
,
&
clsid
);
ok_ole_success
(
hr
,
"CLSIDFromString"
);
ok
(
IsEqualCLSID
(
&
clsid
,
&
CLSID_NULL
),
"clsid wasn't equal to CLSID_NULL
\n
"
);
}
static
void
test_CoCreateInstance
(
void
)
...
...
@@ -418,6 +425,35 @@ static void test_CoRegisterPSClsid(void)
CoUninitialize
();
}
static
void
test_CoGetPSClsid
(
void
)
{
HRESULT
hr
;
CLSID
clsid
;
hr
=
CoGetPSClsid
(
&
IID_IClassFactory
,
&
clsid
);
ok
(
hr
==
CO_E_NOTINITIALIZED
,
"CoGetPSClsid should have returned CO_E_NOTINITIALIZED instead of 0x%08lx
\n
"
,
hr
);
pCoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
hr
=
CoGetPSClsid
(
&
IID_IClassFactory
,
&
clsid
);
ok_ole_success
(
hr
,
"CoGetPSClsid"
);
hr
=
CoGetPSClsid
(
&
IID_IWineTest
,
&
clsid
);
ok
(
hr
==
REGDB_E_IIDNOTREG
,
"CoGetPSClsid for random IID returned 0x%08lx instead of REGDB_E_IIDNOTREG
\n
"
,
hr
);
hr
=
CoGetPSClsid
(
&
IID_IClassFactory
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"CoGetPSClsid for null clsid returned 0x%08lx instead of E_INVALIDARG
\n
"
,
hr
);
CoUninitialize
();
}
START_TEST
(
compobj
)
{
HMODULE
hOle32
=
GetModuleHandle
(
"ole32"
);
...
...
@@ -435,4 +471,5 @@ START_TEST(compobj)
test_CoGetClassObject
();
test_CoRegisterMessageFilter
();
test_CoRegisterPSClsid
();
test_CoGetPSClsid
();
}
dlls/ole32/tests/marshal.c
View file @
0e99d795
...
...
@@ -46,20 +46,6 @@ static const IID IID_IWineTest =
{
0xa1
,
0xa2
,
0x5d
,
0x5a
,
0x36
,
0x54
,
0xd3
,
0xbd
}
};
/* 5201163f-8164-4fd0-a1a2-5d5a3654d3bd */
static
void
test_CoGetPSClsid
(
void
)
{
HRESULT
hr
;
CLSID
clsid
;
hr
=
CoGetPSClsid
(
&
IID_IClassFactory
,
&
clsid
);
ok_ole_success
(
hr
,
CoGetPSClsid
);
hr
=
CoGetPSClsid
(
&
IID_IWineTest
,
&
clsid
);
ok
(
hr
==
REGDB_E_IIDNOTREG
,
"CoGetPSClsid for random IID returned 0x%08lx instead of REGDB_E_IIDNOTREG
\n
"
,
hr
);
}
static
void
test_cocreateinstance_proxy
(
void
)
{
IUnknown
*
pProxy
;
...
...
@@ -2281,9 +2267,6 @@ START_TEST(marshal)
/* FIXME: test CoCreateInstanceEx */
/* helper function tests */
test_CoGetPSClsid
();
/* lifecycle management and marshaling tests */
test_no_marshaler
();
test_normal_marshal_and_release
();
...
...
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