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
2021c98b
Commit
2021c98b
authored
Feb 23, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comsvcs/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e240aeb7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
74 deletions
+73
-74
Makefile.in
dlls/comsvcs/tests/Makefile.in
+0
-1
comsvcs.c
dlls/comsvcs/tests/comsvcs.c
+63
-63
property.c
dlls/comsvcs/tests/property.c
+10
-10
No files found.
dlls/comsvcs/tests/Makefile.in
View file @
2021c98b
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
comsvcs.dll
IMPORTS
=
uuid oleaut32 ole32
...
...
dlls/comsvcs/tests/comsvcs.c
View file @
2021c98b
...
...
@@ -63,7 +63,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
ULONG
rc
;
IUnknown_AddRef
(
obj
);
rc
=
IUnknown_Release
(
obj
);
ok_
(
__FILE__
,
line
)(
rc
==
ref
,
"expected refcount %
d, got %
d
\n
"
,
ref
,
rc
);
ok_
(
__FILE__
,
line
)(
rc
==
ref
,
"expected refcount %
ld, got %l
d
\n
"
,
ref
,
rc
);
}
struct
test_driver
...
...
@@ -186,7 +186,7 @@ static void create_dispenser(void)
struct
test_driver
driver
;
hr
=
CoCreateInstance
(
&
CLSID_DispenserManager
,
NULL
,
CLSCTX_ALL
,
&
IID_IDispenserManager
,
(
void
**
)
&
dispenser
);
ok
(
hr
==
S_OK
,
"Failed to create object 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create object 0x%08
l
x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
win_skip
(
"DispenserManager not available
\n
"
);
...
...
@@ -196,13 +196,13 @@ static void create_dispenser(void)
thread
=
CreateThread
(
NULL
,
0
,
com_thread
,
NULL
,
0
,
NULL
);
ok
(
!
WaitForSingleObject
(
thread
,
1000
),
"wait failed
\n
"
);
GetExitCodeThread
(
thread
,
&
ret
);
ok
(
ret
==
CO_E_NOTINITIALIZED
,
"got unexpected hr %#x
\n
"
,
ret
);
ok
(
ret
==
CO_E_NOTINITIALIZED
,
"got unexpected hr %#
l
x
\n
"
,
ret
);
CloseHandle
(
thread
);
init_test_driver
(
&
driver
);
hr
=
IDispenserManager_RegisterDispenser
(
dispenser
,
&
driver
.
IDispenserDriver_iface
,
L"SC.Pool 0 0"
,
&
holder1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/* The above call creates an MTA thread, but we need to wait for it to
* actually initialize. */
...
...
@@ -210,15 +210,15 @@ static void create_dispenser(void)
thread
=
CreateThread
(
NULL
,
0
,
com_thread
,
NULL
,
0
,
NULL
);
ok
(
!
WaitForSingleObject
(
thread
,
20000
),
"wait failed
\n
"
);
GetExitCodeThread
(
thread
,
&
ret
);
ok
(
ret
==
S_OK
,
"got unexpected hr %#x
\n
"
,
ret
);
ok
(
ret
==
S_OK
,
"got unexpected hr %#
l
x
\n
"
,
ret
);
CloseHandle
(
thread
);
hr
=
IDispenserManager_RegisterDispenser
(
dispenser
,
&
driver
.
IDispenserDriver_iface
,
L"SC.Pool 0 0"
,
&
holder2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
holder1
!=
holder2
,
"same holder object returned
\n
"
);
hr
=
IDispenserManager_RegisterDispenser
(
dispenser
,
&
driver
.
IDispenserDriver_iface
,
L"SC.Pool 1 1"
,
&
holder3
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
if
(
holder1
)
{
...
...
@@ -227,7 +227,7 @@ static void create_dispenser(void)
str
=
SysAllocString
(
L"data1"
);
hr
=
IHolder_AllocResource
(
holder1
,
(
RESTYPID
)
str
,
&
resid
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
resid
==
10
,
"got %d
\n
"
,
(
int
)
resid
);
SysFreeString
(
str
);
...
...
@@ -236,13 +236,13 @@ static void create_dispenser(void)
SET_EXPECT
(
driver_ResetResource
);
hr
=
IHolder_FreeResource
(
holder1
,
resid
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
todo_wine
CHECK_CALLED
(
driver_ResetResource
);
SET_EXPECT
(
driver_DestroyResource
);
SET_EXPECT
(
driver_Release
);
hr
=
IHolder_Close
(
holder1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
CHECK_CALLED
(
driver_Release
);
CHECK_CALLED
(
driver_DestroyResource
);
...
...
@@ -255,7 +255,7 @@ static void create_dispenser(void)
str
=
SysAllocString
(
L"data1"
);
hr
=
IHolder_AllocResource
(
holder2
,
(
RESTYPID
)
str
,
&
resid
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
resid
==
10
,
"got %d
\n
"
,
(
int
)
resid
);
SysFreeString
(
str
);
...
...
@@ -264,7 +264,7 @@ static void create_dispenser(void)
SET_EXPECT
(
driver_ResetResource
);
hr
=
IHolder_FreeResource
(
holder2
,
resid
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
todo_wine
CHECK_CALLED
(
driver_ResetResource
);
/* DestroyResource return doesn't directly affect the Holder Close return value */
...
...
@@ -272,7 +272,7 @@ static void create_dispenser(void)
SET_EXPECT
(
driver_DestroyResource
);
SET_EXPECT
(
driver_Release
);
hr
=
IHolder_Close
(
holder2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
CHECK_CALLED
(
driver_Release
);
CHECK_CALLED
(
driver_DestroyResource
);
driver
.
destroy_resource_hr
=
S_OK
;
...
...
@@ -282,7 +282,7 @@ static void create_dispenser(void)
{
SET_EXPECT
(
driver_Release
);
hr
=
IHolder_Close
(
holder3
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
CHECK_CALLED
(
driver_Release
);
IHolder_Release
(
holder3
);
}
...
...
@@ -301,7 +301,7 @@ static void test_new_moniker_serialize(const WCHAR *clsid, const WCHAR *progid,
DWORD
*
ptr
;
hr
=
IMoniker_GetSizeMax
(
moniker
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
expected_size
=
sizeof
(
GUID
)
+
2
*
sizeof
(
DWORD
);
if
(
progid
)
...
...
@@ -312,24 +312,24 @@ static void test_new_moniker_serialize(const WCHAR *clsid, const WCHAR *progid,
size
.
QuadPart
=
0
;
hr
=
IMoniker_GetSizeMax
(
moniker
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get size, hr %#x.
\n
"
,
hr
);
ok
(
size
.
QuadPart
==
expected_size
,
"Unexpected size %s, expected %#x.
\n
"
,
wine_dbgstr_longlong
(
size
.
QuadPart
),
ok
(
hr
==
S_OK
,
"Failed to get size, hr %#
l
x.
\n
"
,
hr
);
ok
(
size
.
QuadPart
==
expected_size
,
"Unexpected size %s, expected %#
l
x.
\n
"
,
wine_dbgstr_longlong
(
size
.
QuadPart
),
expected_size
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
ok
(
hr
==
S_OK
,
"Failed to create a stream, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create a stream, hr %#
l
x.
\n
"
,
hr
);
hr
=
IMoniker_Save
(
moniker
,
stream
,
FALSE
);
ok
(
hr
==
S_OK
,
"Failed to save moniker, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to save moniker, hr %#
l
x.
\n
"
,
hr
);
hr
=
GetHGlobalFromStream
(
stream
,
&
hglobal
);
ok
(
hr
==
S_OK
,
"Failed to get a handle, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get a handle, hr %#
l
x.
\n
"
,
hr
);
ptr
=
GlobalLock
(
hglobal
);
ok
(
!!
ptr
,
"Failed to get data pointer.
\n
"
);
hr
=
CLSIDFromString
(
clsid
,
&
guid
);
ok
(
hr
==
S_OK
,
"Failed to get CLSID, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get CLSID, hr %#
l
x.
\n
"
,
hr
);
ok
(
IsEqualGUID
((
GUID
*
)
ptr
,
&
guid
),
"Unexpected buffer content.
\n
"
);
ptr
+=
sizeof
(
GUID
)
/
sizeof
(
DWORD
);
...
...
@@ -376,51 +376,51 @@ static void test_new_moniker(void)
WCHAR
*
str
;
hr
=
CreateBindCtx
(
0
,
&
bindctx
);
ok
(
hr
==
S_OK
,
"Failed to create bind context, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create bind context, hr %#
l
x.
\n
"
,
hr
);
eaten
=
0
;
hr
=
MkParseDisplayName
(
bindctx
,
L"new:20d04fe0-3aea-1069-a2d8-08002b30309d"
,
&
eaten
,
&
moniker
);
ok
(
hr
==
S_OK
,
"Failed to parse display name, hr %#x.
\n
"
,
hr
);
ok
(
eaten
==
40
,
"Unexpected eaten length %u.
\n
"
,
eaten
);
ok
(
hr
==
S_OK
,
"Failed to parse display name, hr %#
l
x.
\n
"
,
hr
);
ok
(
eaten
==
40
,
"Unexpected eaten length %
l
u.
\n
"
,
eaten
);
hr
=
IMoniker_QueryInterface
(
moniker
,
&
IID_IROTData
,
(
void
**
)
&
rot_data
);
ok
(
hr
==
S_OK
,
"Failed to get IROTData, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get IROTData, hr %#
l
x.
\n
"
,
hr
);
IROTData_Release
(
rot_data
);
eaten
=
0
;
hr
=
IMoniker_ParseDisplayName
(
moniker
,
bindctx
,
NULL
,
(
WCHAR
*
)
L"new:20d04fe0-3aea-1069-a2d8-08002b30309d"
,
&
eaten
,
&
moniker2
);
ok
(
hr
==
S_OK
,
"Failed to parse display name, hr %#x.
\n
"
,
hr
);
ok
(
eaten
==
40
,
"Unexpected eaten length %u.
\n
"
,
eaten
);
ok
(
hr
==
S_OK
,
"Failed to parse display name, hr %#
l
x.
\n
"
,
hr
);
ok
(
eaten
==
40
,
"Unexpected eaten length %
l
u.
\n
"
,
eaten
);
IMoniker_Release
(
moniker2
);
hr
=
IMoniker_QueryInterface
(
moniker
,
&
IID_IParseDisplayName
,
(
void
**
)
&
obj
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
/* Object creation. */
hr
=
CLSIDFromProgID
(
L"new"
,
&
clsid
);
ok
(
hr
==
S_OK
,
"Failed to get clsid, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get clsid, hr %#
l
x.
\n
"
,
hr
);
hr
=
CreateClassMoniker
(
&
clsid
,
&
class_moniker
);
ok
(
hr
==
S_OK
,
"Failed to create class moniker, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create class moniker, hr %#
l
x.
\n
"
,
hr
);
hr
=
IMoniker_BindToObject
(
class_moniker
,
bindctx
,
NULL
,
&
IID_IParseDisplayName
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#
l
x.
\n
"
,
hr
);
IUnknown_Release
(
obj
);
hr
=
IMoniker_BindToObject
(
class_moniker
,
bindctx
,
NULL
,
&
IID_IClassFactory
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#
l
x.
\n
"
,
hr
);
IUnknown_Release
(
obj
);
hr
=
CoGetClassObject
(
&
clsid
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IParseDisplayName
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#
l
x.
\n
"
,
hr
);
IUnknown_Release
(
obj
);
hr
=
CoGetClassObject
(
&
clsid
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IClassFactory
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#
l
x.
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
obj
,
&
IID_IParseDisplayName
,
(
void
**
)
&
obj2
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get parsing interface, hr %#
l
x.
\n
"
,
hr
);
IUnknown_Release
(
obj
);
IMoniker_Release
(
class_moniker
);
...
...
@@ -428,73 +428,73 @@ static void test_new_moniker(void)
/* Reducing. */
moniker_left
=
(
void
*
)
0xdeadbeef
;
hr
=
IMoniker_Reduce
(
moniker
,
bindctx
,
MKRREDUCE_ONE
,
&
moniker_left
,
&
moniker2
);
ok
(
hr
==
MK_S_REDUCED_TO_SELF
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
MK_S_REDUCED_TO_SELF
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
ok
(
moniker_left
==
(
void
*
)
0xdeadbeef
,
"Unexpected left moniker.
\n
"
);
ok
(
moniker2
==
moniker
,
"Unexpected returned moniker.
\n
"
);
IMoniker_Release
(
moniker2
);
hr
=
IMoniker_Reduce
(
moniker
,
bindctx
,
MKRREDUCE_ONE
,
NULL
,
&
moniker2
);
ok
(
hr
==
MK_S_REDUCED_TO_SELF
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
MK_S_REDUCED_TO_SELF
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
ok
(
moniker2
==
moniker
,
"Unexpected returned moniker.
\n
"
);
IMoniker_Release
(
moniker2
);
hr
=
IMoniker_Reduce
(
moniker
,
bindctx
,
MKRREDUCE_ONE
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
/* Hashing */
hash
=
0
;
hr
=
IMoniker_Hash
(
moniker
,
&
hash
);
ok
(
hr
==
S_OK
,
"Failed to get a hash, hr %#x.
\n
"
,
hr
);
ok
(
hash
==
0x20d04fe0
,
"Unexpected hash value %#x.
\n
"
,
hash
);
ok
(
hr
==
S_OK
,
"Failed to get a hash, hr %#
l
x.
\n
"
,
hr
);
ok
(
hash
==
0x20d04fe0
,
"Unexpected hash value %#
l
x.
\n
"
,
hash
);
moniker_type
=
MKSYS_CLASSMONIKER
;
hr
=
IMoniker_IsSystemMoniker
(
moniker
,
&
moniker_type
);
ok
(
hr
==
S_FALSE
||
broken
(
hr
==
S_OK
)
/* XP */
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
moniker_type
==
MKSYS_NONE
,
"Unexpected moniker type %d.
\n
"
,
moniker_type
);
ok
(
hr
==
S_FALSE
||
broken
(
hr
==
S_OK
)
/* XP */
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
ok
(
moniker_type
==
MKSYS_NONE
,
"Unexpected moniker type %
l
d.
\n
"
,
moniker_type
);
hr
=
IMoniker_IsRunning
(
moniker
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
hr
=
IMoniker_IsRunning
(
moniker
,
bindctx
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
hr
=
IMoniker_GetTimeOfLastChange
(
moniker
,
bindctx
,
NULL
,
&
filetime
);
ok
(
hr
==
MK_E_UNAVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
MK_E_UNAVAILABLE
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
hr
=
IMoniker_BindToObject
(
moniker
,
bindctx
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to bind to object, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to bind to object, hr %#
l
x.
\n
"
,
hr
);
IUnknown_Release
(
obj
);
hr
=
IMoniker_BindToStorage
(
moniker
,
bindctx
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
obj
);
todo_wine
ok
(
hr
==
MK_E_NOSTORAGE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
MK_E_NOSTORAGE
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
hr
=
IMoniker_Inverse
(
moniker
,
&
inverse
);
ok
(
hr
==
S_OK
,
"Failed to create inverse moniker, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create inverse moniker, hr %#
l
x.
\n
"
,
hr
);
moniker_type
=
MKSYS_NONE
;
hr
=
IMoniker_IsSystemMoniker
(
inverse
,
&
moniker_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
moniker_type
==
MKSYS_ANTIMONIKER
,
"Unexpected moniker type %d.
\n
"
,
moniker_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
ok
(
moniker_type
==
MKSYS_ANTIMONIKER
,
"Unexpected moniker type %
l
d.
\n
"
,
moniker_type
);
IMoniker_Release
(
inverse
);
hr
=
IMoniker_Enum
(
moniker
,
FALSE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
obj
=
(
IUnknown
*
)
moniker
;
hr
=
IMoniker_Enum
(
moniker
,
FALSE
,
(
IEnumMoniker
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
ok
(
obj
==
NULL
,
"Unexpected return value.
\n
"
);
/* Serialization. */
test_new_moniker_serialize
(
L"{20d04fe0-3aea-1069-a2d8-08002b30309d}"
,
NULL
,
moniker
);
hr
=
IMoniker_IsDirty
(
moniker
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
hr
=
IMoniker_GetClassID
(
moniker
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
IMoniker_Release
(
moniker
);
...
...
@@ -504,39 +504,39 @@ static void test_new_moniker(void)
bind_opts
.
dwClassContext
=
CLSCTX_INPROC_SERVER
;
hr
=
CoGetObject
(
L"new:msxml2.domdocument"
,
(
BIND_OPTS
*
)
&
bind_opts
,
&
IID_IXMLDOMDocument
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to create object, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create object, hr %#
l
x.
\n
"
,
hr
);
IUnknown_Release
(
obj
);
IBindCtx_Release
(
bindctx
);
/* Returned object is not bound to context. */
hr
=
CreateBindCtx
(
0
,
&
bindctx
);
ok
(
hr
==
S_OK
,
"Failed to create bind context, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create bind context, hr %#
l
x.
\n
"
,
hr
);
eaten
=
0
;
hr
=
MkParseDisplayName
(
bindctx
,
L"new:msxml2.domdocument"
,
&
eaten
,
&
moniker
);
ok
(
hr
==
S_OK
,
"Failed to parse display name, hr %#x.
\n
"
,
hr
);
ok
(
eaten
,
"Unexpected eaten length %u.
\n
"
,
eaten
);
ok
(
hr
==
S_OK
,
"Failed to parse display name, hr %#
l
x.
\n
"
,
hr
);
ok
(
eaten
,
"Unexpected eaten length %
l
u.
\n
"
,
eaten
);
hr
=
CLSIDFromProgID
(
L"msxml2.domdocument"
,
&
clsid
);
ok
(
hr
==
S_OK
,
"Failed to get clsid, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get clsid, hr %#
l
x.
\n
"
,
hr
);
hr
=
StringFromCLSID
(
&
clsid
,
&
str
);
ok
(
hr
==
S_OK
,
"Failed to get guid string, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get guid string, hr %#
l
x.
\n
"
,
hr
);
test_new_moniker_serialize
(
str
,
L"msxml2.domdocument"
,
moniker
);
CoTaskMemFree
(
str
);
hr
=
IMoniker_BindToObject
(
moniker
,
bindctx
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to bind to object, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to bind to object, hr %#
l
x.
\n
"
,
hr
);
EXPECT_REF
(
obj
,
1
);
hr
=
IBindCtx_GetRunningObjectTable
(
bindctx
,
&
rot
);
ok
(
hr
==
S_OK
,
"Failed to get rot, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get rot, hr %#
l
x.
\n
"
,
hr
);
hr
=
IRunningObjectTable_GetObject
(
rot
,
moniker
,
&
obj2
);
todo_wine
ok
(
hr
==
MK_E_UNAVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
MK_E_UNAVAILABLE
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
IRunningObjectTable_Release
(
rot
);
...
...
dlls/comsvcs/tests/property.c
View file @
2021c98b
...
...
@@ -70,35 +70,35 @@ static void test_interfaces(void)
hr
=
CoCreateInstance
(
&
CLSID_SharedPropertyGroupManager
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_ISharedPropertyGroupManager
,
(
void
**
)
&
manager
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"Got hr %#
l
x.
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_SharedPropertyGroupManager
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#
l
x.
\n
"
,
hr
);
expected_refcount
=
get_refcount
(
unk
)
+
1
;
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_ISharedPropertyGroupManager
,
(
void
**
)
&
manager
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#
l
x.
\n
"
,
hr
);
refcount
=
get_refcount
(
unk
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
u, expected %
u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
lu, expected %l
u.
\n
"
,
refcount
,
expected_refcount
);
expected_refcount
=
get_refcount
(
manager
)
+
1
;
hr
=
CoCreateInstance
(
&
CLSID_SharedPropertyGroupManager
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ISharedPropertyGroupManager
,
(
void
**
)
&
manager1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#
l
x.
\n
"
,
hr
);
ok
(
manager1
==
manager
,
"Got wrong pointer: %p.
\n
"
,
manager1
);
refcount
=
get_refcount
(
manager1
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
u, expected %
u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
lu, expected %l
u.
\n
"
,
refcount
,
expected_refcount
);
refcount
=
get_refcount
(
manager
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
u, expected %
u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
lu, expected %l
u.
\n
"
,
refcount
,
expected_refcount
);
ISharedPropertyGroupManager_Release
(
manager1
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IDispatch
,
(
void
**
)
&
dispatch
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#
l
x.
\n
"
,
hr
);
refcount
=
get_refcount
(
dispatch
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
u, expected %
u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
lu, expected %l
u.
\n
"
,
refcount
,
expected_refcount
);
refcount
=
get_refcount
(
manager
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
u, expected %
u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got refcount: %
lu, expected %l
u.
\n
"
,
refcount
,
expected_refcount
);
IDispatch_Release
(
dispatch
);
IUnknown_Release
(
unk
);
...
...
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