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
2daa5367
Commit
2daa5367
authored
Jun 10, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Add a test for local server interaction using an in-process handler.
parent
289437dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
7 deletions
+85
-7
ole_server.c
dlls/ole32/tests/ole_server.c
+85
-7
No files found.
dlls/ole32/tests/ole_server.c
View file @
2daa5367
...
...
@@ -55,6 +55,7 @@ static const struct
GUID_NAME
(
IStdMarshalInfo
),
GUID_NAME
(
IExternalConnection
),
GUID_NAME
(
IRunnableObject
),
GUID_NAME
(
ICallFactory
),
{
&
CLSID_IdentityUnmarshal
,
"CLSID_IdentityUnmarshal"
},
{
&
CLSID_UnknownUnmarshal
,
"CLSID_UnknownUnmarshal"
},
#undef GUID_NAME
...
...
@@ -276,7 +277,7 @@ static void ole_server(void)
}
/******************************* OLE client *******************************/
static
BOOL
register_server
(
const
char
*
server
)
static
BOOL
register_server
(
const
char
*
server
,
BOOL
inproc_handler
)
{
static
const
WCHAR
clsidW
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
'\\'
,
0
};
DWORD
ret
;
...
...
@@ -296,6 +297,13 @@ static BOOL register_server(const char *server)
{
ret
=
RegSetValue
(
root
,
"LocalServer32"
,
REG_SZ
,
server_path
,
strlen
(
server_path
));
ok
(
ret
==
ERROR_SUCCESS
,
"RegSetValue error %u
\n
"
,
ret
);
if
(
inproc_handler
)
{
ret
=
RegSetValue
(
root
,
"InprocHandler32"
,
REG_SZ
,
"ole32.dll"
,
9
);
ok
(
ret
==
ERROR_SUCCESS
,
"RegSetValue error %u
\n
"
,
ret
);
}
RegCloseKey
(
root
);
}
...
...
@@ -316,6 +324,8 @@ static void unregister_server(void)
DELETE
,
NULL
,
&
root
,
NULL
);
if
(
ret
==
ERROR_SUCCESS
)
{
ret
=
RegDeleteKey
(
root
,
"InprocHandler32"
);
ok
(
ret
==
ERROR_SUCCESS
,
"RegDeleteKey error %u
\n
"
,
ret
);
ret
=
RegDeleteKey
(
root
,
"LocalServer32"
);
ok
(
ret
==
ERROR_SUCCESS
,
"RegDeleteKey error %u
\n
"
,
ret
);
ret
=
RegDeleteKey
(
root
,
""
);
...
...
@@ -359,6 +369,7 @@ START_TEST(ole_server)
IClassFactory
*
factory
;
IUnknown
*
unknown
;
IOleObject
*
oleobj
;
IRunnableObject
*
runobj
;
DWORD
ret
;
HANDLE
mapping
,
done_event
,
init_done_event
,
process
;
struct
winetest_info
*
info
;
...
...
@@ -396,7 +407,7 @@ START_TEST(ole_server)
return
;
}
if
(
!
register_server
(
argv
[
0
]))
if
(
!
register_server
(
argv
[
0
]
,
FALSE
))
{
win_skip
(
"not enough permissions to create a server CLSID key
\n
"
);
return
;
...
...
@@ -415,14 +426,81 @@ START_TEST(ole_server)
hr
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_INPROC_HANDLER
,
&
IID_IUnknown
,
(
void
**
)
&
unknown
);
ok
(
hr
==
REGDB_E_CLASSNOTREG
,
"expected REGDB_E_CLASSNOTREG, got %#x
\n
"
,
hr
);
/* server supports IID_IUnknown */
if
(
!
register_server
(
argv
[
0
],
TRUE
))
{
win_skip
(
"not enough permissions to create a server CLSID key
\n
"
);
unregister_server
();
return
;
}
trace
(
"call CoCreateInstance(&IID_NULL)
\n
"
);
hr
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_LOCAL_SERVER
,
&
IID_NULL
,
(
void
**
)
&
unknown
);
trace
(
"ret CoCreateInstance(&IID_NULL)
\n
"
);
ok
(
hr
==
E_NOINTERFACE
,
"expected E_NOINTERFACE, got %#x
\n
"
,
hr
);
/* in-process handler supports IID_IUnknown starting from Vista */
trace
(
"call CoCreateInstance(&IID_IUnknown)
\n
"
);
hr
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_INPROC_HANDLER
,
&
IID_IUnknown
,
(
void
**
)
&
unknown
);
trace
(
"ret CoCreateInstance(&IID_IUnknown)
\n
"
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
REGDB_E_CLASSNOTREG
)
/* XP,win2000 and earlier */
,
"CoCreateInstance(IID_IUnknown) error %#x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"In-process handler doesn't support IID_IUnknown on this platform
\n
"
);
goto
test_local_server
;
}
trace
(
"call CoCreateInstance(&IID_IOleObject)
\n
"
);
hr
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_LOCAL_SERVER
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
trace
(
"ret CoCreateInstance(&IID_IOleObject)
\n
"
);
ok
(
hr
==
E_NOINTERFACE
,
"expected E_NOINTERFACE, got %#x
\n
"
,
hr
);
trace
(
"call IUnknown_QueryInterface(&IID_IRunnableObject)
\n
"
);
hr
=
IUnknown_QueryInterface
(
unknown
,
&
IID_IRunnableObject
,
(
void
**
)
&
runobj
);
trace
(
"ret IUnknown_QueryInterface(&IID_IRunnableObject)
\n
"
);
ok
(
hr
==
S_OK
,
"QueryInterface(&IID_IRunnableObject) error %#x
\n
"
,
hr
);
ret
=
IRunnableObject_IsRunning
(
runobj
);
ok
(
!
ret
,
"expected 0, got %d
\n
"
,
ret
);
trace
(
"call OleRun
\n
"
);
hr
=
OleRun
(
unknown
);
trace
(
"ret OleRun
\n
"
);
todo_wine
ok
(
hr
==
S_OK
,
"OleRun error %#x
\n
"
,
hr
);
ret
=
IRunnableObject_IsRunning
(
runobj
);
todo_wine
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
trace
(
"call IRunnableObject_Release
\n
"
);
ret
=
IRunnableObject_Release
(
runobj
);
trace
(
"ret IRunnableObject_Release
\n
"
);
ok
(
ret
==
1
,
"expected ref 1, got %u
\n
"
,
ret
);
trace
(
"call IUnknown_QueryInterface(&IID_IOleObject)
\n
"
);
hr
=
IUnknown_QueryInterface
(
unknown
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
trace
(
"ret IUnknown_QueryInterface(&IID_IOleObject)
\n
"
);
ok
(
hr
==
S_OK
,
"QueryInterface(&IID_IOleObject) error %#x
\n
"
,
hr
);
trace
(
"call IOleObject_Release
\n
"
);
ret
=
IOleObject_Release
(
oleobj
);
trace
(
"ret IOleObject_Release
\n
"
);
ok
(
ret
==
1
,
"expected ref 1, got %u
\n
"
,
ret
);
trace
(
"call IUnknown_Release
\n
"
);
ret
=
IUnknown_Release
(
unknown
);
trace
(
"ret IUnknown_Release
\n
"
);
ok
(
!
ret
,
"expected ref 0, got %u
\n
"
,
ret
);
test_local_server
:
/* local server supports IID_IUnknown */
trace
(
"call CoCreateInstance(&IID_IUnknown)
\n
"
);
hr
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_LOCAL_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unknown
);
trace
(
"ret CoCreateInstance(&IID_IUnknown)
\n
"
);
ok
(
hr
==
S_OK
,
"CoCreateInstance(IID_IUnknown) error %#x
\n
"
,
hr
);
trace
(
"call IUnknown_QueryInterface(&IID_IRunnableObject)
\n
"
);
hr
=
IUnknown_QueryInterface
(
unknown
,
&
IID_IRunnableObject
,
(
void
**
)
&
ole
obj
);
hr
=
IUnknown_QueryInterface
(
unknown
,
&
IID_IRunnableObject
,
(
void
**
)
&
run
obj
);
trace
(
"ret IUnknown_QueryInterface(&IID_IRunnableObject)
\n
"
);
ok
(
hr
==
E_NOINTERFACE
,
"expected E_NOINTERFACE, got %#x
\n
"
,
hr
);
...
...
@@ -446,9 +524,9 @@ START_TEST(ole_server)
trace
(
"ret CoGetClassObject(&IID_IClassFactory)
\n
"
);
ok
(
hr
==
S_OK
,
"CoGetClassObject error %#x
\n
"
,
hr
);
trace
(
"call IClassFactory_
QueryInterface(&IID_IOleObject
)
\n
"
);
hr
=
IClassFactory_
QueryInterface
(
factory
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
trace
(
"ret IClassFactory_
QueryInterface(&IID_IOleObject
)
\n
"
);
trace
(
"call IClassFactory_
CreateInstance(&IID_NULL
)
\n
"
);
hr
=
IClassFactory_
CreateInstance
(
factory
,
NULL
,
&
IID_NULL
,
(
void
**
)
&
oleobj
);
trace
(
"ret IClassFactory_
CreateInstance(&IID_NULL
)
\n
"
);
ok
(
hr
==
E_NOINTERFACE
,
"expected E_NOINTERFACE, got %#x
\n
"
,
hr
);
trace
(
"call IClassFactory_CreateInstance(&IID_IOleObject)
\n
"
);
...
...
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