--- /dev/null
+#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
--- /dev/null
+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