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
05aab53f
Commit
05aab53f
authored
Apr 02, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4/tests: Add a couple of tests for marshalling an array of strings.
parent
a333c658
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
server.c
dlls/rpcrt4/tests/server.c
+55
-0
server.idl
dlls/rpcrt4/tests/server.idl
+5
-0
No files found.
dlls/rpcrt4/tests/server.c
View file @
05aab53f
...
...
@@ -54,6 +54,9 @@ static char *domain_and_user;
/* type check statements generated in header file */
fnprintf
*
p_printf
=
printf
;
static
const
WCHAR
helloW
[]
=
{
'H'
,
'e'
,
'l'
,
'l'
,
'o'
,
0
};
static
const
WCHAR
worldW
[]
=
{
'W'
,
'o'
,
'r'
,
'l'
,
'd'
,
'!'
,
0
};
static
void
InitFunctionPointers
(
void
)
{
HMODULE
hrpcrt4
=
GetModuleHandleA
(
"rpcrt4.dll"
);
...
...
@@ -572,6 +575,34 @@ void __cdecl s_get_name(name_t *name)
name
->
name
[
name
->
size
-
1
]
=
0
;
}
void
__cdecl
s_get_names
(
int
*
n
,
str_array_t
*
names
)
{
str_array_t
list
;
list
=
MIDL_user_allocate
(
2
*
sizeof
(
list
[
0
]));
list
[
0
]
=
MIDL_user_allocate
(
6
);
strcpy
(
list
[
0
],
"Hello"
);
list
[
1
]
=
MIDL_user_allocate
(
7
);
strcpy
(
list
[
1
],
"World!"
);
*
names
=
list
;
*
n
=
2
;
}
void
__cdecl
s_get_namesw
(
int
*
n
,
wstr_array_t
*
names
)
{
wstr_array_t
list
;
list
=
MIDL_user_allocate
(
2
*
sizeof
(
list
[
0
]));
list
[
0
]
=
MIDL_user_allocate
(
sizeof
(
helloW
));
lstrcpyW
(
list
[
0
],
helloW
);
list
[
1
]
=
MIDL_user_allocate
(
sizeof
(
worldW
));
lstrcpyW
(
list
[
1
],
worldW
);
*
names
=
list
;
*
n
=
2
;
}
int
__cdecl
s_sum_pcarr2
(
int
n
,
int
**
pa
)
{
return
s_sum_conf_array
(
*
pa
,
n
);
...
...
@@ -1191,12 +1222,36 @@ pointer_tests(void)
if
(
!
old_windows_version
)
{
int
n
;
str_array_t
names
;
wstr_array_t
namesw
;
name
.
size
=
10
;
name
.
name
=
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
name
.
size
);
get_name
(
&
name
);
ok
(
name
.
name
==
buffer
,
"[in,out] pointer should have stayed as %p but instead changed to %p
\n
"
,
name
.
name
,
buffer
);
ok
(
!
strcmp
(
name
.
name
,
"Jeremy Wh"
),
"name didn't unmarshall properly, expected
\"
Jeremy Wh
\"
, but got
\"
%s
\"\n
"
,
name
.
name
);
HeapFree
(
GetProcessHeap
(),
0
,
name
.
name
);
n
=
-
1
;
names
=
NULL
;
get_names
(
&
n
,
&
names
);
ok
(
n
==
2
,
"expected 2, got %d
\n
"
,
n
);
ok
(
!
strcmp
(
names
[
0
],
"Hello"
),
"expected Hello, got %s
\n
"
,
names
[
0
]);
ok
(
!
strcmp
(
names
[
1
],
"World!"
),
"expected World!, got %s
\n
"
,
names
[
1
]);
MIDL_user_free
(
names
[
0
]);
MIDL_user_free
(
names
[
1
]);
MIDL_user_free
(
names
);
n
=
-
1
;
namesw
=
NULL
;
get_namesw
(
&
n
,
&
namesw
);
ok
(
n
==
2
,
"expected 2, got %d
\n
"
,
n
);
ok
(
!
lstrcmpW
(
namesw
[
0
],
helloW
),
"expected Hello, got %s
\n
"
,
wine_dbgstr_w
(
namesw
[
0
]));
ok
(
!
lstrcmpW
(
namesw
[
1
],
worldW
),
"expected World!, got %s
\n
"
,
wine_dbgstr_w
(
namesw
[
1
]));
MIDL_user_free
(
namesw
[
0
]);
MIDL_user_free
(
namesw
[
1
]);
MIDL_user_free
(
namesw
);
}
pa2
=
a
;
...
...
dlls/rpcrt4/tests/server.idl
View file @
05aab53f
...
...
@@ -328,6 +328,11 @@ cpp_quote("#endif")
} name_t;
void get_name([in,out] name_t *name);
typedef char **str_array_t;
void get_names([out] int *n, [out, string, size_is(,*n)] str_array_t *names);
typedef WCHAR **wstr_array_t;
void get_namesw([out] int *n, [out, string, size_is(,*n)] wstr_array_t *names);
int sum_pcarr2(int n, [size_is(, n)] int **pa);
int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
...
...
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