midltests: add midltests_varying_string_01.*
authorStefan Metzmacher <metze@samba.org>
Mon, 23 Sep 2013 07:54:13 +0000 (09:54 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 4 Jun 2019 11:15:20 +0000 (13:15 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
testprogs/win32/midltests/valid/midltests_varying_string_01.idl [new file with mode: 0644]
testprogs/win32/midltests/valid/midltests_varying_string_01.txt [new file with mode: 0644]

diff --git a/testprogs/win32/midltests/valid/midltests_varying_string_01.idl b/testprogs/win32/midltests/valid/midltests_varying_string_01.idl
new file mode 100644 (file)
index 0000000..925a292
--- /dev/null
@@ -0,0 +1,63 @@
+#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
+{
+       struct strings {
+               [string] char str[15];
+       };
+
+       long midltests_fn(
+               [in,ref] struct strings *_s1
+       );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+       struct strings s1;
+
+       memset(&s1, 0, sizeof(s1));
+
+       s1.str[0] = '1';
+       s1.str[1] = '2';
+
+       cli_midltests_fn(&s1);
+}
+
+long srv_midltests_fn(struct strings *s1)
+{
+       printf("srv_midltests_fn: Start\n");
+       printf("srv_midltests_fn: End\n");
+       return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_varying_string_01.txt b/testprogs/win32/midltests/valid/midltests_varying_string_01.txt
new file mode 100644 (file)
index 0000000..a3428c4
--- /dev/null
@@ -0,0 +1,38 @@
+Wait for setup of server threads\r
+\r
+Test NDR32\r
+\r
+ndr32: disable NDR64\r
+\r
+ndr32:in => out: ptype[request] flen[35] plen[11] ahint[11]\r
+\r
+[000] 00 00 00 00 03 00 00 00  31 32 00                 ........ 12.\r
+\r
+srv_midltests_fn: Start\r
+srv_midltests_fn: End\r
+\r
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]\r
+\r
+[000] 54 72 75 65                                       True \r
+\r
+NDRTcpThread[ndr32] stop\r
+\r
+Test NDR64\r
+\r
+ndr64: got NDR64\r
+\r
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]\r
+\r
+[000] 00 00 00 00 00 00 00 00  03 00 00 00 00 00 00 00  ........ ........\r
+[010] 31 32 00                                          12. \r
+\r
+srv_midltests_fn: Start\r
+srv_midltests_fn: End\r
+\r
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]\r
+\r
+[000] 54 72 75 65                                       True \r
+\r
+NDRTcpThread[ndr64] stop\r
+\r
+Test OK\r