diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-10-24 18:54:46 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-10-24 19:04:08 +0200 |
commit | fd628e7ae4653d5224c5dfcd9b2815113eaae7b8 (patch) | |
tree | c90affae8aa4c254e94ed9cf4f4a78dabc6359af /testprogs/win32/midltests/valid/midltests_union_align_02.idl | |
parent | 172a1580d234a2194ce5bc6ca6056bbea48ed7e3 (diff) | |
download | samba-fd628e7ae4653d5224c5dfcd9b2815113eaae7b8.tar.gz samba-fd628e7ae4653d5224c5dfcd9b2815113eaae7b8.tar.bz2 samba-fd628e7ae4653d5224c5dfcd9b2815113eaae7b8.zip |
midltests: add more union_align examples
This demonstrates the difference between NDR32 and NDR64
metze
Diffstat (limited to 'testprogs/win32/midltests/valid/midltests_union_align_02.idl')
-rw-r--r-- | testprogs/win32/midltests/valid/midltests_union_align_02.idl | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_02.idl b/testprogs/win32/midltests/valid/midltests_union_align_02.idl new file mode 100644 index 0000000000..dc2d84df47 --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_union_align_02.idl @@ -0,0 +1,61 @@ +#ifndef MIDLTESTS_C_CODE + +/* + * For midltests_tcp.exe you may want to + * redirect the traffic via rinetd + * with a /etc/rinetd.conf like this: + * + * 172.31.9.1 5032 172.31.9.8 5032 + * 172.31.9.1 5064 172.31.9.8 5064 + * + * This is useful to watch the traffic with + * a network sniffer. + */ +/* +cpp_quote("#define LISTEN_IP \"0.0.0.0\"") +cpp_quote("#define FORWARD_IP \"127.0.0.1\"") +cpp_quote("#define CONNECT_IP \"172.31.9.1\"") +*/ + +/* + * With midltests_tcp.exe NDR64 is enforced by default. + * For testing it might be needed to allow downgrades + * to NDR32. This is needed when you use 'pipe'. + */ +//cpp_quote("#define DONOT_FORCE_NDR64 1") + +[ + uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"), + pointer_default(unique) +] +interface midltests +{ + typedef [switch_type(char)] union { + [case(1)] char c; + } u; + long midltests_fn( + [in] char l, + [in,switch_is(l)] u u + ); +} + +#elif MIDLTESTS_C_CODE + +static void midltests(void) +{ + char l; + u u; + + l = 1; + u.c = 'A'; + cli_midltests_fn(l,u); +} + +long srv_midltests_fn(char l, u u) +{ + printf("srv_midltests_fn: Start\n"); + printf("srv_midltests_fn: End\n"); + return 0x65757254; +} + +#endif |