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
e24f664b
Commit
e24f664b
authored
Dec 25, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Add tests for low-level context handle functions.
parent
3d8af563
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
1 deletion
+93
-1
server.c
dlls/rpcrt4/tests/server.c
+92
-0
server.idl
dlls/rpcrt4/tests/server.idl
+1
-1
No files found.
dlls/rpcrt4/tests/server.c
View file @
e24f664b
...
...
@@ -504,6 +504,97 @@ s_get_filename(void)
}
void
s_context_handle_test
(
void
)
{
NDR_SCONTEXT
h
;
RPC_BINDING_HANDLE
binding
;
RPC_STATUS
status
;
unsigned
char
buf
[
20
];
static
RPC_SERVER_INTERFACE
server_if
=
{
sizeof
(
RPC_SERVER_INTERFACE
),
{{
0x00000000
,
0x4114
,
0x0704
,{
0x23
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
}},{
1
,
0
}},
{{
0x8a885d04
,
0x1ceb
,
0x11c9
,{
0x9f
,
0xe8
,
0x08
,
0x00
,
0x2b
,
0x10
,
0x48
,
0x60
}},{
2
,
0
}},
NULL
,
0
,
0
,
0
,
0
,
0
,
};
binding
=
I_RpcGetCurrentCallHandle
();
ok
(
binding
!=
NULL
,
"I_RpcGetCurrentCallHandle returned NULL
\n
"
);
h
=
NDRSContextUnmarshall2
(
binding
,
NULL
,
NDR_LOCAL_DATA_REPRESENTATION
,
NULL
,
0
);
ok
(
h
!=
NULL
,
"NDRSContextUnmarshall2 returned NULL
\n
"
);
/* marshal a context handle with NULL userContext */
memset
(
buf
,
0xcc
,
sizeof
(
buf
));
NDRSContextMarshall2
(
binding
,
h
,
buf
,
NULL
,
NULL
,
0
);
ok
(
*
(
ULONG
*
)
buf
==
0
,
"attributes should have been set to 0 instead of 0x%x
\n
"
,
*
(
ULONG
*
)
buf
);
ok
(
UuidIsNil
((
UUID
*
)
&
buf
[
4
],
&
status
),
"uuid should have been nil
\n
"
);
h
=
NDRSContextUnmarshall2
(
binding
,
NULL
,
NDR_LOCAL_DATA_REPRESENTATION
,
NULL
,
0
);
ok
(
h
!=
NULL
,
"NDRSContextUnmarshall2 returned NULL
\n
"
);
/* marshal a context handle with non-NULL userContext */
memset
(
buf
,
0xcc
,
sizeof
(
buf
));
h
->
userContext
=
(
void
*
)
0xdeadbeef
;
NDRSContextMarshall2
(
binding
,
h
,
buf
,
NULL
,
NULL
,
0
);
ok
(
*
(
ULONG
*
)
buf
==
0
,
"attributes should have been set to 0 instead of 0x%x
\n
"
,
*
(
ULONG
*
)
buf
);
ok
(
!
UuidIsNil
((
UUID
*
)
&
buf
[
4
],
&
status
),
"uuid should not have been nil
\n
"
);
h
=
NDRSContextUnmarshall2
(
binding
,
buf
,
NDR_LOCAL_DATA_REPRESENTATION
,
NULL
,
0
);
ok
(
h
!=
NULL
,
"NDRSContextUnmarshall2 returned NULL
\n
"
);
ok
(
h
->
userContext
==
(
void
*
)
0xdeadbeef
,
"userContext of interface didn't unmarshal properly: %p
\n
"
,
h
->
userContext
);
/* marshal a context handle with an interface specified */
h
=
NDRSContextUnmarshall2
(
binding
,
NULL
,
NDR_LOCAL_DATA_REPRESENTATION
,
&
server_if
.
InterfaceId
,
0
);
ok
(
h
!=
NULL
,
"NDRSContextUnmarshall2 returned NULL
\n
"
);
memset
(
buf
,
0xcc
,
sizeof
(
buf
));
h
->
userContext
=
(
void
*
)
0xcafebabe
;
NDRSContextMarshall2
(
binding
,
h
,
buf
,
NULL
,
&
server_if
.
InterfaceId
,
0
);
ok
(
*
(
ULONG
*
)
buf
==
0
,
"attributes should have been set to 0 instead of 0x%x
\n
"
,
*
(
ULONG
*
)
buf
);
ok
(
!
UuidIsNil
((
UUID
*
)
&
buf
[
4
],
&
status
),
"uuid should not have been nil
\n
"
);
h
=
NDRSContextUnmarshall2
(
binding
,
buf
,
NDR_LOCAL_DATA_REPRESENTATION
,
&
server_if
.
InterfaceId
,
0
);
ok
(
h
!=
NULL
,
"NDRSContextUnmarshall2 returned NULL
\n
"
);
ok
(
h
->
userContext
==
(
void
*
)
0xcafebabe
,
"userContext of interface didn't unmarshal properly: %p
\n
"
,
h
->
userContext
);
/* test same interface data, but different pointer */
/* raises ERROR_INVALID_HANDLE exception */
if
(
0
)
{
RPC_SERVER_INTERFACE
server_if_clone
=
server_if
;
NDRSContextUnmarshall2
(
binding
,
buf
,
NDR_LOCAL_DATA_REPRESENTATION
,
&
server_if_clone
.
InterfaceId
,
0
);
}
/* test different interface data, but different pointer */
/* raises ERROR_INVALID_HANDLE exception */
if
(
0
)
{
static
RPC_SERVER_INTERFACE
server_if2
=
{
sizeof
(
RPC_SERVER_INTERFACE
),
{{
0x00000000
,
0x4114
,
0x0704
,{
0x23
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
}},{
1
,
0
}},
{{
0x8a885d04
,
0x1ceb
,
0x11c9
,{
0x9f
,
0xe8
,
0x08
,
0x00
,
0x2b
,
0x10
,
0x48
,
0x60
}},{
2
,
0
}},
NULL
,
0
,
0
,
0
,
0
,
0
,
};
NDRSContextMarshall2
(
binding
,
h
,
buf
,
NULL
,
&
server_if
.
InterfaceId
,
0
);
NDRSContextUnmarshall2
(
binding
,
buf
,
NDR_LOCAL_DATA_REPRESENTATION
,
&
server_if2
.
InterfaceId
,
0
);
}
}
void
s_stop
(
void
)
{
ok
(
RPC_S_OK
==
RpcMgmtStopServerListening
(
NULL
),
"RpcMgmtStopServerListening
\n
"
);
...
...
@@ -1021,6 +1112,7 @@ run_tests(void)
union_tests
();
pointer_tests
();
array_tests
();
context_handle_test
();
}
static
void
...
...
dlls/rpcrt4/tests/server.idl
View file @
e24f664b
...
...
@@ -301,6 +301,6 @@ cpp_quote("#endif")
int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
str_t get_filename(void);
void context_handle_test(void);
void stop(void);
}
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