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
f8248882
Commit
f8248882
authored
Jun 23, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Jun 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Add test for using a conformant varying structure with pointers.
parent
e22af18e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
server.c
dlls/rpcrt4/tests/server.c
+33
-2
server.idl
dlls/rpcrt4/tests/server.idl
+9
-0
No files found.
dlls/rpcrt4/tests/server.c
View file @
f8248882
...
...
@@ -654,6 +654,24 @@ s_get_numbers(int length, int size, pints_t n[])
}
void
s_get_numbers_struct
(
numbers_struct_t
**
ns
)
{
int
i
;
*
ns
=
midl_user_allocate
(
FIELD_OFFSET
(
numbers_struct_t
,
numbers
[
5
]));
if
(
!*
ns
)
return
;
(
*
ns
)
->
length
=
5
;
(
*
ns
)
->
size
=
5
;
for
(
i
=
0
;
i
<
(
*
ns
)
->
length
;
i
++
)
{
(
*
ns
)
->
numbers
[
i
].
pi
=
NULL
;
(
*
ns
)
->
numbers
[
i
].
ppi
=
NULL
;
(
*
ns
)
->
numbers
[
i
].
pppi
=
NULL
;
}
(
*
ns
)
->
numbers
[
0
].
pi
=
midl_user_allocate
(
sizeof
(
*
(
*
ns
)
->
numbers
[
i
].
pi
));
*
(
*
ns
)
->
numbers
[
0
].
pi
=
5
;
}
void
s_stop
(
void
)
{
ok
(
RPC_S_OK
==
RpcMgmtStopServerListening
(
NULL
),
"RpcMgmtStopServerListening
\n
"
);
...
...
@@ -1096,6 +1114,7 @@ array_tests(void)
doub_carr_t
*
dc
;
int
*
pi
;
pints_t
api
[
5
];
numbers_struct_t
*
ns
;
ok
(
cstr_length
(
str1
,
sizeof
str1
)
==
strlen
(
str1
),
"RPC cstr_length
\n
"
);
...
...
@@ -1177,12 +1196,24 @@ array_tests(void)
api
[
0
].
pi
=
pi
;
get_5numbers
(
1
,
api
);
ok
(
api
[
0
].
pi
==
pi
,
"RPC varying array [out] pointer changed from %p to %p
\n
"
,
pi
,
api
[
0
].
pi
);
ok
(
*
api
[
0
].
pi
==
0
,
"pi unmarshalled incorrectly %d
\n
"
,
*
pi
);
ok
(
*
api
[
0
].
pi
==
0
,
"pi unmarshalled incorrectly %d
\n
"
,
*
api
[
0
].
pi
);
api
[
0
].
pi
=
pi
;
get_numbers
(
1
,
1
,
api
);
ok
(
api
[
0
].
pi
==
pi
,
"RPC conformant varying array [out] pointer changed from %p to %p
\n
"
,
pi
,
api
[
0
].
pi
);
ok
(
*
api
[
0
].
pi
==
0
,
"pi unmarshalled incorrectly %d
\n
"
,
*
pi
);
ok
(
*
api
[
0
].
pi
==
0
,
"pi unmarshalled incorrectly %d
\n
"
,
*
api
[
0
].
pi
);
ns
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
FIELD_OFFSET
(
numbers_struct_t
,
numbers
[
5
]));
ns
->
length
=
5
;
ns
->
size
=
5
;
ns
->
numbers
[
0
].
pi
=
pi
;
get_numbers_struct
(
&
ns
);
todo_wine
{
ok
(
ns
->
numbers
[
0
].
pi
==
pi
,
"RPC conformant varying struct embedded pointer changed from %p to %p
\n
"
,
pi
,
ns
->
numbers
[
0
].
pi
);
}
ok
(
*
ns
->
numbers
[
0
].
pi
==
5
,
"pi unmarshalled incorrectly %d
\n
"
,
*
ns
->
numbers
[
0
].
pi
);
HeapFree
(
GetProcessHeap
(),
0
,
ns
);
HeapFree
(
GetProcessHeap
(),
0
,
pi
);
}
...
...
dlls/rpcrt4/tests/server.idl
View file @
f8248882
...
...
@@ -319,8 +319,17 @@ cpp_quote("#endif")
type
as
a
return
value
.
*/
s123_t
*
get_s123
(
void
)
;
typedef
struct
{
unsigned
int
length
;
unsigned
int
size
;
[
size_is
(
size
),
length_is
(
length
)
]
pints_t
numbers
[]
;
}
numbers_struct_t
;
void
get_5numbers
(
[
in
]
int
count
,
[
out
,
length_is
(
count
)
]
pints_t
pn
[
5
]
)
;
void
get_numbers
(
[
in
]
int
length
,
[
in
]
int
size
,
[
out
,
length_is
(
length
),
size_is
(
size
)
]
pints_t
pn
[]
)
;
void
get_numbers_struct
(
[
out
]
numbers_struct_t
**
ns
)
;
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