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
46da8ef1
Commit
46da8ef1
authored
Apr 23, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: CoGetTreatAsClass should return S_FALSE if it cannot even find the key…
ole32: CoGetTreatAsClass should return S_FALSE if it cannot even find the key for the requested CLSID.
parent
33eb9393
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
compobj.c
dlls/ole32/compobj.c
+3
-0
compobj.c
dlls/ole32/tests/compobj.c
+19
-0
No files found.
dlls/ole32/compobj.c
View file @
46da8ef1
...
@@ -2922,7 +2922,10 @@ HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID clsidNew)
...
@@ -2922,7 +2922,10 @@ HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID clsidNew)
res
=
COM_OpenKeyForCLSID
(
clsidOld
,
wszTreatAs
,
KEY_READ
,
&
hkey
);
res
=
COM_OpenKeyForCLSID
(
clsidOld
,
wszTreatAs
,
KEY_READ
,
&
hkey
);
if
(
FAILED
(
res
))
if
(
FAILED
(
res
))
{
res
=
S_FALSE
;
goto
done
;
goto
done
;
}
if
(
RegQueryValueW
(
hkey
,
NULL
,
szClsidNew
,
&
len
))
if
(
RegQueryValueW
(
hkey
,
NULL
,
szClsidNew
,
&
len
))
{
{
res
=
S_FALSE
;
res
=
S_FALSE
;
...
...
dlls/ole32/tests/compobj.c
View file @
46da8ef1
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
HRESULT
(
WINAPI
*
pCoInitializeEx
)(
LPVOID
lpReserved
,
DWORD
dwCoInit
);
HRESULT
(
WINAPI
*
pCoInitializeEx
)(
LPVOID
lpReserved
,
DWORD
dwCoInit
);
HRESULT
(
WINAPI
*
pCoGetObjectContext
)(
REFIID
riid
,
LPVOID
*
ppv
);
HRESULT
(
WINAPI
*
pCoGetObjectContext
)(
REFIID
riid
,
LPVOID
*
ppv
);
HRESULT
(
WINAPI
*
pCoSwitchCallContext
)(
IUnknown
*
pObject
,
IUnknown
**
ppOldObject
);
HRESULT
(
WINAPI
*
pCoSwitchCallContext
)(
IUnknown
*
pObject
,
IUnknown
**
ppOldObject
);
HRESULT
(
WINAPI
*
pCoGetTreatAsClass
)(
REFCLSID
clsidOld
,
LPCLSID
pClsidNew
);
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
...
@@ -1141,6 +1142,22 @@ static void test_CoGetCallContext(void)
...
@@ -1141,6 +1142,22 @@ static void test_CoGetCallContext(void)
CoUninitialize
();
CoUninitialize
();
}
}
static
void
test_CoGetTreatAsClass
(
void
)
{
HRESULT
hr
;
CLSID
out
;
static
GUID
deadbeef
=
{
0xdeadbeef
,
0xdead
,
0xbeef
,{
0xde
,
0xad
,
0xbe
,
0xef
,
0xde
,
0xad
,
0xbe
,
0xef
}};
if
(
!
pCoGetTreatAsClass
)
{
win_skip
(
"CoGetTreatAsClass not present
\n
"
);
return
;
}
hr
=
pCoGetTreatAsClass
(
&
deadbeef
,
&
out
);
ok
(
hr
==
S_FALSE
,
"expected S_FALSE got %x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
out
,
&
deadbeef
),
"expected to get same clsid back
\n
"
);
}
static
void
test_CoInitializeEx
(
void
)
static
void
test_CoInitializeEx
(
void
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -1167,6 +1184,7 @@ START_TEST(compobj)
...
@@ -1167,6 +1184,7 @@ START_TEST(compobj)
HMODULE
hOle32
=
GetModuleHandle
(
"ole32"
);
HMODULE
hOle32
=
GetModuleHandle
(
"ole32"
);
pCoGetObjectContext
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoGetObjectContext"
);
pCoGetObjectContext
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoGetObjectContext"
);
pCoSwitchCallContext
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoSwitchCallContext"
);
pCoSwitchCallContext
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoSwitchCallContext"
);
pCoGetTreatAsClass
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoGetTreatAsClass"
);
if
(
!
(
pCoInitializeEx
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoInitializeEx"
)))
if
(
!
(
pCoInitializeEx
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoInitializeEx"
)))
{
{
trace
(
"You need DCOM95 installed to run this test
\n
"
);
trace
(
"You need DCOM95 installed to run this test
\n
"
);
...
@@ -1192,5 +1210,6 @@ START_TEST(compobj)
...
@@ -1192,5 +1210,6 @@ START_TEST(compobj)
test_CoFreeUnusedLibraries
();
test_CoFreeUnusedLibraries
();
test_CoGetObjectContext
();
test_CoGetObjectContext
();
test_CoGetCallContext
();
test_CoGetCallContext
();
test_CoGetTreatAsClass
();
test_CoInitializeEx
();
test_CoInitializeEx
();
}
}
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