s4-torture: add simple tests for spoolss_{Add|Delete}PrintProcessor.
[Samba/vl.git] / testprogs / win32 / midltests / todo / midltests-pipe-first.idl
blobef28943d92c725f8c4100f3bf5b61d2d15f93dce
1 #ifndef MIDLTESTS_C_CODE
3 uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
4 pointer_default(unique)
6 interface midltests
8 /* typedef struct st_wire {
9 long len;
10 //[size_is(len)] char data[*];
11 [size_is(l2)] char *d2;
12 long l2;
13 } st_wire_t;
14 struct st_local {
15 short s1;
16 short s2;
18 typedef [transmit_as(st_wire_t)] struct st_local st_local_t;
20 long midltests_fn(
21 [in] st_local_t st
25 /* struct my_ace {
26 long ace1;
27 long ace2;
29 struct my_acl {
30 long revision;
31 long num_aces;
32 [size_is(num_aces)] struct my_ace *aces;
34 long midltests_fn(
35 [in,ref] struct my_acl *acl
38 /* struct my_str {
39 long l1;
40 [string] wchar_t str[260+1];
41 long l2;
43 long midltests_fn(
44 [in,out,ref] struct my_str *str
47 long foo();
48 long midltests_fn(
49 [in] long size,
50 [out,ref,size_is(size),length_is(*length)] byte *bytes,
51 [out,ref] long *length
54 typedef pipe byte BYTE_PIPE;
55 typedef pipe long LONG_PIPE;
57 long midltests_fn_pipe(
58 [in] long count,
59 [out,ref] long *start_magic,
60 [out] BYTE_PIPE b,
61 [out, ref] long *mid_magic,
62 [out] LONG_PIPE l,
63 [out,ref] long *end_magic
67 #elif MIDLTESTS_C_CODE
69 void __RPC_USER st_local_t_to_xmit(st_local_t *l, st_wire_t **w)
71 *w = malloc(4+ sizeof(st_wire_t));
72 (*w)->len = sizeof(st_local_t);
73 //(*w)->data = malloc((*w)->len);
74 memcpy((*w)->data, l, sizeof(st_local_t));
75 //memset(*w, 0xcd, sizeof(st_wire_t));
78 void __RPC_USER st_local_t_from_xmit(st_wire_t *w, st_local_t *l)
80 memcpy(l, w->data, sizeof(st_local_t));
81 // memset(l, 0, sizeof(st_local_t));
84 void __RPC_USER st_local_t_free_inst(st_local_t *l)
89 void __RPC_USER st_local_t_free_xmit(st_wire_t *w)
91 //free(w->data);
92 free(w);
96 void __RPC_USER cli_push_b(char * state,
97 byte * buf,
98 unsigned long ecount)
100 printf("cli_push_b ecount[%lu]\n", ecount);
103 void __RPC_USER cli_alloc_b(char * state,
104 unsigned long bsize,
105 byte * * buf,
106 unsigned long * bcount )
108 printf("cli_alloc_b bsize[%lu]\n", bsize);
109 *buf = NULL;
110 *bcount = 0;
113 void __RPC_USER cli_push_l(char * state,
114 long * buf,
115 unsigned long ecount)
117 printf("cli_push_l ecount[%lu]\n", ecount);
120 void __RPC_USER cli_alloc_l(char * state,
121 unsigned long bsize,
122 long * * buf,
123 unsigned long * bcount )
125 printf("cli_alloc_l bsize[%lu]\n", bsize);
126 *buf = NULL;
127 *bcount = 0;
130 static void midltests()
132 /* st_local_t st;
133 st.s1 = 1;
134 st.s2 = 2;
135 cli_midltests_fn(st);
137 /* struct my_acl acl;
138 struct my_ace aces[3];
139 aces[0].ace1 = 1;
140 aces[0].ace2 = 2;
141 aces[1].ace1 = 1;
142 aces[1].ace2 = 2;
143 aces[2].ace1 = 1;
144 aces[2].ace2 = 2;
145 acl.revision = 5;
146 acl.num_aces = 1;
147 acl.aces = aces;
148 cli_midltests_fn(&acl);
150 /* struct my_str str;
151 memset(&str, 0, sizeof(str));
152 str.l1 = 1;
153 printf("here: %d\n", __LINE__);
154 //wcscpy(str.str, L'Hello World\0');
155 str.l2 = 2;
156 printf("here: %d\n", __LINE__);
157 cli_midltests_fn(&str);
159 byte buf[10];
160 long length = 0;
161 memset(buf, 0xdf, sizeof(buf));
162 // cli_midltests_fn(sizeof(buf), buf, &length);
164 /* long count = 2;
165 long start_magic;
166 BYTE_PIPE b;
167 long mid_magic;
168 LONG_PIPE l;
169 long end_magic;
172 memset(&b, 0, sizeof(b));
173 memset(&l, 0, sizeof(l));
175 b.alloc = cli_alloc_b;
176 b.push = cli_push_b;
178 l.alloc = cli_alloc_l;
179 l.push = cli_push_l;
181 printf("cli call start\n");
182 cli_midltests_fn(count,
183 &start_magic,
185 &mid_magic,
187 &end_magic);
188 printf("cli call end\n");
192 //long srv_midltests_fn(struct my_str *str)//struct my_acl *acl)//st_local_t st)
193 //long srv_midltests_fn(long size, byte *bytes, long *length)
194 #if 1
195 long srv_midltests_fn(
196 /* [in] */ long count,
197 /* [ref][out] */ long *start_magic,
198 /* [out] */ BYTE_PIPE b,
199 /* [ref][out] */ long *mid_magic,
200 /* [out] */ LONG_PIPE l,
201 /* [ref][out] */ long *end_magic)
202 #endif
204 /* byte bytes[10];
205 long longs[10];
206 int i;
208 printf("srv_midltests_fn: Start\n");
209 //printf("s1[%d] s2[%d]\n", st.s1, st.s2);
210 //printf(l1[%d] str[%s] l2[%d]\n", str->l1, str->str, str->l2);
212 /* *start_magic = 0x01234567;
213 *mid_magic = 0x88888888;
214 *end_magic = 0xFEDCBA09;
216 memset(bytes, 0xBE, sizeof(bytes));
217 memset(longs, 0xAC, sizeof(longs));
219 for (i=0; i < count; i++) {
220 b.push(b.state, bytes, sizeof(bytes)/sizeof(bytes[0]));
222 b.push(b.state, NULL, 0);
224 for (i=0; i < count; i++) {
225 l.push(l.state, longs, sizeof(longs)/sizeof(longs[0]));
227 l.push(l.state, NULL, 0);
229 printf("srv_midltests_fn: End\n");
230 return 0x65757254;
233 #endif