1 #ifndef MIDLTESTS_C_CODE
3 uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
4 pointer_default(unique)
8 /* typedef struct st_wire {
10 //[size_is(len)] char data[*];
11 [size_is(l2)] char *d2;
18 typedef [transmit_as(st_wire_t)] struct st_local st_local_t;
32 [size_is(num_aces)] struct my_ace *aces;
35 [in,ref] struct my_acl *acl
40 [string] wchar_t str[260+1];
44 [in,out,ref] struct my_str *str
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
(
59 [out,ref] long *start_magic
,
61 [out, ref] long *mid_magic
,
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)
96 void __RPC_USER cli_push_b
(char * state
,
100 printf
("cli_push_b ecount[%lu]\n", ecount
);
103 void __RPC_USER cli_alloc_b
(char * state
,
106 unsigned long * bcount
)
108 printf
("cli_alloc_b bsize[%lu]\n", bsize
);
113 void __RPC_USER cli_push_l
(char * state
,
115 unsigned long ecount
)
117 printf
("cli_push_l ecount[%lu]\n", ecount
);
120 void __RPC_USER cli_alloc_l
(char * state
,
123 unsigned long * bcount
)
125 printf
("cli_alloc_l bsize[%lu]\n", bsize
);
130 static
void midltests
()
135 cli_midltests_fn(st);
137 /* struct my_acl acl;
138 struct my_ace aces[3];
148 cli_midltests_fn(&acl);
150 /* struct my_str str;
151 memset(&str, 0, sizeof(str));
153 printf("here: %d\n", __LINE__);
154 //wcscpy(str.str, L'Hello World\0');
156 printf("here: %d\n", __LINE__);
157 cli_midltests_fn(&str);
161 memset
(buf
, 0xdf, sizeof
(buf
));
162 // cli_midltests_fn(sizeof(buf), buf, &length);
172 memset(&b, 0, sizeof(b));
173 memset(&l, 0, sizeof(l));
175 b.alloc = cli_alloc_b;
178 l.alloc = cli_alloc_l;
181 printf("cli call start\n");
182 cli_midltests_fn(count,
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)
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
)
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");