summaryrefslogtreecommitdiffstats
path: root/testprogs/win32/midltests/valid/midltests_strings_array_01.idl
blob: db05bb27359b78e72a3e5e6f1e4cda3e409b3fc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef MIDLTESTS_C_CODE

[
  uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
  pointer_default(unique)
]
interface midltests
{
	struct strings {
		long count;
		[size_is(count),string] char *val[];
	};

	long midltests_fn(
		[in,out,ref] struct strings *s
	);
}

#elif MIDLTESTS_C_CODE

static void midltests(void)
{
	const char *s1 = "foo";
	const char *s2 = "bar";
	char *a[] = { "foo", "bar2", NULL };
	char buffer[1024];
	struct strings *s = buffer;

	s->count = 3;
	s->val[0] = "foo";
	s->val[1] = "bar2";
	s->val[2] = NULL;

	cli_midltests_fn(s);
}

long srv_midltests_fn(struct strings *a)
{
	printf("srv_midltests_fn: Start\n");
	printf("srv_midltests_fn: End\n");
	return 0x65757254;
}

#endif