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
a2aefe91
Commit
a2aefe91
authored
Jun 27, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Added tests for external connections stored in ROT.
parent
070b22eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
moniker.c
dlls/ole32/tests/moniker.c
+59
-0
No files found.
dlls/ole32/tests/moniker.c
View file @
a2aefe91
...
@@ -97,6 +97,55 @@ static SIZE_T round_global_size(SIZE_T size)
...
@@ -97,6 +97,55 @@ static SIZE_T round_global_size(SIZE_T size)
return
((
size
+
global_size_alignment
-
1
)
&
~
(
global_size_alignment
-
1
));
return
((
size
+
global_size_alignment
-
1
)
&
~
(
global_size_alignment
-
1
));
}
}
static
DWORD
external_connections
;
static
HRESULT
WINAPI
ExternalConnection_QueryInterface
(
IExternalConnection
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ok
(
0
,
"unxpected call
\n
"
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ExternalConnection_AddRef
(
IExternalConnection
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
ExternalConnection_Release
(
IExternalConnection
*
iface
)
{
return
1
;
}
static
DWORD
WINAPI
ExternalConnection_AddConnection
(
IExternalConnection
*
iface
,
DWORD
extconn
,
DWORD
reserved
)
{
trace
(
"add connection
\n
"
);
ok
(
extconn
==
EXTCONN_STRONG
,
"extconn = %d
\n
"
,
extconn
);
ok
(
!
reserved
,
"reserved = %x
\n
"
,
reserved
);
return
++
external_connections
;
}
static
DWORD
WINAPI
ExternalConnection_ReleaseConnection
(
IExternalConnection
*
iface
,
DWORD
extconn
,
DWORD
reserved
,
BOOL
fLastReleaseCloses
)
{
trace
(
"release connection
\n
"
);
ok
(
extconn
==
EXTCONN_STRONG
,
"extconn = %d
\n
"
,
extconn
);
ok
(
!
reserved
,
"reserved = %x
\n
"
,
reserved
);
return
--
external_connections
;
}
static
const
IExternalConnectionVtbl
ExternalConnectionVtbl
=
{
ExternalConnection_QueryInterface
,
ExternalConnection_AddRef
,
ExternalConnection_Release
,
ExternalConnection_AddConnection
,
ExternalConnection_ReleaseConnection
};
static
IExternalConnection
ExternalConnection
=
{
&
ExternalConnectionVtbl
};
static
HRESULT
WINAPI
Test_IClassFactory_QueryInterface
(
static
HRESULT
WINAPI
Test_IClassFactory_QueryInterface
(
LPCLASSFACTORY
iface
,
LPCLASSFACTORY
iface
,
REFIID
riid
,
REFIID
riid
,
...
@@ -112,6 +161,11 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface(
...
@@ -112,6 +161,11 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface(
return
S_OK
;
return
S_OK
;
}
}
if
(
IsEqualGUID
(
riid
,
&
IID_IExternalConnection
))
{
*
ppvObj
=
&
ExternalConnection
;
return
S_OK
;
}
*
ppvObj
=
NULL
;
*
ppvObj
=
NULL
;
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
...
@@ -588,11 +642,13 @@ static void test_ROT(void)
...
@@ -588,11 +642,13 @@ static void test_ROT(void)
ok_ole_success
(
hr
,
GetRunningObjectTable
);
ok_ole_success
(
hr
,
GetRunningObjectTable
);
expected_method_list
=
methods_register_no_ROTData
;
expected_method_list
=
methods_register_no_ROTData
;
external_connections
=
0
;
/* try with our own moniker that doesn't support IROTData */
/* try with our own moniker that doesn't support IROTData */
hr
=
IRunningObjectTable_Register
(
pROT
,
ROTFLAGS_REGISTRATIONKEEPSALIVE
,
hr
=
IRunningObjectTable_Register
(
pROT
,
ROTFLAGS_REGISTRATIONKEEPSALIVE
,
(
IUnknown
*
)
&
Test_ClassFactory
,
&
MonikerNoROTData
,
&
dwCookie
);
(
IUnknown
*
)
&
Test_ClassFactory
,
&
MonikerNoROTData
,
&
dwCookie
);
ok_ole_success
(
hr
,
IRunningObjectTable_Register
);
ok_ole_success
(
hr
,
IRunningObjectTable_Register
);
ok
(
!*
expected_method_list
,
"Method sequence starting from %s not called
\n
"
,
*
expected_method_list
);
ok
(
!*
expected_method_list
,
"Method sequence starting from %s not called
\n
"
,
*
expected_method_list
);
ok
(
external_connections
==
1
,
"external_connections = %d
\n
"
,
external_connections
);
ok_more_than_one_lock
();
ok_more_than_one_lock
();
...
@@ -603,6 +659,7 @@ static void test_ROT(void)
...
@@ -603,6 +659,7 @@ static void test_ROT(void)
hr
=
IRunningObjectTable_Revoke
(
pROT
,
dwCookie
);
hr
=
IRunningObjectTable_Revoke
(
pROT
,
dwCookie
);
ok_ole_success
(
hr
,
IRunningObjectTable_Revoke
);
ok_ole_success
(
hr
,
IRunningObjectTable_Revoke
);
ok
(
external_connections
==
0
,
"external_connections = %d
\n
"
,
external_connections
);
ok_no_locks
();
ok_no_locks
();
...
@@ -629,9 +686,11 @@ static void test_ROT(void)
...
@@ -629,9 +686,11 @@ static void test_ROT(void)
ok_ole_success
(
hr
,
CreateClassMoniker
);
ok_ole_success
(
hr
,
CreateClassMoniker
);
/* test flags: 0 */
/* test flags: 0 */
external_connections
=
0
;
hr
=
IRunningObjectTable_Register
(
pROT
,
0
,
(
IUnknown
*
)
&
Test_ClassFactory
,
hr
=
IRunningObjectTable_Register
(
pROT
,
0
,
(
IUnknown
*
)
&
Test_ClassFactory
,
pMoniker
,
&
dwCookie
);
pMoniker
,
&
dwCookie
);
ok_ole_success
(
hr
,
IRunningObjectTable_Register
);
ok_ole_success
(
hr
,
IRunningObjectTable_Register
);
ok
(
external_connections
==
0
,
"external_connections = %d
\n
"
,
external_connections
);
ok_more_than_one_lock
();
ok_more_than_one_lock
();
...
...
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