summaryrefslogtreecommitdiffstats
path: root/testprogs/win32
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testprogs/win32/midltests/Makefile16
-rw-r--r--testprogs/win32/midltests/Makefile.simple27
-rw-r--r--testprogs/win32/midltests/Makefile.tcp22
-rw-r--r--testprogs/win32/midltests/invalid/README.txt3
-rw-r--r--testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.idl279
-rw-r--r--testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.txt17
-rw-r--r--testprogs/win32/midltests/midltests.acf6
-rw-r--r--testprogs/win32/midltests/midltests.idl51
-rw-r--r--testprogs/win32/midltests/midltests_c_m.c2
-rw-r--r--testprogs/win32/midltests/midltests_marshall.c125
-rw-r--r--testprogs/win32/midltests/midltests_marshall.h19
-rw-r--r--testprogs/win32/midltests/midltests_s_m.c2
-rw-r--r--testprogs/win32/midltests/midltests_simple.c42
-rw-r--r--testprogs/win32/midltests/midltests_tcp.c646
-rw-r--r--testprogs/win32/midltests/todo/midltests-array-range.idl39
-rw-r--r--testprogs/win32/midltests/todo/midltests-pipe-02.idl153
-rw-r--r--testprogs/win32/midltests/todo/midltests-pipe-03-hyper.idl205
-rw-r--r--testprogs/win32/midltests/todo/midltests-pipe-04-struct.idl272
-rwxr-xr-xtestprogs/win32/midltests/todo/midltests-pipe-first.idl233
-rw-r--r--testprogs/win32/midltests/todo/midltests-pipe-sync-ndr32-downgrade-02.idl296
-rw-r--r--testprogs/win32/midltests/todo/midltests-string-in-out-ref.idl33
-rwxr-xr-xtestprogs/win32/midltests/todo/midltests-transmit-as.idl59
-rwxr-xr-xtestprogs/win32/midltests/todo/midltests_pointer_default.idl20
-rw-r--r--testprogs/win32/midltests/utils.c32
-rw-r--r--testprogs/win32/midltests/valid/README.txt6
-rw-r--r--testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.idl296
-rw-r--r--testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.txt138
-rw-r--r--testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.idl300
-rw-r--r--testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.txt3266
-rw-r--r--testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.idl64
-rw-r--r--testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.out43
-rw-r--r--testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl29
-rw-r--r--testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt6
-rw-r--r--testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt13
-rw-r--r--testprogs/win32/midltests/valid/midltests_strings_array_01.idl44
-rw-r--r--testprogs/win32/midltests/valid/midltests_strings_array_02.idl44
-rw-r--r--testprogs/win32/midltests/valid/midltests_strings_array_02.txt9
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_01.idl42
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_01.txt24
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_02.idl61
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_02.txt37
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_03.idl64
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_03.txt37
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_04.idl64
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_04.txt37
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_05.idl61
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_05.txt37
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_06.idl61
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_06.txt37
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_07.idl61
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_07.txt38
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_08.idl68
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_08.txt129
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_09.idl69
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_09.txt129
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_10.idl71
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_10.txt129
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_11.idl70
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_11.txt129
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_12.idl70
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_12.txt129
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_13.idl71
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_13.txt129
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_14.idl71
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_14.txt131
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_15.idl72
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_15.txt131
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_16.idl93
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_16.txt137
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_17.idl94
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_17.txt137
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_18.idl93
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_18.txt137
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_19.idl90
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_19.txt137
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_20.idl91
-rw-r--r--testprogs/win32/midltests/valid/midltests_union_align_20.txt137
-rw-r--r--testprogs/win32/midltests/valid/midltests_v1_enum_01.idl56
-rw-r--r--testprogs/win32/midltests/valid/midltests_v1_enum_01.txt37
-rwxr-xr-xtestprogs/win32/npecho/GNUmakefile24
-rwxr-xr-xtestprogs/win32/npecho/NMakefile26
-rwxr-xr-xtestprogs/win32/npecho/npecho_client.c50
-rwxr-xr-xtestprogs/win32/npecho/npecho_client2.c117
-rwxr-xr-xtestprogs/win32/npecho/npecho_server2.c76
-rwxr-xr-xtestprogs/win32/prepare_dcpromo/GNUmakefile21
-rwxr-xr-xtestprogs/win32/prepare_dcpromo/NMakefile16
-rwxr-xr-xtestprogs/win32/prepare_dcpromo/prepare_dcpromo.c1074
-rw-r--r--testprogs/win32/rpcecho/Makefile23
-rw-r--r--testprogs/win32/rpcecho/README46
-rw-r--r--testprogs/win32/rpcecho/client.c367
-rw-r--r--testprogs/win32/rpcecho/rpcecho.acf26
-rw-r--r--testprogs/win32/rpcecho/rpcecho.idl146
-rw-r--r--testprogs/win32/rpcecho/server.c208
-rw-r--r--testprogs/win32/rpcecho/utils.c32
-rw-r--r--testprogs/win32/spoolss/GNUmakefile23
-rw-r--r--testprogs/win32/spoolss/NMakefile43
-rw-r--r--testprogs/win32/spoolss/README.win3265
-rw-r--r--testprogs/win32/spoolss/error.c137
-rw-r--r--testprogs/win32/spoolss/error.h36
-rw-r--r--testprogs/win32/spoolss/printlib.c1386
-rw-r--r--testprogs/win32/spoolss/printlib_proto.h67
-rw-r--r--testprogs/win32/spoolss/string.h15
-rw-r--r--testprogs/win32/spoolss/testspoolss.c1842
-rw-r--r--testprogs/win32/spoolss/testspoolss.h51
-rw-r--r--testprogs/win32/spoolss/testspoolss.sln20
-rw-r--r--testprogs/win32/spoolss/testspoolss.vcproj224
-rw-r--r--testprogs/win32/spoolss/torture.c106
-rw-r--r--testprogs/win32/spoolss/torture.h92
-rw-r--r--testprogs/win32/spoolss/torture_proto.h32
-rw-r--r--testprogs/win32/testmailslot/GNUmakefile16
-rw-r--r--testprogs/win32/testmailslot/NMakefile13
-rw-r--r--testprogs/win32/testmailslot/testmailslot.c80
-rw-r--r--testprogs/win32/vs2010-metze.cmd24
-rwxr-xr-xtestprogs/win32/wmi/echoprocessor.vbs10
114 files changed, 16889 insertions, 0 deletions
diff --git a/testprogs/win32/midltests/Makefile b/testprogs/win32/midltests/Makefile
new file mode 100644
index 0000000..ded98e9
--- /dev/null
+++ b/testprogs/win32/midltests/Makefile
@@ -0,0 +1,16 @@
+
+all:
+ @echo "nmake targets:"
+ @echo " clean"
+ @echo " simple"
+ @echo " tcp"
+
+clean:
+ @call nmake /f Makefile.simple /A /NOLOGO clean
+ @call nmake /f Makefile.tcp /A /NOLOGO clean
+
+simple:
+ @call nmake /f Makefile.simple /A /NOLOGO all
+
+tcp:
+ @call nmake /f Makefile.tcp /A /NOLOGO all
diff --git a/testprogs/win32/midltests/Makefile.simple b/testprogs/win32/midltests/Makefile.simple
new file mode 100644
index 0000000..ec4a542
--- /dev/null
+++ b/testprogs/win32/midltests/Makefile.simple
@@ -0,0 +1,27 @@
+INCLUDES=-I
+CFLAGS=$(INCLUDES) -Zi -D_WIN32_WINNT=0x502
+LIBS=rpcrt4.lib
+
+all: midltests_simple.exe
+
+clean:
+ del *~ *.obj *.exe midltests.h midltests_s.c midltests_c.c
+
+#MIDL_ARGS=/target NT50
+MIDL_ARGS=/Os /prefix client cli_ /prefix server srv_ /prefix switch swi_
+midltests.h midltests_s.c midltests_c.c: midltests.idl midltests.acf
+ midl $(MIDL_ARGS) /acf midltests.acf midltests.idl
+
+MIDLTESTS_OBJ = midltests_simple.obj midltests_s_m.obj midltests_c_m.obj midltests_marshall.obj utils.obj
+midltests_simple.exe: $(MIDLTESTS_OBJ)
+ $(CC) -o midltests_simple.exe $(MIDLTESTS_OBJ) $(LIBS)
+
+midltests_simple.obj: midltests.h midltests.idl
+midltests_c_m.c: midltests_c.c
+midltests_s_m.c: midltests_s.c
+
+midltests_simple.obj: midltests.h midltests.idl midltests_simple.c
+midltests_s_m.obj: midltests_marshall.h midltests_s.c midltests_s_m.c
+midltests_c_m.obj: midltests_marshall.h midltests_c.c midltests_c_m.c
+midltests_marshall.obj: midltests.h midltests_marshall.c
+utils.obj: midltests.h utils.c
diff --git a/testprogs/win32/midltests/Makefile.tcp b/testprogs/win32/midltests/Makefile.tcp
new file mode 100644
index 0000000..19c1f11
--- /dev/null
+++ b/testprogs/win32/midltests/Makefile.tcp
@@ -0,0 +1,22 @@
+INCLUDES=-I
+CFLAGS=$(INCLUDES) -Zi -D_WIN32_WINNT=0x610
+LIBS=rpcrt4.lib ws2_32.lib
+
+all: midltests_tcp.exe
+
+clean:
+ del *~ *.obj *.exe midltests.h midltests_s.c midltests_c.c
+
+MIDL_ARGS=/target NT60 /prefix client cli_ /prefix server srv_ /prefix switch swi_
+midltests.h midltests_s.c midltests_c.c: midltests.idl midltests.acf
+ midl $(MIDL_ARGS) /acf midltests.acf midltests.idl
+
+MIDLTESTS_OBJ = midltests_tcp.obj midltests_s.obj midltests_c.obj midltests_marshall.obj utils.obj
+midltests_tcp.exe: $(MIDLTESTS_OBJ)
+ $(CC) -o midltests_tcp.exe $(MIDLTESTS_OBJ) $(LIBS)
+
+midltests_tcp.obj: midltests.h midltests.idl
+
+midltests_tcp.obj: midltests.h midltests.idl midltests_tcp.c
+midltests_marshall.obj: midltests.h midltests_marshall.c
+utils.obj: midltests.h utils.c
diff --git a/testprogs/win32/midltests/invalid/README.txt b/testprogs/win32/midltests/invalid/README.txt
new file mode 100644
index 0000000..f10cc15
--- /dev/null
+++ b/testprogs/win32/midltests/invalid/README.txt
@@ -0,0 +1,3 @@
+This directory contains IDL files which give errors,
+when they're compiled as midltests.idl.
+
diff --git a/testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.idl b/testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.idl
new file mode 100644
index 0000000..517806b
--- /dev/null
+++ b/testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.idl
@@ -0,0 +1,279 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ typedef pipe char pipe_char;
+ typedef pipe hyper pipe_hyper;
+ typedef struct {
+ long l;
+ short s;
+ [switch_is(l)] union {
+ [case(0)];
+ [case(1)] char c;
+ [case(2)] short s;
+ [case(4)] long l;
+ [case(8)] hyper h;
+ } u;
+ } structtype;
+ typedef pipe structtype pipe_structtype;
+
+ struct msg {
+ long l;
+ [size_is(l)] char *m;
+ };
+
+ long midltests_fn(
+ [out,ref] struct msg *out1,
+ [out,ref] pipe_structtype *outp,
+ [in,ref] pipe_structtype *inp,
+ [in] struct msg in1
+ );
+
+ long midltests_ping( [in] struct msg in1);
+
+}
+
+#elif MIDLTESTS_C_CODE
+
+struct pipe_char_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_char_pull(
+ char * _state,
+ unsigned char * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_char_push(
+ char * _state,
+ unsigned char * buf,
+ unsigned long ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_char_alloc(
+ char * _state,
+ unsigned long bsize,
+ unsigned char * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+
+struct pipe_hyper_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_hyper_pull(
+ char * _state,
+ hyper * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_hyper_push(
+ char * _state,
+ hyper * buf,
+ unsigned long ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_hyper_alloc(
+ char * _state,
+ unsigned long bsize,
+ hyper * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+struct pipe_structtype_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_structtype_pull(
+ char * _state,
+ structtype * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_structtype_push(
+ char * _state,
+ structtype * buf,
+ unsigned long ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_structtype_alloc(
+ char * _state,
+ unsigned long bsize,
+ structtype * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+static void midltests(void)
+{
+ struct msg out1;
+ unsigned char out1b[3];
+ struct pipe_structtype_state outs;
+ pipe_structtype outp;
+ struct pipe_structtype_state ins;
+ pipe_structtype inp;
+ struct msg in1;
+ unsigned char in1b[3];
+
+ in1.l = sizeof(in1b);
+ memset(&in1b, 0xAA, sizeof(in1b));
+ in1.m = in1b;
+
+ memset(&outs, 0, sizeof(outs));
+ outs.name = "outp";
+ memset(&outp, 0, sizeof(outp));
+ outp.pull = pipe_structtype_pull;
+ outp.push = pipe_structtype_push;
+ outp.alloc = pipe_structtype_alloc;
+ outp.state = (char *)&outs;
+
+ memset(&ins, 0, sizeof(ins));
+ ins.name = "inp";
+ ins.count = 1;
+ memset(&inp, 0, sizeof(inp));
+ inp.pull = pipe_structtype_pull;
+ inp.push = pipe_structtype_push;
+ inp.alloc = pipe_structtype_alloc;
+ inp.state = (char *)&ins;
+
+ out1.l = sizeof(out1b);
+ memset(&out1b, 0xFF, sizeof(out1b));
+ out1.m = out1b;
+
+ cli_midltests_ping(in1);
+ cli_midltests_fn(&out1, outp, inp, in1);
+}
+
+long srv_midltests_fn(
+ /* [ref][out] */ struct msg *out1,
+ /* [out] */ pipe_structtype outp,
+ /* [in] */ pipe_structtype inp,
+ /* [in] */ struct msg in1)
+{
+ structtype inb[500];
+ unsigned long inb_len = 0;
+ structtype *outb = NULL;
+ unsigned long outb_size = 0;
+ unsigned long outb_len = 0;
+
+ printf("srv_midltests_fn: Start\n");
+
+ do {
+ inp.pull(inp.state, inb, sizeof(inb), &inb_len);
+ printf("pull inp_len[%u]\n", inb_len);
+ } while (inb_len > 0);
+
+ outb_size = 5;
+ do {
+ outp.alloc(outp.state, outb_size, &outb, &outb_len);
+ memset(outb, 0xCC, outb_len * sizeof(*outb));
+ outp.push(outp.state, outb, outb_len);
+ printf("push outb_len[%u]\n", outb_len);
+ //Sleep(1000);
+ outb_size--;
+ } while (outb_len > 0);
+
+ out1->l = 3;
+ out1->m = (unsigned char *)malloc(out1->l);
+ memset(out1->m, 0xBB, out1->l);
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+long srv_midltests_ping(
+ /* [in] */ struct msg in1)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+#endif
diff --git a/testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.txt b/testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.txt
new file mode 100644
index 0000000..46f8de5
--- /dev/null
+++ b/testprogs/win32/midltests/invalid/midltests_pipe_struct_union_01.txt
@@ -0,0 +1,17 @@
+
+Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
+Copyright (C) Microsoft Corporation. All rights reserved.
+
+ midl /target NT60 /prefix client cli_ /prefix server srv_ /prefix switch swi_ /acf midltests.acf midltests.idl
+Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555
+Copyright (c) Microsoft Corporation. All rights reserved.
+64 bit Processing .\midltests.idl
+midltests.idl
+64 bit Processing .\midltests.acf
+midltests.acf
+.\midltests.idl(34) : error MIDL2028 : feature not implemented : pipes can't contain unions [ Type 'pipe_structtype' ( Parameter 'outp' ) ]
+.\midltests.idl(34) : error MIDL2028 : feature not implemented : pipes can't contain unions [ Type 'pipe_structtype' ( Parameter 'inp' ) ]
+NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\x64\midl.EXE"' : return code '0x8a6'
+Stop.
+NMAKE : fatal error U1077: 'call' : return code '0x2'
+Stop.
diff --git a/testprogs/win32/midltests/midltests.acf b/testprogs/win32/midltests/midltests.acf
new file mode 100644
index 0000000..a04bb5d
--- /dev/null
+++ b/testprogs/win32/midltests/midltests.acf
@@ -0,0 +1,6 @@
+[
+ implicit_handle (handle_t midltests_IfHandle)
+]
+interface midltests
+{
+}
diff --git a/testprogs/win32/midltests/midltests.idl b/testprogs/win32/midltests/midltests.idl
new file mode 100644
index 0000000..0c0bbf8
--- /dev/null
+++ b/testprogs/win32/midltests/midltests.idl
@@ -0,0 +1,51 @@
+#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
+{
+ long midltests_fn(
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ cli_midltests_fn();
+}
+
+long srv_midltests_fn(void)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/midltests_c_m.c b/testprogs/win32/midltests/midltests_c_m.c
new file mode 100644
index 0000000..facf735
--- /dev/null
+++ b/testprogs/win32/midltests/midltests_c_m.c
@@ -0,0 +1,2 @@
+#include "midltests_marshall.h"
+#include "midltests_c.c"
diff --git a/testprogs/win32/midltests/midltests_marshall.c b/testprogs/win32/midltests/midltests_marshall.c
new file mode 100644
index 0000000..f0fc78a
--- /dev/null
+++ b/testprogs/win32/midltests/midltests_marshall.c
@@ -0,0 +1,125 @@
+/*
+ MIDLTESTS client.
+
+ Copyright (C) Stefan Metzmacher 2008
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include "midltests.h"
+
+#define MIN(a,b) ((a)<(b)?(a):(b))
+static void print_asc(const unsigned char *buf,int len)
+{
+ int i;
+ for (i=0;i<len;i++)
+ printf("%c", isprint(buf[i])?buf[i]:'.');
+}
+
+void dump_data(const unsigned char *buf1,int len)
+{
+ const unsigned char *buf = (const unsigned char *)buf1;
+ int i=0;
+ if (len<=0) return;
+
+ printf("[%03X] ",i);
+ for (i=0;i<len;) {
+ printf("%02X ",(int)buf[i]);
+ i++;
+ if (i%8 == 0) printf(" ");
+ if (i%16 == 0) {
+ print_asc(&buf[i-16],8); printf(" ");
+ print_asc(&buf[i-8],8); printf("\n");
+ if (i<len) printf("[%03X] ",i);
+ }
+ }
+ if (i%16) {
+ int n;
+ n = 16 - (i%16);
+ printf(" ");
+ if (n>8) printf(" ");
+ while (n--) printf(" ");
+ n = MIN(8,i%16);
+ print_asc(&buf[i-(i%16)],n); printf( " " );
+ n = (i%16) - n;
+ if (n>0) print_asc(&buf[i-n],n);
+ printf("\n");
+ }
+}
+
+#if _WIN32_WINNT < 0x600
+
+void NdrGetBufferMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned long len, RPC_BINDING_HANDLE hnd)
+{
+ stubmsg->RpcMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, len);
+ memset(stubmsg->RpcMsg->Buffer, 0xef, len);
+ stubmsg->RpcMsg->BufferLength = len;
+ stubmsg->Buffer = stubmsg->RpcMsg->Buffer;
+ stubmsg->BufferLength = stubmsg->RpcMsg->BufferLength;
+ stubmsg->fBufferValid = TRUE;
+}
+
+void __RPC_STUB midltests_midltests_fn(PRPC_MESSAGE _pRpcMessage);
+
+void NdrSendReceiveMarshall(PMIDL_STUB_MESSAGE StubMsg, unsigned char *buffer)
+{
+ unsigned long DataRepresentation;
+
+ StubMsg->RpcMsg->BufferLength = buffer - (unsigned char *)StubMsg->RpcMsg->Buffer;
+
+ printf("[in] Buffer[%d/%d]\n",
+ StubMsg->RpcMsg->BufferLength, StubMsg->BufferLength);
+ dump_data(StubMsg->RpcMsg->Buffer, StubMsg->RpcMsg->BufferLength);
+
+ DataRepresentation = StubMsg->RpcMsg->DataRepresentation;
+ StubMsg->RpcMsg->DataRepresentation = NDR_LOCAL_DATA_REPRESENTATION;
+ midltests_midltests_fn(StubMsg->RpcMsg);
+ StubMsg->RpcMsg->DataRepresentation = DataRepresentation;
+
+ StubMsg->BufferLength = StubMsg->RpcMsg->BufferLength;
+ StubMsg->BufferStart = StubMsg->RpcMsg->Buffer;
+ StubMsg->BufferEnd = StubMsg->BufferStart + StubMsg->BufferLength;
+ StubMsg->Buffer = StubMsg->BufferStart;
+
+ printf("[out] Buffer[%d]\n",
+ StubMsg->RpcMsg->BufferLength);
+ dump_data(StubMsg->RpcMsg->Buffer, StubMsg->RpcMsg->BufferLength);
+}
+
+void NdrServerInitializeNewMarshall(PRPC_MESSAGE pRpcMsg,
+ PMIDL_STUB_MESSAGE pStubMsg,
+ PMIDL_STUB_DESC pStubDesc)
+{
+ memset(pStubMsg, 0, sizeof(*pStubMsg));
+ pStubMsg->RpcMsg = pRpcMsg;
+ pStubMsg->Buffer = pStubMsg->BufferStart = pRpcMsg->Buffer;
+ pStubMsg->BufferEnd = pStubMsg->Buffer + pRpcMsg->BufferLength;
+ pStubMsg->BufferLength = pRpcMsg->BufferLength;
+ pStubMsg->pfnAllocate = pStubDesc->pfnAllocate;
+ pStubMsg->pfnFree = pStubDesc->pfnFree;
+ pStubMsg->StubDesc = pStubDesc;
+ pStubMsg->dwDestContext = MSHCTX_DIFFERENTMACHINE;
+}
+
+RPC_STATUS WINAPI I_RpcGetBufferMarshall(PRPC_MESSAGE RpcMsg)
+{
+ RpcMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, RpcMsg->BufferLength);
+ memset(RpcMsg->Buffer, 0xcd, RpcMsg->BufferLength);
+ return 0;
+}
+
+#endif /* _WIN32_WINNT < 0x600 */
diff --git a/testprogs/win32/midltests/midltests_marshall.h b/testprogs/win32/midltests/midltests_marshall.h
new file mode 100644
index 0000000..8bb59b9
--- /dev/null
+++ b/testprogs/win32/midltests/midltests_marshall.h
@@ -0,0 +1,19 @@
+#include "rpc.h"
+#include "rpcndr.h"
+
+void dump_data(const unsigned char *buf1,int len);
+
+#if _WIN32_WINNT < 0x600
+#define NdrSendReceive NdrSendReceiveMarshall
+void NdrSendReceiveMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer);
+#define NdrGetBuffer NdrGetBufferMarshall
+void NdrGetBufferMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned long len, RPC_BINDING_HANDLE hnd);
+#define NdrServerInitializeNew NdrServerInitializeNewMarshall
+void NdrServerInitializeNewMarshall(PRPC_MESSAGE pRpcMsg,
+ PMIDL_STUB_MESSAGE pStubMsg,
+ PMIDL_STUB_DESC pStubDesc);
+#define I_RpcGetBuffer I_RpcGetBufferMarshall
+RPC_STATUS WINAPI I_RpcGetBufferMarshall(PRPC_MESSAGE pMsg);
+
+#endif /* _WIN32_WINNT < 0x600 */
+
diff --git a/testprogs/win32/midltests/midltests_s_m.c b/testprogs/win32/midltests/midltests_s_m.c
new file mode 100644
index 0000000..7e0862d
--- /dev/null
+++ b/testprogs/win32/midltests/midltests_s_m.c
@@ -0,0 +1,2 @@
+#include "midltests_marshall.h"
+#include "midltests_s.c"
diff --git a/testprogs/win32/midltests/midltests_simple.c b/testprogs/win32/midltests/midltests_simple.c
new file mode 100644
index 0000000..61d4ce0
--- /dev/null
+++ b/testprogs/win32/midltests/midltests_simple.c
@@ -0,0 +1,42 @@
+/*
+ MIDLTESTS client.
+
+ Copyright (C) Stefan Metzmacher 2008
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include "midltests.h"
+
+#define MIDLTESTS_C_CODE 1
+#include "midltests.idl"
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ midltests_IfHandle = NULL;
+
+ RpcTryExcept {
+ midltests();
+ } RpcExcept(1) {
+ ret = RpcExceptionCode();
+ printf("Runtime error 0x%x\n", ret);
+ } RpcEndExcept
+
+ return ret;
+}
diff --git a/testprogs/win32/midltests/midltests_tcp.c b/testprogs/win32/midltests/midltests_tcp.c
new file mode 100644
index 0000000..3046f6d
--- /dev/null
+++ b/testprogs/win32/midltests/midltests_tcp.c
@@ -0,0 +1,646 @@
+/*
+ MIDLTESTS client.
+
+ Copyright (C) Stefan Metzmacher 2008
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <winsock.h>
+#include "midltests.h"
+
+#ifndef _M_AMD64
+#error "please run 'vcvarsall.bat amd64' -midltests_tcp needs 64-bit support!"
+#endif
+
+#define MIDLTESTS_C_CODE 1
+#include "midltests.idl"
+
+#ifndef LISTEN_IP
+#define LISTEN_IP "127.0.0.1"
+#endif
+
+#ifndef FORWARD_IP
+#define FORWARD_IP "127.0.0.1"
+#endif
+
+#ifndef CONNECT_IP
+#define CONNECT_IP "127.0.0.1"
+#endif
+
+struct NDRTcpThreadCtx;
+
+struct NDRProxyThreadCtx {
+ const struct NDRTcpThreadCtx *ctx;
+ SOCKET InSocket;
+ SOCKET OutSocket;
+ DWORD dwThreadId;
+ HANDLE hThread;
+};
+
+struct NDRTcpThreadCtx {
+ const char *name;
+ short listen_port;
+ short client_port;
+ BOOL ndr64;
+ BOOL stop;
+};
+
+struct dcerpc_header {
+ BYTE rpc_vers; /* RPC version */
+ BYTE rpc_vers_minor; /* Minor version */
+ BYTE ptype; /* Packet type */
+ BYTE pfc_flags; /* Fragmentation flags */
+ BYTE drep[4]; /* NDR data representation */
+ short frag_length; /* Total length of fragment */
+ short auth_length; /* authenticator length */
+ DWORD call_id; /* Call identifier */
+};
+
+static void dump_packet(const char *ctx, const char *direction,
+ const unsigned char *buf, int len)
+{
+ struct dcerpc_header *hdr = (struct dcerpc_header *)buf;
+
+ if (len < sizeof(struct dcerpc_header)) {
+ printf("%s:%s: invalid dcerpc pdu len(%d)\n",
+ ctx, direction, len);
+ fflush(stdout);
+ return;
+ }
+
+ if (hdr->rpc_vers != 5 || hdr->rpc_vers_minor != 0) {
+ printf("%s:%s: invalid dcerpc pdu len(%d) ver:%d min:%d\n",
+ ctx, direction, len,
+ hdr->rpc_vers, hdr->rpc_vers_minor);
+ fflush(stdout);
+ return;
+ }
+
+ if (hdr->frag_length != len) {
+ printf("%s:%s: invalid dcerpc pdu len(%d) should be (%d)\n",
+ ctx, direction, len, hdr->frag_length);
+ fflush(stdout);
+ return;
+ }
+
+
+ switch (hdr->ptype) {
+ case 0: /* request */
+ printf("%s:%s: ptype[request] flen[%d] plen[%d] ahint[%d]\n\n",
+ ctx, direction, hdr->frag_length,
+ len - 24, *(DWORD *)(&buf[0x10]));
+ dump_data(buf + 24, len - 24);
+ printf("\n");
+ fflush(stdout);
+ break;
+
+ case 2: /* response */
+ printf("\n%s:%s: ptype[response] flen[%d] plen[%d] ahint[%d]\n\n",
+ ctx, direction, hdr->frag_length,
+ len - 24, *(DWORD *)(&buf[0x10]));
+ dump_data(buf + 24, len - 24);
+ printf("\n");
+ fflush(stdout);
+ break;
+
+ case 11: /* bind */
+#if 0
+ printf("%s:%s: ptype[bind] flen[%d] call[%d] contexts[%d]\n\n"
+ ctx, direction, hdr->frag_length, hdr->call_id,
+ buf[24]);
+ dump_data(buf + 24, len - 24);
+ printf("\n");
+ fflush(stdout);
+#endif
+ break;
+
+ case 12: /* bind ack */
+#if 0
+ printf("%s:%s: ptype[bind_ack] flen[%d] call[%d]\n\n",
+ ctx, direction, hdr->frag_length, hdr->call_id);
+ fflush(stdout);
+#endif
+ break;
+
+ case 14: /* alter_req */
+#if 1
+ printf("%s:%s: ptype[alter_req] flen[%d] call[%d] contexts[%d]\n\n",
+ ctx, direction, hdr->frag_length, hdr->call_id,
+ buf[24]);
+ //dump_data(buf + 24, len - 24);
+ printf("\n");
+ fflush(stdout);
+#endif
+ break;
+
+ case 15: /* alter_ack */
+#if 1
+ printf("%s:%s: ptype[alter_ack] flen[%d] call[%d]\n\n",
+ ctx, direction, hdr->frag_length, hdr->call_id);
+ fflush(stdout);
+#endif
+ break;
+
+ default:
+ printf("%s:%s: ptype[%d] flen[%d] call[%d]\n\n",
+ ctx, direction, hdr->ptype, hdr->frag_length, hdr->call_id);
+ fflush(stdout);
+ break;
+ }
+}
+
+static void change_packet(const char *ctx, BOOL ndr64,
+ unsigned char *buf, int len)
+{
+ struct dcerpc_header *hdr = (struct dcerpc_header *)buf;
+ BOOL is_ndr64 = FALSE;
+ const unsigned char ndr64_buf[] = {
+ 0x33, 0x05, 0x71, 0x71, 0xBA, 0xBE, 0x37, 0x49,
+ 0x83, 0x19, 0xB5, 0xDB, 0xEF, 0x9C, 0xCC, 0x36
+ };
+
+ if (len < sizeof(struct dcerpc_header)) {
+ printf("%s: invalid dcerpc pdu len(%d)\n",
+ ctx, len);
+ fflush(stdout);
+ return;
+ }
+
+ if (hdr->rpc_vers != 5 || hdr->rpc_vers_minor != 0) {
+ printf("%s: invalid dcerpc pdu len(%d) ver:%d min:%d\n",
+ ctx, len,
+ hdr->rpc_vers, hdr->rpc_vers_minor);
+ fflush(stdout);
+ return;
+ }
+
+ if (hdr->frag_length != len) {
+ printf("%s: invalid dcerpc pdu len(%d) should be (%d)\n",
+ ctx, len, hdr->frag_length);
+ fflush(stdout);
+ return;
+ }
+
+ switch (hdr->ptype) {
+ case 11: /* bind */
+ case 14: /* alter_req */
+
+ if (buf[24] >= 2) {
+ int ret;
+
+ ret = memcmp(&buf[0x60], ndr64_buf, 16);
+ if (ret == 0) {
+ is_ndr64 = TRUE;
+ }
+ }
+
+ if (is_ndr64 && !ndr64) {
+ buf[24+0x48] = 0xFF;
+ memset(&buf[0x60], 0xFF, 16);
+ printf("%s: disable NDR64\n\n", ctx);
+ } else if (!is_ndr64 && ndr64) {
+ printf("\n%s: got NDR32 downgrade\n\n", ctx);
+#ifndef DONOT_FORCE_NDR64
+ printf("\n\tERROR!!!\n\n");
+ memset(&buf[0x34], 0xFF, 16);
+ printf("You may need to run 'vcvarsall.bat amd64' before 'nmake tcp'\n");
+#endif
+ printf("\n");
+ } else if (is_ndr64) {
+ printf("%s: got NDR64\n\n", ctx);
+ } else {
+ printf("%s: got NDR32\n\n", ctx);
+ }
+ //printf("%s: bind with %u pres\n", ctx, buf[24]);
+ fflush(stdout);
+ break;
+ }
+}
+
+static int sock_pending(SOCKET s)
+{
+ int ret, error;
+ int value = 0;
+ int len;
+
+ ret = ioctlsocket(s, FIONREAD, &value);
+ if (ret == -1) {
+ return ret;
+ }
+
+ if (ret != 0) {
+ /* this should not be reached */
+ return -1;
+ }
+
+ if (value != 0) {
+ return value;
+ }
+
+ error = 0;
+ len = sizeof(error);
+
+ /*
+ * if no data is available check if the socket is in error state. For
+ * dgram sockets it's the way to return ICMP error messages of
+ * connected sockets to the caller.
+ */
+ ret = getsockopt(s, SOL_SOCKET, SO_ERROR, (char *)&error, &len);
+ if (ret == -1) {
+ return ret;
+ }
+ if (error != 0) {
+ return -1;
+ }
+ return 0;
+}
+
+DWORD WINAPI NDRProxyThread(LPVOID lpParameter)
+{
+ struct NDRProxyThreadCtx *p = (struct NDRProxyThreadCtx *)lpParameter;
+
+ while (!p->ctx->stop) {
+ int r, s;
+ int ret = -1;
+ BYTE buf[5840];
+
+ Sleep(250);
+
+ ret = sock_pending(p->InSocket);
+ if (ret == 0) {
+ goto out;
+ }
+
+ r = recv(p->InSocket, buf, sizeof(buf), 0);
+ if (r <= 0) {
+ ret = WSAGetLastError();
+ printf("%s: recv(in) failed[%d][%d]\n", p->ctx->name, r, ret);
+ fflush(stdout);
+ goto stop;
+ }
+
+ change_packet(p->ctx->name, p->ctx->ndr64, buf, r);
+ fflush(stdout);
+
+ dump_packet(p->ctx->name, "in => out", buf, r);
+ fflush(stdout);
+
+out:
+ s = send(p->OutSocket, buf, r, 0);
+ if (s <= 0) {
+ ret = WSAGetLastError();
+ printf("%s: send(out) failed[%d][%d]\n", p->ctx->name, s, ret);
+ fflush(stdout);
+ goto stop;
+ }
+
+ ret = sock_pending(p->OutSocket);
+ if (ret == 0) {
+ goto next;
+ }
+
+ r = recv(p->OutSocket, buf, sizeof(buf), 0);
+ if (r <= 0) {
+ ret = WSAGetLastError();
+ printf("%s: recv(out) failed[%d][%d]\n", p->ctx->name, r, ret);
+ fflush(stdout);
+ goto stop;
+ }
+
+ dump_packet(p->ctx->name, "out => in", buf, r);
+ fflush(stdout);
+
+ s = send(p->InSocket, buf, r, 0);
+ if (s <= 0) {
+ ret = WSAGetLastError();
+ printf("%s: send(in) failed[%d][%d]\n", p->ctx->name, s, ret);
+ fflush(stdout);
+ goto stop;
+ }
+next:
+ continue;
+ }
+stop:
+ closesocket(p->InSocket);
+ closesocket(p->OutSocket);
+
+ printf("NDRTcpThread[%s] stop\n", p->ctx->name);
+ fflush(stdout);
+ return 0;
+}
+
+DWORD WINAPI NDRTcpThread(LPVOID lpParameter)
+{
+ struct NDRTcpThreadCtx *ctx = (struct NDRTcpThreadCtx *)lpParameter;
+ int ret = -1;
+ SOCKET ListenSocket;
+ struct sockaddr_in saServer;
+ struct sockaddr_in saClient;
+
+ //printf("NDRTcpThread[%s] start\n", ctx->name);
+ fflush(stdout);
+
+ ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (ListenSocket == INVALID_SOCKET) {
+ ret = WSAGetLastError();
+ printf("socket() failed[%d][%d]\n", ListenSocket, ret);
+ fflush(stdout);
+ goto failed;
+ }
+
+ saServer.sin_family = AF_INET;
+ saServer.sin_addr.s_addr = inet_addr(LISTEN_IP);
+ saServer.sin_port = htons(ctx->listen_port);
+
+ saClient.sin_family = AF_INET;
+ saClient.sin_addr.s_addr = inet_addr(FORWARD_IP);
+ saClient.sin_port = htons(ctx->client_port);
+
+ ret = bind(ListenSocket, (SOCKADDR*)&saServer, sizeof(saServer));
+ if (ret == SOCKET_ERROR) {
+ ret = WSAGetLastError();
+ printf("bind() failed[%d]\n", ret);
+ fflush(stdout);
+ goto failed;
+ }
+
+ ret = listen(ListenSocket, 10);
+ if (ret == SOCKET_ERROR) {
+ ret = WSAGetLastError();
+ printf("listen() failed[%d]\n", ret);
+ fflush(stdout);
+ goto failed;
+ }
+
+ while (!ctx->stop) {
+ struct sockaddr_in sa;
+ int sa_len = sizeof(sa);
+ struct NDRProxyThreadCtx *p = malloc(sizeof(*p));
+ p->ctx = ctx;
+
+ p->InSocket = accept(ListenSocket, (SOCKADDR *)&sa, &sa_len);
+ if (p->InSocket == INVALID_SOCKET) {
+ ret = WSAGetLastError();
+ printf("%s: accept() failed[%d][%d]\n", p->ctx->name, p->InSocket, ret);
+ fflush(stdout);
+ continue;
+ }
+
+ p->OutSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (p->OutSocket == INVALID_SOCKET) {
+ ret = WSAGetLastError();
+ printf("%s: socket(out) failed[%d][%d]\n", p->ctx->name, p->OutSocket, ret);
+ fflush(stdout);
+ closesocket(p->InSocket);
+ continue;
+ }
+
+ ret = connect(p->OutSocket, (SOCKADDR*)&saClient, sizeof(saClient));
+ if (ret == SOCKET_ERROR) {
+ ret = WSAGetLastError();
+ printf("%s: connect() failed[%d]\n", p->ctx->name, ret);
+ fflush(stdout);
+ closesocket(p->InSocket);
+ closesocket(p->OutSocket);
+ continue;
+ }
+
+ p->hThread = CreateThread(
+ NULL, // default security attributes
+ 0, // use default stack size
+ NDRProxyThread, // thread function name
+ p, // argument to thread function
+ 0, // use default creation flags
+ &p->dwThreadId);// returns the thread identifier
+ if (p->hThread == NULL) {
+ printf("failed to create thread ndr32\n");
+ fflush(stdout);
+ return -1;
+ }
+ }
+
+ //printf("NDRTcpThread[%s] stop\n", ctx->name);
+ fflush(stdout);
+ return 0;
+failed:
+ printf("NDRTcpThread[%s] failed[%d]\n", ctx->name, ret);
+ fflush(stdout);
+ return ret;
+}
+
+struct NDRRpcThreadCtx {
+ const char *name;
+ short listen_port;
+};
+
+DWORD WINAPI NDRRpcThread(LPVOID lpParameter)
+{
+ struct NDRRpcThreadCtx *ctx = (struct NDRRpcThreadCtx *)lpParameter;
+ int ret = -1;
+ RPC_STATUS status;
+ RPC_BINDING_VECTOR *pBindingVector;
+
+#define RPC_MIN_CALLS 1
+#define RPC_MAX_CALLS 20
+
+ //printf("NDRRpcThread[%s] start\n", ctx->name);
+ fflush(stdout);
+ status = RpcServerUseProtseqEp("ncacn_ip_tcp", RPC_MAX_CALLS, "5055", NULL);
+ if (status) {
+ printf("Failed to register ncacn_ip_tcp endpoint\n");
+ fflush(stdout);
+ return status;
+ }
+
+ status = RpcServerInqBindings(&pBindingVector);
+ if (status) {
+ printf("Failed RpcServerInqBindings\n");
+ fflush(stdout);
+ return status;
+ }
+
+#if 0
+ status = RpcEpRegister(srv_midltests_v0_0_s_ifspec, pBindingVector, NULL, "midltests server");
+ if (status) {
+ printf("Failed RpcEpRegister\n");
+ fflush(stdout);
+ return status;
+ }
+#endif
+ status = RpcServerRegisterIf(srv_midltests_v0_0_s_ifspec, NULL, NULL);
+ if (status) {
+ printf("Failed to register interface\n");
+ fflush(stdout);
+ return status;
+ }
+
+ status = RpcServerListen(RPC_MIN_CALLS, RPC_MAX_CALLS, FALSE);
+ if (status) {
+ printf("RpcServerListen returned error %d\n", status);
+ fflush(stdout);
+ return status;
+ }
+
+ printf("NDRRpcThread[%s] stop\n", ctx->name);
+ fflush(stdout);
+ return 0;
+failed:
+ printf("NDRRpcThread[%s] failed[%d]\n", ctx->name, ret);
+ fflush(stdout);
+ return ret;
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+ struct NDRTcpThreadCtx ctx_ndr32;
+ struct NDRTcpThreadCtx ctx_ndr64;
+ struct NDRRpcThreadCtx ctx_rpc;
+ DWORD dwThreadIdArray[3];
+ HANDLE hThreadArray[3];
+ WORD wVersionRequested = MAKEWORD(2, 2);
+ WSADATA wsaData;
+ char *binding;
+ RPC_STATUS status;
+
+ ret = WSAStartup(wVersionRequested, &wsaData);
+ if (ret != 0) {
+ printf("WSAStartup failed with error: %d\n", ret);
+ fflush(stdout);
+ return -1;
+ }
+
+ ctx_ndr32.name = "ndr32";
+ ctx_ndr32.listen_port = 5032;
+ ctx_ndr32.client_port = 5055;
+ ctx_ndr32.ndr64 = FALSE;
+ ctx_ndr32.stop = FALSE;
+ hThreadArray[0] = CreateThread(
+ NULL, // default security attributes
+ 0, // use default stack size
+ NDRTcpThread, // thread function name
+ &ctx_ndr32, // argument to thread function
+ 0, // use default creation flags
+ &dwThreadIdArray[0]); // returns the thread identifier
+ if (hThreadArray[0] == NULL) {
+ printf("failed to create thread ndr32\n");
+ fflush(stdout);
+ return -1;
+ }
+
+ ctx_ndr64.name = "ndr64";
+ ctx_ndr64.listen_port = 5064;
+ ctx_ndr64.client_port = 5055;
+ ctx_ndr64.ndr64 = TRUE;
+ ctx_ndr64.stop = FALSE;
+ hThreadArray[1] = CreateThread(
+ NULL, // default security attributes
+ 0, // use default stack size
+ NDRTcpThread, // thread function name
+ &ctx_ndr64, // argument to thread function
+ 0, // use default creation flags
+ &dwThreadIdArray[1]); // returns the thread identifier
+ if (hThreadArray[1] == NULL) {
+ printf("failed to create thread ndr64\n");
+ fflush(stdout);
+ return -1;
+ }
+
+ ctx_rpc.name = "rpc";
+ ctx_rpc.listen_port = 5050;
+ hThreadArray[2] = CreateThread(
+ NULL, // default security attributes
+ 0, // use default stack size
+ NDRRpcThread, // thread function name
+ &ctx_rpc, // argument to thread function
+ 0, // use default creation flags
+ &dwThreadIdArray[2]); // returns the thread identifier
+ if (hThreadArray[2] == NULL) {
+ printf("failed to create thread rpc\n");
+ fflush(stdout);
+ return -1;
+ }
+
+ printf("Wait for setup of server threads\n");
+ fflush(stdout);
+ ret = WaitForMultipleObjects(3, hThreadArray, TRUE, 3000);
+ if (ret == WAIT_TIMEOUT) {
+ /* OK */
+ } else {
+ printf("Failed to setup of server threads %d:%d\n",
+ ret, GetLastError());
+ fflush(stdout);
+ return -1;
+ }
+ ret = 0;
+
+ printf("\nTest NDR32\n\n");
+ fflush(stdout);
+ binding = "ncacn_ip_tcp:" CONNECT_IP "[5032]";
+ status = RpcBindingFromStringBinding(
+ binding,
+ &midltests_IfHandle);
+ if (status) {
+ printf("RpcBindingFromStringBinding returned %d\n", status);
+ fflush(stdout);
+ return status;
+ }
+
+ RpcTryExcept {
+ midltests();
+ } RpcExcept(1) {
+ ret = RpcExceptionCode();
+ printf("NDR32 Runtime error 0x%x\n", ret);
+ fflush(stdout);
+ } RpcEndExcept
+ ctx_ndr32.stop = TRUE;
+
+ Sleep(250);
+
+ printf("\nTest NDR64\n\n");
+ binding = "ncacn_ip_tcp:" CONNECT_IP "[5064]";
+ status = RpcBindingFromStringBinding(
+ binding,
+ &midltests_IfHandle);
+ if (status) {
+ printf("RpcBindingFromStringBinding returned %d\n", status);
+ fflush(stdout);
+ return status;
+ }
+
+ RpcTryExcept {
+ midltests();
+ } RpcExcept(1) {
+ ret = RpcExceptionCode();
+ printf("Runtime error 0x%x\n", ret);
+ fflush(stdout);
+ } RpcEndExcept
+ ctx_ndr64.stop = TRUE;
+
+ WaitForMultipleObjects(3, hThreadArray, TRUE, 2000);
+
+ if (ret == 0) {
+ printf("\nTest OK\n");
+ fflush(stdout);
+ } else {
+ printf("\nTest FAILED[%d]\n", ret);
+ fflush(stdout);
+ }
+
+ return ret;
+}
diff --git a/testprogs/win32/midltests/todo/midltests-array-range.idl b/testprogs/win32/midltests/todo/midltests-array-range.idl
new file mode 100644
index 0000000..1d60fd6
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-array-range.idl
@@ -0,0 +1,39 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ long midltests_fn(
+ [out,ref] long *count,
+ [out,ref,size_is(,*count),range(0,1)] long **array,
+ [out,ref] long *error
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ long count;
+ long *array;
+ long error;
+
+ cli_midltests_fn(&count, &array, &error);
+}
+
+long srv_midltests_fn(long *count, long **array, long *error)
+{
+ printf("srv_midltests_fn: Start\n");
+ *count=2;
+ *array=(long *)malloc((*count) * sizeof(long));
+ (*array)[0] = 7;
+ (*array)[1] = 7;
+ *error=0;
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/todo/midltests-pipe-02.idl b/testprogs/win32/midltests/todo/midltests-pipe-02.idl
new file mode 100644
index 0000000..e6be283
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-pipe-02.idl
@@ -0,0 +1,153 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ typedef pipe char pipe_char;
+
+ struct msg {
+ long l;
+ [size_is(l)] char *m;
+ };
+
+ long midltests_fn(
+ [out,ref] struct msg *out1,
+ [out] pipe_char outp,
+ [in] pipe_char inp,
+ [in] struct msg in1
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+struct pipe_char_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_char_pull(
+ char * _state,
+ unsigned char * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount);
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_char_push(
+ char * _state,
+ unsigned char * buf,
+ unsigned long ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_char_alloc(
+ char * _state,
+ unsigned long bsize,
+ unsigned char * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+
+static void midltests(void)
+{
+ struct msg out1;
+ unsigned char out1b[3];
+ struct pipe_char_state outs;
+ pipe_char outp;
+ struct pipe_char_state ins;
+ pipe_char inp;
+ struct msg in1;
+ unsigned char in1b[3];
+
+ in1.l = sizeof(in1b);
+ memset(&in1b, 0xAA, sizeof(in1b));
+ in1.m = in1b;
+
+ memset(&outs, 0, sizeof(outs));
+ outs.name = "outp";
+ memset(&outp, 0, sizeof(outp));
+ outp.pull = pipe_char_pull;
+ outp.push = pipe_char_push;
+ outp.alloc = pipe_char_alloc;
+ outp.state = (char *)&outs;
+
+ memset(&ins, 0, sizeof(ins));
+ ins.name = "inp";
+ ins.count = 1;
+ memset(&inp, 0, sizeof(inp));
+ inp.pull = pipe_char_pull;
+ inp.push = pipe_char_push;
+ inp.alloc = pipe_char_alloc;
+ inp.state = (char *)&ins;
+
+ out1.l = sizeof(out1b);
+ memset(&out1b, 0xFF, sizeof(out1b));
+ out1.m = out1b;
+
+ cli_midltests_fn(&out1, outp, inp, in1);
+}
+
+long srv_midltests_fn(
+ /* [ref][out] */ struct msg *out1,
+ /* [out] */ pipe_char outp,
+ /* [in] */ pipe_char inp,
+ /* [in] */ struct msg in1)
+{
+ char inb[500];
+ unsigned long inb_len = 0;
+ char *outb = NULL;
+ unsigned long outb_size = 0;
+ unsigned long outb_len = 0;
+
+ printf("srv_midltests_fn: Start\n");
+
+ do {
+ inp.pull(inp.state, inb, sizeof(inb), &inb_len);
+ printf("pull inp_len[%u]\n", inb_len);
+ } while (inb_len > 0);
+
+ outb_size = 5;
+ do {
+ outp.alloc(outp.state, outb_size, &outb, &outb_len);
+ memset(outb, 0xCC, outb_len);
+ outp.push(outp.state, outb, outb_len);
+ printf("push outb_len[%u]\n", outb_len);
+ //Sleep(1000);
+ outb_size--;
+ } while (outb_len > 0);
+
+ out1->l = 3;
+ out1->m = (unsigned char *)malloc(out1->l);
+ memset(out1->m, 0xBB, out1->l);
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/todo/midltests-pipe-03-hyper.idl b/testprogs/win32/midltests/todo/midltests-pipe-03-hyper.idl
new file mode 100644
index 0000000..475aedd
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-pipe-03-hyper.idl
@@ -0,0 +1,205 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ typedef pipe char pipe_char;
+ typedef pipe hyper pipe_hyper;
+
+ struct msg {
+ long l;
+ [size_is(l)] char *m;
+ };
+
+ long midltests_fn(
+ [out,ref] struct msg *out1,
+ [out] pipe_hyper outp,
+ [in] pipe_hyper inp,
+ [in] struct msg in1
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+struct pipe_char_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_char_pull(
+ char * _state,
+ unsigned char * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_char_push(
+ char * _state,
+ unsigned char * buf,
+ unsigned long ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_char_alloc(
+ char * _state,
+ unsigned long bsize,
+ unsigned char * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+
+struct pipe_hyper_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_hyper_pull(
+ char * _state,
+ hyper * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_hyper_push(
+ char * _state,
+ hyper * buf,
+ unsigned long ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_hyper_alloc(
+ char * _state,
+ unsigned long bsize,
+ hyper * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+static void midltests(void)
+{
+ struct msg out1;
+ unsigned char out1b[3];
+ struct pipe_hyper_state outs;
+ pipe_hyper outp;
+ struct pipe_hyper_state ins;
+ pipe_hyper inp;
+ struct msg in1;
+ unsigned char in1b[3];
+
+ in1.l = sizeof(in1b);
+ memset(&in1b, 0xAA, sizeof(in1b));
+ in1.m = in1b;
+
+ memset(&outs, 0, sizeof(outs));
+ outs.name = "outp";
+ memset(&outp, 0, sizeof(outp));
+ outp.pull = pipe_hyper_pull;
+ outp.push = pipe_hyper_push;
+ outp.alloc = pipe_hyper_alloc;
+ outp.state = (char *)&outs;
+
+ memset(&ins, 0, sizeof(ins));
+ ins.name = "inp";
+ ins.count = 1;
+ memset(&inp, 0, sizeof(inp));
+ inp.pull = pipe_hyper_pull;
+ inp.push = pipe_hyper_push;
+ inp.alloc = pipe_hyper_alloc;
+ inp.state = (char *)&ins;
+
+ out1.l = sizeof(out1b);
+ memset(&out1b, 0xFF, sizeof(out1b));
+ out1.m = out1b;
+
+ cli_midltests_fn(&out1, outp, inp, in1);
+}
+
+long srv_midltests_fn(
+ /* [ref][out] */ struct msg *out1,
+ /* [out] */ pipe_hyper outp,
+ /* [in] */ pipe_hyper inp,
+ /* [in] */ struct msg in1)
+{
+ hyper inb[500];
+ unsigned long inb_len = 0;
+ hyper *outb = NULL;
+ unsigned long outb_size = 0;
+ unsigned long outb_len = 0;
+
+ printf("srv_midltests_fn: Start\n");
+
+ do {
+ inp.pull(inp.state, inb, sizeof(inb), &inb_len);
+ printf("pull inp_len[%u]\n", inb_len);
+ } while (inb_len > 0);
+
+ outb_size = 5;
+ do {
+ outp.alloc(outp.state, outb_size, &outb, &outb_len);
+ memset(outb, 0xCC, outb_len * sizeof(*outb));
+ outp.push(outp.state, outb, outb_len);
+ printf("push outb_len[%u]\n", outb_len);
+ //Sleep(1000);
+ outb_size--;
+ } while (outb_len > 0);
+
+ out1->l = 3;
+ out1->m = (unsigned char *)malloc(out1->l);
+ memset(out1->m, 0xBB, out1->l);
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/todo/midltests-pipe-04-struct.idl b/testprogs/win32/midltests/todo/midltests-pipe-04-struct.idl
new file mode 100644
index 0000000..07921b8
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-pipe-04-struct.idl
@@ -0,0 +1,272 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ typedef pipe char pipe_char;
+ typedef pipe hyper pipe_hyper;
+ typedef struct {
+ long l;
+ short s;
+ } structtype;
+ typedef pipe structtype pipe_structtype;
+
+ struct msg {
+ long l;
+ [size_is(l)] char *m;
+ };
+
+ long midltests_fn(
+ [out,ref] struct msg *out1,
+ [out] pipe_structtype outp,
+ [in] pipe_structtype inp,
+ [in] struct msg in1
+ );
+
+ long midltests_ping( [in] struct msg in1);
+
+}
+
+#elif MIDLTESTS_C_CODE
+
+struct pipe_char_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_char_pull(
+ char * _state,
+ unsigned char * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_char_push(
+ char * _state,
+ unsigned char * buf,
+ unsigned long ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_char_alloc(
+ char * _state,
+ unsigned long bsize,
+ unsigned char * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+
+struct pipe_hyper_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_hyper_pull(
+ char * _state,
+ hyper * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_hyper_push(
+ char * _state,
+ hyper * buf,
+ unsigned long ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_hyper_alloc(
+ char * _state,
+ unsigned long bsize,
+ hyper * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+struct pipe_structtype_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_structtype_pull(
+ char * _state,
+ structtype * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_structtype_push(
+ char * _state,
+ structtype * buf,
+ unsigned long ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_structtype_alloc(
+ char * _state,
+ unsigned long bsize,
+ structtype * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+static void midltests(void)
+{
+ struct msg out1;
+ unsigned char out1b[3];
+ struct pipe_structtype_state outs;
+ pipe_structtype outp;
+ struct pipe_structtype_state ins;
+ pipe_structtype inp;
+ struct msg in1;
+ unsigned char in1b[3];
+
+ in1.l = sizeof(in1b);
+ memset(&in1b, 0xAA, sizeof(in1b));
+ in1.m = in1b;
+
+ memset(&outs, 0, sizeof(outs));
+ outs.name = "outp";
+ memset(&outp, 0, sizeof(outp));
+ outp.pull = pipe_structtype_pull;
+ outp.push = pipe_structtype_push;
+ outp.alloc = pipe_structtype_alloc;
+ outp.state = (char *)&outs;
+
+ memset(&ins, 0, sizeof(ins));
+ ins.name = "inp";
+ ins.count = 1;
+ memset(&inp, 0, sizeof(inp));
+ inp.pull = pipe_structtype_pull;
+ inp.push = pipe_structtype_push;
+ inp.alloc = pipe_structtype_alloc;
+ inp.state = (char *)&ins;
+
+ out1.l = sizeof(out1b);
+ memset(&out1b, 0xFF, sizeof(out1b));
+ out1.m = out1b;
+
+ cli_midltests_ping(in1);
+ cli_midltests_fn(&out1, outp, inp, in1);
+}
+
+long srv_midltests_fn(
+ /* [ref][out] */ struct msg *out1,
+ /* [out] */ pipe_structtype outp,
+ /* [in] */ pipe_structtype inp,
+ /* [in] */ struct msg in1)
+{
+ structtype inb[500];
+ unsigned long inb_len = 0;
+ structtype *outb = NULL;
+ unsigned long outb_size = 0;
+ unsigned long outb_len = 0;
+
+ printf("srv_midltests_fn: Start\n");
+
+ do {
+ inp.pull(inp.state, inb, sizeof(inb), &inb_len);
+ printf("pull inp_len[%u]\n", inb_len);
+ } while (inb_len > 0);
+
+ outb_size = 5;
+ do {
+ outp.alloc(outp.state, outb_size, &outb, &outb_len);
+ memset(outb, 0xCC, outb_len * sizeof(*outb));
+ outp.push(outp.state, outb, outb_len);
+ printf("push outb_len[%u]\n", outb_len);
+ //Sleep(1000);
+ outb_size--;
+ } while (outb_len > 0);
+
+ out1->l = 3;
+ out1->m = (unsigned char *)malloc(out1->l);
+ memset(out1->m, 0xBB, out1->l);
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+long srv_midltests_ping(
+ /* [in] */ struct msg in1)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+#endif
diff --git a/testprogs/win32/midltests/todo/midltests-pipe-first.idl b/testprogs/win32/midltests/todo/midltests-pipe-first.idl
new file mode 100755
index 0000000..ef28943
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-pipe-first.idl
@@ -0,0 +1,233 @@
+#ifndef MIDLTESTS_C_CODE
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+/* typedef struct st_wire {
+ long len;
+ //[size_is(len)] char data[*];
+ [size_is(l2)] char *d2;
+ long l2;
+ } st_wire_t;
+ struct st_local {
+ short s1;
+ short s2;
+ };
+ typedef [transmit_as(st_wire_t)] struct st_local st_local_t;
+
+ long midltests_fn(
+ [in] st_local_t st
+
+ );
+*/
+/* struct my_ace {
+ long ace1;
+ long ace2;
+ };
+ struct my_acl {
+ long revision;
+ long num_aces;
+ [size_is(num_aces)] struct my_ace *aces;
+ };
+ long midltests_fn(
+ [in,ref] struct my_acl *acl
+ );
+*/
+/* struct my_str {
+ long l1;
+ [string] wchar_t str[260+1];
+ long l2;
+ };
+ long midltests_fn(
+ [in,out,ref] struct my_str *str
+ );
+*/
+ long foo();
+ long midltests_fn(
+ [in] long size,
+ [out,ref,size_is(size),length_is(*length)] byte *bytes,
+ [out,ref] long *length
+ );
+
+ typedef pipe byte BYTE_PIPE;
+ typedef pipe long LONG_PIPE;
+
+ long midltests_fn_pipe(
+ [in] long count,
+ [out,ref] long *start_magic,
+ [out] BYTE_PIPE b,
+ [out, ref] long *mid_magic,
+ [out] LONG_PIPE l,
+ [out,ref] long *end_magic
+ );
+
+}
+#elif MIDLTESTS_C_CODE
+/*
+void __RPC_USER st_local_t_to_xmit(st_local_t *l, st_wire_t **w)
+{
+ *w = malloc(4+ sizeof(st_wire_t));
+ (*w)->len = sizeof(st_local_t);
+ //(*w)->data = malloc((*w)->len);
+ memcpy((*w)->data, l, sizeof(st_local_t));
+ //memset(*w, 0xcd, sizeof(st_wire_t));
+}
+
+void __RPC_USER st_local_t_from_xmit(st_wire_t *w, st_local_t *l)
+{
+ memcpy(l, w->data, sizeof(st_local_t));
+// memset(l, 0, sizeof(st_local_t));
+}
+
+void __RPC_USER st_local_t_free_inst(st_local_t *l)
+{
+
+}
+
+void __RPC_USER st_local_t_free_xmit(st_wire_t *w)
+{
+ //free(w->data);
+ free(w);
+}
+*/
+
+void __RPC_USER cli_push_b(char * state,
+ byte * buf,
+ unsigned long ecount)
+{
+ printf("cli_push_b ecount[%lu]\n", ecount);
+}
+
+void __RPC_USER cli_alloc_b(char * state,
+ unsigned long bsize,
+ byte * * buf,
+ unsigned long * bcount )
+{
+ printf("cli_alloc_b bsize[%lu]\n", bsize);
+ *buf = NULL;
+ *bcount = 0;
+}
+
+void __RPC_USER cli_push_l(char * state,
+ long * buf,
+ unsigned long ecount)
+{
+ printf("cli_push_l ecount[%lu]\n", ecount);
+}
+
+void __RPC_USER cli_alloc_l(char * state,
+ unsigned long bsize,
+ long * * buf,
+ unsigned long * bcount )
+{
+ printf("cli_alloc_l bsize[%lu]\n", bsize);
+ *buf = NULL;
+ *bcount = 0;
+}
+
+static void midltests()
+{
+/* st_local_t st;
+ st.s1 = 1;
+ st.s2 = 2;
+ cli_midltests_fn(st);
+*/
+/* struct my_acl acl;
+ struct my_ace aces[3];
+ aces[0].ace1 = 1;
+ aces[0].ace2 = 2;
+ aces[1].ace1 = 1;
+ aces[1].ace2 = 2;
+ aces[2].ace1 = 1;
+ aces[2].ace2 = 2;
+ acl.revision = 5;
+ acl.num_aces = 1;
+ acl.aces = aces;
+ cli_midltests_fn(&acl);
+*/
+/* struct my_str str;
+ memset(&str, 0, sizeof(str));
+ str.l1 = 1;
+ printf("here: %d\n", __LINE__);
+ //wcscpy(str.str, L'Hello World\0');
+ str.l2 = 2;
+ printf("here: %d\n", __LINE__);
+ cli_midltests_fn(&str);
+*/
+ byte buf[10];
+ long length = 0;
+ memset(buf, 0xdf, sizeof(buf));
+// cli_midltests_fn(sizeof(buf), buf, &length);
+
+/* long count = 2;
+ long start_magic;
+ BYTE_PIPE b;
+ long mid_magic;
+ LONG_PIPE l;
+ long end_magic;
+
+
+ memset(&b, 0, sizeof(b));
+ memset(&l, 0, sizeof(l));
+
+ b.alloc = cli_alloc_b;
+ b.push = cli_push_b;
+
+ l.alloc = cli_alloc_l;
+ l.push = cli_push_l;
+
+ printf("cli call start\n");
+ cli_midltests_fn(count,
+ &start_magic,
+ b,
+ &mid_magic,
+ l,
+ &end_magic);
+ printf("cli call end\n");
+*/
+}
+
+//long srv_midltests_fn(struct my_str *str)//struct my_acl *acl)//st_local_t st)
+//long srv_midltests_fn(long size, byte *bytes, long *length)
+#if 1
+long srv_midltests_fn(
+ /* [in] */ long count,
+ /* [ref][out] */ long *start_magic,
+ /* [out] */ BYTE_PIPE b,
+ /* [ref][out] */ long *mid_magic,
+ /* [out] */ LONG_PIPE l,
+ /* [ref][out] */ long *end_magic)
+#endif
+{
+/* byte bytes[10];
+ long longs[10];
+ int i;
+*/
+ printf("srv_midltests_fn: Start\n");
+ //printf("s1[%d] s2[%d]\n", st.s1, st.s2);
+ //printf(l1[%d] str[%s] l2[%d]\n", str->l1, str->str, str->l2);
+
+/* *start_magic = 0x01234567;
+ *mid_magic = 0x88888888;
+ *end_magic = 0xFEDCBA09;
+
+ memset(bytes, 0xBE, sizeof(bytes));
+ memset(longs, 0xAC, sizeof(longs));
+
+ for (i=0; i < count; i++) {
+ b.push(b.state, bytes, sizeof(bytes)/sizeof(bytes[0]));
+ }
+ b.push(b.state, NULL, 0);
+
+ for (i=0; i < count; i++) {
+ l.push(l.state, longs, sizeof(longs)/sizeof(longs[0]));
+ }
+ l.push(l.state, NULL, 0);
+*/
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif \ No newline at end of file
diff --git a/testprogs/win32/midltests/todo/midltests-pipe-sync-ndr32-downgrade-02.idl b/testprogs/win32/midltests/todo/midltests-pipe-sync-ndr32-downgrade-02.idl
new file mode 100644
index 0000000..760401e
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-pipe-sync-ndr32-downgrade-02.idl
@@ -0,0 +1,296 @@
+#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 pipe char pipe_char;
+ typedef pipe hyper pipe_hyper;
+ typedef struct {
+ long l;
+ short s;
+ } structtype;
+ typedef pipe structtype pipe_structtype;
+
+ struct msg {
+ long l;
+ [size_is(l)] char *m;
+ };
+
+ long midltests_fn(
+ [out,ref] struct msg *out1,
+ [out] pipe_structtype outp,
+ [in] pipe_structtype inp,
+ [in] struct msg in1
+ );
+
+ long midltests_ping( [in] struct msg in1);
+
+}
+
+#elif MIDLTESTS_C_CODE
+
+struct pipe_char_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_char_pull(
+ char * _state,
+ unsigned char * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_char_push(
+ char * _state,
+ unsigned char * buf,
+ unsigned long ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_char_alloc(
+ char * _state,
+ unsigned long bsize,
+ unsigned char * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+
+struct pipe_hyper_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_hyper_pull(
+ char * _state,
+ hyper * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_hyper_push(
+ char * _state,
+ hyper * buf,
+ unsigned long ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_hyper_alloc(
+ char * _state,
+ unsigned long bsize,
+ hyper * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+struct pipe_structtype_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_structtype_pull(
+ char * _state,
+ structtype * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_structtype_push(
+ char * _state,
+ structtype * buf,
+ unsigned long ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_structtype_alloc(
+ char * _state,
+ unsigned long bsize,
+ structtype * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+static void midltests(void)
+{
+ struct msg out1;
+ unsigned char out1b[3];
+ struct pipe_structtype_state outs;
+ pipe_structtype outp;
+ struct pipe_structtype_state ins;
+ pipe_structtype inp;
+ struct msg in1;
+ unsigned char in1b[5000];
+
+ in1.l = sizeof(in1b);
+ memset(&in1b, 0xAA, sizeof(in1b));
+ in1.m = in1b;
+
+ memset(&outs, 0, sizeof(outs));
+ outs.name = "outp";
+ memset(&outp, 0, sizeof(outp));
+ outp.pull = pipe_structtype_pull;
+ outp.push = pipe_structtype_push;
+ outp.alloc = pipe_structtype_alloc;
+ outp.state = (char *)&outs;
+
+ memset(&ins, 0, sizeof(ins));
+ ins.name = "inp";
+ ins.count = 100;
+ memset(&inp, 0, sizeof(inp));
+ inp.pull = pipe_structtype_pull;
+ inp.push = pipe_structtype_push;
+ inp.alloc = pipe_structtype_alloc;
+ inp.state = (char *)&ins;
+
+ out1.l = sizeof(out1b);
+ memset(&out1b, 0xFF, sizeof(out1b));
+ out1.m = out1b;
+
+ cli_midltests_ping(in1);
+ cli_midltests_fn(&out1, outp, inp, in1);
+}
+
+long srv_midltests_fn(
+ /* [ref][out] */ struct msg *out1,
+ /* [out] */ pipe_structtype outp,
+ /* [in] */ pipe_structtype inp,
+ /* [in] */ struct msg in1)
+{
+ structtype inb[500];
+ unsigned long inb_len = 0;
+ structtype *outb = NULL;
+ unsigned long outb_size = 0;
+ unsigned long outb_len = 0;
+
+ printf("srv_midltests_fn: Start\n");
+
+ do {
+ inp.pull(inp.state, inb, sizeof(inb), &inb_len);
+ printf("pull inp_len[%u]\n", inb_len);
+ } while (inb_len > 0);
+
+ outb_size = 5;
+ do {
+ outp.alloc(outp.state, outb_size, &outb, &outb_len);
+ memset(outb, 0xCC, outb_len * sizeof(*outb));
+ outp.push(outp.state, outb, outb_len);
+ printf("push outb_len[%u]\n", outb_len);
+ //Sleep(1000);
+ outb_size--;
+ } while (outb_len > 0);
+
+ out1->l = 3;
+ out1->m = (unsigned char *)malloc(out1->l);
+ memset(out1->m, 0xBB, out1->l);
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+long srv_midltests_ping(
+ /* [in] */ struct msg in1)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+#endif
diff --git a/testprogs/win32/midltests/todo/midltests-string-in-out-ref.idl b/testprogs/win32/midltests/todo/midltests-string-in-out-ref.idl
new file mode 100644
index 0000000..4db6f96
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-string-in-out-ref.idl
@@ -0,0 +1,33 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ long midltests_fn(
+ [in,out,ref,string] wchar_t *s
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ wchar_t s[] = { 's', 'a', 'm', 'b', 'a', 0 };
+
+ cli_midltests_fn(s);
+}
+
+long srv_midltests_fn(wchar_t *s)
+{
+ printf("srv_midltests_fn: Start\n");
+ s[1] = 0;
+ s[2] = 'M';
+ s[5] = '4';
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/todo/midltests-transmit-as.idl b/testprogs/win32/midltests/todo/midltests-transmit-as.idl
new file mode 100755
index 0000000..bf5bc3f
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests-transmit-as.idl
@@ -0,0 +1,59 @@
+#ifndef MIDLTESTS_C_CODE
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ typedef struct st_wire {
+ char data[20];
+ } st_wire_t;
+ struct st_local {
+ short s1;
+ short s2;
+ };
+ typedef [transmit_as(st_wire_t)] struct st_local st_local_t;
+
+ long midltests_fn(
+ [in] st_local_t st
+ );
+}
+#elif MIDLTESTS_C_CODE
+
+void __RPC_USER st_local_t_to_xmit(st_local_t *l, st_wire_t **w)
+{
+ *w = malloc(sizeof(st_wire_t));
+ memset(*w, 0xcd, sizeof(st_wire_t));
+}
+
+void __RPC_USER st_local_t_from_xmit(st_wire_t *w, st_local_t *l)
+{
+ memset(l, 0, sizeof(st_local_t));
+}
+
+void __RPC_USER st_local_t_free_inst(st_local_t *l)
+{
+
+}
+
+void __RPC_USER st_local_t_free_xmit(st_wire_t *w)
+{
+ free(w);
+}
+
+static void midltests()
+{
+ char s[64];
+ st_local_t st;
+ strcpy(s, "TestString");
+ cli_midltests_fn(st);
+}
+
+long srv_midltests_fn(st_local_t st)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif \ No newline at end of file
diff --git a/testprogs/win32/midltests/todo/midltests_pointer_default.idl b/testprogs/win32/midltests/todo/midltests_pointer_default.idl
new file mode 100755
index 0000000..9e0c18f
--- /dev/null
+++ b/testprogs/win32/midltests/todo/midltests_pointer_default.idl
@@ -0,0 +1,20 @@
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(ptr)
+]
+interface midltests
+{
+ struct midltests_struct {
+ [ref] long ****p;
+ [ref] long **a;
+ [ref] long **b;
+ [ref] long **c;
+ };
+
+ void midltests_fn(
+ //[in] long size,
+ [in,out,ref] struct midltests_struct *s
+ //[in,ref,size_is(,size)] long ***array
+ );
+
+} \ No newline at end of file
diff --git a/testprogs/win32/midltests/utils.c b/testprogs/win32/midltests/utils.c
new file mode 100644
index 0000000..8c4833d
--- /dev/null
+++ b/testprogs/win32/midltests/utils.c
@@ -0,0 +1,32 @@
+/*
+ MIDLTESTS utility functions.
+
+ Copyright (C) Tim Potter 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "midltests.h"
+
+/* MIDL allocate and free functions */
+
+void __RPC_FAR *__RPC_USER midl_user_allocate(size_t len)
+{
+ return(malloc(len));
+}
+
+void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
+{
+ free(ptr);
+}
diff --git a/testprogs/win32/midltests/valid/README.txt b/testprogs/win32/midltests/valid/README.txt
new file mode 100644
index 0000000..9208fae
--- /dev/null
+++ b/testprogs/win32/midltests/valid/README.txt
@@ -0,0 +1,6 @@
+This directory contains IDL files which demonstrate
+the relationship between IDL definitions and NDR representation.
+
+In order to test them, you can compile them as midltests.idl.
+
+Note: some examples trigger runtime errors.
diff --git a/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.idl b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.idl
new file mode 100644
index 0000000..26ef939
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.idl
@@ -0,0 +1,296 @@
+#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 pipe char pipe_char;
+ typedef pipe hyper pipe_hyper;
+ typedef struct {
+ long l;
+ short s;
+ } structtype;
+ typedef pipe structtype pipe_structtype;
+
+ struct msg {
+ long l;
+ [size_is(l)] char *m;
+ };
+
+ long midltests_fn(
+ [out,ref] struct msg *out1,
+ [out] pipe_structtype outp,
+ [in] pipe_structtype inp,
+ [in] struct msg in1
+ );
+
+ long midltests_ping( [in] struct msg in1);
+
+}
+
+#elif MIDLTESTS_C_CODE
+
+struct pipe_char_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_char_pull(
+ char * _state,
+ unsigned char * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_char_push(
+ char * _state,
+ unsigned char * buf,
+ unsigned long ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_char_alloc(
+ char * _state,
+ unsigned long bsize,
+ unsigned char * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+
+struct pipe_hyper_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_hyper_pull(
+ char * _state,
+ hyper * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_hyper_push(
+ char * _state,
+ hyper * buf,
+ unsigned long ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_hyper_alloc(
+ char * _state,
+ unsigned long bsize,
+ hyper * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+struct pipe_structtype_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_structtype_pull(
+ char * _state,
+ structtype * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_structtype_push(
+ char * _state,
+ structtype * buf,
+ unsigned long ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_structtype_alloc(
+ char * _state,
+ unsigned long bsize,
+ structtype * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+static void midltests(void)
+{
+ struct msg out1;
+ unsigned char out1b[3];
+ struct pipe_structtype_state outs;
+ pipe_structtype outp;
+ struct pipe_structtype_state ins;
+ pipe_structtype inp;
+ struct msg in1;
+ unsigned char in1b[3];
+
+ in1.l = sizeof(in1b);
+ memset(&in1b, 0xAA, sizeof(in1b));
+ in1.m = in1b;
+
+ memset(&outs, 0, sizeof(outs));
+ outs.name = "outp";
+ memset(&outp, 0, sizeof(outp));
+ outp.pull = pipe_structtype_pull;
+ outp.push = pipe_structtype_push;
+ outp.alloc = pipe_structtype_alloc;
+ outp.state = (char *)&outs;
+
+ memset(&ins, 0, sizeof(ins));
+ ins.name = "inp";
+ ins.count = 1;
+ memset(&inp, 0, sizeof(inp));
+ inp.pull = pipe_structtype_pull;
+ inp.push = pipe_structtype_push;
+ inp.alloc = pipe_structtype_alloc;
+ inp.state = (char *)&ins;
+
+ out1.l = sizeof(out1b);
+ memset(&out1b, 0xFF, sizeof(out1b));
+ out1.m = out1b;
+
+ cli_midltests_ping(in1);
+ cli_midltests_fn(&out1, outp, inp, in1);
+}
+
+long srv_midltests_fn(
+ /* [ref][out] */ struct msg *out1,
+ /* [out] */ pipe_structtype outp,
+ /* [in] */ pipe_structtype inp,
+ /* [in] */ struct msg in1)
+{
+ structtype inb[500];
+ unsigned long inb_len = 0;
+ structtype *outb = NULL;
+ unsigned long outb_size = 0;
+ unsigned long outb_len = 0;
+
+ printf("srv_midltests_fn: Start\n");
+
+ do {
+ inp.pull(inp.state, inb, sizeof(inb), &inb_len);
+ printf("pull inp_len[%u]\n", inb_len);
+ } while (inb_len > 0);
+
+ outb_size = 5;
+ do {
+ outp.alloc(outp.state, outb_size, &outb, &outb_len);
+ memset(outb, 0xCC, outb_len * sizeof(*outb));
+ outp.push(outp.state, outb, outb_len);
+ printf("push outb_len[%u]\n", outb_len);
+ //Sleep(1000);
+ outb_size--;
+ } while (outb_len > 0);
+
+ out1->l = 3;
+ out1->m = (unsigned char *)malloc(out1->l);
+ memset(out1->m, 0xBB, out1->l);
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+long srv_midltests_ping(
+ /* [in] */ struct msg in1)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.txt b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.txt
new file mode 100644
index 0000000..1c8d003
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-01.txt
@@ -0,0 +1,138 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[39] plen[15]
+
+[000] 03 00 00 00 00 00 02 00 03 00 00 00 AA AA AA ........ .......
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4]
+
+[000] 54 72 75 65 True
+
+ndr32: got NDR32
+
+alloc1:inp: bsize[5000], bcount[0]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[1]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[0]
+ndr32:in => out: ptype[alter_req] flen[72] call[3] contexts[1]
+
+
+ndr32:out => in: ptype[alter_ack] flen[56] call[3]
+
+ndr32:in => out: ptype[request] flen[56] plen[32]
+
+[000] 03 00 00 00 00 00 02 00 03 00 00 00 AA AA AA 00 ........ ........
+[010] 01 00 00 00 DD DD DD DD DD DD 08 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+pull inp_len[1]
+pull inp_len[0]
+push outb_len[5]
+push outb_len[4]
+push outb_len[3]
+push outb_len[2]
+push outb_len[1]
+push outb_len[0]
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[188] plen[164]
+
+[000] 05 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[020] CC CC CC CC CC CC CC CC CC CC 00 00 04 00 00 00 ........ ........
+[030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[050] 03 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[060] CC CC CC CC CC CC CC CC CC CC 00 00 02 00 00 00 ........ ........
+[070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[080] 01 00 00 00 CC CC CC CC CC CC 00 00 00 00 00 00 ........ ........
+[090] 03 00 00 00 00 00 02 00 03 00 00 00 BB BB BB 00 ........ ........
+[0A0] 54 72 75 65 True
+
+alloc1:outp: bsize[6664], bcount[1]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[15]
+push:outp: ecount[0]
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[51] plen[27]
+
+[000] 03 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 ........ ........
+[010] 03 00 00 00 00 00 00 00 AA AA AA ........ ...
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4]
+
+[000] 54 72 75 65 True
+
+
+ndr64: got NDR32 downgrade
+
+
+alloc1:inp: bsize[5000], bcount[0]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[1]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[0]
+ndr64:in => out: ptype[alter_req] flen[72] call[3] contexts[1]
+
+
+ndr64:out => in: ptype[alter_ack] flen[56] call[3]
+
+ndr64:in => out: ptype[request] flen[56] plen[32]
+
+[000] 03 00 00 00 00 00 02 00 03 00 00 00 AA AA AA 00 ........ ........
+[010] 01 00 00 00 DD DD DD DD DD DD 00 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+pull inp_len[1]
+pull inp_len[0]
+push outb_len[5]
+push outb_len[4]
+push outb_len[3]
+push outb_len[2]
+push outb_len[1]
+push outb_len[0]
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[188] plen[164]
+
+[000] 05 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[020] CC CC CC CC CC CC CC CC CC CC 00 00 04 00 00 00 ........ ........
+[030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[050] 03 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[060] CC CC CC CC CC CC CC CC CC CC 00 00 02 00 00 00 ........ ........
+[070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[080] 01 00 00 00 CC CC CC CC CC CC 00 00 00 00 00 00 ........ ........
+[090] 03 00 00 00 00 00 02 00 03 00 00 00 BB BB BB 00 ........ ........
+[0A0] 54 72 75 65 True
+
+alloc1:outp: bsize[6664], bcount[1]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[15]
+push:outp: ecount[0]
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.idl b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.idl
new file mode 100644
index 0000000..888ba79
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.idl
@@ -0,0 +1,300 @@
+#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 pipe char pipe_char;
+ typedef pipe hyper pipe_hyper;
+ typedef struct {
+ long l;
+ short s;
+ } structtype;
+ typedef pipe structtype pipe_structtype;
+
+ struct msg {
+ long l;
+ [size_is(l)] char *m;
+ };
+
+ long midltests_fn(
+ [out,ref] struct msg *out1,
+ [out] pipe_structtype outp,
+ [in] pipe_structtype inp,
+ [in] struct msg in1
+ );
+
+ long midltests_ping( [in] struct msg in1);
+
+}
+
+#elif MIDLTESTS_C_CODE
+
+struct pipe_char_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_char_pull(
+ char * _state,
+ unsigned char * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_char_push(
+ char * _state,
+ unsigned char * buf,
+ unsigned long ecount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_char_alloc(
+ char * _state,
+ unsigned long bsize,
+ unsigned char * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_char_state *state = (struct pipe_char_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+
+struct pipe_hyper_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_hyper_pull(
+ char * _state,
+ hyper * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_hyper_push(
+ char * _state,
+ hyper * buf,
+ unsigned long ecount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_hyper_alloc(
+ char * _state,
+ unsigned long bsize,
+ hyper * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+struct pipe_structtype_state {
+ const char *name;
+ unsigned long count;
+ unsigned long sleep;
+};
+
+void pipe_structtype_pull(
+ char * _state,
+ structtype * buf,
+ unsigned long esize,
+ unsigned long * ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("pull1:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+ *ecount = state->count--;
+ if (*ecount > esize) {
+ *ecount = esize;
+ }
+ memset(buf, 0xDD, *ecount * sizeof(*buf));
+ printf("pull2:%s: esize[%u] ecount[%u]\n",
+ state->name, esize, *ecount);
+}
+
+void pipe_structtype_push(
+ char * _state,
+ structtype * buf,
+ unsigned long ecount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("push:%s: ecount[%u]\n",
+ state->name, ecount);
+}
+
+void pipe_structtype_alloc(
+ char * _state,
+ unsigned long bsize,
+ structtype * * buf,
+ unsigned long * bcount)
+{
+ struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
+
+ printf("alloc1:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+ *bcount = bsize / sizeof(**buf);
+ *buf = malloc(*bcount * sizeof(**buf));
+ printf("alloc2:%s: bsize[%u], bcount[%u]\n",
+ state->name, bsize, *bcount);
+}
+static void midltests(void)
+{
+ struct msg out1;
+ unsigned char out1b[3];
+ struct pipe_structtype_state outs;
+ pipe_structtype outp;
+ struct pipe_structtype_state ins;
+ pipe_structtype inp;
+ struct msg in1;
+ unsigned char in1b[3000];
+
+ in1.l = sizeof(in1b);
+ memset(&in1b, 0xAA, sizeof(in1b));
+ in1.m = in1b;
+
+ memset(&outs, 0, sizeof(outs));
+ outs.name = "outp";
+ memset(&outp, 0, sizeof(outp));
+ outp.pull = pipe_structtype_pull;
+ outp.push = pipe_structtype_push;
+ outp.alloc = pipe_structtype_alloc;
+ outp.state = (char *)&outs;
+
+ memset(&ins, 0, sizeof(ins));
+ ins.name = "inp";
+ ins.count = 35;
+ memset(&inp, 0, sizeof(inp));
+ inp.pull = pipe_structtype_pull;
+ inp.push = pipe_structtype_push;
+ inp.alloc = pipe_structtype_alloc;
+ inp.state = (char *)&ins;
+
+ out1.l = sizeof(out1b);
+ memset(&out1b, 0xFF, sizeof(out1b));
+ out1.m = out1b;
+
+ cli_midltests_ping(in1);
+ cli_midltests_fn(&out1, outp, inp, in1);
+}
+
+long srv_midltests_fn(
+ /* [ref][out] */ struct msg *out1,
+ /* [out] */ pipe_structtype outp,
+ /* [in] */ pipe_structtype inp,
+ /* [in] */ struct msg in1)
+{
+ structtype inb[2500];
+ unsigned long inb_len = 0;
+ structtype *outb = NULL;
+ unsigned long outb_size = 0;
+ unsigned long outb_len = 0;
+
+ printf("srv_midltests_fn: Start\n");
+ fflush(stdout);
+
+ do {
+ inp.pull(inp.state, inb, sizeof(inb), &inb_len);
+ printf("pull inp_len[%u]\n", inb_len);
+ fflush(stdout);
+ } while (inb_len > 0);
+
+ outb_size = 50;
+ do {
+ outp.alloc(outp.state, outb_size, &outb, &outb_len);
+ memset(outb, 0xCC, outb_len * sizeof(*outb));
+ printf("push outb_len[%u]\n", outb_len);
+ fflush(stdout);
+ outp.push(outp.state, outb, outb_len);
+ //Sleep(1000);
+ outb_size--;
+ } while (outb_len > 0);
+
+ out1->l = 3;
+ out1->m = (unsigned char *)malloc(out1->l);
+ memset(out1->m, 0xBB, out1->l);
+ printf("srv_midltests_fn: End\n");
+ fflush(stdout);
+ return 0x65757254;
+}
+
+long srv_midltests_ping(
+ /* [in] */ struct msg in1)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.txt b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.txt
new file mode 100644
index 0000000..9ae037e
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests-pipe-sync-ndr32-downgrade-02.txt
@@ -0,0 +1,3266 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[3036] plen[3012] ahint[3012]
+
+[000] B8 0B 00 00 00 00 02 00 B8 0B 00 00 AA AA AA AA ........ ........
+[010] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[020] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[030] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[040] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[050] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[060] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[070] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[080] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[090] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[100] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[110] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[120] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[130] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[140] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[150] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[160] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[170] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[180] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[190] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[200] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[210] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[220] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[230] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[240] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[250] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[260] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[270] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[280] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[290] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[300] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[310] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[320] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[330] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[340] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[350] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[360] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[370] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[380] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[390] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[400] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[410] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[420] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[430] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[440] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[450] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[460] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[470] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[480] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[490] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[500] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[510] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[520] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[530] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[540] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[550] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[560] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[570] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[580] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[590] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[600] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[610] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[620] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[630] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[640] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[650] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[660] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[670] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[680] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[690] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[700] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[710] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[720] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[730] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[740] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[750] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[760] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[770] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[780] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[790] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[800] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[810] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[820] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[830] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[840] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[850] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[860] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[870] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[880] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[890] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[900] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[910] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[920] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[930] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[940] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[950] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[960] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[970] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[980] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[990] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AC0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AD0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AE0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AF0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BC0] AA AA AA AA ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32: disable NDR64
+
+alloc1:inp: bsize[5000], bcount[0]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[35]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[34]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[33]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[32]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[31]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[30]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[29]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[28]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[27]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[26]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[25]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[24]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[23]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[22]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[21]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[20]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[19]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[18]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[17]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[16]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[15]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[14]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[13]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[12]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[11]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[10]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[9]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[8]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[7]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[6]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[5]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[4]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[3]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[2]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[1]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[0]
+ndr32:in => out: ptype[request] flen[5840] plen[5816] ahint[3012]
+
+[000] B8 0B 00 00 00 00 02 00 B8 0B 00 00 AA AA AA AA ........ ........
+[010] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[020] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[030] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[040] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[050] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[060] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[070] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[080] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[090] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[100] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[110] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[120] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[130] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[140] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[150] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[160] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[170] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[180] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[190] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[200] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[210] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[220] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[230] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[240] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[250] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[260] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[270] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[280] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[290] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[300] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[310] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[320] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[330] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[340] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[350] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[360] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[370] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[380] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[390] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[400] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[410] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[420] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[430] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[440] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[450] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[460] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[470] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[480] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[490] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[500] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[510] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[520] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[530] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[540] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[550] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[560] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[570] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[580] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[590] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[600] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[610] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[620] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[630] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[640] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[650] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[660] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[670] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[680] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[690] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[700] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[710] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[720] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[730] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[740] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[750] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[760] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[770] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[780] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[790] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[800] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[810] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[820] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[830] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[840] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[850] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[860] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[870] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[880] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[890] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[900] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[910] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[920] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[930] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[940] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[950] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[960] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[970] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[980] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[990] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AC0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AD0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AE0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AF0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BC0] AA AA AA AA 23 00 00 00 DD DD DD DD DD DD DD DD ....#... ........
+[BD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[BE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[BF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C00] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[CE0] 22 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD "....... ........
+[CF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D00] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DF0] DD DD 00 00 21 00 00 00 DD DD DD DD DD DD DD DD ....!... ........
+[E00] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[ED0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[F00] 20 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ....... ........
+[F10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1000] DD DD 00 00 1F 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[1010] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1020] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1030] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1040] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1050] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1060] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1070] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1080] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1090] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[1100] 1E 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1110] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1120] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1130] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1140] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1150] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1160] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1170] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1180] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1190] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11F0] DD DD 00 00 1D 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[1200] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1210] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1220] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1230] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1240] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1250] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1260] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1270] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1280] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1290] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[12E0] 1C 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1300] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1310] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1320] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1330] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1340] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1350] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1360] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1370] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1380] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1390] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13C0] DD DD 00 00 1B 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[13D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1400] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1410] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1420] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1430] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1440] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1450] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1460] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1470] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1480] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1490] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[14A0] 1A 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1500] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1510] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1520] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1530] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1540] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1550] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1560] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1570] DD DD 00 00 19 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[1580] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1590] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1600] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1610] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1620] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1630] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[1640] 18 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1650] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1660] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1670] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1680] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1690] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[16A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[16B0] DD DD DD DD DD DD DD DD ........
+
+srv_midltests_fn: Start
+pull inp_len[344]
+ndr32:in => out: ptype[request] flen[2404] plen[2380] ahint[2380]
+
+[000] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[010] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[020] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[030] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[040] DD DD DD DD DD DD DD DD DD DD 00 00 17 00 00 00 ........ ........
+[050] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[060] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[070] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[080] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[090] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[100] DD DD DD DD DD DD AA AA 16 00 00 00 DD DD DD DD ........ ........
+[110] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[120] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[130] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[140] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[150] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[160] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[170] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[180] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[190] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1B0] DD DD DD DD DD DD DD DD DD DD AA AA 15 00 00 00 ........ ........
+[1C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[200] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[210] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[220] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[230] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[240] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[250] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[260] DD DD DD DD DD DD AA AA 14 00 00 00 DD DD DD DD ........ ........
+[270] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[280] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[290] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[300] DD DD DD DD DD DD DD DD DD DD AA AA 13 00 00 00 ........ ........
+[310] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[320] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[330] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[340] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[350] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[360] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[370] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[380] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[390] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3A0] DD DD DD DD DD DD AA AA 12 00 00 00 DD DD DD DD ........ ........
+[3B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[400] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[410] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[420] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[430] DD DD DD DD DD DD DD DD DD DD AA AA 11 00 00 00 ........ ........
+[440] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[450] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[460] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[470] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[480] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[490] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4C0] DD DD DD DD DD DD AA AA 10 00 00 00 DD DD DD DD ........ ........
+[4D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[500] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[510] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[520] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[530] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[540] DD DD DD DD DD DD DD DD DD DD AA AA 0F 00 00 00 ........ ........
+[550] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[560] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[570] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[580] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[590] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5C0] DD DD DD DD DD DD AA AA 0E 00 00 00 DD DD DD DD ........ ........
+[5D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[600] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[610] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[620] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[630] DD DD DD DD DD DD DD DD DD DD AA AA 0D 00 00 00 ........ ........
+[640] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[650] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[660] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[670] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[680] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[690] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6A0] DD DD DD DD DD DD AA AA 0C 00 00 00 DD DD DD DD ........ ........
+[6B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[700] DD DD DD DD DD DD DD DD DD DD AA AA 0B 00 00 00 ........ ........
+[710] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[720] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[730] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[740] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[750] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[760] DD DD DD DD DD DD AA AA 0A 00 00 00 DD DD DD DD ........ ........
+[770] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[780] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[790] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7B0] DD DD DD DD DD DD DD DD DD DD AA AA 09 00 00 00 ........ ........
+[7C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[800] DD DD DD DD DD DD AA AA 08 00 00 00 DD DD DD DD ........ ........
+[810] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[820] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[830] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[840] DD DD DD DD DD DD DD DD DD DD AA AA 07 00 00 00 ........ ........
+[850] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[860] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[870] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[880] DD DD DD DD DD DD AA AA 06 00 00 00 DD DD DD DD ........ ........
+[890] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8B0] DD DD DD DD DD DD DD DD DD DD AA AA 05 00 00 00 ........ ........
+[8C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8E0] DD DD DD DD DD DD AA AA 04 00 00 00 DD DD DD DD ........ ........
+[8F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[900] DD DD DD DD DD DD DD DD DD DD AA AA 03 00 00 00 ........ ........
+[910] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[920] DD DD DD DD DD DD AA AA 02 00 00 00 DD DD DD DD ........ ........
+[930] DD DD DD DD DD DD DD DD DD DD AA AA 01 00 00 00 ........ ........
+[940] DD DD DD DD DD DD AA AA 00 00 00 00 ........ ....
+
+pull inp_len[286]
+pull inp_len[0]
+push outb_len[50]
+push outb_len[49]
+push outb_len[48]
+push outb_len[47]
+push outb_len[46]
+push outb_len[45]
+push outb_len[44]
+push outb_len[43]
+push outb_len[42]
+push outb_len[41]
+push outb_len[40]
+push outb_len[39]
+push outb_len[38]
+push outb_len[37]
+push outb_len[36]
+push outb_len[35]
+push outb_len[34]
+push outb_len[33]
+push outb_len[32]
+push outb_len[31]
+push outb_len[30]
+push outb_len[29]
+push outb_len[28]
+push outb_len[27]
+push outb_len[26]
+push outb_len[25]
+push outb_len[24]
+push outb_len[23]
+push outb_len[22]
+push outb_len[21]
+push outb_len[20]
+push outb_len[19]
+push outb_len[18]
+push outb_len[17]
+push outb_len[16]
+push outb_len[15]
+push outb_len[14]
+push outb_len[13]
+push outb_len[12]
+push outb_len[11]
+push outb_len[10]
+push outb_len[9]
+push outb_len[8]
+push outb_len[7]
+push outb_len[6]
+push outb_len[5]
+push outb_len[4]
+push outb_len[3]
+push outb_len[2]
+push outb_len[1]
+push outb_len[0]
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[5840] plen[5816] ahint[5816]
+
+[000] 32 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC 2....... ........
+[010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[050] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[120] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[150] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[180] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[190] CC CC 00 00 31 00 00 00 CC CC CC CC CC CC CC CC ....1... ........
+[1A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[200] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[210] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[220] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[230] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[240] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[250] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[260] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[270] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[280] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[290] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[300] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[310] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[320] 30 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC 0....... ........
+[330] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[340] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[350] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[360] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[370] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[380] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[390] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[400] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[410] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[420] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[430] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[440] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[450] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[460] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[470] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[480] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[490] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4A0] CC CC 00 00 2F 00 00 00 CC CC CC CC CC CC CC CC ..../... ........
+[4B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[500] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[510] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[520] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[530] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[540] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[550] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[560] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[570] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[580] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[590] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[600] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[610] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[620] 2E 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[630] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[640] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[650] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[660] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[670] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[680] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[690] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[700] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[710] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[720] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[730] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[740] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[750] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[760] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[770] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[780] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[790] CC CC 00 00 2D 00 00 00 CC CC CC CC CC CC CC CC ....-... ........
+[7A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[800] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[810] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[820] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[830] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[840] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[850] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[860] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[870] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[880] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[890] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[900] 2C 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ,....... ........
+[910] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[920] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[930] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[940] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[950] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[960] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[970] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[980] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[990] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A60] CC CC 00 00 2B 00 00 00 CC CC CC CC CC CC CC CC ....+... ........
+[A70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[BC0] 2A 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC *....... ........
+[BD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D10] CC CC 00 00 29 00 00 00 CC CC CC CC CC CC CC CC ....)... ........
+[D20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[E60] 28 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC (....... ........
+[E70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[ED0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FA0] CC CC 00 00 27 00 00 00 CC CC CC CC CC CC CC CC ....'... ........
+[FB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1000] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1050] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[10E0] 26 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC &....... ........
+[10F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1120] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1150] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1180] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1190] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1200] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1210] CC CC 00 00 25 00 00 00 CC CC CC CC CC CC CC CC ....%... ........
+[1220] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1230] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1240] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1250] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1260] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1270] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1280] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1290] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1300] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1310] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1320] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1330] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[1340] 24 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC $....... ........
+[1350] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1360] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1370] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1380] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1390] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1400] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1410] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1420] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1430] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1440] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1450] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1460] CC CC 00 00 23 00 00 00 CC CC CC CC CC CC CC CC ....#... ........
+[1470] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1480] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1490] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1500] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1510] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1520] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1530] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1540] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1550] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1560] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1570] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[1580] 22 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC "....... ........
+[1590] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1600] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1610] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1620] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1630] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1640] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1650] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1660] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1670] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1680] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1690] CC CC 00 00 21 00 00 00 CC CC CC CC CC CC CC CC ....!... ........
+[16A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[16B0] CC CC CC CC CC CC CC CC ........
+
+
+ndr32:out => in: ptype[response] flen[4632] plen[4608] ahint[4608]
+
+[000] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[050] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0E0] CC CC CC CC CC CC 00 00 20 00 00 00 CC CC CC CC ........ .......
+[0F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[120] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[150] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[180] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[190] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1E0] CC CC CC CC CC CC CC CC CC CC CC CC 1F 00 00 00 ........ ........
+[1F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[200] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[210] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[220] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[230] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[240] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[250] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[260] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[270] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[280] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[290] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2E0] CC CC CC CC CC CC CC CC 1E 00 00 00 CC CC CC CC ........ ........
+[2F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[300] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[310] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[320] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[330] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[340] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[350] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[360] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[370] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[380] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[390] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3D0] CC CC CC CC CC CC CC CC CC CC CC CC 1D 00 00 00 ........ ........
+[3E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[400] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[410] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[420] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[430] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[440] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[450] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[460] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[470] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[480] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[490] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4C0] CC CC CC CC CC CC CC CC 1C 00 00 00 CC CC CC CC ........ ........
+[4D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[500] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[510] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[520] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[530] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[540] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[550] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[560] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[570] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[580] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[590] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5A0] CC CC CC CC CC CC CC CC CC CC CC CC 1B 00 00 00 ........ ........
+[5B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[600] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[610] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[620] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[630] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[640] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[650] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[660] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[670] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[680] CC CC CC CC CC CC CC CC 1A 00 00 00 CC CC CC CC ........ ........
+[690] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[700] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[710] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[720] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[730] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[740] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[750] CC CC CC CC CC CC CC CC CC CC CC CC 19 00 00 00 ........ ........
+[760] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[770] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[780] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[790] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[800] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[810] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[820] CC CC CC CC CC CC CC CC 18 00 00 00 CC CC CC CC ........ ........
+[830] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[840] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[850] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[860] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[870] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[880] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[890] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8E0] CC CC CC CC CC CC CC CC CC CC CC CC 17 00 00 00 ........ ........
+[8F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[900] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[910] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[920] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[930] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[940] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[950] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[960] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[970] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[980] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[990] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9A0] CC CC CC CC CC CC CC CC 16 00 00 00 CC CC CC CC ........ ........
+[9B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A50] CC CC CC CC CC CC CC CC CC CC CC CC 15 00 00 00 ........ ........
+[A60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B00] CC CC CC CC CC CC CC CC 14 00 00 00 CC CC CC CC ........ ........
+[B10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BA0] CC CC CC CC CC CC CC CC CC CC CC CC 13 00 00 00 ........ ........
+[BB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C40] CC CC CC CC CC CC CC CC 12 00 00 00 CC CC CC CC ........ ........
+[C50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CD0] CC CC CC CC CC CC CC CC CC CC CC CC 11 00 00 00 ........ ........
+[CE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D60] CC CC CC CC CC CC CC CC 10 00 00 00 CC CC CC CC ........ ........
+[D70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DE0] CC CC CC CC CC CC CC CC CC CC CC CC 0F 00 00 00 ........ ........
+[DF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E60] CC CC CC CC CC CC CC CC 0E 00 00 00 CC CC CC CC ........ ........
+[E70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[ED0] CC CC CC CC CC CC CC CC CC CC CC CC 0D 00 00 00 ........ ........
+[EE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F40] CC CC CC CC CC CC CC CC 0C 00 00 00 CC CC CC CC ........ ........
+[F50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FA0] CC CC CC CC CC CC CC CC CC CC CC CC 0B 00 00 00 ........ ........
+[FB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1000] CC CC CC CC CC CC CC CC 0A 00 00 00 CC CC CC CC ........ ........
+[1010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1050] CC CC CC CC CC CC CC CC CC CC CC CC 09 00 00 00 ........ ........
+[1060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10A0] CC CC CC CC CC CC CC CC 08 00 00 00 CC CC CC CC ........ ........
+[10B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10E0] CC CC CC CC CC CC CC CC CC CC CC CC 07 00 00 00 ........ ........
+[10F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1120] CC CC CC CC CC CC CC CC 06 00 00 00 CC CC CC CC ........ ........
+[1130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1150] CC CC CC CC CC CC CC CC CC CC CC CC 05 00 00 00 ........ ........
+[1160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1180] CC CC CC CC CC CC CC CC 04 00 00 00 CC CC CC CC ........ ........
+[1190] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11A0] CC CC CC CC CC CC CC CC CC CC CC CC 03 00 00 00 ........ ........
+[11B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11C0] CC CC CC CC CC CC CC CC 02 00 00 00 CC CC CC CC ........ ........
+[11D0] CC CC CC CC CC CC CC CC CC CC CC CC 01 00 00 00 ........ ........
+[11E0] CC CC CC CC CC CC CC CC 00 00 00 00 03 00 00 00 ........ ........
+[11F0] 00 00 02 00 03 00 00 00 BB BB BB 00 54 72 75 65 ........ ....True
+
+alloc1:outp: bsize[6664], bcount[1]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[27]
+push:outp: ecount[0]
+NDRTcpThread[ndr32] stop
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[3048] plen[3024] ahint[3024]
+
+[000] B8 0B 00 00 00 00 00 00 00 00 02 00 00 00 00 00 ........ ........
+[010] B8 0B 00 00 00 00 00 00 AA AA AA AA AA AA AA AA ........ ........
+[020] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[030] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[040] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[050] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[060] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[070] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[080] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[090] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[100] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[110] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[120] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[130] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[140] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[150] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[160] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[170] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[180] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[190] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[200] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[210] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[220] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[230] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[240] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[250] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[260] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[270] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[280] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[290] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[300] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[310] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[320] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[330] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[340] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[350] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[360] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[370] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[380] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[390] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[400] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[410] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[420] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[430] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[440] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[450] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[460] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[470] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[480] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[490] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[500] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[510] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[520] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[530] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[540] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[550] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[560] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[570] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[580] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[590] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[600] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[610] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[620] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[630] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[640] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[650] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[660] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[670] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[680] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[690] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[700] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[710] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[720] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[730] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[740] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[750] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[760] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[770] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[780] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[790] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[800] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[810] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[820] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[830] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[840] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[850] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[860] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[870] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[880] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[890] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[900] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[910] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[920] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[930] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[940] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[950] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[960] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[970] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[980] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[990] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AC0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AD0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AE0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AF0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BC0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64: got NDR64
+
+alloc1:inp: bsize[5000], bcount[0]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[35]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[34]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[33]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[32]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[31]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[30]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[29]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[28]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[27]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[26]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[25]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[24]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[23]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[22]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[21]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[20]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[19]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[18]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[17]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[16]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[15]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[14]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[13]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[12]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[11]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[10]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[9]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[8]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[7]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[6]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[5]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[4]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[3]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[2]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[1]
+alloc1:inp: bsize[5000], bcount[625]
+alloc2:inp: bsize[5000], bcount[625]
+pull1:inp: esize[78] ecount[78]
+pull2:inp: esize[78] ecount[0]
+
+ndr64: got NDR32 downgrade
+
+
+ndr64:in => out: ptype[alter_req] flen[72] call[3] contexts[1]
+
+
+ndr64:out => in: ptype[alter_ack] flen[56] call[3]
+
+ndr64:in => out: ptype[request] flen[5840] plen[5816] ahint[3012]
+
+[000] B8 0B 00 00 00 00 02 00 B8 0B 00 00 AA AA AA AA ........ ........
+[010] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[020] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[030] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[040] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[050] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[060] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[070] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[080] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[090] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[0F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[100] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[110] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[120] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[130] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[140] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[150] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[160] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[170] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[180] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[190] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[1F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[200] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[210] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[220] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[230] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[240] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[250] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[260] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[270] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[280] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[290] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[2F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[300] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[310] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[320] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[330] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[340] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[350] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[360] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[370] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[380] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[390] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[3F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[400] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[410] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[420] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[430] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[440] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[450] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[460] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[470] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[480] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[490] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[4F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[500] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[510] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[520] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[530] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[540] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[550] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[560] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[570] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[580] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[590] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[5F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[600] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[610] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[620] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[630] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[640] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[650] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[660] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[670] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[680] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[690] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[6F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[700] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[710] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[720] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[730] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[740] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[750] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[760] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[770] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[780] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[790] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[7F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[800] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[810] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[820] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[830] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[840] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[850] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[860] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[870] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[880] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[890] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[8F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[900] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[910] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[920] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[930] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[940] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[950] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[960] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[970] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[980] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[990] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9A0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9B0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9C0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9D0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9E0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[9F0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[A90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AC0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AD0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AE0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[AF0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B00] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B10] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B20] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B30] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B40] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B50] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B60] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B70] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B80] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[B90] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BA0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BB0] AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA ........ ........
+[BC0] AA AA AA AA 23 00 00 00 DD DD DD DD DD DD DD DD ....#... ........
+[BD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[BE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[BF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C00] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[C90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[CD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[CE0] 22 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD "....... ........
+[CF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D00] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[D90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[DF0] DD DD 00 00 21 00 00 00 DD DD DD DD DD DD DD DD ....!... ........
+[E00] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[E90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[ED0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[EF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[F00] 20 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ....... ........
+[F10] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F20] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F30] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F40] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F50] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F60] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F70] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F80] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[F90] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FA0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FB0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FC0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FD0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FE0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[FF0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1000] DD DD 00 00 1F 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[1010] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1020] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1030] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1040] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1050] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1060] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1070] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1080] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1090] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[10F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[1100] 1E 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1110] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1120] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1130] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1140] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1150] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1160] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1170] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1180] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1190] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[11F0] DD DD 00 00 1D 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[1200] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1210] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1220] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1230] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1240] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1250] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1260] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1270] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1280] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1290] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[12E0] 1C 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[12F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1300] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1310] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1320] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1330] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1340] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1350] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1360] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1370] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1380] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1390] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13C0] DD DD 00 00 1B 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[13D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[13F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1400] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1410] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1420] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1430] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1440] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1450] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1460] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1470] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1480] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1490] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[14A0] 1A 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[14F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1500] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1510] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1520] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1530] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1540] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1550] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1560] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1570] DD DD 00 00 19 00 00 00 DD DD DD DD DD DD DD DD ........ ........
+[1580] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1590] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[15F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1600] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1610] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1620] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1630] DD DD DD DD DD DD DD DD DD DD DD DD DD DD 00 00 ........ ........
+[1640] 18 00 00 00 DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1650] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1660] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1670] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1680] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1690] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[16A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[16B0] DD DD DD DD DD DD DD DD ........
+
+srv_midltests_fn: Start
+pull inp_len[344]
+ndr64:in => out: ptype[request] flen[2404] plen[2380] ahint[2380]
+
+[000] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[010] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[020] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[030] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[040] DD DD DD DD DD DD DD DD DD DD 00 00 17 00 00 00 ........ ........
+[050] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[060] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[070] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[080] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[090] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[0F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[100] DD DD DD DD DD DD AA AA 16 00 00 00 DD DD DD DD ........ ........
+[110] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[120] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[130] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[140] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[150] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[160] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[170] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[180] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[190] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1B0] DD DD DD DD DD DD DD DD DD DD AA AA 15 00 00 00 ........ ........
+[1C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[1F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[200] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[210] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[220] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[230] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[240] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[250] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[260] DD DD DD DD DD DD AA AA 14 00 00 00 DD DD DD DD ........ ........
+[270] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[280] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[290] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[2F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[300] DD DD DD DD DD DD DD DD DD DD AA AA 13 00 00 00 ........ ........
+[310] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[320] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[330] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[340] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[350] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[360] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[370] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[380] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[390] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3A0] DD DD DD DD DD DD AA AA 12 00 00 00 DD DD DD DD ........ ........
+[3B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[3F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[400] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[410] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[420] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[430] DD DD DD DD DD DD DD DD DD DD AA AA 11 00 00 00 ........ ........
+[440] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[450] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[460] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[470] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[480] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[490] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4C0] DD DD DD DD DD DD AA AA 10 00 00 00 DD DD DD DD ........ ........
+[4D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[4F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[500] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[510] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[520] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[530] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[540] DD DD DD DD DD DD DD DD DD DD AA AA 0F 00 00 00 ........ ........
+[550] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[560] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[570] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[580] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[590] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5C0] DD DD DD DD DD DD AA AA 0E 00 00 00 DD DD DD DD ........ ........
+[5D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[5F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[600] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[610] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[620] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[630] DD DD DD DD DD DD DD DD DD DD AA AA 0D 00 00 00 ........ ........
+[640] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[650] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[660] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[670] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[680] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[690] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6A0] DD DD DD DD DD DD AA AA 0C 00 00 00 DD DD DD DD ........ ........
+[6B0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[6F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[700] DD DD DD DD DD DD DD DD DD DD AA AA 0B 00 00 00 ........ ........
+[710] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[720] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[730] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[740] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[750] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[760] DD DD DD DD DD DD AA AA 0A 00 00 00 DD DD DD DD ........ ........
+[770] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[780] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[790] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7B0] DD DD DD DD DD DD DD DD DD DD AA AA 09 00 00 00 ........ ........
+[7C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7E0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[7F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[800] DD DD DD DD DD DD AA AA 08 00 00 00 DD DD DD DD ........ ........
+[810] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[820] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[830] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[840] DD DD DD DD DD DD DD DD DD DD AA AA 07 00 00 00 ........ ........
+[850] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[860] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[870] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[880] DD DD DD DD DD DD AA AA 06 00 00 00 DD DD DD DD ........ ........
+[890] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8A0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8B0] DD DD DD DD DD DD DD DD DD DD AA AA 05 00 00 00 ........ ........
+[8C0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8D0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[8E0] DD DD DD DD DD DD AA AA 04 00 00 00 DD DD DD DD ........ ........
+[8F0] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[900] DD DD DD DD DD DD DD DD DD DD AA AA 03 00 00 00 ........ ........
+[910] DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD ........ ........
+[920] DD DD DD DD DD DD AA AA 02 00 00 00 DD DD DD DD ........ ........
+[930] DD DD DD DD DD DD DD DD DD DD AA AA 01 00 00 00 ........ ........
+[940] DD DD DD DD DD DD AA AA 00 00 00 00 ........ ....
+
+pull inp_len[286]
+pull inp_len[0]
+push outb_len[50]
+push outb_len[49]
+push outb_len[48]
+push outb_len[47]
+push outb_len[46]
+push outb_len[45]
+push outb_len[44]
+push outb_len[43]
+push outb_len[42]
+push outb_len[41]
+push outb_len[40]
+push outb_len[39]
+push outb_len[38]
+push outb_len[37]
+push outb_len[36]
+push outb_len[35]
+push outb_len[34]
+push outb_len[33]
+push outb_len[32]
+push outb_len[31]
+push outb_len[30]
+push outb_len[29]
+push outb_len[28]
+push outb_len[27]
+push outb_len[26]
+push outb_len[25]
+push outb_len[24]
+push outb_len[23]
+push outb_len[22]
+push outb_len[21]
+push outb_len[20]
+push outb_len[19]
+push outb_len[18]
+push outb_len[17]
+push outb_len[16]
+push outb_len[15]
+push outb_len[14]
+push outb_len[13]
+push outb_len[12]
+push outb_len[11]
+push outb_len[10]
+push outb_len[9]
+push outb_len[8]
+push outb_len[7]
+push outb_len[6]
+push outb_len[5]
+push outb_len[4]
+push outb_len[3]
+push outb_len[2]
+push outb_len[1]
+push outb_len[0]
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[5840] plen[5816] ahint[5816]
+
+[000] 32 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC 2....... ........
+[010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[050] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[120] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[150] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[180] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[190] CC CC 00 00 31 00 00 00 CC CC CC CC CC CC CC CC ....1... ........
+[1A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[200] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[210] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[220] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[230] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[240] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[250] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[260] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[270] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[280] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[290] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[300] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[310] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[320] 30 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC 0....... ........
+[330] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[340] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[350] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[360] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[370] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[380] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[390] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[400] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[410] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[420] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[430] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[440] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[450] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[460] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[470] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[480] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[490] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4A0] CC CC 00 00 2F 00 00 00 CC CC CC CC CC CC CC CC ..../... ........
+[4B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[500] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[510] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[520] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[530] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[540] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[550] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[560] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[570] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[580] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[590] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[600] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[610] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[620] 2E 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[630] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[640] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[650] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[660] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[670] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[680] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[690] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[700] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[710] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[720] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[730] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[740] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[750] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[760] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[770] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[780] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[790] CC CC 00 00 2D 00 00 00 CC CC CC CC CC CC CC CC ....-... ........
+[7A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[800] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[810] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[820] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[830] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[840] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[850] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[860] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[870] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[880] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[890] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[900] 2C 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC ,....... ........
+[910] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[920] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[930] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[940] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[950] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[960] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[970] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[980] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[990] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A60] CC CC 00 00 2B 00 00 00 CC CC CC CC CC CC CC CC ....+... ........
+[A70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[BC0] 2A 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC *....... ........
+[BD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D10] CC CC 00 00 29 00 00 00 CC CC CC CC CC CC CC CC ....)... ........
+[D20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[E60] 28 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC (....... ........
+[E70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[ED0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FA0] CC CC 00 00 27 00 00 00 CC CC CC CC CC CC CC CC ....'... ........
+[FB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1000] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1050] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[10E0] 26 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC &....... ........
+[10F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1120] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1150] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1180] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1190] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1200] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1210] CC CC 00 00 25 00 00 00 CC CC CC CC CC CC CC CC ....%... ........
+[1220] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1230] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1240] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1250] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1260] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1270] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1280] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1290] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[12F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1300] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1310] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1320] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1330] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[1340] 24 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC $....... ........
+[1350] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1360] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1370] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1380] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1390] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[13F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1400] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1410] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1420] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1430] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1440] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1450] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1460] CC CC 00 00 23 00 00 00 CC CC CC CC CC CC CC CC ....#... ........
+[1470] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1480] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1490] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[14F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1500] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1510] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1520] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1530] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1540] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1550] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1560] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1570] CC CC CC CC CC CC CC CC CC CC CC CC CC CC 00 00 ........ ........
+[1580] 22 00 00 00 CC CC CC CC CC CC CC CC CC CC CC CC "....... ........
+[1590] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[15F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1600] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1610] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1620] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1630] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1640] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1650] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1660] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1670] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1680] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1690] CC CC 00 00 21 00 00 00 CC CC CC CC CC CC CC CC ....!... ........
+[16A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[16B0] CC CC CC CC CC CC CC CC ........
+
+
+ndr64:out => in: ptype[response] flen[4632] plen[4608] ahint[4608]
+
+[000] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[050] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[0E0] CC CC CC CC CC CC 00 00 20 00 00 00 CC CC CC CC ........ .......
+[0F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[120] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[150] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[180] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[190] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1E0] CC CC CC CC CC CC CC CC CC CC CC CC 1F 00 00 00 ........ ........
+[1F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[200] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[210] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[220] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[230] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[240] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[250] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[260] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[270] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[280] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[290] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[2E0] CC CC CC CC CC CC CC CC 1E 00 00 00 CC CC CC CC ........ ........
+[2F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[300] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[310] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[320] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[330] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[340] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[350] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[360] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[370] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[380] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[390] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3D0] CC CC CC CC CC CC CC CC CC CC CC CC 1D 00 00 00 ........ ........
+[3E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[3F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[400] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[410] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[420] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[430] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[440] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[450] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[460] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[470] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[480] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[490] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4C0] CC CC CC CC CC CC CC CC 1C 00 00 00 CC CC CC CC ........ ........
+[4D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[4F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[500] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[510] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[520] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[530] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[540] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[550] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[560] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[570] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[580] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[590] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5A0] CC CC CC CC CC CC CC CC CC CC CC CC 1B 00 00 00 ........ ........
+[5B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[5F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[600] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[610] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[620] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[630] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[640] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[650] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[660] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[670] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[680] CC CC CC CC CC CC CC CC 1A 00 00 00 CC CC CC CC ........ ........
+[690] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[6F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[700] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[710] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[720] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[730] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[740] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[750] CC CC CC CC CC CC CC CC CC CC CC CC 19 00 00 00 ........ ........
+[760] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[770] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[780] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[790] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[7F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[800] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[810] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[820] CC CC CC CC CC CC CC CC 18 00 00 00 CC CC CC CC ........ ........
+[830] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[840] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[850] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[860] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[870] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[880] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[890] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8A0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[8E0] CC CC CC CC CC CC CC CC CC CC CC CC 17 00 00 00 ........ ........
+[8F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[900] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[910] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[920] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[930] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[940] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[950] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[960] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[970] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[980] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[990] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9A0] CC CC CC CC CC CC CC CC 16 00 00 00 CC CC CC CC ........ ........
+[9B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9E0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[9F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A50] CC CC CC CC CC CC CC CC CC CC CC CC 15 00 00 00 ........ ........
+[A60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[A90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[AF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B00] CC CC CC CC CC CC CC CC 14 00 00 00 CC CC CC CC ........ ........
+[B10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[B90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BA0] CC CC CC CC CC CC CC CC CC CC CC CC 13 00 00 00 ........ ........
+[BB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[BF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C40] CC CC CC CC CC CC CC CC 12 00 00 00 CC CC CC CC ........ ........
+[C50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[C90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CD0] CC CC CC CC CC CC CC CC CC CC CC CC 11 00 00 00 ........ ........
+[CE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[CF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D60] CC CC CC CC CC CC CC CC 10 00 00 00 CC CC CC CC ........ ........
+[D70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[D90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[DE0] CC CC CC CC CC CC CC CC CC CC CC CC 0F 00 00 00 ........ ........
+[DF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E40] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E60] CC CC CC CC CC CC CC CC 0E 00 00 00 CC CC CC CC ........ ........
+[E70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[E90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EA0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[ED0] CC CC CC CC CC CC CC CC CC CC CC CC 0D 00 00 00 ........ ........
+[EE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[EF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F00] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F10] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F20] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F30] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F40] CC CC CC CC CC CC CC CC 0C 00 00 00 CC CC CC CC ........ ........
+[F50] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F60] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F70] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F80] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[F90] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FA0] CC CC CC CC CC CC CC CC CC CC CC CC 0B 00 00 00 ........ ........
+[FB0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FC0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FD0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FE0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[FF0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1000] CC CC CC CC CC CC CC CC 0A 00 00 00 CC CC CC CC ........ ........
+[1010] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1020] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1030] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1040] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1050] CC CC CC CC CC CC CC CC CC CC CC CC 09 00 00 00 ........ ........
+[1060] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1070] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1080] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1090] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10A0] CC CC CC CC CC CC CC CC 08 00 00 00 CC CC CC CC ........ ........
+[10B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10C0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10D0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[10E0] CC CC CC CC CC CC CC CC CC CC CC CC 07 00 00 00 ........ ........
+[10F0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1100] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1110] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1120] CC CC CC CC CC CC CC CC 06 00 00 00 CC CC CC CC ........ ........
+[1130] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1140] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1150] CC CC CC CC CC CC CC CC CC CC CC CC 05 00 00 00 ........ ........
+[1160] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1170] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[1180] CC CC CC CC CC CC CC CC 04 00 00 00 CC CC CC CC ........ ........
+[1190] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11A0] CC CC CC CC CC CC CC CC CC CC CC CC 03 00 00 00 ........ ........
+[11B0] CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC ........ ........
+[11C0] CC CC CC CC CC CC CC CC 02 00 00 00 CC CC CC CC ........ ........
+[11D0] CC CC CC CC CC CC CC CC CC CC CC CC 01 00 00 00 ........ ........
+[11E0] CC CC CC CC CC CC CC CC 00 00 00 00 03 00 00 00 ........ ........
+[11F0] 00 00 02 00 03 00 00 00 BB BB BB 00 54 72 75 65 ........ ....True
+
+alloc1:outp: bsize[6664], bcount[1]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[104]
+alloc1:outp: bsize[6664], bcount[833]
+alloc2:outp: bsize[6664], bcount[833]
+push:outp: ecount[27]
+push:outp: ecount[0]
+NDRTcpThread[ndr64] stop
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.idl b/testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.idl
new file mode 100644
index 0000000..73aeb16
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.idl
@@ -0,0 +1,64 @@
+#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 struct {
+ [range(1,10000)] long cb;
+ [size_is(cb)] char rcg[];
+ } DRS_EXTENSIONS;
+
+ long midltests_fn(
+ [out] DRS_EXTENSIONS **e
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ DRS_EXTENSIONS *e = NULL;
+ cli_midltests_fn(&e);
+}
+
+long srv_midltests_fn(DRS_EXTENSIONS **_e)
+{
+ DRS_EXTENSIONS *e;
+ printf("srv_midltests_fn: Start\n");
+ e = (DRS_EXTENSIONS *)malloc(sizeof(DRS_EXTENSIONS) + 0x34);
+ e->cb = 0x34;
+ memset(e->rcg, 0xcd, e->cb);
+ *_e = e;
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.out b/testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.out
new file mode 100644
index 0000000..e0b3a0e
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_DRS_EXTENSIONS.out
@@ -0,0 +1,43 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[24] plen[0] ahint[0]
+
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[92] plen[68] ahint[68]
+
+[000] 00 00 02 00 34 00 00 00 34 00 00 00 CD CD CD CD ....4... 4.......
+[010] CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
+[020] CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
+[030] CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
+[040] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[24] plen[0] ahint[0]
+
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[100] plen[76] ahint[76]
+
+[000] 00 00 02 00 00 00 00 00 34 00 00 00 00 00 00 00 ........ 4.......
+[010] 34 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD 4....... ........
+[020] CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
+[030] CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
+[040] CD CD CD CD CD CD CD CD 54 72 75 65 ........ True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl
new file mode 100644
index 0000000..170b147
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl
@@ -0,0 +1,29 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ long midltests_fn(
+ [in] long a[2]
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ long a[2] = { 1, 2 };
+ cli_midltests_fn(a);
+}
+
+long srv_midltests_fn(long a[2])
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt
new file mode 100644
index 0000000..8903c4c
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt
@@ -0,0 +1,6 @@
+[in] Buffer[8/24]
+[000] 01 00 00 00 02 00 00 00 ........
+srv_midltests_fn: Start
+srv_midltests_fn: End
+[out] Buffer[4]
+[000] 54 72 75 65 True
diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt b/testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt
new file mode 100644
index 0000000..dbbc89a
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt
@@ -0,0 +1,13 @@
+[in] Buffer[53/53]
+[000] 03 00 00 00 03 00 00 00 00 00 02 00 04 00 02 00 ........ ........
+[010] 00 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 ........ ........
+[020] 66 6F 6F 00 05 00 00 00 00 00 00 00 05 00 00 00 foo..... ........
+[030] 62 61 72 32 00 bar2.
+srv_midltests_fn: Start
+srv_midltests_fn: End
+[out] Buffer[60]
+[000] 03 00 00 00 03 00 00 00 00 00 02 00 04 00 02 00 ........ ........
+[010] 00 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 ........ ........
+[020] 66 6F 6F 00 05 00 00 00 00 00 00 00 05 00 00 00 foo..... ........
+[030] 62 61 72 32 00 00 00 00 54 72 75 65 bar2.... True
+Runtime error 0x6f7
diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_01.idl b/testprogs/win32/midltests/valid/midltests_strings_array_01.idl
new file mode 100644
index 0000000..db05bb2
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_strings_array_01.idl
@@ -0,0 +1,44 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ struct strings {
+ long count;
+ [size_is(count),string] char *val[];
+ };
+
+ long midltests_fn(
+ [in,out,ref] struct strings *s
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ const char *s1 = "foo";
+ const char *s2 = "bar";
+ char *a[] = { "foo", "bar2", NULL };
+ char buffer[1024];
+ struct strings *s = buffer;
+
+ s->count = 3;
+ s->val[0] = "foo";
+ s->val[1] = "bar2";
+ s->val[2] = NULL;
+
+ cli_midltests_fn(s);
+}
+
+long srv_midltests_fn(struct strings *a)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_02.idl b/testprogs/win32/midltests/valid/midltests_strings_array_02.idl
new file mode 100644
index 0000000..46154c9
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_strings_array_02.idl
@@ -0,0 +1,44 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ struct strings {
+ long count;
+ [size_is(count),string] char *val[];
+ };
+
+ long midltests_fn(
+ [in,ref] struct strings *s
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ const char *s1 = "foo";
+ const char *s2 = "bar";
+ char *a[] = { "foo", "bar2", NULL };
+ char buffer[1024];
+ struct strings *s = buffer;
+
+ s->count = 3;
+ s->val[0] = "foo";
+ s->val[1] = "bar2";
+ s->val[2] = NULL;
+
+ cli_midltests_fn(s);
+}
+
+long srv_midltests_fn(struct strings *a)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_02.txt b/testprogs/win32/midltests/valid/midltests_strings_array_02.txt
new file mode 100644
index 0000000..2bec6a0
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_strings_array_02.txt
@@ -0,0 +1,9 @@
+[in] Buffer[53/53]
+[000] 03 00 00 00 03 00 00 00 00 00 02 00 04 00 02 00 ........ ........
+[010] 00 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 ........ ........
+[020] 66 6F 6F 00 05 00 00 00 00 00 00 00 05 00 00 00 foo..... ........
+[030] 62 61 72 32 00 bar2.
+srv_midltests_fn: Start
+srv_midltests_fn: End
+[out] Buffer[4]
+[000] 54 72 75 65 True
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_01.idl b/testprogs/win32/midltests/valid/midltests_union_align_01.idl
new file mode 100644
index 0000000..fcea072
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_01.idl
@@ -0,0 +1,42 @@
+#ifndef MIDLTESTS_C_CODE
+
+[
+ uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+ pointer_default(unique)
+]
+interface midltests
+{
+ [switch_type(short)] union u {
+ [case(0)];
+ [case(2)] short s;
+ [case(4)] long l;
+ [case(8)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] short level,
+ [in,switch_is(level)] union u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(0, u);
+ cli_midltests_fn(2, u);
+ cli_midltests_fn(4, u);
+ cli_midltests_fn(8, u);
+}
+
+long srv_midltests_fn(short level, union u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_01.txt b/testprogs/win32/midltests/valid/midltests_union_align_01.txt
new file mode 100644
index 0000000..cc372c8
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_01.txt
@@ -0,0 +1,24 @@
+[in] Buffer[4/8]
+[000] 00 00 00 00 ....
+srv_midltests_fn: Start
+srv_midltests_fn: End
+[out] Buffer[4]
+[000] 54 72 75 65 True
+[in] Buffer[6/10]
+[000] 02 00 02 00 FF FF ......
+srv_midltests_fn: Start
+srv_midltests_fn: End
+[out] Buffer[4]
+[000] 54 72 75 65 True
+[in] Buffer[8/12]
+[000] 04 00 04 00 FF FF FF FF ........
+srv_midltests_fn: Start
+srv_midltests_fn: End
+[out] Buffer[4]
+[000] 54 72 75 65 True
+[in] Buffer[16/16]
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+srv_midltests_fn: Start
+srv_midltests_fn: End
+[out] Buffer[4]
+[000] 54 72 75 65 True
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 0000000..dc2d84d
--- /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
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_02.txt b/testprogs/win32/midltests/valid/midltests_union_align_02.txt
new file mode 100644
index 0000000..16186ea
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_02.txt
@@ -0,0 +1,37 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[27] plen[3] ahint[3]
+
+[000] 01 01 41 ..A
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[27] plen[3] ahint[3]
+
+[000] 01 01 41 ..A
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_03.idl b/testprogs/win32/midltests/valid/midltests_union_align_03.idl
new file mode 100644
index 0000000..699dd6c
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_03.idl
@@ -0,0 +1,64 @@
+#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(short)] union {
+ [case(1)] char c;
+ } u;
+ long midltests_fn(
+ [in] short l,
+ [in] char v,
+ [in,switch_is(l)] u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ short l;
+ char v;
+ u u;
+
+ l = 1;
+ v = 'V';
+ u.c = 'C';
+ cli_midltests_fn(l, v, u);
+}
+
+long srv_midltests_fn(short l, char v, u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_03.txt b/testprogs/win32/midltests/valid/midltests_union_align_03.txt
new file mode 100644
index 0000000..7078dd3
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_03.txt
@@ -0,0 +1,37 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[31] plen[7] ahint[7]
+
+[000] 01 00 56 00 01 00 43 ..V...C
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[31] plen[7] ahint[7]
+
+[000] 01 00 56 00 01 00 43 ..V...C
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_04.idl b/testprogs/win32/midltests/valid/midltests_union_align_04.idl
new file mode 100644
index 0000000..a7c6ad7
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_04.idl
@@ -0,0 +1,64 @@
+#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(long)] union {
+ [case(1)] char c;
+ } u;
+ long midltests_fn(
+ [in] long l,
+ [in] char v,
+ [in,switch_is(l)] u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ long l;
+ char v;
+ u u;
+
+ l = 1;
+ v = 'V';
+ u.c = 'C';
+ cli_midltests_fn(l, v, u);
+}
+
+long srv_midltests_fn(long l, char v, u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_04.txt b/testprogs/win32/midltests/valid/midltests_union_align_04.txt
new file mode 100644
index 0000000..d323860
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_04.txt
@@ -0,0 +1,37 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[37] plen[13] ahint[13]
+
+[000] 01 00 00 00 56 00 00 00 01 00 00 00 43 ....V... ....C
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[37] plen[13] ahint[13]
+
+[000] 01 00 00 00 56 00 00 00 01 00 00 00 43 ....V... ....C
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_05.idl b/testprogs/win32/midltests/valid/midltests_union_align_05.idl
new file mode 100644
index 0000000..da46bab
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_05.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)] short 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 = 'C';
+ cli_midltests_fn(l, u);
+}
+
+long srv_midltests_fn(hyper l, u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_05.txt b/testprogs/win32/midltests/valid/midltests_union_align_05.txt
new file mode 100644
index 0000000..1938b0a
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_05.txt
@@ -0,0 +1,37 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[28] plen[4] ahint[4]
+
+[000] 01 01 43 00 ..C.
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 43 00 ....C.
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_06.idl b/testprogs/win32/midltests/valid/midltests_union_align_06.idl
new file mode 100644
index 0000000..63fb310
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_06.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)] long 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 = 'C';
+ cli_midltests_fn(l, u);
+}
+
+long srv_midltests_fn(hyper l, u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_06.txt b/testprogs/win32/midltests/valid/midltests_union_align_06.txt
new file mode 100644
index 0000000..c864e51
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_06.txt
@@ -0,0 +1,37 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[32] plen[8] ahint[8]
+
+[000] 01 01 00 00 43 00 00 00 ....C...
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[36] plen[12] ahint[12]
+
+[000] 01 00 00 00 01 00 00 00 43 00 00 00 ........ C...
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_07.idl b/testprogs/win32/midltests/valid/midltests_union_align_07.idl
new file mode 100644
index 0000000..892460d
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_07.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)] hyper 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 = 'C';
+ cli_midltests_fn(l, u);
+}
+
+long srv_midltests_fn(hyper l, u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_07.txt b/testprogs/win32/midltests/valid/midltests_union_align_07.txt
new file mode 100644
index 0000000..88b44ec
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_07.txt
@@ -0,0 +1,38 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 01 01 00 00 00 00 00 00 43 00 00 00 00 00 00 00 ........ C.......
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[48] plen[24] ahint[24]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] 43 00 00 00 00 00 00 00 C.......
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_08.idl b/testprogs/win32/midltests/valid/midltests_union_align_08.idl
new file mode 100644
index 0000000..0cbdbfe
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_08.idl
@@ -0,0 +1,68 @@
+#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
+{
+ [switch_type(char)] union u {
+ [case(0)];
+ [case(1)] char c;
+ [case(2)] short s;
+ [case(4)] long l;
+ [case(8)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] char level,
+ [in,switch_is(level)] union u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(0, u);
+ cli_midltests_fn(1, u);
+ cli_midltests_fn(2, u);
+ cli_midltests_fn(4, u);
+ cli_midltests_fn(8, u);
+}
+
+long srv_midltests_fn(char level, union u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_08.txt b/testprogs/win32/midltests/valid/midltests_union_align_08.txt
new file mode 100644
index 0000000..1bf5cd9
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_08.txt
@@ -0,0 +1,129 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[26] plen[2] ahint[2]
+
+[000] 00 00 ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[27] plen[3] ahint[3]
+
+[000] 01 01 FF ...
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[28] plen[4] ahint[4]
+
+[000] 02 02 FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[32] plen[8] ahint[8]
+
+[000] 04 04 00 00 FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 08 08 00 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[44] plen[20] ahint[20]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[48] plen[24] ahint[24]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_09.idl b/testprogs/win32/midltests/valid/midltests_union_align_09.idl
new file mode 100644
index 0000000..358a598
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_09.idl
@@ -0,0 +1,69 @@
+#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"),
+ ms_union,
+ pointer_default(unique)
+]
+interface midltests
+{
+ [switch_type(char)] union u {
+ [case(0)];
+ [case(1)] char c;
+ [case(2)] short s;
+ [case(4)] long l;
+ [case(8)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] char level,
+ [in,switch_is(level)] union u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(0, u);
+ cli_midltests_fn(1, u);
+ cli_midltests_fn(2, u);
+ cli_midltests_fn(4, u);
+ cli_midltests_fn(8, u);
+}
+
+long srv_midltests_fn(char level, union u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_09.txt b/testprogs/win32/midltests/valid/midltests_union_align_09.txt
new file mode 100644
index 0000000..5e7e192
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_09.txt
@@ -0,0 +1,129 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[32] plen[8] ahint[8]
+
+[000] 00 00 00 00 00 00 00 00 ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 01 01 00 00 00 00 00 00 FF ........ .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 02 02 00 00 00 00 00 00 FF FF ........ ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[36] plen[12] ahint[12]
+
+[000] 04 04 00 00 00 00 00 00 FF FF FF FF ........ ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 08 08 00 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[44] plen[20] ahint[20]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[48] plen[24] ahint[24]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_10.idl b/testprogs/win32/midltests/valid/midltests_union_align_10.idl
new file mode 100644
index 0000000..6d66272
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_10.idl
@@ -0,0 +1,71 @@
+#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"),
+ ms_union,
+ pointer_default(unique)
+]
+interface midltests
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(long)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] enum level_enum level,
+ [in,switch_is(level)] union u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(ZERO, u);
+ cli_midltests_fn(ONE, u);
+ cli_midltests_fn(TWO, u);
+ cli_midltests_fn(FOUR, u);
+ cli_midltests_fn(EIGHT, u);
+}
+
+long srv_midltests_fn(char level, union u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_10.txt b/testprogs/win32/midltests/valid/midltests_union_align_10.txt
new file mode 100644
index 0000000..babae12
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_10.txt
@@ -0,0 +1,129 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[32] plen[8] ahint[8]
+
+[000] 00 00 00 00 00 00 00 00 ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 01 00 00 00 01 00 00 00 FF ........ .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 02 00 00 00 02 00 00 00 FF FF ........ ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[36] plen[12] ahint[12]
+
+[000] 04 00 00 00 04 00 00 00 FF FF FF FF ........ ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 08 00 00 00 08 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[44] plen[20] ahint[20]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[48] plen[24] ahint[24]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_11.idl b/testprogs/win32/midltests/valid/midltests_union_align_11.idl
new file mode 100644
index 0000000..1036abe
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_11.idl
@@ -0,0 +1,70 @@
+#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
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(long)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] enum level_enum level,
+ [in,switch_is(level)] union u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(ZERO, u);
+ cli_midltests_fn(ONE, u);
+ cli_midltests_fn(TWO, u);
+ cli_midltests_fn(FOUR, u);
+ cli_midltests_fn(EIGHT, u);
+}
+
+long srv_midltests_fn(char level, union u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_11.txt b/testprogs/win32/midltests/valid/midltests_union_align_11.txt
new file mode 100644
index 0000000..babae12
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_11.txt
@@ -0,0 +1,129 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[32] plen[8] ahint[8]
+
+[000] 00 00 00 00 00 00 00 00 ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 01 00 00 00 01 00 00 00 FF ........ .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 02 00 00 00 02 00 00 00 FF FF ........ ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[36] plen[12] ahint[12]
+
+[000] 04 00 00 00 04 00 00 00 FF FF FF FF ........ ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 08 00 00 00 08 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[44] plen[20] ahint[20]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[48] plen[24] ahint[24]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_12.idl b/testprogs/win32/midltests/valid/midltests_union_align_12.idl
new file mode 100644
index 0000000..6b27cb9
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_12.idl
@@ -0,0 +1,70 @@
+#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
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] enum level_enum level,
+ [in,switch_is(level)] union u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(ZERO, u);
+ cli_midltests_fn(ONE, u);
+ cli_midltests_fn(TWO, u);
+ cli_midltests_fn(FOUR, u);
+ cli_midltests_fn(EIGHT, u);
+}
+
+long srv_midltests_fn(char level, union u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_12.txt b/testprogs/win32/midltests/valid/midltests_union_align_12.txt
new file mode 100644
index 0000000..1a32739
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_12.txt
@@ -0,0 +1,129 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[28] plen[4] ahint[4]
+
+[000] 00 00 00 00 ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[29] plen[5] ahint[5]
+
+[000] 01 00 01 00 FF .....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[30] plen[6] ahint[6]
+
+[000] 02 00 02 00 FF FF ......
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[32] plen[8] ahint[8]
+
+[000] 04 00 04 00 FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[44] plen[20] ahint[20]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[48] plen[24] ahint[24]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_13.idl b/testprogs/win32/midltests/valid/midltests_union_align_13.idl
new file mode 100644
index 0000000..a29dcb9
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_13.idl
@@ -0,0 +1,71 @@
+#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"),
+ ms_union,
+ pointer_default(unique)
+]
+interface midltests
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] enum level_enum level,
+ [in,switch_is(level)] union u u
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(ZERO, u);
+ cli_midltests_fn(ONE, u);
+ cli_midltests_fn(TWO, u);
+ cli_midltests_fn(FOUR, u);
+ cli_midltests_fn(EIGHT, u);
+}
+
+long srv_midltests_fn(char level, union u u)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_13.txt b/testprogs/win32/midltests/valid/midltests_union_align_13.txt
new file mode 100644
index 0000000..8f0563b
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_13.txt
@@ -0,0 +1,129 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[32] plen[8] ahint[8]
+
+[000] 00 00 00 00 00 00 00 00 ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 01 00 01 00 00 00 00 00 FF ........ .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 02 00 02 00 00 00 00 00 FF FF ........ ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[36] plen[12] ahint[12]
+
+[000] 04 00 04 00 00 00 00 00 FF FF FF FF ........ ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[40] plen[16] ahint[16]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF .
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF ..
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[44] plen[20] ahint[20]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[48] plen[24] ahint[24]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF ........
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_14.idl b/testprogs/win32/midltests/valid/midltests_union_align_14.idl
new file mode 100644
index 0000000..c029f5a
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_14.idl
@@ -0,0 +1,71 @@
+#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
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] enum level_enum level,
+ [in,switch_is(level)] union u u,
+ [in] char c
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(ZERO, u, 'c');
+ cli_midltests_fn(ONE, u, 'c');
+ cli_midltests_fn(TWO, u, 'c');
+ cli_midltests_fn(FOUR, u, 'c');
+ cli_midltests_fn(EIGHT, u, 'c');
+}
+
+long srv_midltests_fn(char level, union u u, char c)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_14.txt b/testprogs/win32/midltests/valid/midltests_union_align_14.txt
new file mode 100644
index 0000000..9713788
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_14.txt
@@ -0,0 +1,131 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[29] plen[5] ahint[5]
+
+[000] 00 00 00 00 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 FF 63 .....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[31] plen[7] ahint[7]
+
+[000] 02 00 02 00 FF FF 63 ......c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 04 00 04 00 FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_15.idl b/testprogs/win32/midltests/valid/midltests_union_align_15.idl
new file mode 100644
index 0000000..c8037b8
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_15.idl
@@ -0,0 +1,72 @@
+#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"),
+ ms_union,
+ pointer_default(unique)
+]
+interface midltests
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ long midltests_fn(
+ [in] enum level_enum level,
+ [in,switch_is(level)] union u u,
+ [in] char c
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ cli_midltests_fn(ZERO, u, 'c');
+ cli_midltests_fn(ONE, u, 'c');
+ cli_midltests_fn(TWO, u, 'c');
+ cli_midltests_fn(FOUR, u, 'c');
+ cli_midltests_fn(EIGHT, u, 'c');
+}
+
+long srv_midltests_fn(char level, union u u, char c)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_15.txt b/testprogs/win32/midltests/valid/midltests_union_align_15.txt
new file mode 100644
index 0000000..4754930
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_15.txt
@@ -0,0 +1,131 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 00 00 00 00 00 00 00 00 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 01 00 01 00 00 00 00 00 FF 63 ........ .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[35] plen[11] ahint[11]
+
+[000] 02 00 02 00 00 00 00 00 FF FF 63 ........ ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[37] plen[13] ahint[13]
+
+[000] 04 00 04 00 00 00 00 00 FF FF FF FF 63 ........ ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr32:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+ndr64:in => out: ptype[request] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_16.idl b/testprogs/win32/midltests/valid/midltests_union_align_16.idl
new file mode 100644
index 0000000..683a79a
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_16.idl
@@ -0,0 +1,93 @@
+#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
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ struct us {
+ enum level_enum level;
+ [switch_is(level)] union {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ } u;
+ };
+
+ void midltests_fn(
+ [in,ref] enum level_enum *level,
+ [in,switch_is(*level)] union u u,
+ [out,ref] struct us *us,
+ [in,out,ref] char *c
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ enum level_enum level;
+ unsigned char c = 'c';
+ struct us us;
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ level = ZERO;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = ONE;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = TWO;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = FOUR;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = EIGHT;
+ cli_midltests_fn(&level, u, &us, &c);
+}
+
+void srv_midltests_fn(enum level_enum *level, union u u, struct us *us, unsigned char *c)
+{
+ printf("srv_midltests_fn: Start\n");
+ us->level = *level;
+ us->u.h = u.h;
+ printf("srv_midltests_fn: End\n");
+ return;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_16.txt b/testprogs/win32/midltests/valid/midltests_union_align_16.txt
new file mode 100644
index 0000000..5366c14
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_16.txt
@@ -0,0 +1,137 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[29] plen[5] ahint[5]
+
+[000] 00 00 00 00 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[29] plen[5] ahint[5]
+
+[000] 00 00 00 00 63 ....c
+
+ndr32:in => out: ptype[request] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 FF 63 .....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 FF 63 .....c
+
+ndr32:in => out: ptype[request] flen[31] plen[7] ahint[7]
+
+[000] 02 00 02 00 FF FF 63 ......c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[31] plen[7] ahint[7]
+
+[000] 02 00 02 00 FF FF 63 ......c
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 04 00 04 00 FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[33] plen[9] ahint[9]
+
+[000] 04 00 04 00 FF FF FF FF 63 ........ c
+
+ndr32:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 00 00 00 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 00 00 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_17.idl b/testprogs/win32/midltests/valid/midltests_union_align_17.idl
new file mode 100644
index 0000000..f151452
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_17.idl
@@ -0,0 +1,94 @@
+#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"),
+ ms_union,
+ pointer_default(unique)
+]
+interface midltests
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ struct us {
+ enum level_enum level;
+ [switch_is(level)] union {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ } u;
+ };
+
+ void midltests_fn(
+ [in,ref] enum level_enum *level,
+ [in,switch_is(*level)] union u u,
+ [out,ref] struct us *us,
+ [in,out,ref] char *c
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ enum level_enum level;
+ char c = 'c';
+ struct us us;
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ level = ZERO;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = ONE;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = TWO;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = FOUR;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = EIGHT;
+ cli_midltests_fn(&level, u, &us, &c);
+}
+
+void srv_midltests_fn(enum level_enum *level, union u u, struct us *us, char *c)
+{
+ printf("srv_midltests_fn: Start\n");
+ us->level = *level;
+ us->u.h = u.h;
+ printf("srv_midltests_fn: End\n");
+ return;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_17.txt b/testprogs/win32/midltests/valid/midltests_union_align_17.txt
new file mode 100644
index 0000000..7b62241
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_17.txt
@@ -0,0 +1,137 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 00 00 00 00 00 00 00 00 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[33] plen[9] ahint[9]
+
+[000] 00 00 00 00 00 00 00 00 63 ........ c
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 01 00 01 00 00 00 00 00 FF 63 ........ .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[34] plen[10] ahint[10]
+
+[000] 01 00 01 00 00 00 00 00 FF 63 ........ .c
+
+ndr32:in => out: ptype[request] flen[35] plen[11] ahint[11]
+
+[000] 02 00 02 00 00 00 00 00 FF FF 63 ........ ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[35] plen[11] ahint[11]
+
+[000] 02 00 02 00 00 00 00 00 FF FF 63 ........ ..c
+
+ndr32:in => out: ptype[request] flen[37] plen[13] ahint[13]
+
+[000] 04 00 04 00 00 00 00 00 FF FF FF FF 63 ........ ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[37] plen[13] ahint[13]
+
+[000] 04 00 04 00 00 00 00 00 FF FF FF FF 63 ........ ....c
+
+ndr32:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 00 00 00 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 00 00 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_18.idl b/testprogs/win32/midltests/valid/midltests_union_align_18.idl
new file mode 100644
index 0000000..542973b
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_18.idl
@@ -0,0 +1,93 @@
+#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
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum),ms_union] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ struct us {
+ enum level_enum level;
+ [switch_is(level)] union {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ } u;
+ };
+
+ void midltests_fn(
+ [in,ref] enum level_enum *level,
+ [in,switch_is(*level)] union u u,
+ [out,ref] struct us *us,
+ [in,out,ref] char *c
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ enum level_enum level;
+ char c = 'c';
+ struct us us;
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ level = ZERO;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = ONE;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = TWO;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = FOUR;
+ cli_midltests_fn(&level, u, &us, &c);
+ level = EIGHT;
+ cli_midltests_fn(&level, u, &us, &c);
+}
+
+void srv_midltests_fn(enum level_enum *level, union u u, struct us *us, char *c)
+{
+ printf("srv_midltests_fn: Start\n");
+ us->level = *level;
+ us->u.h = u.h;
+ printf("srv_midltests_fn: End\n");
+ return;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_18.txt b/testprogs/win32/midltests/valid/midltests_union_align_18.txt
new file mode 100644
index 0000000..5693dd3
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_18.txt
@@ -0,0 +1,137 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 00 00 00 00 00 00 00 00 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[29] plen[5] ahint[5]
+
+[000] 00 00 00 00 63 ....c
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 01 00 01 00 00 00 00 00 FF 63 ........ .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 FF 63 .....c
+
+ndr32:in => out: ptype[request] flen[35] plen[11] ahint[11]
+
+[000] 02 00 02 00 00 00 00 00 FF FF 63 ........ ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[31] plen[7] ahint[7]
+
+[000] 02 00 02 00 FF FF 63 ......c
+
+ndr32:in => out: ptype[request] flen[37] plen[13] ahint[13]
+
+[000] 04 00 04 00 00 00 00 00 FF FF FF FF 63 ........ ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[33] plen[9] ahint[9]
+
+[000] 04 00 04 00 FF FF FF FF 63 ........ c
+
+ndr32:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 00 00 00 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 00 00 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 00 00 00 00 63 ........ c
+
+ndr64:in => out: ptype[request] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_19.idl b/testprogs/win32/midltests/valid/midltests_union_align_19.idl
new file mode 100644
index 0000000..b8ff0d6
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_19.idl
@@ -0,0 +1,90 @@
+#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
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ union ue switch(enum level_enum level) u {
+ case(ZERO):;
+ case(ONE): char c;
+ case(TWO): short s;
+ case(FOUR): long l;
+ case(EIGHT): hyper h;
+ };
+
+ void midltests_fn(
+ [in,out,ref] enum level_enum *level,
+ [in,switch_is(*level)] union u u,
+ [out,ref] union ue *ue,
+ [in,out,ref] char *c
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ enum level_enum level;
+ unsigned char c = 'c';
+ struct ue ue;
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ level = ZERO;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = ONE;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = TWO;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = FOUR;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = EIGHT;
+ cli_midltests_fn(&level, u, &ue, &c);
+}
+
+void srv_midltests_fn(enum level_enum *level, union u u, struct ue *ue, unsigned char *c)
+{
+ printf("srv_midltests_fn: Start\n");
+ ue->level = *level;
+ ue->u.h = u.h;
+ printf("srv_midltests_fn: End\n");
+ return;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_19.txt b/testprogs/win32/midltests/valid/midltests_union_align_19.txt
new file mode 100644
index 0000000..804f0ed
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_19.txt
@@ -0,0 +1,137 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[29] plen[5] ahint[5]
+
+[000] 00 00 00 00 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[29] plen[5] ahint[5]
+
+[000] 00 00 00 00 63 ....c
+
+ndr32:in => out: ptype[request] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 FF 63 .....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 FF 63 .....c
+
+ndr32:in => out: ptype[request] flen[31] plen[7] ahint[7]
+
+[000] 02 00 02 00 FF FF 63 ......c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[31] plen[7] ahint[7]
+
+[000] 02 00 02 00 FF FF 63 ......c
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 04 00 04 00 FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[33] plen[9] ahint[9]
+
+[000] 04 00 04 00 FF FF FF FF 63 ........ c
+
+ndr32:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+ndr64:in => out: ptype[request] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+ndr64:in => out: ptype[request] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_20.idl b/testprogs/win32/midltests/valid/midltests_union_align_20.idl
new file mode 100644
index 0000000..fe8bb72
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_20.idl
@@ -0,0 +1,91 @@
+#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"),
+ ms_union,
+ pointer_default(unique)
+]
+interface midltests
+{
+ enum level_enum { ZERO = 0, ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 };
+
+ [switch_type(enum level_enum)] union u {
+ [case(ZERO)];
+ [case(ONE)] char c;
+ [case(TWO)] short s;
+ [case(FOUR)] long l;
+ [case(EIGHT)] hyper h;
+ };
+
+ union ue switch(enum level_enum level) u {
+ case(ZERO):;
+ case(ONE): char c;
+ case(TWO): short s;
+ case(FOUR): long l;
+ case(EIGHT): hyper h;
+ };
+
+ void midltests_fn(
+ [in,out,ref] enum level_enum *level,
+ [in,switch_is(*level)] union u u,
+ [out,ref] union ue *ue,
+ [in,out,ref] char *c
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ enum level_enum level;
+ unsigned char c = 'c';
+ struct ue ue;
+ union u u;
+ u.h = 0xFFFFFFFFFFFFFFFFLL;
+
+ level = ZERO;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = ONE;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = TWO;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = FOUR;
+ cli_midltests_fn(&level, u, &ue, &c);
+ level = EIGHT;
+ cli_midltests_fn(&level, u, &ue, &c);
+}
+
+void srv_midltests_fn(enum level_enum *level, union u u, struct ue *ue, unsigned char *c)
+{
+ printf("srv_midltests_fn: Start\n");
+ ue->level = *level;
+ ue->u.h = u.h;
+ printf("srv_midltests_fn: End\n");
+ return;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_union_align_20.txt b/testprogs/win32/midltests/valid/midltests_union_align_20.txt
new file mode 100644
index 0000000..84d62aa
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_union_align_20.txt
@@ -0,0 +1,137 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[33] plen[9] ahint[9]
+
+[000] 00 00 00 00 00 00 00 00 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[29] plen[5] ahint[5]
+
+[000] 00 00 00 00 63 ....c
+
+ndr32:in => out: ptype[request] flen[34] plen[10] ahint[10]
+
+[000] 01 00 01 00 00 00 00 00 FF 63 ........ .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[30] plen[6] ahint[6]
+
+[000] 01 00 01 00 FF 63 .....c
+
+ndr32:in => out: ptype[request] flen[35] plen[11] ahint[11]
+
+[000] 02 00 02 00 00 00 00 00 FF FF 63 ........ ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[31] plen[7] ahint[7]
+
+[000] 02 00 02 00 FF FF 63 ......c
+
+ndr32:in => out: ptype[request] flen[37] plen[13] ahint[13]
+
+[000] 04 00 04 00 00 00 00 00 FF FF FF FF 63 ........ ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[33] plen[9] ahint[9]
+
+[000] 04 00 04 00 FF FF FF FF 63 ........ c
+
+ndr32:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........
+[010] 63 c
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[41] plen[17] ahint[17]
+
+[000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
+[010] 63 c
+
+ndr64:in => out: ptype[request] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[42] plen[18] ahint[18]
+
+[000] 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ........ ........
+[010] FF 63 .c
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[43] plen[19] ahint[19]
+
+[000] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ........ ........
+[010] FF FF 63 ..c
+
+ndr64:in => out: ptype[request] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[45] plen[21] ahint[21]
+
+[000] 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF 63 ....c
+
+ndr64:in => out: ptype[request] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[49] plen[25] ahint[25]
+
+[000] 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 ........ ........
+[010] FF FF FF FF FF FF FF FF 63 ........ c
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/midltests/valid/midltests_v1_enum_01.idl b/testprogs/win32/midltests/valid/midltests_v1_enum_01.idl
new file mode 100644
index 0000000..18a5ceb
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_v1_enum_01.idl
@@ -0,0 +1,56 @@
+#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 [v1_enum] enum {
+ value1 = -1
+ } midltests_enum;
+
+ long midltests_fn(
+ midltests_enum v
+ );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+ cli_midltests_fn(value1);
+}
+
+long srv_midltests_fn(enum midltests_enum v)
+{
+ printf("srv_midltests_fn: Start\n");
+ printf("srv_midltests_fn: End\n");
+ return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_v1_enum_01.txt b/testprogs/win32/midltests/valid/midltests_v1_enum_01.txt
new file mode 100644
index 0000000..d4d018c
--- /dev/null
+++ b/testprogs/win32/midltests/valid/midltests_v1_enum_01.txt
@@ -0,0 +1,37 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[28] plen[4] ahint[4]
+
+[000] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[28] plen[4] ahint[4]
+
+[000] FF FF FF FF ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65 True
+
+NDRTcpThread[ndr64] stop
+
+Test OK
diff --git a/testprogs/win32/npecho/GNUmakefile b/testprogs/win32/npecho/GNUmakefile
new file mode 100755
index 0000000..5b4f976
--- /dev/null
+++ b/testprogs/win32/npecho/GNUmakefile
@@ -0,0 +1,24 @@
+INCLUDES=-I.
+CFLAGS=$(INCLUDES)
+
+NPECHO = npecho_client.exe
+#npecho_server.exe
+
+NPECHO2 = npecho_client2.exe npecho_server2.exe
+
+all: $(NPECHO) $(NPECHO2)
+
+MINGW_CC = i586-mingw32msvc-cc
+CC = $(MINGW_CC)
+
+.SUFFIXES: .c .obj .exe
+
+.c.obj:
+ $(CC) $(CFLAGS) -c $< -o $@
+
+.obj.exe:
+ $(CC) $(CFLAGS) -o $@ $< $(LIBS)
+
+clean:
+ rm -f *~ *.obj *.exe
+
diff --git a/testprogs/win32/npecho/NMakefile b/testprogs/win32/npecho/NMakefile
new file mode 100755
index 0000000..a0e61d7
--- /dev/null
+++ b/testprogs/win32/npecho/NMakefile
@@ -0,0 +1,26 @@
+#
+# use nmake /f NMakefile [<target>]
+#
+INCLUDES=-I
+CFLAGS=$(INCLUDES) -Zi -nologo
+
+NPECHO = npecho_client.exe
+# missing npecho_server.exe
+NPECHO2 = npecho_client2.exe npecho_server2.exe
+
+all: $(NPECHO) $(NPECHO2)
+
+clean:
+ del *~ *.obj *.exe
+
+npecho_client.exe: npecho_client.obj
+ $(CC) $(CFLAGS) -o npecho_client.exe npecho_client.obj $(LIBS)
+
+npecho_server.exe: npecho_server.obj
+ $(CC) $(CFLAGS) -o npecho_server.exe npecho_server.obj $(LIBS)
+
+npecho_client2.exe: npecho_client2.obj
+ $(CC) $(CFLAGS) -o npecho_client2.exe npecho_client2.obj $(LIBS)
+
+npecho_server2.exe: npecho_server2.obj
+ $(CC) $(CFLAGS) -o npecho_server2.exe npecho_server2.obj $(LIBS)
diff --git a/testprogs/win32/npecho/npecho_client.c b/testprogs/win32/npecho/npecho_client.c
new file mode 100755
index 0000000..97d31c4
--- /dev/null
+++ b/testprogs/win32/npecho/npecho_client.c
@@ -0,0 +1,50 @@
+/*
+ * Simple Named Pipe Client
+ * (C) 2005 Jelmer Vernooij <jelmer@samba.org>
+ * Published to the public domain
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+#define ECHODATA "Black Dog"
+
+int main(int argc, char *argv[])
+{
+ HANDLE h;
+ DWORD numread = 0;
+ char *outbuffer = malloc(strlen(ECHODATA));
+
+ if (argc == 1) {
+ printf("Usage: %s pipename\n", argv[0]);
+ printf(" Where pipename is something like \\\\servername\\NPECHO\n");
+ return -1;
+ }
+
+ h = CreateFile(argv[1], GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ printf("Error opening: %d\n", GetLastError());
+ return -1;
+ }
+
+ if (!WriteFile(h, ECHODATA, strlen(ECHODATA), &numread, NULL)) {
+ printf("Error writing: %d\n", GetLastError());
+ return -1;
+ }
+
+ if (!ReadFile(h, outbuffer, strlen(ECHODATA), &numread, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+
+ printf("Read: %s\n", outbuffer);
+
+ if (!TransactNamedPipe(h, ECHODATA, strlen(ECHODATA), outbuffer, strlen(ECHODATA), &numread, NULL)) {
+ printf("TransactNamedPipe failed: %d!\n", GetLastError());
+ return -1;
+ }
+
+ printf("Result: %s\n", outbuffer);
+
+ return 0;
+}
diff --git a/testprogs/win32/npecho/npecho_client2.c b/testprogs/win32/npecho/npecho_client2.c
new file mode 100755
index 0000000..ebf4f9a
--- /dev/null
+++ b/testprogs/win32/npecho/npecho_client2.c
@@ -0,0 +1,117 @@
+/*
+ * Simple Named Pipe Client
+ * (C) 2005 Jelmer Vernooij <jelmer@samba.org>
+ * (C) 2009 Stefan Metzmacher <metze@samba.org>
+ * Published to the public domain
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+#define ECHODATA "Black Dog"
+
+int main(int argc, char *argv[])
+{
+ HANDLE h;
+ DWORD numread = 0;
+ char *outbuffer = malloc(sizeof(ECHODATA)*2);
+ BOOL small_reads = FALSE;
+ DWORD state = 0;
+ DWORD flags = 0;
+
+ if (argc == 1) {
+ goto usage;
+ } else if (argc >= 3) {
+ if (strcmp(argv[2], "large") == 0) {
+ small_reads = FALSE;
+ } else if (strcmp(argv[2], "small") == 0) {
+ small_reads = TRUE;
+ } else {
+ goto usage;
+ }
+ }
+
+ h = CreateFile(argv[1], GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ printf("Error opening: %d\n", GetLastError());
+ return -1;
+ }
+
+ GetNamedPipeHandleState(h, &state, NULL, NULL, NULL, NULL, 0);
+
+ if (state & PIPE_READMODE_MESSAGE) {
+ printf("message read mode\n");
+ } else {
+ printf("byte read mode\n");
+ }
+
+ Sleep(5000);
+
+ if (small_reads) {
+ DWORD ofs, size, nread;
+ const char *more = "";
+ printf("small reads\n");
+ numread = 0;
+ ofs = 0;
+ size = sizeof(ECHODATA)/2;
+ if (ReadFile(h, outbuffer+ofs, size, &nread, NULL)) {
+ if (state & PIPE_READMODE_MESSAGE) {
+ printf("Error message mode small read succeeded\n");
+ return -1;
+ }
+ } else if (GetLastError() == ERROR_MORE_DATA) {
+ if (!(state & PIPE_READMODE_MESSAGE)) {
+ printf("Error byte mode small read returned ERROR_MORE_DATA\n");
+ return -1;
+ }
+ more = " more data";
+ } else {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+ printf("Small Read: %d%s\n", nread, more);
+ numread += nread;
+ ofs = size;
+ size = sizeof(ECHODATA) - ofs;
+ if (!ReadFile(h, outbuffer+ofs, size, &nread, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+ printf("Small Read: %d\n", nread);
+ numread += nread;
+ } else {
+ printf("large read\n");
+ if (!ReadFile(h, outbuffer, sizeof(ECHODATA)*2, &numread, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+ }
+ printf("Read: %s %d\n", outbuffer, numread);
+ if (state & PIPE_READMODE_MESSAGE) {
+ if (numread != sizeof(ECHODATA)) {
+ printf("message mode returned %d bytes should be %s\n",
+ numread, sizeof(ECHODATA));
+ return -1;
+ }
+ } else {
+ if (numread != (sizeof(ECHODATA)*2)) {
+ printf("message mode returned %d bytes should be %s\n",
+ numread, (sizeof(ECHODATA)*2));
+ return -1;
+ }
+ }
+
+ if (!ReadFile(h, outbuffer, sizeof(ECHODATA)*2, &numread, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+
+ printf("Read: %s %d\n", outbuffer, numread);
+
+ return 0;
+usage:
+ printf("Usage: %s pipename [read]\n", argv[0]);
+ printf(" Where pipename is something like \\\\servername\\NPECHO\n");
+ printf(" Where read is something 'large' or 'small'\n");
+ return -1;
+}
diff --git a/testprogs/win32/npecho/npecho_server2.c b/testprogs/win32/npecho/npecho_server2.c
new file mode 100755
index 0000000..281fc45
--- /dev/null
+++ b/testprogs/win32/npecho/npecho_server2.c
@@ -0,0 +1,76 @@
+/*
+ * Simple Named Pipe Client
+ * (C) 2005 Jelmer Vernooij <jelmer@samba.org>
+ * (C) 2009 Stefan Metzmacher <metze@samba.org>
+ * Published to the public domain
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+#define ECHODATA "Black Dog"
+
+int main(int argc, char *argv[])
+{
+ HANDLE h;
+ DWORD numread = 0;
+ char *outbuffer = malloc(sizeof(ECHODATA));
+ BOOL msgmode = FALSE;
+ DWORD type = 0;
+
+ if (argc == 1) {
+ goto usage;
+ } else if (argc >= 3) {
+ if (strcmp(argv[2], "byte") == 0) {
+ msgmode = FALSE;
+ } else if (strcmp(argv[2], "message") == 0) {
+ msgmode = TRUE;
+ } else {
+ goto usage;
+ }
+ }
+
+ if (msgmode == TRUE) {
+ printf("using message mode\n");
+ type = PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT;
+ } else {
+ printf("using byte mode\n");
+ type = PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT;
+ }
+
+ h = CreateNamedPipe(argv[1],
+ PIPE_ACCESS_DUPLEX,
+ type,
+ PIPE_UNLIMITED_INSTANCES,
+ 1024,
+ 1024,
+ 0,
+ NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ printf("Error opening: %d\n", GetLastError());
+ return -1;
+ }
+
+ ConnectNamedPipe(h, NULL);
+
+ if (!WriteFile(h, ECHODATA, sizeof(ECHODATA), &numread, NULL)) {
+ printf("Error writing: %d\n", GetLastError());
+ return -1;
+ }
+
+ if (!WriteFile(h, ECHODATA, sizeof(ECHODATA), &numread, NULL)) {
+ printf("Error writing: %d\n", GetLastError());
+ return -1;
+ }
+
+ FlushFileBuffers(h);
+ DisconnectNamedPipe(h);
+ CloseHandle(h);
+
+ return 0;
+usage:
+ printf("Usage: %s pipename [mode]\n", argv[0]);
+ printf(" Where pipename is something like \\\\servername\\PIPE\\NPECHO\n");
+ printf(" Where mode is 'byte' or 'message'\n");
+ return -1;
+}
diff --git a/testprogs/win32/prepare_dcpromo/GNUmakefile b/testprogs/win32/prepare_dcpromo/GNUmakefile
new file mode 100755
index 0000000..1c95613
--- /dev/null
+++ b/testprogs/win32/prepare_dcpromo/GNUmakefile
@@ -0,0 +1,21 @@
+INCLUDES=-I.
+CFLAGS=$(INCLUDES)
+LIBS=-ladvapi32
+
+PREPARE_DCPROMO = prepare_dcpromo.exe
+
+all: $(PREPARE_DCPROMO)
+
+MINGW_CC = i586-mingw32msvc-cc
+CC = $(MINGW_CC)
+
+.SUFFIXES: .c .obj .exe
+
+.c.obj:
+ $(CC) $(CFLAGS) -c $< -o $@
+
+.obj.exe:
+ $(CC) $(CFLAGS) -o $@ $< $(LIBS)
+
+clean:
+ rm -f *~ *.obj *.exe
diff --git a/testprogs/win32/prepare_dcpromo/NMakefile b/testprogs/win32/prepare_dcpromo/NMakefile
new file mode 100755
index 0000000..6f810ee
--- /dev/null
+++ b/testprogs/win32/prepare_dcpromo/NMakefile
@@ -0,0 +1,16 @@
+#
+# use nmake /f NMakefile [<target>]
+#
+INCLUDES=-I
+CFLAGS=$(INCLUDES) -Zi -nologo -Dsnprintf=sprintf_s
+LIBS=advapi32.lib
+
+PREPARE_DCPROMO = prepare_dcpromo.exe
+
+all: $(PREPARE_DCPROMO)
+
+clean:
+ del *~ *.obj *.exe
+
+prepare_dcpromo.exe: prepare_dcpromo.obj
+ $(CC) $(CFLAGS) -o prepare_dcpromo.exe prepare_dcpromo.obj $(LIBS)
diff --git a/testprogs/win32/prepare_dcpromo/prepare_dcpromo.c b/testprogs/win32/prepare_dcpromo/prepare_dcpromo.c
new file mode 100755
index 0000000..91b819b
--- /dev/null
+++ b/testprogs/win32/prepare_dcpromo/prepare_dcpromo.c
@@ -0,0 +1,1074 @@
+/*
+ Copyright (C) Stefan Metzmacher <metze@samba.org> 2010
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ Published to the public domain
+ */
+
+/*
+ * This tool can set the DOMAIN-SID and nextRid counter in
+ * the local SAM on windows servers (tested with w2k8r2)
+ *
+ * dcpromo will use this values for the ad domain it creates.
+ *
+ * This might be useful for upgrades from a Samba3 domain.
+ */
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+/* Convert a binary SID to a character string */
+static DWORD SidToString(const SID *sid,
+ char **string)
+{
+ DWORD id_auth;
+ int i, ofs, maxlen;
+ char *result;
+
+ if (!sid) {
+ return ERROR_INVALID_SID;
+ }
+
+ maxlen = sid->SubAuthorityCount * 11 + 25;
+
+ result = (char *)malloc(maxlen);
+ if (result == NULL) {
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ /*
+ * BIG NOTE: this function only does SIDS where the identauth is not
+ * >= ^32 in a range of 2^48.
+ */
+
+ id_auth = sid->IdentifierAuthority.Value[5] +
+ (sid->IdentifierAuthority.Value[4] << 8) +
+ (sid->IdentifierAuthority.Value[3] << 16) +
+ (sid->IdentifierAuthority.Value[2] << 24);
+
+ ofs = snprintf(result, maxlen, "S-%u-%lu",
+ (unsigned int)sid->Revision, (unsigned long)id_auth);
+
+ for (i = 0; i < sid->SubAuthorityCount; i++) {
+ ofs += snprintf(result + ofs, maxlen - ofs, "-%lu",
+ (unsigned long)sid->SubAuthority[i]);
+ }
+
+ *string = result;
+ return ERROR_SUCCESS;
+}
+
+static DWORD StringToSid(const char *str,
+ SID *sid)
+{
+ const char *p;
+ char *q;
+ DWORD x;
+
+ if (!sid) {
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ /* Sanity check for either "S-" or "s-" */
+
+ if (!str
+ || (str[0]!='S' && str[0]!='s')
+ || (str[1]!='-'))
+ {
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ /* Get the SID revision number */
+
+ p = str+2;
+ x = (DWORD)strtol(p, &q, 10);
+ if (x==0 || !q || *q!='-') {
+ return ERROR_INVALID_SID;
+ }
+ sid->Revision = (BYTE)x;
+
+ /* Next the Identifier Authority. This is stored in big-endian
+ in a 6 byte array. */
+
+ p = q+1;
+ x = (DWORD)strtol(p, &q, 10);
+ if (!q || *q!='-') {
+ return ERROR_INVALID_SID;
+ }
+ sid->IdentifierAuthority.Value[5] = (x & 0x000000ff);
+ sid->IdentifierAuthority.Value[4] = (x & 0x0000ff00) >> 8;
+ sid->IdentifierAuthority.Value[3] = (x & 0x00ff0000) >> 16;
+ sid->IdentifierAuthority.Value[2] = (x & 0xff000000) >> 24;
+ sid->IdentifierAuthority.Value[1] = 0;
+ sid->IdentifierAuthority.Value[0] = 0;
+
+ /* now read the the subauthorities */
+
+ p = q +1;
+ sid->SubAuthorityCount = 0;
+ while (sid->SubAuthorityCount < 6) {
+ x=(DWORD)strtoul(p, &q, 10);
+ if (p == q)
+ break;
+ if (q == NULL) {
+ return ERROR_INVALID_SID;
+ }
+ sid->SubAuthority[sid->SubAuthorityCount++] = x;
+
+ if ((*q!='-') || (*q=='\0'))
+ break;
+ p = q + 1;
+ }
+
+ /* IF we ended early, then the SID could not be converted */
+
+ if (q && *q!='\0') {
+ return ERROR_INVALID_SID;
+ }
+
+ return ERROR_SUCCESS;
+}
+
+#define MIN(a,b) ((a)<(b)?(a):(b))
+static void print_asc(const unsigned char *buf,int len)
+{
+ int i;
+ for (i=0;i<len;i++)
+ printf("%c", isprint(buf[i])?buf[i]:'.');
+}
+
+static void dump_data(const unsigned char *buf1,int len)
+{
+ const unsigned char *buf = (const unsigned char *)buf1;
+ int i=0;
+ if (len<=0) return;
+
+ printf("[%03X] ",i);
+ for (i=0;i<len;) {
+ printf("%02X ",(int)buf[i]);
+ i++;
+ if (i%8 == 0) printf(" ");
+ if (i%16 == 0) {
+ print_asc(&buf[i-16],8); printf(" ");
+ print_asc(&buf[i-8],8); printf("\n");
+ if (i<len) printf("[%03X] ",i);
+ }
+ }
+ if (i%16) {
+ int n;
+ n = 16 - (i%16);
+ printf(" ");
+ if (n>8) printf(" ");
+ while (n--) printf(" ");
+ n = MIN(8,i%16);
+ print_asc(&buf[i-(i%16)],n); printf( " " );
+ n = (i%16) - n;
+ if (n>0) print_asc(&buf[i-n],n);
+ printf("\n");
+ }
+}
+
+static DWORD calc_tmp_HKLM_SECURITY_SD(SECURITY_DESCRIPTOR *old_sd,
+ SID *current_user_sid,
+ SECURITY_DESCRIPTOR **_old_parent_sd,
+ SECURITY_DESCRIPTOR **_old_child_sd,
+ SECURITY_DESCRIPTOR **_new_parent_sd,
+ SECURITY_DESCRIPTOR **_new_child_sd)
+{
+ LONG status;
+ DWORD cbSecurityDescriptor = 0;
+ SECURITY_DESCRIPTOR *old_parent_sd = NULL;
+ SECURITY_DESCRIPTOR *old_child_sd = NULL;
+ SECURITY_DESCRIPTOR *new_parent_sd = NULL;
+ SECURITY_DESCRIPTOR *new_child_sd = NULL;
+ BOOL ok;
+ ACL *old_Dacl = NULL;
+ ACL *new_Dacl = NULL;
+ ACL_SIZE_INFORMATION dacl_info;
+ DWORD i = 0;
+ SECURITY_DESCRIPTOR *AbsoluteSD = NULL;
+ DWORD dwAbsoluteSDSize = 0;
+ DWORD dwRelativeSDSize = 0;
+ DWORD dwDaclSize = 0;
+ ACL *Sacl = NULL;
+ DWORD dwSaclSize = 0;
+ SID *Owner = NULL;
+ DWORD dwOwnerSize = 0;
+ SID *PrimaryGroup = NULL;
+ DWORD dwPrimaryGroupSize = 0;
+ ACCESS_ALLOWED_ACE *ace = NULL;
+
+ ok = MakeAbsoluteSD(old_sd,
+ NULL,
+ &dwAbsoluteSDSize,
+ NULL,
+ &dwDaclSize,
+ NULL,
+ &dwSaclSize,
+ NULL,
+ &dwOwnerSize,
+ NULL,
+ &dwPrimaryGroupSize);
+ if (!ok) {
+ status = GetLastError();
+ }
+ if (status != ERROR_INSUFFICIENT_BUFFER) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ AbsoluteSD = (SECURITY_DESCRIPTOR *)malloc(dwAbsoluteSDSize+1024);
+ if (AbsoluteSD == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+ old_Dacl = (ACL *)malloc(dwDaclSize + 1024);
+ if (old_Dacl == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+ Sacl = (ACL *)malloc(dwSaclSize);
+ if (Sacl == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+ Owner = (SID *)malloc(dwOwnerSize);
+ if (Owner == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+ PrimaryGroup = (SID *)malloc(dwPrimaryGroupSize);
+ if (PrimaryGroup == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ ok = MakeAbsoluteSD(old_sd,
+ AbsoluteSD,
+ &dwAbsoluteSDSize,
+ old_Dacl,
+ &dwDaclSize,
+ Sacl,
+ &dwSaclSize,
+ Owner,
+ &dwOwnerSize,
+ PrimaryGroup,
+ &dwPrimaryGroupSize);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ AbsoluteSD->Control |= SE_DACL_AUTO_INHERITED | SE_DACL_AUTO_INHERIT_REQ | SE_DACL_PROTECTED;
+ dwRelativeSDSize = 0;
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ NULL,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ }
+ if (status != ERROR_INSUFFICIENT_BUFFER) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ old_parent_sd = (SECURITY_DESCRIPTOR *)malloc(dwRelativeSDSize);
+ if (old_parent_sd == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ old_parent_sd,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ ok = GetAclInformation(old_Dacl,
+ &dacl_info,
+ sizeof(dacl_info),
+ AclSizeInformation);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ new_Dacl = (ACL *)calloc(dacl_info.AclBytesInUse + 1024, 1);
+ if (new_Dacl == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ InitializeAcl(new_Dacl, dacl_info.AclBytesInUse + 1024, ACL_REVISION);
+
+ ok = AddAccessAllowedAce(new_Dacl, ACL_REVISION,
+ KEY_ALL_ACCESS, current_user_sid);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ ok = GetAce(new_Dacl, 0, (LPVOID *)&ace);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ ace->Header.AceFlags |= CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE;
+
+ for (i=0; i < dacl_info.AceCount; i++) {
+ ok = GetAce(old_Dacl, i, (LPVOID *)&ace);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ ok = AddAce(new_Dacl, ACL_REVISION, MAXDWORD,
+ ace, ace->Header.AceSize);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+ }
+
+ AbsoluteSD->Dacl = new_Dacl;
+ dwRelativeSDSize = 0;
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ NULL,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ }
+ if (status != ERROR_INSUFFICIENT_BUFFER) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ new_parent_sd = (SECURITY_DESCRIPTOR *)malloc(dwRelativeSDSize);
+ if (new_parent_sd == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ new_parent_sd,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ for (i=0; i < dacl_info.AceCount; i++) {
+ ok = GetAce(old_Dacl, i, (LPVOID *)&ace);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ ace->Header.AceFlags |= INHERITED_ACE;
+ }
+
+ AbsoluteSD->Control &= ~SE_DACL_PROTECTED;
+ AbsoluteSD->Dacl = old_Dacl;
+ dwRelativeSDSize = 0;
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ NULL,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ }
+ if (status != ERROR_INSUFFICIENT_BUFFER) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ old_child_sd = (SECURITY_DESCRIPTOR *)malloc(dwRelativeSDSize);
+ if (old_child_sd == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ old_child_sd,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ for (i=0; i < dacl_info.AceCount + 1; i++) {
+ ok = GetAce(new_Dacl, i, (LPVOID *)&ace);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ ace->Header.AceFlags |= INHERITED_ACE;
+ }
+
+ AbsoluteSD->Dacl = new_Dacl;
+ dwRelativeSDSize = 0;
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ NULL,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ }
+ if (status != ERROR_INSUFFICIENT_BUFFER) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ new_child_sd = (SECURITY_DESCRIPTOR *)malloc(dwRelativeSDSize);
+ if (new_child_sd == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ ok = MakeSelfRelativeSD(AbsoluteSD,
+ new_child_sd,
+ &dwRelativeSDSize);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ *_old_parent_sd = old_parent_sd;
+ *_old_child_sd = old_child_sd;
+ *_new_parent_sd = new_parent_sd;
+ *_new_child_sd = new_child_sd;
+ return ERROR_SUCCESS;
+}
+
+static DWORD inherit_SD(HKEY parent_hk,
+ char *current_key,
+ BOOL reset,
+ SECURITY_DESCRIPTOR *current_sd,
+ SECURITY_DESCRIPTOR *child_sd)
+{
+ DWORD status;
+ DWORD i = 0;
+ HKEY current_hk;
+
+ if (!reset) {
+ status = RegOpenKeyEx(parent_hk,
+ current_key,
+ 0, /* options */
+ WRITE_DAC, /* samDesired */
+ &current_hk);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ status = RegSetKeySecurity(current_hk,
+ DACL_SECURITY_INFORMATION |
+ PROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_SACL_SECURITY_INFORMATION,
+ current_sd /* pSecurityDescriptor */
+ );
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ RegCloseKey(current_hk);
+ }
+
+ status = RegOpenKeyEx(parent_hk,
+ current_key,
+ 0, /* options */
+ KEY_ENUMERATE_SUB_KEYS, /* samDesired */
+ &current_hk);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ for (i=0; ; i++) {
+ char subkey[10240];
+ HKEY hk_child;
+
+ memset(subkey, 0, sizeof(subkey));
+ status = RegEnumKey(current_hk, i, subkey, sizeof(subkey));
+ if (status == ERROR_NO_MORE_ITEMS) {
+ break;
+ }
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+#if 0
+ printf("subkey: %s\n", subkey);
+#endif
+
+ status = inherit_SD(current_hk, subkey, reset,
+ child_sd, child_sd);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+ }
+
+ RegCloseKey(current_hk);
+
+ if (reset) {
+ status = RegOpenKeyEx(parent_hk,
+ current_key,
+ 0, /* options */
+ WRITE_DAC, /* samDesired */
+ &current_hk);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ status = RegSetKeySecurity(current_hk,
+ DACL_SECURITY_INFORMATION |
+ PROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_SACL_SECURITY_INFORMATION,
+ current_sd /* pSecurityDescriptor */
+ );
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ RegCloseKey(current_hk);
+ }
+
+ return ERROR_SUCCESS;
+}
+
+static DWORD replaceSIDBuffer(BYTE *buf, DWORD len,
+ SID *oldDomainSid,
+ SID *newDomainSid)
+{
+ DWORD ret = 0;
+ BYTE *oldb = ((BYTE *)oldDomainSid)+2;
+ BYTE *newb = ((BYTE *)newDomainSid)+2;
+ int cmp;
+
+#if 0
+ printf("replaceSIDBuffer: %u\n", len);
+ dump_data(buf, len);
+#endif
+
+ if (len < 24) {
+ return 0;
+ }
+
+ if (buf[0] != SID_REVISION) {
+ return 0;
+ }
+
+ switch (buf[1]) {
+ case 4:
+ ret = 24;
+ break;
+ case 5:
+ if (len < 28) {
+ return 0;
+ }
+ ret = 28;
+ break;
+ default:
+ return 0;
+ }
+
+#if 0
+ printf("oldb:\n");
+ dump_data(oldb, 22);
+#endif
+ cmp = memcmp(&buf[2], oldb, 22);
+ if (cmp != 0) {
+ return 0;
+ }
+
+ memcpy(&buf[2], newb, 22);
+
+ return ret;
+}
+
+static DWORD replaceSID(HKEY parent_hk,
+ const char *parent_path,
+ const char *current_key,
+ SID *oldDomainSid,
+ SID *newDomainSid)
+{
+ DWORD status;
+ DWORD i = 0;
+ HKEY current_hk;
+ char current_path[10240];
+
+ snprintf(current_path, sizeof(current_path), "%s\\%s",
+ parent_path, current_key);
+
+ status = RegOpenKeyEx(parent_hk,
+ current_key,
+ 0, /* options */
+ KEY_ALL_ACCESS, /* samDesired */
+ &current_hk);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ for (i=0; ; i++) {
+ char subkey[10240];
+ HKEY hk_child;
+
+ memset(subkey, 0, sizeof(subkey));
+ status = RegEnumKey(current_hk, i, subkey, sizeof(subkey));
+ if (status == ERROR_NO_MORE_ITEMS) {
+ break;
+ }
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+#if 0
+ printf("subkey: %s\n", subkey);
+#endif
+
+ status = replaceSID(current_hk, current_path, subkey,
+ oldDomainSid, newDomainSid);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+ }
+
+ for (i=0; ; i++) {
+ char valueName[10240];
+ DWORD cbValueName;
+ DWORD valueType = 0;
+ BYTE *valueData = NULL;
+ DWORD cbValueData = 0;
+ DWORD ofs = 0;
+ BOOL modified = FALSE;
+
+ memset(valueName, 0, sizeof(valueName));
+ cbValueName = sizeof(valueName)-1;
+ status = RegEnumValue(current_hk, i,
+ valueName, &cbValueName,
+ NULL, NULL,
+ NULL, &cbValueData);
+ if (status == ERROR_NO_MORE_ITEMS) {
+ break;
+ }
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ valueData = (BYTE *)malloc(cbValueData);
+ if (valueData == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ cbValueName = sizeof(valueName)-1;
+ status = RegEnumValue(current_hk, i,
+ valueName, &cbValueName,
+ NULL, &valueType,
+ valueData, &cbValueData);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ if (valueType != REG_BINARY) {
+ free(valueData);
+ continue;
+ }
+
+ for (ofs=0; ofs < cbValueData;) {
+ DWORD len;
+
+ len = replaceSIDBuffer(valueData + ofs,
+ cbValueData - ofs,
+ oldDomainSid,
+ newDomainSid);
+ if (len == 0) {
+ ofs += 4;
+ continue;
+ }
+
+#if 0
+ printf("%s value[%u]:%s modified ofs:%u (0x%X) len:%u\n",
+ current_path, i, valueName, ofs, ofs, len);
+#endif
+
+ ofs += len;
+ modified = TRUE;
+ }
+
+ if (!modified) {
+ free(valueData);
+ continue;
+ }
+
+ printf("%s value[%u]:%s replacing data\n",
+ current_path, i, valueName);
+ status = RegSetValueEx(current_hk,
+ valueName,
+ 0,
+ valueType,
+ valueData,
+ cbValueData);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ free(valueData);
+ }
+
+ RegCloseKey(current_hk);
+
+ return ERROR_SUCCESS;
+}
+
+int main(int argc, char *argv[])
+{
+ LONG status;
+ HANDLE tokenHandle = NULL;
+ TOKEN_USER *tokenUser = NULL;
+ DWORD cbTokenUser = 0;
+ HKEY hklm;
+ HKEY hk_security;
+ HKEY hk_account_domain;
+ DWORD cbSecurityDescriptor = 0;
+ SECURITY_DESCRIPTOR *security_old_sd = NULL;
+ SECURITY_DESCRIPTOR *security_parent_old_sd = NULL;
+ SECURITY_DESCRIPTOR *security_child_old_sd = NULL;
+ SECURITY_DESCRIPTOR *security_parent_new_sd = NULL;
+ SECURITY_DESCRIPTOR *security_child_new_sd = NULL;
+ SID *currentUserSid = NULL;
+ char *currentUserSidString = NULL;
+ BOOL ok;
+ DWORD cbTmp = 0;
+ BYTE *AccountDomainF = NULL;
+ DWORD cbAccountDomainF = 0;
+ DWORD AccountDomainFType = 0;
+ DWORD *nextRid = NULL;
+ DWORD oldNextRid = 0;
+ DWORD newNextRid = 0;
+ BYTE *AccountDomainV = NULL;
+ DWORD cbAccountDomainV = 0;
+ SID *oldDomainSid = NULL;
+ char *oldDomainSidString = NULL;
+ SID *newDomainSid = NULL;
+ const char *newDomainSidString = NULL;
+
+ if (argc < 2 || argc > 3) {
+ printf("Usage: %s <DOMAINSID> [<NEXTRID>]\n", argv[0]);
+ return -1;
+ }
+
+ newDomainSidString = argv[1];
+
+ newDomainSid = (SID *)malloc(24);
+ if (newDomainSid == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return -1;
+ }
+
+ status = StringToSid(newDomainSidString, newDomainSid);
+ if (status != ERROR_SUCCESS) {
+ printf("Failed to parse DOMAINSID[%s]: Error: %d (0x%X)\n",
+ newDomainSidString, status, status);
+ return -1;
+ }
+ if (newDomainSid->SubAuthorityCount != 4) {
+ printf("DOMAINSID[%s]: Invalid SubAuthorityCount[%u] should be 4\n",
+ newDomainSidString, newDomainSid->SubAuthorityCount);
+ return -1;
+ }
+
+ if (argc == 3) {
+ char *q = NULL;
+ newNextRid = (DWORD)strtoul(argv[2], &q, 10);
+ if (newNextRid == 0 || newNextRid == 0xFFFFFFFF || !q || *q!='\0') {
+ printf("Invalid newNextRid[%s]\n", argv[2]);
+ return -1;
+ }
+ if (newNextRid < 1000) {
+ printf("newNextRid[%u] < 1000\n", newNextRid);
+ return -1;
+ }
+ }
+
+ ok = OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &tokenHandle);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ ok = GetTokenInformation(tokenHandle, TokenUser,
+ NULL, 0, &cbTokenUser);
+ if (!ok) {
+ status = GetLastError();
+ }
+ if (status != ERROR_INSUFFICIENT_BUFFER) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ tokenUser = (TOKEN_USER *)malloc(cbTokenUser);
+ if (tokenUser == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return -1;
+ }
+
+ ok = GetTokenInformation(tokenHandle, TokenUser,
+ tokenUser, cbTokenUser, &cbTokenUser);
+ if (!ok) {
+ status = GetLastError();
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ currentUserSid = tokenUser->User.Sid;
+
+ status = SidToString(currentUserSid, &currentUserSidString);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ status = RegConnectRegistry(NULL, HKEY_LOCAL_MACHINE, &hklm);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ status = RegOpenKeyEx(hklm, "SECURITY",
+ 0, /* options */
+ READ_CONTROL, /* samDesired */
+ &hk_security);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ status = RegGetKeySecurity(hk_security,
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION |
+ PROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_SACL_SECURITY_INFORMATION,
+ NULL, /* pSecurityDescriptor */
+ &cbSecurityDescriptor /* lpcbSecurityDescriptor */
+ );
+ if (status != ERROR_INSUFFICIENT_BUFFER) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ security_old_sd = (SECURITY_DESCRIPTOR *)malloc(cbSecurityDescriptor);
+ if (security_old_sd == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return -1;
+ }
+
+ status = RegGetKeySecurity(hk_security,
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION |
+ PROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_DACL_SECURITY_INFORMATION |
+ UNPROTECTED_SACL_SECURITY_INFORMATION,
+ security_old_sd, /* pSecurityDescriptor */
+ &cbSecurityDescriptor /* lpcbSecurityDescriptor */
+ );
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ RegCloseKey(hk_security);
+
+ printf("currentUserSid: %s\n", currentUserSidString);
+
+ status = calc_tmp_HKLM_SECURITY_SD(security_old_sd,
+ currentUserSid,
+ &security_parent_old_sd,
+ &security_child_old_sd,
+ &security_parent_new_sd,
+ &security_child_new_sd);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ printf("Grant full access to HKLM\\SECURITY\n");
+ status = inherit_SD(hklm, "SECURITY", FALSE,
+ security_parent_new_sd, security_child_new_sd);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ status = RegOpenKeyEx(hklm, "SECURITY\\SAM\\Domains\\Account",
+ 0, /* options */
+ KEY_ALL_ACCESS, /* samDesired */
+ &hk_account_domain);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ status = RegQueryValueEx(hk_account_domain,
+ "F", NULL, NULL,
+ NULL,
+ &cbAccountDomainF);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ AccountDomainF = (BYTE *)malloc(cbAccountDomainF);
+ if (AccountDomainF == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return -1;
+ }
+
+ status = RegQueryValueEx(hk_account_domain,
+ "F", NULL, NULL,
+ AccountDomainF,
+ &cbAccountDomainF);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ nextRid = (DWORD *)((BYTE *)AccountDomainF + 0x48);
+ oldNextRid = *nextRid;
+ if (newNextRid == 0) {
+ newNextRid = oldNextRid;
+ }
+ printf("AccountDomainF: %u bytes\n", cbAccountDomainF);
+
+ status = RegQueryValueEx(hk_account_domain,
+ "V", NULL, NULL,
+ NULL,
+ &cbAccountDomainV);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ AccountDomainV = (BYTE *)malloc(cbAccountDomainV);
+ if (AccountDomainV == NULL) {
+ printf("LINE:%u: Error: no memory\n", __LINE__);
+ return -1;
+ }
+
+ status = RegQueryValueEx(hk_account_domain,
+ "V", NULL, NULL,
+ AccountDomainV,
+ &cbAccountDomainV);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ printf("AccountDomainV: %u bytes\n", cbAccountDomainV);
+ oldDomainSid = (SID *)((BYTE *)AccountDomainV + (cbAccountDomainV - 24));
+
+ status = SidToString(oldDomainSid, &oldDomainSidString);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+
+ printf("Old Domain:%s, NextRid: %u (0x%08X)\n",
+ oldDomainSidString, oldNextRid, oldNextRid);
+ printf("New Domain:%s, NextRid: %u (0x%08X)\n",
+ newDomainSidString, newNextRid, newNextRid);
+
+ status = replaceSID(hklm, "HKLM", "SECURITY\\SAM\\Domains",
+ oldDomainSid, newDomainSid);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ goto failed;
+ }
+
+ status = RegQueryValueEx(hk_account_domain,
+ "F", NULL, &AccountDomainFType,
+ AccountDomainF,
+ &cbAccountDomainF);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+ nextRid = (DWORD *)((BYTE *)AccountDomainF + 0x48);
+ *nextRid = newNextRid;
+
+ printf("AccountDomainF replacing data (nextRid)\n");
+ status = RegSetValueEx(hk_account_domain,
+ "F",
+ 0,
+ AccountDomainFType,
+ AccountDomainF,
+ cbAccountDomainF);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return status;
+ }
+
+ printf("Withdraw full access to HKLM\\SECURITY\n");
+ status = inherit_SD(hklm, "SECURITY", TRUE,
+ security_parent_old_sd, security_child_old_sd);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+ printf("DONE!\n");
+ return 0;
+failed:
+ printf("Withdraw full access to HKLM\\SECURITY\n");
+ status = inherit_SD(hklm, "SECURITY", TRUE,
+ security_parent_old_sd, security_child_old_sd);
+ if (status != ERROR_SUCCESS) {
+ printf("LINE:%u: Error: %d (0x%X)\n", __LINE__, status, status);
+ return -1;
+ }
+ printf("FAILED!\n");
+ return 0;
+}
diff --git a/testprogs/win32/rpcecho/Makefile b/testprogs/win32/rpcecho/Makefile
new file mode 100644
index 0000000..ca0c823
--- /dev/null
+++ b/testprogs/win32/rpcecho/Makefile
@@ -0,0 +1,23 @@
+INCLUDES=-I
+CFLAGS=$(INCLUDES) -Zi -nologo
+LIBS=rpcrt4.lib
+
+all: client server
+
+clean:
+ del *~ *.obj client server rpcecho_c.c rpcecho_s.c rpcecho.h
+
+rpcecho.h rpcecho_s.c rpcecho_c.c: rpcecho.idl rpcecho.acf
+ midl rpcecho.idl
+
+client: client.obj rpcecho_c.obj utils.obj
+ $(CC) $(CFLAGS) -o client client.obj rpcecho_c.obj utils.obj $(LIBS)
+
+server: server.obj rpcecho_s.obj utils.obj
+ $(CC) $(CFLAGS) -o server server.obj rpcecho_s.obj utils.obj $(LIBS)
+
+client.obj: rpcecho.h client.c
+server.obj: rpcecho.h server.c
+rpcecho_c.obj: rpcecho.h rpcecho_c.c
+rpcecho_s.obj: rpcecho.h rpcecho_s.c
+utils.obj: rpcecho.h utils.c
diff --git a/testprogs/win32/rpcecho/README b/testprogs/win32/rpcecho/README
new file mode 100644
index 0000000..2eb6ab9
--- /dev/null
+++ b/testprogs/win32/rpcecho/README
@@ -0,0 +1,46 @@
+This directory contains two win32 programs to test large RPC requests
+and responses. The two programs are:
+
+ server A command line RPC server that listens and processes
+ RPC requests on the \pipe\rpcecho named pipe.
+
+ client A command line RPC client program that
+
+Samba also implements the client and server sides of the rpcecho pipe
+if the --enable-developer option to configure has been used. The
+rpcclient(1) program is used to implement the client side RPC
+operations.
+
+There are currently four RPC calls defined in the rpcecho pipe. They
+are:
+
+ AddOne Adds one to an integer sent by the client
+
+ EchoData The client sends an array of bytes and it is echoed
+ back by the server.
+
+ SourceData The client sends an array of bytes and it is discarded
+ by the server.
+
+ SinkData The server returns an array of bytes.
+
+The Ethereal network protocol decoder (http://www.ethereal.com/) also
+contains support for the rpcecho pipe as part of its DCERPC for
+Windows.
+
+Starting the win32 server program is easy. Just run server.exe in a
+command window. The win32 client program is also run from a command
+window. The usage information is shown below:
+
+ Usage: client hostname cmd [args]
+
+ Where hostname is the name of the host to connect to,
+ and cmd is the command to execute with optional args:
+
+ addone num Add one to num and return the result
+ echodata size Send an array of size bytes and receive it back
+ sinkdata size Send an array of size bytes
+ sourcedata size Receive an array of size bytes
+
+Tim Potter
+tpot@samba.org
diff --git a/testprogs/win32/rpcecho/client.c b/testprogs/win32/rpcecho/client.c
new file mode 100644
index 0000000..dae2a4b
--- /dev/null
+++ b/testprogs/win32/rpcecho/client.c
@@ -0,0 +1,367 @@
+/*
+ RPC echo client.
+
+ Copyright (C) Tim Potter 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include "rpcecho.h"
+
+void main(int argc, char **argv)
+{
+ RPC_STATUS status;
+ char *binding = NULL;
+ const char *username=NULL;
+ const char *password=NULL;
+ const char *domain=NULL;
+ unsigned sec_options = 0;
+
+ argv += 1;
+ argc -= 1;
+
+ while (argc > 2 && argv[0][0] == '-') {
+ const char *option;
+
+ switch (argv[0][1]) {
+ case 'e':
+ binding = argv[1];
+ break;
+ case 'u':
+ username = argv[1];
+ break;
+ case 'p':
+ password = argv[1];
+ break;
+ case 'd':
+ domain = argv[1];
+ break;
+ case '-':
+ option = &argv[0][2];
+ if (strcmp(option, "sign") == 0) {
+ if (sec_options == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) {
+ printf("You must choose sign or seal, not both\n");
+ exit(1);
+ }
+ sec_options = RPC_C_AUTHN_LEVEL_PKT_INTEGRITY;
+ } else if (strcmp(option, "seal") == 0) {
+ if (sec_options == RPC_C_AUTHN_LEVEL_PKT_INTEGRITY) {
+ printf("You must choose sign or seal, not both\n");
+ exit(1);
+ }
+ sec_options = RPC_C_AUTHN_LEVEL_PKT_PRIVACY;
+ } else {
+ printf("Bad security option '%s'\n", option);
+ exit(1);
+ }
+ argv++;
+ argc--;
+ continue;
+ default:
+ printf("Bad option -%c\n", argv[0][0]);
+ exit(1);
+ }
+ argv += 2;
+ argc -= 2;
+ }
+
+ if (argc < 2) {
+ printf("Usage: client [options] hostname cmd [args]\n\n");
+ printf("Where hostname is the name of the host to connect to,\n");
+ printf("and cmd is the command to execute with optional args:\n\n");
+ printf("\taddone num\tAdd one to num and return the result\n");
+ printf("\techodata size\tSend an array of size bytes and receive it back\n");
+ printf("\tsinkdata size\tSend an array of size bytes\n");
+ printf("\tsourcedata size\tReceive an array of size bytes\n");
+ printf("\ttest\trun testcall\n");
+ printf("\noptions:\n");
+ printf("\t-u username -d domain -p password -e endpoint\n");
+ printf("\t--sign --seal\n");
+ printf("\nExamples:\n");
+ printf("\tclient HOSTNAME addone 3\n");
+ printf("\tclient 192.168.115.1 addone 3\n");
+ printf("\tclient -e ncacn_np:HOSTNAME[\\\\pipe\\\\rpcecho] addone 3\n");
+ printf("\tclient -e ncacn_ip_tcp:192.168.115.1 addone 3\n");
+ printf("\tclient -e ncacn_ip_tcp:192.168.115.1 -u tridge -d MYDOMAIN -p PASSWORD addone 3\n");
+ exit(0);
+ }
+
+
+ if (!binding) {
+ char *network_address = argv[0];
+
+ argc--;
+ argv++;
+
+ status = RpcStringBindingCompose(
+ NULL, /* uuid */
+ "ncacn_np",
+ network_address,
+ "\\pipe\\rpcecho",
+ NULL, /* options */
+ &binding);
+
+ if (status) {
+ printf("RpcStringBindingCompose returned %d\n", status);
+ exit(status);
+ }
+ }
+
+ printf("Endpoint is %s\n", binding);
+
+ status = RpcBindingFromStringBinding(
+ binding,
+ &rpcecho_IfHandle);
+
+ if (status) {
+ printf("RpcBindingFromStringBinding returned %d\n", status);
+ exit(status);
+ }
+
+ if (username) {
+ SEC_WINNT_AUTH_IDENTITY ident = { username, strlen(username),
+ domain, strlen(domain),
+ password, strlen(password),
+ SEC_WINNT_AUTH_IDENTITY_ANSI };
+
+ status = RpcBindingSetAuthInfo(rpcecho_IfHandle, NULL,
+ sec_options,
+ RPC_C_AUTHN_WINNT,
+ &ident, 0);
+ if (status) {
+ printf ("RpcBindingSetAuthInfo failed: 0x%x\n", status);
+ exit (1);
+ }
+ }
+
+
+ while (argc > 0) {
+ RpcTryExcept {
+
+ /* Add one to a number */
+
+ if (strcmp(argv[0], "addone") == 0) {
+ int arg, result;
+
+ if (argc < 2) {
+ printf("Usage: addone num\n");
+ exit(1);
+ }
+
+ arg = atoi(argv[1]);
+
+ AddOne(arg, &result);
+ printf("%d + 1 = %d\n", arg, result);
+
+ argc -= 2;
+ argv += 2;
+ continue;
+ }
+
+ /* Echo an array */
+
+ if (strcmp(argv[0], "echodata") == 0) {
+ int arg, i;
+ char *indata, *outdata;
+
+ if (argc < 2) {
+ printf("Usage: echo num\n");
+ exit(1);
+ }
+
+ arg = atoi(argv[1]);
+
+ if ((indata = malloc(arg)) == NULL) {
+ printf("Error allocating %d bytes for input\n", arg);
+ exit(1);
+ }
+
+ if ((outdata = malloc(arg)) == NULL) {
+ printf("Error allocating %d bytes for output\n", arg);
+ exit(1);
+ }
+
+ for (i = 0; i < arg; i++)
+ indata[i] = i & 0xff;
+
+ EchoData(arg, indata, outdata);
+
+ printf("echo %d\n", arg);
+
+ for (i = 0; i < arg; i++) {
+ if (indata[i] != outdata[i]) {
+ printf("data mismatch at offset %d, %d != %d\n",
+ i, indata[i], outdata[i]);
+ exit(0);
+ }
+ }
+
+ argc -= 2;
+ argv += 2;
+ continue;
+ }
+
+ if (strcmp(argv[0], "sinkdata") == 0) {
+ int arg, i;
+ char *indata;
+
+ if (argc < 2) {
+ printf("Usage: sinkdata num\n");
+ exit(1);
+ }
+
+ arg = atoi(argv[1]);
+
+ if ((indata = malloc(arg)) == NULL) {
+ printf("Error allocating %d bytes for input\n", arg);
+ exit(1);
+ }
+
+ for (i = 0; i < arg; i++)
+ indata[i] = i & 0xff;
+
+ SinkData(arg, indata);
+
+ printf("sinkdata %d\n", arg);
+ argc -= 2;
+ argv += 2;
+ continue;
+ }
+
+ if (strcmp(argv[0], "sourcedata") == 0) {
+ int arg, i;
+ unsigned char *outdata;
+
+ if (argc < 2) {
+ printf("Usage: sourcedata num\n");
+ exit(1);
+ }
+
+ arg = atoi(argv[1]);
+
+ if ((outdata = malloc(arg)) == NULL) {
+ printf("Error allocating %d bytes for output\n", arg);
+ exit(1);
+ }
+
+ SourceData(arg, outdata);
+
+ printf("sourcedata %d\n", arg);
+
+ for (i = 0; i < arg; i++) {
+ if (outdata[i] != (i & 0xff)) {
+ printf("data mismatch at offset %d, %d != %d\n",
+ i, outdata[i], i & 0xff);
+ }
+ }
+
+ argc -= 2;
+ argv += 2;
+ continue;
+ }
+
+ if (strcmp(argv[0], "test") == 0) {
+ printf("no TestCall\n");
+
+ argc -= 1;
+ argv += 1;
+ continue;
+ }
+
+
+ if (strcmp(argv[0], "enum") == 0) {
+ enum echo_Enum1 v = ECHO_ENUM1;
+ echo_Enum2 e2;
+ echo_Enum3 e3;
+
+ e2.e1 = 76;
+ e2.e2 = ECHO_ENUM1_32;
+ e3.e1 = ECHO_ENUM2;
+
+ argc -= 1;
+ argv += 1;
+
+ echo_TestEnum(&v, &e2, &e3);
+
+ continue;
+ }
+
+ if (strcmp(argv[0], "double") == 0) {
+ typedef unsigned short uint16;
+ uint16 v = 13;
+ uint16 *pv = &v;
+ uint16 **ppv = &pv;
+ uint16 ret;
+
+ argc -= 1;
+ argv += 1;
+
+ ret = echo_TestDoublePointer(&ppv);
+
+ printf("TestDoublePointer v=%d ret=%d\n", v, ret);
+
+ continue;
+ }
+
+ if (strcmp(argv[0], "sleep") == 0) {
+ long arg, result;
+
+ if (argc < 2) {
+ printf("Usage: sleep num\n");
+ exit(1);
+ }
+
+ arg = atoi(argv[1]);
+
+// result = TestSleep(arg);
+// printf("Slept for %d seconds\n", result);
+ printf("Sleep disabled (need async code)\n");
+
+ argc -= 2;
+ argv += 2;
+ continue;
+ }
+
+ printf("Invalid command '%s'\n", argv[0]);
+ goto done;
+
+ } RpcExcept(1) {
+ unsigned long ex;
+
+ ex = RpcExceptionCode();
+ printf("Runtime error 0x%x\n", ex);
+ } RpcEndExcept
+ }
+
+done:
+
+ status = RpcStringFree(&binding);
+
+ if (status) {
+ printf("RpcStringFree returned %d\n", status);
+ exit(status);
+ }
+
+ status = RpcBindingFree(&rpcecho_IfHandle);
+
+ if (status) {
+ printf("RpcBindingFree returned %d\n", status);
+ exit(status);
+ }
+
+ exit(0);
+}
diff --git a/testprogs/win32/rpcecho/rpcecho.acf b/testprogs/win32/rpcecho/rpcecho.acf
new file mode 100644
index 0000000..56c7d33
--- /dev/null
+++ b/testprogs/win32/rpcecho/rpcecho.acf
@@ -0,0 +1,26 @@
+/*
+ RPC echo ACF.
+
+ Copyright (C) Tim Potter 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+[
+ implicit_handle (handle_t rpcecho_IfHandle)
+]
+interface rpcecho
+{
+/* [async] TestSleep(); */
+}
diff --git a/testprogs/win32/rpcecho/rpcecho.idl b/testprogs/win32/rpcecho/rpcecho.idl
new file mode 100644
index 0000000..b0ddb81
--- /dev/null
+++ b/testprogs/win32/rpcecho/rpcecho.idl
@@ -0,0 +1,146 @@
+/*
+ RPC echo IDL.
+
+ Copyright (C) Tim Potter 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __PIDL__
+#define unistr [string] wchar_t *
+#endif
+
+[
+uuid(60a15ec5-4de8-11d7-a637-005056a20182),
+version(1.0)
+]
+interface rpcecho
+{
+ // Add one to an integer
+ void AddOne(
+ [in] int in_data,
+ [out] int *out_data
+ );
+ // Echo an array of bytes back at the caller
+ void EchoData(
+ [in] int len,
+ [in] [size_is(len)] char in_data[],
+ [out] [size_is(len)] char out_data[]
+ );
+ // Sink data to the server
+ void SinkData(
+ [in] int len,
+ [in] [size_is(len)] char in_data[]
+ );
+ // Source data from server
+ void SourceData(
+ [in] int len,
+ [out] [size_is(len)] char out_data[]
+ );
+ const long myconstant = 42;
+
+ /* test strings */
+ void TestCall (
+ [in] unistr *s1,
+ [out] unistr *s2
+ );
+
+ /* test some alignment issues */
+ typedef struct {
+ char v;
+ } echo_info1;
+
+ typedef struct {
+ short v;
+ } echo_info2;
+
+ typedef struct {
+ long v;
+ } echo_info3;
+
+ typedef struct {
+ hyper v;
+ } echo_info4;
+
+ typedef struct {
+ char v1;
+ hyper v2;
+ } echo_info5;
+
+ typedef struct {
+ char v1;
+ echo_info1 info1;
+ } echo_info6;
+
+ typedef struct {
+ char v1;
+ echo_info4 info4;
+ } echo_info7;
+
+ typedef union {
+ [case(1)] echo_info1 info1;
+ [case(2)] echo_info2 info2;
+ [case(3)] echo_info3 info3;
+ [case(4)] echo_info4 info4;
+ [case(5)] echo_info5 info5;
+ [case(6)] echo_info6 info6;
+ [case(7)] echo_info7 info7;
+ } echo_Info;
+
+ long TestCall2 (
+ [in] short level,
+ [out,switch_is(level)] echo_Info **info
+ );
+
+ long TestSleep(
+ [in] long seconds
+ );
+
+ typedef enum {
+ ECHO_ENUM1 = 1,
+ ECHO_ENUM2 = 2
+ } echo_Enum1;
+
+ typedef [v1_enum] enum {
+ ECHO_ENUM1_32 = 1,
+ ECHO_ENUM2_32 = 2
+ } echo_Enum1_32;
+
+ typedef struct {
+ echo_Enum1 e1;
+ echo_Enum1_32 e2;
+ } echo_Enum2;
+
+ typedef union {
+ [case(ECHO_ENUM1)] echo_Enum1 e1;
+ [case(ECHO_ENUM2)] echo_Enum2 e2;
+ } echo_Enum3;
+
+ void echo_TestEnum(
+ [in,out,ref] echo_Enum1 *foo1,
+ [in,out,ref] echo_Enum2 *foo2,
+ [in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
+ );
+
+ typedef struct {
+ long x;
+ [size_is(x)] short surrounding[*];
+ } echo_Surrounding;
+
+ void echo_TestSurrounding(
+ [in,out,ref] echo_Surrounding *data
+ );
+
+ short echo_TestDoublePointer([in] short ***data);
+}
diff --git a/testprogs/win32/rpcecho/server.c b/testprogs/win32/rpcecho/server.c
new file mode 100644
index 0000000..b092852
--- /dev/null
+++ b/testprogs/win32/rpcecho/server.c
@@ -0,0 +1,208 @@
+/*
+ RPC echo server.
+
+ Copyright (C) Tim Potter 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#define _WIN32_WINNT 0x0500
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include "rpcecho.h"
+
+#define RPC_MIN_CALLS 1
+#define RPC_MAX_CALLS 20
+#define RPC_ENDPOINT "\\pipe\\rpcecho"
+
+void AddOne(int in_data, __RPC_FAR int *out_data)
+{
+ printf("AddOne: got in_data = %d\n", in_data);
+ *out_data = in_data + 1;
+}
+
+void EchoData(int len, unsigned char __RPC_FAR in_data[],
+ unsigned char __RPC_FAR out_data[])
+{
+ printf("EchoData: got len = %d\n", len);
+
+ memcpy(out_data, in_data, len);
+}
+
+void SinkData(int len, unsigned char __RPC_FAR in_data[ ])
+{
+ printf("SinkData: got len = %d\n", len);
+}
+
+void SourceData(int len, unsigned char __RPC_FAR out_data[ ])
+{
+ int i;
+
+ printf("SourceData: got len = %d\n", len);
+
+ for (i = 0; i < len; i++)
+ out_data[i] = i & 0xff;
+}
+
+void TestCall(wchar_t **s1, wchar_t **s2)
+{
+ if (*s1) {
+ printf("s1='%S'\n", *s1);
+ } else {
+ printf("s1=NULL\n");
+ }
+ *s2 = L"test string";
+}
+
+long TestCall2(short level, echo_Info **info)
+{
+ static echo_Info i;
+
+ printf("TestCall2 level %d\n", level);
+
+ *info = &i;
+
+ switch (level) {
+ case 1:
+ i.info1.v = 10;
+ break;
+ case 2:
+ i.info2.v = 20;
+ break;
+ case 3:
+ i.info3.v = 30;
+ break;
+ case 4:
+ i.info4.v = 40;
+ break;
+ case 5:
+ i.info5.v1 = 50;
+ i.info5.v2 = 51;
+ break;
+ case 6:
+ i.info6.v1 = 60;
+ i.info6.info1.v = 61;
+ break;
+ case 7:
+ i.info7.v1 = 70;
+ i.info7.info4.v = 71;
+ break;
+ default:
+ return -1;
+ }
+ return 0;
+}
+
+#if 0
+void TestSleep(PRPC_ASYNC_STATE pAsync, long seconds)
+{
+ long ret;
+ printf("async Sleeping for %d seconds\n", seconds);
+ Sleep(1000 * seconds);
+ ret = seconds;
+ RpcAsyncCompleteCall(pAsync, &ret);
+}
+#else
+long TestSleep(long seconds)
+{
+ printf("non-async Sleeping for %d seconds\n", seconds);
+ Sleep(1000 * seconds);
+ return seconds;
+}
+#endif
+
+
+void echo_TestEnum(echo_Enum1 *foo1,
+ echo_Enum2 *foo2,
+ echo_Enum3 *foo3)
+{
+ foo2->e1 = ECHO_ENUM2;
+}
+
+void echo_TestSurrounding(echo_Surrounding *data)
+{
+ printf("Incoming array of size %d\n", data->x);
+ data->x *= 2;
+}
+
+short echo_TestDoublePointer(short ***data)
+{
+ if (!*data) {
+ printf("WARNING: *data == NULL\n");
+ return 0;
+ }
+ if (!**data) {
+ printf("WARNING: **data == NULL\n");
+ return 0;
+ }
+ printf("Incoming double pointer: %d\n", ***data);
+ return ***data;
+}
+
+void main(int argc, char **argv)
+{
+ RPC_STATUS status;
+ RPC_BINDING_VECTOR *pBindingVector;
+
+ if (argc != 1) {
+ printf("Usage: rpcechosrv\n");
+ exit(0);
+ }
+
+ status = RpcServerUseProtseqEp("ncacn_np", RPC_MAX_CALLS, "\\pipe\\rpcecho", NULL);
+ if (status) {
+ printf("Failed to register ncacn_np endpoint\n");
+ exit(status);
+ }
+
+ status = RpcServerUseProtseqEp("ncacn_ip_tcp", RPC_MAX_CALLS, "1234", NULL);
+ if (status) {
+ printf("Failed to register ncacn_ip_tcp endpoint\n");
+ exit(status);
+ }
+
+ status = RpcServerInqBindings(&pBindingVector);
+ if (status) {
+ printf("Failed RpcServerInqBindings\n");
+ exit(status);
+ }
+
+ status = RpcEpRegister(rpcecho_v1_0_s_ifspec, pBindingVector, NULL, "rpcecho server");
+ if (status) {
+ printf("Failed RpcEpRegister\n");
+ exit(status);
+ }
+
+ status = RpcServerRegisterIf(rpcecho_v1_0_s_ifspec, NULL, NULL);
+
+ if (status) {
+ printf("Failed to register interface\n");
+ exit(status);
+ }
+
+ status = RpcServerRegisterAuthInfo(NULL, RPC_C_AUTHN_GSS_NEGOTIATE, NULL, NULL);
+ if (status) {
+ printf("Failed to setup auth info\n");
+ }
+
+ status = RpcServerListen(RPC_MIN_CALLS, RPC_MAX_CALLS, FALSE);
+
+ if (status) {
+ printf("RpcServerListen returned error %d\n", status);
+ exit(status);
+ }
+}
+
diff --git a/testprogs/win32/rpcecho/utils.c b/testprogs/win32/rpcecho/utils.c
new file mode 100644
index 0000000..09a81d1
--- /dev/null
+++ b/testprogs/win32/rpcecho/utils.c
@@ -0,0 +1,32 @@
+/*
+ RPC echo utility functions.
+
+ Copyright (C) Tim Potter 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "rpcecho.h"
+
+/* MIDL allocate and free functions */
+
+void __RPC_FAR *__RPC_USER midl_user_allocate(size_t len)
+{
+ return(malloc(len));
+}
+
+void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
+{
+ free(ptr);
+}
diff --git a/testprogs/win32/spoolss/GNUmakefile b/testprogs/win32/spoolss/GNUmakefile
new file mode 100644
index 0000000..0321a65
--- /dev/null
+++ b/testprogs/win32/spoolss/GNUmakefile
@@ -0,0 +1,23 @@
+CFLAGS=-I../../../
+MINGW_CC = i586-mingw32msvc-cc
+CC = $(MINGW_CC)
+
+LIBS=-lwinspool
+
+all: testspoolss.exe
+
+clean:
+ rm -vf *.exe tags
+
+ctags:
+ ctags `find . -name "*.[ch]" | grep -v include/proto.h`
+ ctags --c-kinds=-p -a `find /usr/i686-pc-mingw32/sys-root/mingw/include -name "*.[ch]" | grep -v /CVS/`
+
+proto:
+ mkproto.pl printlib.c --private=printlib_proto.h --public=printlib_proto_pub.h --srcdir=. --builddir=.
+ mkproto.pl torture.c --private=torture_proto.h --public=torture_proto_pub.h --srcdir=. --builddir=.
+
+testspoolss.exe: testspoolss.c printlib.c torture.c error.c
+ @echo Compiling testspoolss.exe
+ @$(CC) $(CFLAGS) $(LDFLAGS) testspoolss.c printlib.c torture.c error.c $(LIBS) -o testspoolss.exe
+
diff --git a/testprogs/win32/spoolss/NMakefile b/testprogs/win32/spoolss/NMakefile
new file mode 100644
index 0000000..949104e
--- /dev/null
+++ b/testprogs/win32/spoolss/NMakefile
@@ -0,0 +1,43 @@
+#
+# use nmake /f NMakefile [<target>]
+#
+CFLAGS = /nologo /Zi /MT /Gm- /W4 /FR /D_CRT_SECURE_NO_WARNINGS
+LIBS = kernel32.lib gdi32.lib user32.lib shell32.lib \
+ advapi32.lib ole32.lib ws2_32.lib rpcrt4.lib
+WINSPOOL_LIBS = winspool.lib
+
+all: testspoolss.exe
+
+.cpp.obj:
+ cl /c $(CFLAGS) $*.cpp
+
+.c.obj:
+ cl /c $(CFLAGS) $*.c
+
+clean: cleantmp
+ -del *.dll 2>nul
+
+cleantmp:
+ -del *~ *.o *.obj *.sbr *.bsc *.pdb *.lib *.ilk *.exp 2>nul
+ -del test_s.c test_c.c test.h 2>nul
+
+###############################
+# helpers
+###############################
+
+printlib.obj: printlib.c
+
+error.obj: error.c
+
+torture.obj: torture.c
+
+###############################
+# binaries
+###############################
+
+testspoolss.obj: testspoolss.c
+
+testspoolss.exe: testspoolss.obj printlib.obj error.obj torture.obj
+ cl $(CFLAGS) /Fe$@ testspoolss.obj printlib.obj error.obj torture.obj \
+ /link /incremental:no /subsystem:console $(LIBS) $(WINSPOOL_LIBS)
+
diff --git a/testprogs/win32/spoolss/README.win32 b/testprogs/win32/spoolss/README.win32
new file mode 100644
index 0000000..f43a9c7
--- /dev/null
+++ b/testprogs/win32/spoolss/README.win32
@@ -0,0 +1,65 @@
+
+This directory holds sources for a Win32 test utility to test the "spoolss"
+(print spool subsystem) functions of either a Windows or a Samba server. The
+sources are known to build with (free as in beer) Microsoft Visual C++ 2008
+Express Edition's "nmake.exe" on Windows XP Professional.
+
+
+How to build
+------------
+
+Use the Microsoft "nmake" command to build the *.exe. This command is in your
+%path% if you start the "Visual Studio 2008 Command Prompt" from your Start
+menu.
+
+Currently the real build target is named "testspoolss.exe". Run
+
+ nmake /f Makefile
+
+to build the testspoolss.exe. After a successful build you may want to clean up
+temporary files:
+
+ nmake /f Makefile cleantmp
+
+
+How to use
+----------
+
+Running testspoolss.exe with no additional params displays a short usage info.
+
+..............................................................................
+usage: testspoolss.exe <name> [print] [samba3] [architecture=ARCHITECTURE]
+
+ <name> can be a server or printer name URI
+ [print] will print all data that has been retrieved
+ from the printserver
+ [samba3] will skip some tests samba servers are known
+ not to have implemented
+ [architecture=X] allows one to define a specific
+ architecture to test with. choose between:
+ "Windows NT x86" or "Windows x64"
+..............................................................................
+
+The utility may be most useful if you use the "print" parameter to output all
+data received from the print server. You may re-direct the data into log files
+for later evaluation like this:
+
+ testspoolss.exe \\smbserver print samba3 1>smbserver.log 2>smbserver.err
+ testspoolss.exe \\smbserver print 1>smbserver.log 2>smbserver.err
+ testspoolss.exe \\winserver print 1>winserver.log 2>winserver.err
+
+One interesting source of learning could be to compare the output for (maybe
+"the same") printers/drivers as installed on a Windows and on a Samba print
+server:
+
+ testspoolss.exe \\winserver\printername print 1>winprinter.log 2>winprinter.err
+ testspoolss.exe \\smbserver\printername print 1>smbprinter.log 2>smbprinter.err
+
+and then compare the respective log files with a diff utility of your choice.
+To install "the same" printer/driver on a Samba server as on a Windows server,
+you can use the Samba "net" utility, which has the following syntax:
+
+ net rpc printer MIGRATE PRINTERS printername \
+ --server=winserver \
+ --destination=smbserver \
+ -UAdministrator%secretpassword
diff --git a/testprogs/win32/spoolss/error.c b/testprogs/win32/spoolss/error.c
new file mode 100644
index 0000000..3f96594
--- /dev/null
+++ b/testprogs/win32/spoolss/error.c
@@ -0,0 +1,137 @@
+/*
+ Unix SMB/CIFS implementation.
+ test suite for spoolss rpc operations
+
+ Copyright (C) Guenther Deschner 2009
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testspoolss.h"
+
+const char *errstr(DWORD error)
+{
+ static char tmp[20];
+
+ switch (error) {
+ case ERROR_FILE_NOT_FOUND:
+ return "ERROR_FILE_NOT_FOUND";
+ case ERROR_ACCESS_DENIED:
+ return "ERROR_ACCESS_DENIED";
+ case ERROR_INVALID_PARAMETER:
+ return "ERROR_INVALID_PARAMETER";
+ case ERROR_INVALID_HANDLE:
+ return "ERROR_INVALID_HANDLE";
+ case ERROR_CALL_NOT_IMPLEMENTED:
+ return "ERROR_CALL_NOT_IMPLEMENTED";
+ case ERROR_INSUFFICIENT_BUFFER:
+ return "ERROR_INSUFFICIENT_BUFFER";
+ case ERROR_INVALID_NAME:
+ return "ERROR_INVALID_NAME";
+ case ERROR_INVALID_LEVEL:
+ return "ERROR_INVALID_LEVEL";
+ case ERROR_INVALID_DATA:
+ return "ERROR_INVALID_DATA";
+ case ERROR_MORE_DATA:
+ return "ERROR_MORE_DATA";
+ case ERROR_NO_MORE_ITEMS:
+ return "ERROR_NO_MORE_ITEMS";
+#ifdef ERROR_INVALID_DATATYPE
+ case ERROR_INVALID_DATATYPE:
+ return "ERROR_INVALID_DATATYPE";
+#endif
+ case ERROR_INVALID_ENVIRONMENT:
+ return "ERROR_INVALID_ENVIRONMENT";
+ case ERROR_INVALID_PRINTER_COMMAND:
+ return "ERROR_INVALID_PRINTER_COMMAND";
+ case ERROR_PRINTER_ALREADY_EXISTS:
+ return "ERROR_PRINTER_ALREADY_EXISTS";
+ case ERROR_INVALID_PRINTER_NAME:
+ return "ERROR_INVALID_PRINTER_NAME";
+ case ERROR_INVALID_PRIORITY:
+ return "ERROR_INVALID_PRIORITY";
+ case ERROR_INVALID_SEPARATOR_FILE:
+ return "ERROR_INVALID_SEPARATOR_FILE";
+ case ERROR_UNKNOWN_PRINTPROCESSOR:
+ return "ERROR_UNKNOWN_PRINTPROCESSOR";
+ case ERROR_UNKNOWN_PRINTER_DRIVER:
+ return "ERROR_UNKNOWN_PRINTER_DRIVER";
+ case ERROR_UNKNOWN_PORT:
+ return "ERROR_UNKNOWN_PORT";
+ case ERROR_PRINTER_DRIVER_ALREADY_INSTALLED:
+ return "ERROR_PRINTER_DRIVER_ALREADY_INSTALLED";
+ case ERROR_UNKNOWN_PRINT_MONITOR:
+ return "ERROR_UNKNOWN_PRINT_MONITOR";
+ case ERROR_PRINTER_DRIVER_IN_USE:
+ return "ERROR_PRINTER_DRIVER_IN_USE";
+ case ERROR_SPOOL_FILE_NOT_FOUND:
+ return "ERROR_SPOOL_FILE_NOT_FOUND";
+ case ERROR_SPL_NO_STARTDOC:
+ return "ERROR_SPL_NO_STARTDOC";
+ case ERROR_SPL_NO_ADDJOB:
+ return "ERROR_SPL_NO_ADDJOB";
+ case ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED:
+ return "ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED";
+ case ERROR_PRINT_MONITOR_ALREADY_INSTALLED:
+ return "ERROR_PRINT_MONITOR_ALREADY_INSTALLED";
+ case ERROR_INVALID_PRINT_MONITOR:
+ return "ERROR_INVALID_PRINT_MONITOR";
+ case ERROR_PRINT_MONITOR_IN_USE:
+ return "ERROR_PRINT_MONITOR_IN_USE";
+ case ERROR_PRINTER_HAS_JOBS_QUEUED:
+ return "ERROR_PRINTER_HAS_JOBS_QUEUED";
+ case ERROR_PRINTER_NOT_FOUND:
+ return "ERROR_PRINTER_NOT_FOUND";
+ case ERROR_PRINTER_DRIVER_WARNED:
+ return "ERROR_PRINTER_DRIVER_WARNED";
+ case ERROR_PRINTER_DRIVER_BLOCKED:
+ return "ERROR_PRINTER_DRIVER_BLOCKED";
+#ifdef ERROR_PRINTER_DRIVER_PACKAGE_IN_USE
+ case ERROR_PRINTER_DRIVER_PACKAGE_IN_USE:
+ return "ERROR_PRINTER_DRIVER_PACKAGE_IN_USE";
+#endif
+#ifdef ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND
+ case ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND:
+ return "ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND";
+#endif
+#ifdef ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED
+ case ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED:
+ return "ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED";
+#endif
+#ifdef ERROR_PRINT_JOB_RESTART_REQUIRED
+ case ERROR_PRINT_JOB_RESTART_REQUIRED:
+ return "ERROR_PRINT_JOB_RESTART_REQUIRED";
+#endif
+ case ERROR_CANCELLED:
+ return "ERROR_CANCELLED";
+ case ERROR_NOACCESS:
+ return "ERROR_NOACCESS";
+ case RPC_X_NULL_REF_POINTER:
+ return "RPC_X_NULL_REF_POINTER";
+ case RPC_S_PROCNUM_OUT_OF_RANGE:
+ return "RPC_S_PROCNUM_OUT_OF_RANGE";
+ case RPC_S_SERVER_UNAVAILABLE:
+ return "RPC_S_SERVER_UNAVAILABLE";
+ case RPC_S_INVALID_NET_ADDR:
+ return "RPC_S_INVALID_NET_ADDR";
+ case RPC_S_CALL_FAILED:
+ return "RPC_S_CALL_FAILED";
+ default:
+ break;
+ }
+
+ sprintf(tmp, "0x%08x", error);
+
+ return tmp;
+}
diff --git a/testprogs/win32/spoolss/error.h b/testprogs/win32/spoolss/error.h
new file mode 100644
index 0000000..581c109
--- /dev/null
+++ b/testprogs/win32/spoolss/error.h
@@ -0,0 +1,36 @@
+/*
+ Unix SMB/CIFS implementation.
+ test suite for spoolss rpc operations
+
+ Copyright (C) Guenther Deschner 2009
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef ERROR_INVALID_PARAMETER
+#define ERROR_INVALID_PARAMETER 87
+#endif
+
+#ifndef ERROR_INSUFFICIENT_BUFFER
+#define ERROR_INSUFFICIENT_BUFFER 0x007a
+#endif
+
+#if 0
+#ifdef STATUS_PENDING
+#undef STATUS_PENDING
+#define STATUS_PENDING 0x0103
+#endif
+#endif
+
+const char *errstr(DWORD error);
diff --git a/testprogs/win32/spoolss/printlib.c b/testprogs/win32/spoolss/printlib.c
new file mode 100644
index 0000000..1dd1277
--- /dev/null
+++ b/testprogs/win32/spoolss/printlib.c
@@ -0,0 +1,1386 @@
+/*
+ Unix SMB/CIFS implementation.
+ test suite for spoolss rpc operations
+
+ Copyright (C) Gerald (Jerry) Carter 2007
+ Copyright (C) Guenther Deschner 2009-2010
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <windows.h>
+#include <stdio.h>
+#include <assert.h>
+#include <sddl.h>
+
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+
+void print_devmode(DEVMODE *pDevModeIn)
+{
+ if (pDevModeIn == NULL) {
+ printf("\tDevice Mode\t= (null)\n");
+ return;
+ }
+
+ printf("\tDEVMODE:----------\n");
+ printf("\tDeviceName: [%s]\n", pDevModeIn->dmDeviceName);
+ printf("\tSpecVersion: %d\n", pDevModeIn->dmSpecVersion);
+ printf("\tDriverVersion: %d\n", pDevModeIn->dmDriverVersion);
+ printf("\tSize: %d\n", pDevModeIn->dmSize);
+ printf("\tDriverExtra: %d\n", pDevModeIn->dmDriverExtra);
+ printf("\tFields: 0x%x\n", pDevModeIn->dmFields);
+
+ if (pDevModeIn->dmFields & DM_ORIENTATION)
+ printf("\tOrientation: %d\n", pDevModeIn->dmOrientation);
+ if (pDevModeIn->dmFields & DM_PAPERSIZE)
+ printf("\tPaperSize: %d\n", pDevModeIn->dmPaperSize);
+ if (pDevModeIn->dmFields & DM_PAPERLENGTH)
+ printf("\tPaperLength: %d\n", pDevModeIn->dmPaperLength);
+ if (pDevModeIn->dmFields & DM_PAPERWIDTH)
+ printf("\tPaperWidth: %d\n", pDevModeIn->dmPaperWidth);
+// if (pDevModeIn->dmFields & DM_POSITION)
+// printf("\tPosition: %d\n", pDevModeIn->dmPosition);
+ if (pDevModeIn->dmFields & DM_SCALE)
+ printf("\tScale: %d\n", pDevModeIn->dmScale);
+ if (pDevModeIn->dmFields & DM_COPIES)
+ printf("\tCopies: %d\n", pDevModeIn->dmCopies );
+ if (pDevModeIn->dmFields & DM_DEFAULTSOURCE)
+ printf("\tDefaultSource: %d\n", pDevModeIn->dmDefaultSource);
+ if (pDevModeIn->dmFields & DM_PRINTQUALITY)
+ printf("\tPrintQuality: %d\n", pDevModeIn->dmPrintQuality);
+ if (pDevModeIn->dmFields & DM_COLOR)
+ printf("\tColor: %d\n", pDevModeIn->dmColor);
+ if (pDevModeIn->dmFields & DM_DUPLEX)
+ printf("\tDuplex: %d\n", pDevModeIn->dmDuplex);
+ if (pDevModeIn->dmFields & DM_YRESOLUTION)
+ printf("\tYResolution: %d\n", pDevModeIn->dmYResolution);
+ if (pDevModeIn->dmFields & DM_TTOPTION)
+ printf("\tTTOption: %d\n", pDevModeIn->dmTTOption);
+ if (pDevModeIn->dmFields & DM_COLLATE)
+ printf("\tCollate: %d\n", pDevModeIn->dmCollate);
+ if (pDevModeIn->dmFields & DM_FORMNAME)
+ printf("\tForm: [%s]\n", pDevModeIn->dmFormName);
+ if (pDevModeIn->dmFields & DM_LOGPIXELS)
+ printf("\tLogPixels: %d\n", pDevModeIn->dmLogPixels);
+ if (pDevModeIn->dmFields & DM_BITSPERPEL)
+ printf("\tBitsPerPel: %d\n", pDevModeIn->dmBitsPerPel);
+ if (pDevModeIn->dmFields & DM_PELSWIDTH)
+ printf("\tPelsWidth: %d\n", pDevModeIn->dmPelsWidth);
+ if (pDevModeIn->dmFields & DM_PELSHEIGHT)
+ printf("\tPelsHeight: %d\n", pDevModeIn->dmPelsHeight);
+ if (pDevModeIn->dmFields & DM_DISPLAYFLAGS)
+ printf("\tDisplayFlags: %d\n", pDevModeIn->dmDisplayFlags);
+// if (pDevModeIn->dmFields & DM_NUP)
+// printf("\tNup: %d\n", pDevModeIn->dmNup);
+ if (pDevModeIn->dmFields & DM_DISPLAYFREQUENCY)
+ printf("\tDisplayFrequency:%d\n", pDevModeIn->dmDisplayFrequency);
+ if (pDevModeIn->dmFields & DM_ICMMETHOD)
+ printf("\tICMMethod: %d\n", pDevModeIn->dmICMMethod);
+ if (pDevModeIn->dmFields & DM_ICMINTENT)
+ printf("\tICMIntent: %d\n", pDevModeIn->dmICMIntent);
+ if (pDevModeIn->dmFields & DM_MEDIATYPE)
+ printf("\tMediaType: %d\n", pDevModeIn->dmMediaType);
+ if (pDevModeIn->dmFields & DM_DITHERTYPE)
+ printf("\tDitherType: %d\n", pDevModeIn->dmDitherType);
+// if (pDevModeIn->dmFields & DM_PANNINGWIDTH)
+// printf("\tPanningWidth: %d\n", pDevModeIn->dmPanningWidth);
+// if (pDevModeIn->dmFields & DM_PANNINGHEIGHT)
+// printf("\tPanningHeight: %d\n", pDevModeIn->dmPanningHeight);
+
+#if 0
+ if (bForceIn) {
+ printf("DEVMODE\n");
+ Dump((BYTE*)pDevModeIn, sizeof(DEVMODE), LEADER);
+
+ if (pDevModeIn->dmDriverExtra) {
+ printf("DriverExtra\n");
+ Dump((BYTE*)pDevModeIn + sizeof(DEVMODE), pDevModeIn->dmDriverExtra, LEADER);
+ }
+ }
+#endif
+
+ return;
+}
+
+void print_acl(const char* str, ACL *acl)
+{
+ printf("%s\n", str);
+ if (acl == NULL)
+ return;
+
+ printf("\t\tACL Revision \t\t 0x%x\n", acl->AclRevision);
+ printf("\t\tSbz1\t\t 0x%x\n", acl->Sbz1);
+ printf("\t\tSbz2\t\t 0x%x\n", acl->Sbz2);
+ printf("\t\tACL Size\t\t 0x%x\n", acl->AclSize);
+ printf("\t\tACL Count\t\t 0x%x\n", acl->AceCount);
+
+ return;
+}
+
+void PrintLastError();
+
+void print_sid(LPSTR str, PSID sid)
+{
+ LPSTR sid_string;
+
+ printf("%s\n", str);
+
+ if (sid == NULL) {
+ printf("(null sid)\n");
+ return;
+ }
+
+ if (!ConvertSidToStringSid(sid, &sid_string)) {
+ PrintLastError();
+ return;
+ }
+
+ printf("%s\n", sid_string);
+ LocalFree(sid_string);
+
+ return;
+}
+
+void print_secdesc(SECURITY_DESCRIPTOR *secdesc)
+{
+ LPSTR sd_string;
+
+ if (secdesc == NULL) {
+ printf("\tSecurity Descriptor\t= (null)\n");
+ return;
+ }
+
+ if (!ConvertSecurityDescriptorToStringSecurityDescriptor(secdesc, 1, 7, &sd_string, NULL)) {
+ PrintLastError();
+ return;
+ }
+
+ printf("%s\n", sd_string);
+ LocalFree(sd_string);
+
+#if 0
+ printf("\tRevision\t= 0x%x\n", secdesc->Revision);
+ printf("\tSbz1\t\t= 0x%x\n", secdesc->Sbz1);
+ printf("\tControl\t\t= 0x%x\n", secdesc->Control);
+ print_sid("\tOwner\t\t= ", secdesc->Owner);
+ print_sid("\tGroup\t\t= ",secdesc->Group);
+ print_acl("\tSacl\t\t= ", secdesc->Sacl);
+ print_acl("\tDacl\t\t= ", secdesc->Dacl);
+#endif
+ return;
+}
+
+void PrintLastError()
+{
+ LPVOID lpMsgBuf;
+ DWORD status;
+
+ status = GetLastError();
+
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR)&lpMsgBuf, 0, NULL);
+ printf("ERROR [0x%x] : %s\n", status, (char*)lpMsgBuf);
+ LocalFree(lpMsgBuf);
+
+ return;
+}
+
+
+void print_job_info_1(PJOB_INFO_1 info)
+{
+ printf("\tJob ID\t\t= %d\n", info->JobId);
+ printf("\tPrinter Name\t= %s\n", info->pPrinterName);
+ printf("\tMachine Name\t= %s\n", info->pMachineName);
+ printf("\tUser Name\t= %s\n", info->pUserName);
+ printf("\tDocument\t= %s\n", info->pDocument);
+ printf("\tDatatype\t= %s\n", info->pDatatype);
+ printf("\tStatus\t\t= %s\n", info->pStatus);
+ printf("\tStatus\t= %d\n", info->Status);
+ printf("\tPriority\t= %d\n", info->Priority);
+ printf("\tPosition\t= %d\n", info->Position);
+ printf("\tTotal Pages\t= %d\n", info->TotalPages);
+ printf("\tPages Printed\t= %d\n", info->PagesPrinted);
+ printf("\tSubmitted (DD:MM:YY HH:MM:SS)\t= %d:%d:%d %d:%d:%d UTC\n",
+ info->Submitted.wDay, info->Submitted.wMonth,
+ info->Submitted.wYear, info->Submitted.wHour,
+ info->Submitted.wMinute, info->Submitted.wSecond);
+
+ return;
+}
+
+void print_job_info_2(PJOB_INFO_2 info)
+{
+ printf("\tJob ID\t\t= %d\n", info->JobId);
+ printf("\tPrinter Name\t= %s\n", info->pPrinterName);
+ printf("\tMachine Name\t= %s\n", info->pMachineName);
+ printf("\tUser Name\t= %s\n", info->pUserName);
+ printf("\tDocument\t= %s\n", info->pDocument);
+ printf("\tDatatype\t= %s\n", info->pDatatype);
+ printf("\tNotify Name\t= %s\n", info->pNotifyName);
+ printf("\tPrint Processor\t= %s\n", info->pPrintProcessor);
+ printf("\tParameters\t= %s\n", info->pParameters);
+ printf("\tDriver Name\t= %s\n", info->pDriverName);
+ printf("\tStatus\t\t= %s\n", info->pStatus);
+ printf("\tStatus\t\t= %d\n", info->Status);
+ printf("\tPriority\t= %d\n", info->Priority);
+ printf("\tPosition\t= %d\n", info->Position);
+ printf("\tTotal Pages\t= %d\n", info->TotalPages);
+ printf("\tPages Printed\t= %d\n", info->PagesPrinted);
+ printf("\tStart Time\t= %d\n", info->StartTime);
+ printf("\tUntil Time\t= %d\n", info->UntilTime);
+ printf("\tTime\t\t= %d\n", info->Time);
+ printf("\tSize\t\t= %d\n", info->Size);
+ printf("\tSubmitted (DD:MM:YY HH:MM:SS)\t= %d:%d:%d %d:%d:%d UTC\n",
+ info->Submitted.wDay, info->Submitted.wMonth,
+ info->Submitted.wYear, info->Submitted.wHour,
+ info->Submitted.wMinute, info->Submitted.wSecond);
+ printf("\tDevice Mode Information\n");
+ printf("\t-----------------------\n");
+ print_devmode(info->pDevMode);
+ printf("\tSecurity Descriptor Information\n");
+ printf("\t-------------------------------\n");
+ print_secdesc(info->pSecurityDescriptor);
+
+ return;
+}
+
+void print_job_info_3(PJOB_INFO_3 info)
+{
+ printf("\tJob ID\t\t= %d\n", info->JobId);
+ printf("\tJob ID Next Job\t= %d\n", info->NextJobId);
+ printf("\tReserved (must be 0)\t= %d\n",info->Reserved);
+
+ return;
+}
+
+void print_job_info_4(PJOB_INFO_4 info)
+{
+ printf("\tJob ID\t\t= %d\n", info->JobId);
+ printf("\tPrinter Name\t= %s\n", info->pPrinterName);
+ printf("\tMachine Name\t= %s\n", info->pMachineName);
+ printf("\tUser Name\t= %s\n", info->pUserName);
+ printf("\tDocument\t= %s\n", info->pDocument);
+ printf("\tDatatype\t= %s\n", info->pDatatype);
+ printf("\tNotify Name\t= %s\n", info->pNotifyName);
+ printf("\tPrint Processor\t= %s\n", info->pPrintProcessor);
+ printf("\tDriver Name\t= %s\n", info->pDriverName);
+ printf("\tStatus\t\t= %s\n", info->pStatus);
+ printf("\tStatus\t\t= %d\n", info->Status);
+ printf("\tPriority\t= %d\n", info->Priority);
+ printf("\tPosition\t= %d\n", info->Position);
+ printf("\tTotal Pages\t= %d\n", info->TotalPages);
+ printf("\tPages Printed\t= %d\n", info->PagesPrinted);
+ printf("\tStart Time\t= %d\n", info->StartTime);
+ printf("\tUntil Time\t= %d\n", info->UntilTime);
+ printf("\tTime\t\t= %d\n", info->Time);
+ printf("\tSize\t\t= %d\n", info->Size);
+ printf("\tSize High\t\t= 0x%016x\n", info->SizeHigh);
+ printf("\tSubmitted (DD:MM:YY HH:MM:SS)\t= %d:%d:%d %d:%d:%d UTC\n",
+ info->Submitted.wDay, info->Submitted.wMonth,
+ info->Submitted.wYear, info->Submitted.wHour,
+ info->Submitted.wMinute, info->Submitted.wSecond);
+ printf("\tDevice Mode Information\n");
+ printf("\t-----------------------\n");
+ print_devmode(info->pDevMode);
+ printf("\tSecurity Descriptor Information\n");
+ printf("\t-------------------------------\n");
+ print_secdesc(info->pSecurityDescriptor);
+
+ return;
+}
+
+void print_job_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PJOB_INFO_1 buffer1 = NULL;
+ PJOB_INFO_2 buffer2 = NULL;
+ PJOB_INFO_3 buffer3 = NULL;
+ PJOB_INFO_4 buffer4 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PJOB_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PJOB_INFO_2)buffer;
+ break;
+ case 3:
+ buffer3 = (PJOB_INFO_3)buffer;
+ break;
+ case 4:
+ buffer4 = (PJOB_INFO_4)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Job Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_job_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_job_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ case 3:
+ for (i=0; i<count; i++) {
+ print_job_info_3(&buffer3[i]);
+ printf("\n");
+ }
+ break;
+ case 4:
+ for (i=0; i<count; i++) {
+ print_job_info_4(&buffer4[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_monitor_info_1(PMONITOR_INFO_1 info)
+{
+ printf("\tMonitor Name\t= %s\n", info->pName);
+
+ return;
+}
+
+void print_monitor_info_2(PMONITOR_INFO_2 info)
+{
+ printf("\tMonitor Name\t= %s\n", info->pName);
+ printf("\tEnvironment\t= %s\n", info->pEnvironment);
+ printf("\tDLL Name\t= %s\n", info->pDLLName);
+
+ return;
+}
+
+void print_monitor_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PMONITOR_INFO_1 buffer1 = NULL;
+ PMONITOR_INFO_2 buffer2 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PMONITOR_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PMONITOR_INFO_2)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Monitor Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_monitor_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_monitor_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_port_info_1(PPORT_INFO_1 info)
+{
+ printf("\tPort Name\t= %s\n", info->pName);
+ return;
+}
+
+void print_port_info_2(PPORT_INFO_2 info)
+{
+ printf("\tPort Name\t= %s\n", info->pPortName);
+ printf("\tMonitor Name\t= %s\n",info->pMonitorName);
+ printf("\tDescription\t= %s\n", info->pDescription);
+ printf("\tPort Type\t= 0x%08x\n", info->fPortType);
+ printf("\tReserved\t= 0x%08x\n", info->Reserved);
+ return;
+}
+
+void print_port_info_3(PPORT_INFO_3 info)
+{
+ printf("\tStatus\t= 0x%08x\n", info->dwStatus);
+ printf("\tStatus String\t= %s\n", info->pszStatus);
+ printf("\tSeverity\t= 0x%08x\n", info->dwSeverity);
+ return;
+}
+
+void print_port_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PPORT_INFO_1 buffer1 = NULL;
+ PPORT_INFO_2 buffer2 = NULL;
+ PPORT_INFO_3 buffer3 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PPORT_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PPORT_INFO_2)buffer;
+ break;
+ case 3:
+ buffer3 = (PPORT_INFO_3)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Port Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_port_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_port_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ case 3:
+ for (i=0; i<count; i++) {
+ print_port_info_3(&buffer3[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_form_info_1(PFORM_INFO_1 info)
+{
+ printf("\tForm Name\t= %s\n", info->pName);
+ printf("\tFlags\t\t= 0x%x\n", info->Flags);
+ printf("\tSize\t\t= %d x %d\n", info->Size.cx, info->Size.cy);
+ printf("\tRectangle\t= [left]%d [right]%d [top]%d [bottom]%d\n",
+ info->ImageableArea.left, info->ImageableArea.right,
+ info->ImageableArea.top, info->ImageableArea.bottom);
+
+ return;
+}
+
+void print_form_info_2(PFORM_INFO_2 info)
+{
+ printf("\tForm Name\t= %s\n", info->pName);
+ printf("\tFlags\t\t= 0x%x\n", info->Flags);
+ printf("\tSize\t\t= %d x %d\n", info->Size.cx, info->Size.cy);
+ printf("\tRectangle\t= [left]%d [right]%d [top]%d [bottom]%d\n",
+ info->ImageableArea.left, info->ImageableArea.right,
+ info->ImageableArea.top, info->ImageableArea.bottom);
+ printf("\tKeyword\t= %s\n", info->pKeyword);
+ printf("\tString Type\t= 0x%08x\n", info->StringType);
+ printf("\tMui DLL\t= %s\n", info->pMuiDll);
+ printf("\tResource Id\t= 0x%08x\n", info->dwResourceId);
+ printf("\tDisplay Name\t= %s\n",info->pDisplayName);
+ printf("\tLang Id\t= 0x%04x\n", info->wLangId);
+
+ return;
+}
+
+void print_form_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PFORM_INFO_1 buffer1 = NULL;
+ PFORM_INFO_2 buffer2 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PFORM_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PFORM_INFO_2)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Form Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_form_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_form_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_printer_info_1(PPRINTER_INFO_1 info)
+{
+ printf("\tPrinter Name\t= %s\n", info->pName);
+ printf("\tDescription\t= %s\n", info->pDescription);
+ printf("\tComment\t\t= %s\n", info->pComment);
+ printf("\tFlags\t\t= 0x%x\n", info->Flags);
+
+ return;
+}
+
+void print_printer_info_2(PPRINTER_INFO_2 info)
+{
+ printf("\tServer Name\t\t= %s\n", info->pServerName);
+ printf("\tPrinter Name\t\t= %s\n", info->pPrinterName);
+ printf("\tPort Name\t\t= %s\n", info->pPortName);
+ printf("\tShare Name\t\t= %s\n", info->pShareName);
+ printf("\tDriver Name\t\t= %s\n", info->pDriverName);
+ printf("\tComment\t\t\t= %s\n", info->pComment);
+ printf("\tLocation\t\t= %s\n", info->pLocation);
+ printf("\tSeparator File\t\t= %s\n", info->pSepFile);
+ printf("\tDefault Data Type\t= %s\n", info->pDatatype);
+ printf("\tPrint Processor\t\t= %s\n", info->pPrintProcessor);
+ printf("\tParameters\t\t= %s\n", info->pParameters);
+ printf("\tAttributes\t\t= 0x%x\n", info->Attributes);
+ printf("\tPriority\t\t= 0x%x\n", info->Priority);
+ printf("\tDefault Priority\t= 0x%x\n", info->DefaultPriority);
+ printf("\tStart Time\t\t= 0x%x\n", info->StartTime);
+ printf("\tUntil Time\t\t= 0x%x\n", info->UntilTime);
+ printf("\tStatus\t\t\t= 0x%x\n", info->Status);
+ printf("\tcJobs\t\t\t= 0x%x\n", info->cJobs);
+ printf("\tAverage PPM\t\t= 0x%x\n", info->AveragePPM);
+
+ printf("\tDevice Mode Information\n");
+ printf("\t-----------------------\n");
+ print_devmode(info->pDevMode);
+ printf("\tSecurity Descriptor Information\n");
+ printf("\t-------------------------------\n");
+ print_secdesc(info->pSecurityDescriptor);
+ return;
+}
+
+void print_printer_info_3(PPRINTER_INFO_3 info)
+{
+ printf("\tSecurity Descriptor Information\n");
+ printf("\t-------------------------------\n");
+ print_secdesc(info->pSecurityDescriptor);
+ return;
+}
+
+void print_printer_info_4(PPRINTER_INFO_4 info)
+{
+ printf("\tServer Name\t\t= %s\n", info->pServerName);
+ printf("\tPrinter Name\t\t= %s\n", info->pPrinterName);
+ printf("\tAttributes\t\t= 0x%x\n", info->Attributes);
+ return;
+}
+
+void print_printer_info_5(PPRINTER_INFO_5 info)
+{
+ printf("\tPrinter Name\t\t\t= %s\n", info->pPrinterName);
+ printf("\tPort Name\t\t\t= %s\n", info->pPortName);
+ printf("\tAttributes\t\t\t= 0x%x\n", info->Attributes);
+ printf("\tDev NotSelect Timeout\t= 0x%x\n", info->DeviceNotSelectedTimeout);
+ printf("\tTX RetryTimeout\t\t= 0x%x\n", info->TransmissionRetryTimeout);
+ return;
+}
+
+void print_printer_info_6(PPRINTER_INFO_6 info)
+{
+ printf("\tStatus\t\t\t= 0x%x\n", info->dwStatus);
+ return;
+}
+
+void print_printer_info_7(PPRINTER_INFO_7 info)
+{
+ printf("\tObject GUID\t\t\t= %s\n", info->pszObjectGUID);
+ printf("\tAction\t\t\t= 0x%x\n", info->dwAction);
+ return;
+}
+
+void print_printer_info_8(PPRINTER_INFO_8 info)
+{
+ print_devmode(info->pDevMode);
+}
+
+void print_printer_info_9(PPRINTER_INFO_9 info)
+{
+ print_devmode(info->pDevMode);
+}
+
+void print_printer_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PPRINTER_INFO_1 buffer1 = NULL;
+ PPRINTER_INFO_2 buffer2 = NULL;
+ PPRINTER_INFO_3 buffer3 = NULL;
+ PPRINTER_INFO_4 buffer4 = NULL;
+ PPRINTER_INFO_5 buffer5 = NULL;
+ PPRINTER_INFO_6 buffer6 = NULL;
+ PPRINTER_INFO_7 buffer7 = NULL;
+ PPRINTER_INFO_8 buffer8 = NULL;
+ PPRINTER_INFO_9 buffer9 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PPRINTER_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PPRINTER_INFO_2)buffer;
+ break;
+ case 3:
+ buffer3 = (PPRINTER_INFO_3)buffer;
+ break;
+ case 4:
+ buffer4 = (PPRINTER_INFO_4)buffer;
+ break;
+ case 5:
+ buffer5 = (PPRINTER_INFO_5)buffer;
+ break;
+ case 6:
+ buffer6 = (PPRINTER_INFO_6)buffer;
+ break;
+ case 7:
+ buffer7 = (PPRINTER_INFO_7)buffer;
+ break;
+ case 8:
+ buffer8 = (PPRINTER_INFO_8)buffer;
+ break;
+ case 9:
+ buffer9 = (PPRINTER_INFO_9)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Printer Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_printer_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_printer_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ case 3:
+ for (i=0; i<count; i++) {
+ print_printer_info_3(&buffer3[i]);
+ printf("\n");
+ }
+ break;
+ case 4:
+ for (i=0; i<count; i++) {
+ print_printer_info_4(&buffer4[i]);
+ printf("\n");
+ }
+ break;
+ case 5:
+ for (i=0; i<count; i++) {
+ print_printer_info_5(&buffer5[i]);
+ printf("\n");
+ }
+ break;
+ case 6:
+ for (i=0; i<count; i++) {
+ print_printer_info_6(&buffer6[i]);
+ printf("\n");
+ }
+ break;
+ case 7:
+ for (i=0; i<count; i++) {
+ print_printer_info_7(&buffer7[i]);
+ printf("\n");
+ }
+ break;
+ case 8:
+ for (i=0; i<count; i++) {
+ print_printer_info_8(&buffer8[i]);
+ printf("\n");
+ }
+ break;
+ case 9:
+ for (i=0; i<count; i++) {
+ print_printer_info_9(&buffer9[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_printprocessor_info_1(PPRINTPROCESSOR_INFO_1 info)
+{
+ printf("\tPrint Processor Name\t= %s\n", info->pName);
+
+ return;
+}
+
+void print_printprocessor_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PPRINTPROCESSOR_INFO_1 buffer1 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PPRINTPROCESSOR_INFO_1)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Print Processor Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_printprocessor_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_datatypes_info_1(PDATATYPES_INFO_1 info)
+{
+ printf("\tDataTypes Name\t= %s\n", info->pName);
+
+ return;
+}
+
+void print_datatypes_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PDATATYPES_INFO_1 buffer1 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PDATATYPES_INFO_1)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("DataTypes Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_datatypes_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_driver_info_1(PDRIVER_INFO_1 info)
+{
+ printf("\tDriver Name\t= %s\n\n", info->pName);
+
+ return;
+}
+
+void print_driver_info_2(PDRIVER_INFO_2 info)
+{
+ printf("\tDriver Name\t= %s\n", info->pName);
+ printf("\tEnvironment\t= %s\n", info->pEnvironment);
+ printf("\tVersion\t\t= %d\n", info->cVersion);
+ printf("\tDriver Path\t= %s\n", info->pDriverPath);
+ printf("\tData File\t= %s\n", info->pDataFile);
+ printf("\tConfig File\t= %s\n\n", info->pConfigFile);
+
+ return;
+}
+
+void print_driver_info_3(PDRIVER_INFO_3 info)
+{
+ char *ptr = NULL;
+
+ printf("\tDriver Name\t= %s\n", info->pName);
+ printf("\tEnvironment\t= %s\n", info->pEnvironment);
+ printf("\tVersion\t\t= %d\n", info->cVersion);
+ printf("\tDriver Path\t= %s\n", info->pDriverPath);
+ printf("\tData File\t= %s\n", info->pDataFile);
+ printf("\tConfig File\t= %s\n", info->pConfigFile);
+ printf("\tHelp Path\t= %s\n", info->pHelpFile);
+ printf("\tMonitor Name\t= %s\n", info->pMonitorName);
+ printf("\tData Type\t= %s\n", info->pDefaultDataType);
+ ptr = (char*)info->pDependentFiles;
+ while ((ptr != NULL) && (*ptr != '\0')) {
+ printf("\tDependent Files\t= %s\n", ptr);
+ for (;*ptr != '\0'; ptr++)
+ /* printf("%s\n", ptr); */
+ ;
+ ptr++;
+ }
+
+ return;
+}
+
+void print_driver_info_4(PDRIVER_INFO_4 info)
+{
+ char *ptr = NULL;
+
+ printf("\tDriver Name\t= %s\n", info->pName);
+ printf("\tEnvironment\t= %s\n", info->pEnvironment);
+ printf("\tVersion\t\t= %d\n", info->cVersion);
+ printf("\tDriver Path\t= %s\n", info->pDriverPath);
+ printf("\tData File\t= %s\n", info->pDataFile);
+ printf("\tConfig File\t= %s\n", info->pConfigFile);
+ printf("\tHelp Path\t= %s\n", info->pHelpFile);
+ printf("\tMonitor Name\t= %s\n", info->pMonitorName);
+ printf("\tData Type\t= %s\n", info->pDefaultDataType);
+ printf("\tPrevious Names\t= %s\n", info->pszzPreviousNames);
+ ptr = (char*)info->pDependentFiles;
+ while ((ptr != NULL) && (*ptr != '\0')) {
+ printf("\tDependent Files\t= %s\n", ptr);
+ for (;*ptr != '\0'; ptr++)
+ /* printf("%s\n", ptr); */
+ ;
+ ptr++;
+ }
+
+ return;
+}
+
+void print_driver_info_5(PDRIVER_INFO_5 info)
+{
+ printf("\tDriver Name\t= %s\n", info->pName);
+ printf("\tEnvironment\t= %s\n", info->pEnvironment);
+ printf("\tVersion\t\t= %d\n", info->cVersion);
+ printf("\tDriver Path\t= %s\n", info->pDriverPath);
+ printf("\tData File\t= %s\n", info->pDataFile);
+ printf("\tConfig File\t= %s\n", info->pConfigFile);
+ printf("\tDriver Attributes\t= %d\n", info->dwDriverAttributes);
+ printf("\tConfig Version\t= %d\n", info->dwConfigVersion);
+ printf("\tDriver Version\t= %d\n", info->dwDriverVersion);
+
+ return;
+}
+
+void print_driver_info_6(PDRIVER_INFO_6 info)
+{
+ char *ptr = NULL;
+
+ printf("\tDriver Name\t= %s\n", info->pName);
+ printf("\tEnvironment\t= %s\n", info->pEnvironment);
+ printf("\tVersion\t\t= %d\n", info->cVersion);
+ printf("\tDriver Path\t= %s\n", info->pDriverPath);
+ printf("\tData File\t= %s\n", info->pDataFile);
+ printf("\tConfig File\t= %s\n", info->pConfigFile);
+ printf("\tHelp Path\t= %s\n", info->pHelpFile);
+ printf("\tMonitor Name\t= %s\n", info->pMonitorName);
+ printf("\tData Type\t= %s\n", info->pDefaultDataType);
+ printf("\tPrevious Names\t= %s\n", info->pszzPreviousNames);
+ ptr = (char*)info->pDependentFiles;
+ if (ptr != NULL) {
+ while (*ptr != '\0') {
+ printf("\tDependent Files\t= %s\n", ptr);
+ for (;*ptr != '\0'; ptr++)
+ /* printf("%s\n", ptr); */
+ ;
+ ptr++;
+ }
+ } else {
+ printf("\tPrevious Names\t= (null)\n");
+ }
+
+ ptr = (char*)info->pszzPreviousNames;
+ if (ptr != NULL) {
+ while (*ptr != '\0') {
+ printf("\tPrevious Names\t= %s\n", ptr);
+ for (;*ptr != '\0'; ptr++)
+ /* printf("%s\n", ptr); */
+ ;
+ ptr++;
+ }
+ } else {
+ printf("\tPrevious Names\t= (null)\n");
+ }
+
+ printf("\tDriver Date\t= %d (%08x:%08x)\n",
+ info->ftDriverDate,
+ info->ftDriverDate.dwLowDateTime,
+ info->ftDriverDate.dwHighDateTime);
+ printf("\t\t");
+ print_file_time(&info->ftDriverDate);
+ printf("\tDriver Version\t= %d\n", info->dwlDriverVersion);
+ printf("\tManufacture Name = %s\n", info->pszMfgName);
+ printf("\tOEM URL\t\t= %s\n", info->pszOEMUrl);
+ printf("\tHardware ID\t= %s\n", info->pszHardwareID);
+ printf("\tProvider\t= %s\n", info->pszProvider);
+ return;
+}
+
+static void print_multi_sz(LPSTR multisz)
+{
+ char *ptr = NULL;
+
+ ptr = (char *)multisz;
+
+ if (!ptr) {
+ printf("(null)\n");
+ return;
+ }
+
+ while (*ptr != '\0') {
+ printf("%s\n", ptr);
+ for (; *ptr != '\0'; ptr++) {
+ /* printf("%s\n", ptr); */
+ ;
+ }
+ ptr++;
+ }
+}
+
+void print_driver_info_8(PDRIVER_INFO_8 info)
+{
+ printf("\tDriver Name\t= %s\n", info->pName);
+ printf("\tEnvironment\t= %s\n", info->pEnvironment);
+ printf("\tVersion\t\t= %d\n", info->cVersion);
+ printf("\tDriver Path\t= %s\n", info->pDriverPath);
+ printf("\tData File\t= %s\n", info->pDataFile);
+ printf("\tConfig File\t= %s\n", info->pConfigFile);
+ printf("\tHelp Path\t= %s\n", info->pHelpFile);
+ printf("\tMonitor Name\t= %s\n", info->pMonitorName);
+ printf("\tData Type\t= %s\n", info->pDefaultDataType);
+ printf("\tPrevious Names\t=\n");
+ print_multi_sz(info->pszzPreviousNames);
+ printf("\tDependent Files\t=\n");
+ print_multi_sz(info->pDependentFiles);
+ printf("\tDriver Date\t= %d (%08x:%08x)\n",
+ info->ftDriverDate,
+ info->ftDriverDate.dwLowDateTime,
+ info->ftDriverDate.dwHighDateTime);
+ printf("\t\t");
+ print_file_time(&info->ftDriverDate);
+ printf("\tDriver Version\t= %d\n", info->dwlDriverVersion);
+ printf("\tManufacture Name = %s\n", info->pszMfgName);
+ printf("\tOEM URL\t\t= %s\n", info->pszOEMUrl);
+ printf("\tHardware ID\t= %s\n", info->pszHardwareID);
+ printf("\tProvider\t= %s\n", info->pszProvider);
+ printf("\tPrint Processor\t= %s\n", info->pszPrintProcessor);
+ printf("\tVendor Setup\t= %s\n", info->pszVendorSetup);
+ printf("\tColor Profiles\t=\n");
+ print_multi_sz(info->pszzColorProfiles);
+ printf("\tInf Path\t= %s\n", info->pszInfPath);
+ printf("\tPrinter Driver Attributes = %d\n", info->dwPrinterDriverAttributes);
+ printf("\tCore Driver Dependencies\t=\n");
+ print_multi_sz(info->pszzCoreDriverDependencies);
+ printf("\tMin Inbox Driver VerDate\t= %d (%08x:%08x)\n",
+ info->ftMinInboxDriverVerDate,
+ info->ftMinInboxDriverVerDate.dwLowDateTime,
+ info->ftMinInboxDriverVerDate.dwHighDateTime);
+ printf("\t\t");
+ print_file_time(&info->ftMinInboxDriverVerDate);
+ printf("\tMin Inbox Driver VerVersion\t= %d\n", info->dwlMinInboxDriverVerVersion);
+ return;
+}
+
+void print_driver_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PDRIVER_INFO_1 buffer1 = NULL;
+ PDRIVER_INFO_2 buffer2 = NULL;
+ PDRIVER_INFO_3 buffer3 = NULL;
+ PDRIVER_INFO_4 buffer4 = NULL;
+ PDRIVER_INFO_5 buffer5 = NULL;
+ PDRIVER_INFO_6 buffer6 = NULL;
+ PDRIVER_INFO_8 buffer8 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PDRIVER_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PDRIVER_INFO_2)buffer;
+ break;
+ case 3:
+ buffer3 = (PDRIVER_INFO_3)buffer;
+ break;
+ case 4:
+ buffer4 = (PDRIVER_INFO_4)buffer;
+ break;
+ case 5:
+ buffer5 = (PDRIVER_INFO_5)buffer;
+ break;
+ case 6:
+ buffer6 = (PDRIVER_INFO_6)buffer;
+ break;
+ case 8:
+ buffer8 = (PDRIVER_INFO_8)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Driver Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_driver_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_driver_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ case 3:
+ for (i=0; i<count; i++) {
+ print_driver_info_3(&buffer3[i]);
+ printf("\n");
+ }
+ break;
+ case 4:
+ for (i=0; i<count; i++) {
+ print_driver_info_4(&buffer4[i]);
+ printf("\n");
+ }
+ break;
+ case 5:
+ for (i=0; i<count; i++) {
+ print_driver_info_5(&buffer5[i]);
+ printf("\n");
+ }
+ break;
+ case 6:
+ for (i=0; i<count; i++) {
+ print_driver_info_6(&buffer6[i]);
+ printf("\n");
+ }
+ break;
+ case 8:
+ for (i=0; i<count; i++) {
+ print_driver_info_8(&buffer8[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void print_doc_info_1(PDOC_INFO_1 info)
+{
+ printf("\tDocument Name\t= %s\n", info->pDocName);
+ printf("\tOutput Filename\t= %s\n", info->pOutputFile);
+ printf("\tDatatype\t= %s\n", info->pDatatype);
+ return;
+}
+
+void print_printer_keys(LPSTR buffer)
+{
+ LPSTR p = NULL;
+
+ p = buffer;
+
+ while (p && *p) {
+ printf("%s\n", p);
+ for (; *p; p = CharNext(p)) {
+ p = CharNext(p);
+ }
+ }
+}
+
+LPSTR reg_type_str(DWORD type)
+{
+ switch (type) {
+ case REG_DWORD:
+ return "REG_DWORD";
+ case REG_SZ:
+ return "REG_SZ";
+ case REG_MULTI_SZ:
+ return "REG_MULTI_SZ";
+ case REG_BINARY:
+ return "REG_BINARY";
+ default:
+ return NULL;
+ }
+}
+
+void print_asc(const BYTE *buf, DWORD len)
+{
+ int i;
+ for (i=0; i<len; i++) {
+ printf("%c", isprint(buf[i])?buf[i]:'.');
+ }
+}
+
+static void dump_data(const BYTE *buf, int len)
+{
+ int i=0;
+ static const BYTE empty[16] = { 0, };
+
+ if (len<=0) return;
+
+ for (i=0; i<len;) {
+
+ if (i%16 == 0) {
+ if ((i > 0) &&
+ (len > i+16) &&
+ (memcmp(&buf[i], &empty, 16) == 0))
+ {
+ i +=16;
+ continue;
+ }
+
+ if (i<len) {
+ printf("[%04X] ",i);
+ }
+ }
+
+ printf("%02x ", buf[i]);
+ i++;
+
+ if (i%8 == 0) printf(" ");
+ if (i%16 == 0) {
+ print_asc(&buf[i-16],8); printf(" ");
+ print_asc(&buf[i-8],8); printf("\n");
+ }
+ }
+
+ if (i%16) {
+ int n;
+ n = 16 - (i%16);
+ printf(" ");
+ if (n>8) printf(" ");
+ while (n--) printf(" ");
+ n = MIN(8,i%16);
+ print_asc(&buf[i-(i%16)],n); printf( " " );
+ n = (i%16) - n;
+ if (n>0) print_asc(&buf[i-n],n);
+ printf("\n");
+ }
+}
+
+static void dump_printer_data(DWORD size, LPBYTE buffer, DWORD type)
+{
+ DWORD i = 0;
+ LPSTR p = NULL;
+
+ switch (type) {
+ case REG_SZ:
+ dump_data(buffer, size);
+ break;
+ case REG_MULTI_SZ:
+ dump_data(buffer, size);
+ p = (LPSTR)buffer;
+ while (p && *p) {
+ printf("\t\t%s\n", p);
+ for (; *p; p = CharNext(p)) {
+ p = CharNext(p);
+ }
+ }
+ break;
+ case REG_DWORD:
+ assert(size == 4);
+ printf("\t\t0x%08x\n", (DWORD)*buffer);
+ break;
+ case REG_BINARY:
+ dump_data(buffer, size);
+ break;
+ default:
+ break;
+ }
+}
+
+void print_printer_data(LPSTR keyname, LPSTR valuename, DWORD size, LPBYTE buffer, DWORD type)
+{
+ if (keyname) {
+ printf("\tKey Name:\t%s\n", keyname);
+ }
+
+ printf("\tValue Name:\t%s\n", valuename);
+ printf("\tSize:\t\t0x%x (%d)\n", size, size);
+ printf("\tType:\t\t%s\n", reg_type_str(type));
+
+ if (buffer == NULL || size == 0) {
+ return;
+ }
+
+ dump_printer_data(size, buffer, type);
+}
+
+void print_printer_dataw(LPCWSTR keyname, LPCWSTR valuename, DWORD size, LPBYTE buffer, DWORD type)
+{
+ if (keyname) {
+ printf("\tKey Name:\t%ls\n", keyname);
+ }
+
+ printf("\tValue Name:\t%ls\n", valuename);
+ printf("\tSize:\t\t0x%x (%d)\n", size, size);
+ printf("\tType:\t\t%s\n", reg_type_str(type));
+
+ if (buffer == NULL || size == 0) {
+ return;
+ }
+
+ dump_printer_data(size, buffer, type);
+}
+
+
+void print_printer_enum_values(PRINTER_ENUM_VALUES *info)
+{
+ print_printer_data(NULL, info->pValueName, info->cbData, info->pData, info->dwType);
+}
+
+void print_file_time(const FILETIME *t)
+{
+ SYSTEMTIME s;
+ LPSTR dayofweek = NULL;
+ LPSTR month = NULL;
+
+ if (!FileTimeToSystemTime(t, &s)) {
+ printf("Failed to convert FILETIME to SYSTEMTIME\n");
+ return;
+ }
+ switch (s.wDayOfWeek) {
+ case 0:
+ dayofweek = "Sun";
+ break;
+ case 1:
+ dayofweek = "Mon";
+ break;
+ case 2:
+ dayofweek = "Tue";
+ break;
+ case 3:
+ dayofweek = "Wed";
+ break;
+ case 4:
+ dayofweek = "Thu";
+ break;
+ case 5:
+ dayofweek = "Fri";
+ break;
+ case 6:
+ dayofweek = "Sat";
+ break;
+ default:
+ break;
+ }
+
+ switch (s.wMonth) {
+ case 1:
+ month = "Jan";
+ break;
+ case 2:
+ month = "Feb";
+ break;
+ case 3:
+ month = "Mar";
+ break;
+ case 4:
+ month = "Apr";
+ break;
+ case 5:
+ month = "May";
+ break;
+ case 6:
+ month = "Jun";
+ break;
+ case 7:
+ month = "Jul";
+ break;
+ case 8:
+ month = "Aug";
+ break;
+ case 9:
+ month = "Sep";
+ break;
+ case 10:
+ month = "Oct";
+ break;
+ case 11:
+ month = "Nov";
+ break;
+ case 12:
+ month = "Dec";
+ break;
+ default:
+ break;
+ }
+
+ printf("%s %s %02d %02d:%02d:%02d %04d\n",
+ dayofweek, month, s.wDay,
+ s.wHour, s.wMinute, s.wSecond, s.wYear);
+}
diff --git a/testprogs/win32/spoolss/printlib_proto.h b/testprogs/win32/spoolss/printlib_proto.h
new file mode 100644
index 0000000..704cdbf
--- /dev/null
+++ b/testprogs/win32/spoolss/printlib_proto.h
@@ -0,0 +1,67 @@
+#ifndef __PRINTLIB_PROTO_H__
+#define __PRINTLIB_PROTO_H__
+
+#undef _PRINTF_ATTRIBUTE
+#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
+/* This file was automatically generated by mkproto.pl. DO NOT EDIT */
+
+/* this file contains prototypes for functions that are private
+ * to this subsystem or library. These functions should not be
+ * used outside this particular subsystem! */
+
+
+/* The following definitions come from printlib.c */
+
+void print_devmode(DEVMODE *pDevModeIn);
+void print_acl(const char* str, ACL *acl);
+void print_sid(const char* str, SID *sid);
+void print_secdesc(SECURITY_DESCRIPTOR *secdesc);
+void PrintLastError();
+void print_job_info_1(PJOB_INFO_1 info);
+void print_job_info_2(PJOB_INFO_2 info);
+void print_job_info_3(PJOB_INFO_3 info);
+void print_job_info_4(PJOB_INFO_4 info);
+void print_job_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_monitor_info_1(PMONITOR_INFO_1 info);
+void print_monitor_info_2(PMONITOR_INFO_2 info);
+void print_monitor_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_port_info_1(PPORT_INFO_1 info);
+void print_port_info_2(PPORT_INFO_2 info);
+void print_port_info_3(PPORT_INFO_3 info);
+void print_port_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_form_info_1(PFORM_INFO_1 info);
+void print_form_info_2(PFORM_INFO_2 info);
+void print_form_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_printer_info_1(PPRINTER_INFO_1 info);
+void print_printer_info_2(PPRINTER_INFO_2 info);
+void print_printer_info_5(PPRINTER_INFO_5 info);
+void print_printer_info_6(PPRINTER_INFO_6 info);
+void print_printer_info_7(PPRINTER_INFO_7 info);
+void print_printer_info_8(PPRINTER_INFO_8 info);
+void print_printer_info_9(PPRINTER_INFO_9 info);
+void print_printer_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_printprocessor_info_1(PPRINTPROCESSOR_INFO_1 info);
+void print_printprocessor_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_datatypes_info_1(PDATATYPES_INFO_1 info);
+void print_datatypes_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_driver_info_1(PDRIVER_INFO_1 info);
+void print_driver_info_2(PDRIVER_INFO_2 info);
+void print_driver_info_3(PDRIVER_INFO_3 info);
+void print_driver_info_4(PDRIVER_INFO_4 info);
+void print_driver_info_5(PDRIVER_INFO_5 info);
+void print_driver_info_6(PDRIVER_INFO_6 info);
+void print_driver_info_8(PDRIVER_INFO_8 info);
+void print_driver_info_bylevel(DWORD level, LPBYTE buffer, DWORD count);
+void print_doc_info_1(PDOC_INFO_1 info);
+void print_printer_keys(LPSTR buffer);
+LPSTR reg_type_str(DWORD type);
+void print_printer_data(LPSTR keyname, LPSTR valuename, DWORD size, LPBYTE buffer, DWORD type);
+void print_printer_dataw(LPCWSTR keyname, LPCWSTR valuename, DWORD size, LPBYTE buffer, DWORD type);
+void print_printer_enum_values(PRINTER_ENUM_VALUES *info);
+void print_file_time(const FILETIME *t);
+
+#undef _PRINTF_ATTRIBUTE
+#define _PRINTF_ATTRIBUTE(a1, a2)
+
+#endif /* __PRINTLIB_PROTO_H__ */
+
diff --git a/testprogs/win32/spoolss/string.h b/testprogs/win32/spoolss/string.h
new file mode 100644
index 0000000..17561eb
--- /dev/null
+++ b/testprogs/win32/spoolss/string.h
@@ -0,0 +1,15 @@
+/* __location__ macro replacement taken from talloc.h */
+
+/*
+ this uses a little trick to allow __LINE__ to be stringified
+*/
+#ifndef __location__
+#define __STRING_LINE1__(s) #s
+#define __STRING_LINE2__(s) __STRING_LINE1__(s)
+#define __STRING_LINE3__ __STRING_LINE2__(__LINE__)
+#define __location__ __FILE__ ":" __STRING_LINE3__
+#endif
+
+#ifndef __STRING
+#define __STRING(s) #s
+#endif
diff --git a/testprogs/win32/spoolss/testspoolss.c b/testprogs/win32/spoolss/testspoolss.c
new file mode 100644
index 0000000..794e545
--- /dev/null
+++ b/testprogs/win32/spoolss/testspoolss.c
@@ -0,0 +1,1842 @@
+/*
+ Unix SMB/CIFS implementation.
+ test suite for spoolss rpc operations
+
+ Copyright (C) Guenther Deschner 2009-2010
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/****************************************************************************
+****************************************************************************/
+
+#include "testspoolss.h"
+#include "string.h"
+#include "torture.h"
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_OpenPrinter(struct torture_context *tctx,
+ LPSTR printername,
+ LPPRINTER_DEFAULTS defaults,
+ LPHANDLE handle)
+{
+ torture_comment(tctx, "Testing OpenPrinter(%s)", printername);
+
+ if (!OpenPrinter(printername, handle, defaults)) {
+ char tmp[1024];
+ sprintf(tmp, "failed to open printer %s, error was: 0x%08x\n",
+ printername, GetLastError());
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_ClosePrinter(struct torture_context *tctx,
+ HANDLE handle)
+{
+ torture_comment(tctx, "Testing ClosePrinter");
+
+ if (!ClosePrinter(handle)) {
+ char tmp[1024];
+ sprintf(tmp, "failed to close printer, error was: %s\n",
+ errstr(GetLastError()));
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumPrinters(struct torture_context *tctx,
+ LPSTR servername)
+{
+ DWORD levels[] = { 1, 2, 5 };
+ DWORD success[] = { 1, 1, 1 };
+ DWORD i;
+ DWORD flags = PRINTER_ENUM_NAME;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPrinters level %d", levels[i]);
+
+ EnumPrinters(flags, servername, levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumPrinters(flags, servername, levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrinters failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_printer_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumDrivers(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR architecture)
+{
+ DWORD levels[] = { 1, 2, 3, 4, 5, 6 };
+ DWORD success[] = { 1, 1, 1, 1, 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPrinterDrivers(%s) level %d",
+ architecture, levels[i]);
+
+ EnumPrinterDrivers(servername, architecture, levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumPrinterDrivers(servername, architecture, levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrinterDrivers failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_driver_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetForm(struct torture_context *tctx,
+ LPSTR servername,
+ HANDLE handle,
+ LPSTR formname)
+{
+ DWORD levels[] = { 1, 2 };
+ DWORD success[] = { 1, 0 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetForm(%s) level %d", formname, levels[i]);
+
+ GetForm(handle, formname, levels[i], NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!GetForm(handle, formname, levels[i], buffer, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetForm failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_form_info_bylevel(levels[i], buffer, 1);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumForms(struct torture_context *tctx,
+ LPSTR servername,
+ HANDLE handle)
+{
+ DWORD levels[] = { 1, 2 };
+ DWORD success[] = { 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumForms level %d", levels[i]);
+
+ if (tctx->samba3 && levels[i] == 2) {
+ torture_comment(tctx, "skipping level %d enum against samba\n", levels[i]);
+ continue;
+ }
+
+ EnumForms(handle, levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumForms(handle, levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumForms failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_form_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumPorts(struct torture_context *tctx,
+ LPSTR servername)
+{
+ DWORD levels[] = { 1, 2 };
+ DWORD success[] = { 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPorts level %d", levels[i]);
+
+ EnumPorts(servername, levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumPorts(servername, levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumPorts failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_port_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumMonitors(struct torture_context *tctx,
+ LPSTR servername)
+{
+ DWORD levels[] = { 1, 2 };
+ DWORD success[] = { 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumMonitors level %d", levels[i]);
+
+ EnumMonitors(servername, levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumMonitors(servername, levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumMonitors failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_monitor_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumPrintProcessors(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR architecture)
+{
+ DWORD levels[] = { 1 };
+ DWORD success[] = { 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPrintProcessors(%s) level %d", architecture, levels[i]);
+
+ EnumPrintProcessors(servername, architecture, levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumPrintProcessors(servername, architecture, levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrintProcessors failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_printprocessor_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumPrintProcessorDatatypes(struct torture_context *tctx,
+ LPSTR servername)
+{
+ DWORD levels[] = { 1 };
+ DWORD success[] = { 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPrintProcessorDatatypes level %d", levels[i]);
+
+ EnumPrintProcessorDatatypes(servername, "winprint", levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumPrintProcessorDatatypes(servername, "winprint", levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrintProcessorDatatypes failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_datatypes_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumPrinterKey(struct torture_context *tctx,
+ LPSTR servername,
+ HANDLE handle,
+ LPCSTR key)
+{
+ LPSTR buffer = NULL;
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPrinterKey(%s)", key);
+
+ err = EnumPrinterKey(handle, key, NULL, 0, &needed);
+ if (err == ERROR_MORE_DATA) {
+ buffer = (LPTSTR)malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ err = EnumPrinterKey(handle, key, buffer, needed, &needed);
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrinterKey(%s) failed on [%s] (buffer size = %d), error: %s\n",
+ key, servername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_printer_keys(buffer);
+ }
+
+ free(buffer);
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetPrinter(struct torture_context *tctx,
+ LPSTR printername,
+ HANDLE handle)
+{
+ DWORD levels[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
+ DWORD success[] = { 1, 1, 1, 1, 1, 1, 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetPrinter level %d", levels[i]);
+
+ GetPrinter(handle, levels[i], NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!GetPrinter(handle, levels[i], buffer, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinter failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], printername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_printer_info_bylevel(levels[i], buffer, 1);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetPrinterDriver(struct torture_context *tctx,
+ LPSTR printername,
+ LPSTR architecture,
+ HANDLE handle)
+{
+ DWORD levels[] = { 1, 2, 3, 4, 5, 6, 8 };
+ DWORD success[] = { 1, 1, 1, 1, 1, 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetPrinterDriver(%s) level %d",
+ architecture, levels[i]);
+
+ GetPrinterDriver(handle, architecture, levels[i], NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!GetPrinterDriver(handle, architecture, levels[i], buffer, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinterDriver failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], printername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_driver_info_bylevel(levels[i], buffer, 1);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumJobs(struct torture_context *tctx,
+ LPSTR printername,
+ HANDLE handle)
+{
+ DWORD levels[] = { 1, 2, 3, 4 };
+ DWORD success[] = { 1, 1, 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumJobs level %d", levels[i]);
+
+ if (tctx->samba3 && levels[i] == 4) {
+ torture_comment(tctx, "skipping level %d enum against samba\n", levels[i]);
+ continue;
+ }
+
+ EnumJobs(handle, 0, 100, levels[i], NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumJobs(handle, 0, 100, levels[i], buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumJobs failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], printername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_job_info_bylevel(levels[i], buffer, returned);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumPrinterData(struct torture_context *tctx,
+ LPSTR servername,
+ HANDLE handle)
+{
+ DWORD err = 0;
+ LPTSTR value_name;
+ LPBYTE data;
+ DWORD index = 0;
+ DWORD type;
+ DWORD value_offered = 0, value_needed;
+ DWORD data_offered = 0, data_needed;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPrinterData(%d) (value offered: %d, data_offered: %d)\n",
+ index, value_offered, data_offered);
+
+ err = EnumPrinterData(handle, 0, NULL, 0, &value_needed, NULL, NULL, 0, &data_needed);
+ if (err) {
+ sprintf(tmp, "EnumPrinterData(%d) failed on [%s] (value size = %d, data size = %d), error: %s\n",
+ index, servername, value_offered, data_offered, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ value_name = malloc(value_needed);
+ torture_assert(tctx, value_name, "malloc failed");
+ data = malloc(data_needed);
+ torture_assert(tctx, data, "malloc failed");
+
+ value_offered = value_needed;
+ data_offered = data_needed;
+
+ do {
+
+ value_needed = 0;
+ data_needed = 0;
+
+ torture_comment(tctx, "Testing EnumPrinterData(%d) (value offered: %d, data_offered: %d)\n",
+ index, value_offered, data_offered);
+
+ err = EnumPrinterData(handle, index++, value_name, value_offered, &value_needed, &type, data, data_offered, &data_needed);
+ if (err == ERROR_NO_MORE_ITEMS) {
+ break;
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrinterData(%d) failed on [%s] (value size = %d, data size = %d), error: %s\n",
+ index, servername, value_offered, data_offered, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_printer_data(NULL, value_name, data_needed, data, type);
+ }
+
+ } while (err != ERROR_NO_MORE_ITEMS);
+
+ free(value_name);
+ free(data);
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EnumPrinterDataEx(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR keyname,
+ HANDLE handle,
+ LPBYTE *buffer_p,
+ DWORD *returned_p)
+{
+ LPBYTE buffer = NULL;
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing EnumPrinterDataEx(%s)", keyname);
+
+ err = EnumPrinterDataEx(handle, keyname, NULL, 0, &needed, &returned);
+ if (err == ERROR_MORE_DATA) {
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ err = EnumPrinterDataEx(handle, keyname, buffer, needed, &needed, &returned);
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrinterDataEx(%s) failed on [%s] (buffer size = %d), error: %s\n",
+ keyname, servername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ DWORD i;
+ LPPRINTER_ENUM_VALUES v = (LPPRINTER_ENUM_VALUES)buffer;
+ for (i=0; i < returned; i++) {
+ print_printer_enum_values(&v[i]);
+ }
+ }
+
+ if (returned_p) {
+ *returned_p = returned;
+ }
+
+ if (buffer_p) {
+ *buffer_p = buffer;
+ } else {
+ free(buffer);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_devicemode_equal(struct torture_context *tctx,
+ const DEVMODE *d1,
+ const DEVMODE *d2)
+{
+ if (d1 == d2) {
+ return TRUE;
+ }
+
+ if (!d1 || !d2) {
+ torture_comment(tctx, "%s\n", __location__);
+ return FALSE;
+ }
+
+ torture_assert_str_equal(tctx, (const char *)d1->dmDeviceName, (const char *)d2->dmDeviceName, "dmDeviceName mismatch");
+ torture_assert_int_equal(tctx, d1->dmSpecVersion, d2->dmSpecVersion, "dmSpecVersion mismatch");
+ torture_assert_int_equal(tctx, d1->dmDriverVersion, d2->dmDriverVersion, "dmDriverVersion mismatch");
+ torture_assert_int_equal(tctx, d1->dmSize, d2->dmSize, "size mismatch");
+ torture_assert_int_equal(tctx, d1->dmDriverExtra, d2->dmDriverExtra, "dmDriverExtra mismatch");
+ torture_assert_int_equal(tctx, d1->dmFields, d2->dmFields, "dmFields mismatch");
+
+ torture_assert_int_equal(tctx, d1->dmOrientation, d2->dmOrientation, "dmOrientation mismatch");
+ torture_assert_int_equal(tctx, d1->dmPaperSize, d2->dmPaperSize, "dmPaperSize mismatch");
+ torture_assert_int_equal(tctx, d1->dmPaperLength, d2->dmPaperLength, "dmPaperLength mismatch");
+ torture_assert_int_equal(tctx, d1->dmPaperWidth, d2->dmPaperWidth, "dmPaperWidth mismatch");
+ torture_assert_int_equal(tctx, d1->dmScale, d2->dmScale, "dmScale mismatch");
+ torture_assert_int_equal(tctx, d1->dmCopies, d2->dmCopies, "dmCopies mismatch");
+ torture_assert_int_equal(tctx, d1->dmDefaultSource, d2->dmDefaultSource, "dmDefaultSource mismatch");
+ torture_assert_int_equal(tctx, d1->dmPrintQuality, d2->dmPrintQuality, "dmPrintQuality mismatch");
+
+ torture_assert_int_equal(tctx, d1->dmColor, d2->dmColor, "dmColor mismatch");
+ torture_assert_int_equal(tctx, d1->dmDuplex, d2->dmDuplex, "dmDuplex mismatch");
+ torture_assert_int_equal(tctx, d1->dmYResolution, d2->dmYResolution, "dmYResolution mismatch");
+ torture_assert_int_equal(tctx, d1->dmTTOption, d2->dmTTOption, "dmTTOption mismatch");
+ torture_assert_int_equal(tctx, d1->dmCollate, d2->dmCollate, "dmCollate mismatch");
+ torture_assert_str_equal(tctx, (const char *)d1->dmFormName, (const char *)d2->dmFormName, "dmFormName mismatch");
+ torture_assert_int_equal(tctx, d1->dmLogPixels, d2->dmLogPixels, "dmLogPixels mismatch");
+ torture_assert_int_equal(tctx, d1->dmBitsPerPel, d2->dmBitsPerPel, "dmBitsPerPel mismatch");
+ torture_assert_int_equal(tctx, d1->dmPelsWidth, d2->dmPelsWidth, "dmPelsWidth mismatch");
+ torture_assert_int_equal(tctx, d1->dmPelsHeight, d2->dmPelsHeight, "dmPelsHeight mismatch");
+
+ torture_assert_int_equal(tctx, d1->dmDisplayFlags, d2->dmDisplayFlags, "dmDisplayFlags mismatch");
+ /* or dmNup ? */
+ torture_assert_int_equal(tctx, d1->dmDisplayFrequency, d2->dmDisplayFrequency, "dmDisplayFrequency mismatch");
+
+ torture_assert_int_equal(tctx, d1->dmICMMethod, d2->dmICMMethod, "dmICMMethod mismatch");
+ torture_assert_int_equal(tctx, d1->dmICMIntent, d2->dmICMIntent, "dmICMIntent mismatch");
+ torture_assert_int_equal(tctx, d1->dmMediaType, d2->dmMediaType, "dmMediaType mismatch");
+ torture_assert_int_equal(tctx, d1->dmDitherType, d2->dmDitherType, "dmDitherType mismatch");
+ torture_assert_int_equal(tctx, d1->dmReserved1, d2->dmReserved1, "dmReserved1 mismatch");
+ torture_assert_int_equal(tctx, d1->dmReserved2, d2->dmReserved2, "reserved2 mismatch");
+
+ torture_assert_int_equal(tctx, d1->dmPanningWidth, d2->dmPanningWidth, "dmPanningWidth mismatch");
+ torture_assert_int_equal(tctx, d1->dmPanningHeight, d2->dmPanningHeight, "dmPanningHeight mismatch");
+
+ /* torture_assert_mem_equal(tctx, d1 + d1->dmSize, d2 + d2->dmSize, d1->dmDriverExtra, "private extra data mismatch"); */
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_DeviceModes(struct torture_context *tctx,
+ LPSTR printername,
+ HANDLE handle)
+{
+ PPRINTER_INFO_2 info2 = NULL;
+ PPRINTER_INFO_8 info8 = NULL;
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing DeviceModes");
+
+ torture_comment(tctx, "Testing GetPrinter level %d", 2);
+
+ GetPrinter(handle, 2, NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ info2 = (PPRINTER_INFO_2)malloc(needed);
+ torture_assert(tctx, (LPBYTE)info2, "malloc failed");
+ if (!GetPrinter(handle, 2, (LPBYTE)info2, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinter failed level %d on [%s] (buffer size = %d), error: %s\n",
+ 2, printername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_printer_info_2(info2);
+ }
+
+ torture_comment(tctx, "Testing GetPrinter level %d", 8);
+
+ GetPrinter(handle, 8, NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ info8 = (PPRINTER_INFO_8)malloc(needed);
+ torture_assert(tctx, (LPBYTE)info8, "malloc failed");
+ if (!GetPrinter(handle, 8, (LPBYTE)info8, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinter failed level %d on [%s] (buffer size = %d), error: %s\n",
+ 8, printername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_printer_info_8(info8);
+ }
+
+ torture_assert(tctx, test_devicemode_equal(tctx, info2->pDevMode, info8->pDevMode), "");
+
+ free(info2);
+ free(info8);
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetJob(struct torture_context *tctx,
+ LPSTR printername,
+ HANDLE handle,
+ DWORD job_id)
+{
+ DWORD levels[] = { 1, 2, 3, 4 };
+ DWORD success[] = { 1, 1, 1, 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetJob(%d) level %d", job_id, levels[i]);
+
+ if (tctx->samba3 && (levels[i] == 4) || (levels[i] == 3)) {
+ torture_comment(tctx, "skipping level %d getjob against samba\n", levels[i]);
+ continue;
+ }
+
+ GetJob(handle, job_id, levels[i], NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!GetJob(handle, job_id, levels[i], buffer, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetJob failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], printername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ print_job_info_bylevel(levels[i], buffer, 1);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EachJob(struct torture_context *tctx,
+ LPSTR printername,
+ HANDLE handle)
+{
+ DWORD i;
+ PJOB_INFO_1 buffer = NULL;
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ DWORD level = 1;
+ char tmp[1024];
+ BOOL ret = TRUE;
+
+ torture_comment(tctx, "Testing Each PrintJob %d");
+
+ EnumJobs(handle, 0, 100, level, NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = (PJOB_INFO_1)malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumJobs(handle, 0, 100, level, (LPBYTE)buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumJobs failed level %d on [%s] (buffer size = %d), error: %s\n",
+ level, printername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_job_info_bylevel(level, (LPBYTE)buffer, returned);
+ }
+
+ for (i=0; i < returned; i++) {
+ ret = test_GetJob(tctx, printername, handle, buffer[i].JobId);
+ }
+
+ free(buffer);
+
+ return ret;
+
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_OnePrinter(struct torture_context *tctx,
+ LPSTR printername,
+ LPSTR architecture,
+ LPPRINTER_DEFAULTS defaults)
+{
+ HANDLE handle;
+ BOOL ret = TRUE;
+
+ torture_comment(tctx, "Testing Printer %s", printername);
+
+ ret &= test_OpenPrinter(tctx, printername, defaults, &handle);
+ ret &= test_GetPrinter(tctx, printername, handle);
+ ret &= test_GetPrinterDriver(tctx, printername, architecture, handle);
+ ret &= test_EnumForms(tctx, printername, handle);
+ ret &= test_EnumJobs(tctx, printername, handle);
+ ret &= test_EachJob(tctx, printername, handle);
+ ret &= test_EnumPrinterKey(tctx, printername, handle, "");
+ ret &= test_EnumPrinterKey(tctx, printername, handle, "PrinterDriverData");
+ ret &= test_EnumPrinterData(tctx, printername, handle);
+ ret &= test_EnumPrinterDataEx(tctx, printername, "PrinterDriverData", handle, NULL, NULL);
+ ret &= test_DeviceModes(tctx, printername, handle);
+#if 0
+ /* don't run these at the moment, behaviour is PrinterData API calls (not
+ * dcerpc calls) is almost unpredictable - gd */
+ ret &= test_PrinterData(tctx, printername, handle);
+ ret &= test_PrinterDataW(tctx, printername, handle);
+#endif
+ ret &= test_ClosePrinter(tctx, handle);
+
+ return ret;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_EachPrinter(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR architecture,
+ LPPRINTER_DEFAULTS defaults)
+{
+ DWORD needed = 0;
+ DWORD returned = 0;
+ DWORD err = 0;
+ char tmp[1024];
+ DWORD i;
+ DWORD flags = PRINTER_ENUM_NAME;
+ PPRINTER_INFO_1 buffer = NULL;
+ BOOL ret = TRUE;
+
+ torture_comment(tctx, "Testing EnumPrinters level %d", 1);
+
+ EnumPrinters(flags, servername, 1, NULL, 0, &needed, &returned);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = (PPRINTER_INFO_1)malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!EnumPrinters(flags, servername, 1, (LPBYTE)buffer, needed, &needed, &returned)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "EnumPrinters failed level %d on [%s] (buffer size = %d), error: %s\n",
+ 1, servername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ for (i=0; i < returned; i++) {
+ ret &= test_OnePrinter(tctx, buffer[i].pName, architecture, defaults);
+ }
+
+ free(buffer);
+
+ return ret;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetPrintProcessorDirectory(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR architecture)
+{
+ DWORD levels[] = { 1 };
+ DWORD success[] = { 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetPrintProcessorDirectory(%s) level %d",
+ architecture, levels[i]);
+
+ GetPrintProcessorDirectory(servername, architecture, levels[i], NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!GetPrintProcessorDirectory(servername, architecture, levels[i], buffer, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetPrintProcessorDirectory failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ printf("\tPrint Processor Directory\t= %s\n\n", (LPSTR)buffer);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetPrinterDriverDirectory(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR architecture)
+{
+ DWORD levels[] = { 1 };
+ DWORD success[] = { 1 };
+ DWORD i;
+ LPBYTE buffer = NULL;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ DWORD needed = 0;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetPrinterDriverDirectory(%s) level %d",
+ architecture, levels[i]);
+
+ GetPrinterDriverDirectory(servername, architecture, levels[i], NULL, 0, &needed);
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ err = 0;
+ buffer = malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ if (!GetPrinterDriverDirectory(servername, architecture, levels[i], buffer, needed, &needed)) {
+ err = GetLastError();
+ }
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinterDriverDirectory failed level %d on [%s] (buffer size = %d), error: %s\n",
+ levels[i], servername, needed, errstr(err));
+ if (success[i]) {
+ torture_fail(tctx, tmp);
+ } else {
+ torture_warning(tctx, tmp);
+ }
+ }
+
+ if (tctx->print) {
+ printf("\tPrinter Driver Directory\t= %s\n\n", (LPSTR)buffer);
+ }
+
+ free(buffer);
+ buffer = NULL;
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetPrinterData(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR valuename,
+ HANDLE handle,
+ DWORD *type_p,
+ LPBYTE *buffer_p,
+ DWORD *size_p)
+{
+ LPBYTE buffer = NULL;
+ DWORD needed = 0;
+ DWORD type;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetPrinterData(%s)", valuename);
+
+ err = GetPrinterData(handle, valuename, &type, NULL, 0, &needed);
+ if (err == ERROR_MORE_DATA) {
+ buffer = (LPBYTE)malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ err = GetPrinterData(handle, valuename, &type, buffer, needed, &needed);
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinterData(%s) failed on [%s] (buffer size = %d), error: %s\n",
+ valuename, servername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_printer_data("PrinterDriverData", valuename, needed, buffer, type);
+ }
+
+ if (type_p) {
+ *type_p = type;
+ }
+
+ if (size_p) {
+ *size_p = needed;
+ }
+
+ if (buffer_p) {
+ *buffer_p = buffer;
+ } else {
+ free(buffer);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetPrinterDataEx(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR keyname,
+ LPSTR valuename,
+ HANDLE handle,
+ DWORD *type_p,
+ LPBYTE *buffer_p,
+ DWORD *size_p)
+{
+ LPBYTE buffer = NULL;
+ DWORD needed = 0;
+ DWORD type;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetPrinterDataEx(%s - %s)", keyname, valuename);
+
+ err = GetPrinterDataEx(handle, keyname, valuename, &type, NULL, 0, &needed);
+ if (err == ERROR_MORE_DATA) {
+ buffer = (LPBYTE)malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ err = GetPrinterDataEx(handle, keyname, valuename, &type, buffer, needed, &needed);
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinterDataEx(%s) failed on [%s] (buffer size = %d), error: %s\n",
+ valuename, servername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_printer_data(keyname, valuename, needed, buffer, type);
+ }
+
+ if (type_p) {
+ *type_p = type;
+ }
+
+ if (size_p) {
+ *size_p = needed;
+ }
+
+ if (buffer_p) {
+ *buffer_p = buffer;
+ } else {
+ free(buffer);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_GetPrinterDataExW(struct torture_context *tctx,
+ LPSTR servername,
+ LPCWSTR keyname,
+ LPCWSTR valuename,
+ HANDLE handle,
+ DWORD *type_p,
+ LPBYTE *buffer_p,
+ DWORD *size_p)
+{
+ LPBYTE buffer = NULL;
+ DWORD needed = 0;
+ DWORD type;
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing GetPrinterDataExW(%ls - %ls)", keyname, valuename);
+
+ err = GetPrinterDataExW(handle, keyname, valuename, &type, NULL, 0, &needed);
+ if (err == ERROR_MORE_DATA) {
+ buffer = (LPBYTE)malloc(needed);
+ torture_assert(tctx, buffer, "malloc failed");
+ err = GetPrinterDataExW(handle, keyname, valuename, &type, buffer, needed, &needed);
+ }
+ if (err) {
+ sprintf(tmp, "GetPrinterDataExW(%ls) failed on [%s] (buffer size = %d), error: %s\n",
+ valuename, servername, needed, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ if (tctx->print) {
+ print_printer_dataw(keyname, valuename, needed, buffer, type);
+ }
+
+ if (type_p) {
+ *type_p = type;
+ }
+
+ if (size_p) {
+ *size_p = needed;
+ }
+
+ if (buffer_p) {
+ *buffer_p = buffer;
+ } else {
+ free(buffer);
+ }
+
+ return TRUE;
+}
+
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_DeletePrinterDataEx(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR keyname,
+ LPSTR valuename,
+ HANDLE handle)
+{
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing DeletePrinterDataEx(%s - %s)", keyname, valuename);
+
+ err = DeletePrinterDataEx(handle, keyname, valuename);
+ if (err) {
+ sprintf(tmp, "DeletePrinterDataEx(%s - %s) failed on [%s], error: %s\n",
+ keyname, valuename, servername, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_DeletePrinterDataExW(struct torture_context *tctx,
+ LPSTR servername,
+ LPCWSTR keyname,
+ LPCWSTR valuename,
+ HANDLE handle)
+{
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing DeletePrinterDataExW(%ls - %ls)", keyname, valuename);
+
+ err = DeletePrinterDataExW(handle, keyname, valuename);
+ if (err) {
+ sprintf(tmp, "DeletePrinterDataExW(%ls - %ls) failed on [%s], error: %s\n",
+ keyname, valuename, servername, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_DeletePrinterKey(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR keyname,
+ HANDLE handle)
+{
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing DeletePrinterKey(%s)", keyname);
+
+ err = DeletePrinterKey(handle, keyname);
+ if (err) {
+ sprintf(tmp, "DeletePrinterKey(%s) failed on [%s], error: %s\n",
+ keyname, servername, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_DeletePrinterKeyW(struct torture_context *tctx,
+ LPSTR servername,
+ LPCWSTR keyname,
+ HANDLE handle)
+{
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing DeletePrinterKeyW(%ls)", keyname);
+
+ err = DeletePrinterKeyW(handle, keyname);
+ if (err) {
+ sprintf(tmp, "DeletePrinterKeyW(%ls) failed on [%s], error: %s\n",
+ keyname, servername, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_SetPrinterDataEx(struct torture_context *tctx,
+ LPSTR servername,
+ LPSTR keyname,
+ LPSTR valuename,
+ HANDLE handle,
+ DWORD type,
+ LPBYTE buffer,
+ DWORD offered)
+{
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing SetPrinterDataEx(%s - %s)", keyname, valuename);
+
+ err = SetPrinterDataEx(handle, keyname, valuename, type, buffer, offered);
+ if (err) {
+ sprintf(tmp, "SetPrinterDataEx(%s) failed on [%s] (buffer size = %d), error: %s\n",
+ valuename, servername, offered, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_SetPrinterDataExW(struct torture_context *tctx,
+ LPCSTR servername,
+ LPCWSTR keyname,
+ LPCWSTR valuename,
+ HANDLE handle,
+ DWORD type,
+ LPBYTE buffer,
+ DWORD offered)
+{
+ DWORD err = 0;
+ char tmp[1024];
+
+ torture_comment(tctx, "Testing SetPrinterDataExW(%ls - %ls)", keyname, valuename);
+
+ err = SetPrinterDataExW(handle, keyname, valuename, type, buffer, offered);
+ if (err) {
+ sprintf(tmp, "SetPrinterDataExW(%ls) failed on [%s] (buffer size = %d), error: %s\n",
+ valuename, servername, offered, errstr(err));
+ torture_fail(tctx, tmp);
+ }
+
+ return TRUE;
+}
+
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_PrinterData_Server(struct torture_context *tctx,
+ LPSTR servername,
+ HANDLE handle)
+{
+ BOOL ret = TRUE;
+ DWORD i;
+ DWORD type, type_ex;
+ LPBYTE buffer, buffer_ex;
+ DWORD size, size_ex;
+ LPSTR valuenames[] = {
+ SPLREG_DEFAULT_SPOOL_DIRECTORY,
+ SPLREG_MAJOR_VERSION,
+ SPLREG_MINOR_VERSION,
+ SPLREG_DS_PRESENT,
+ SPLREG_DNS_MACHINE_NAME,
+ SPLREG_ARCHITECTURE,
+ SPLREG_OS_VERSION
+ };
+
+ for (i=0; i < ARRAY_SIZE(valuenames); i++) {
+ ret &= test_GetPrinterData(tctx, servername, valuenames[i], handle, &type, &buffer, &size);
+ ret &= test_GetPrinterDataEx(tctx, servername, "random", valuenames[i], handle, &type_ex, &buffer_ex, &size_ex);
+ torture_assert_int_equal(tctx, type, type_ex, "type mismatch");
+ torture_assert_int_equal(tctx, size, size_ex, "size mismatch");
+ torture_assert_mem_equal(tctx, buffer, buffer_ex, size, "buffer mismatch");
+ free(buffer);
+ free(buffer_ex);
+ }
+
+ return ret;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL PrinterDataEqual(struct torture_context *tctx,
+ DWORD type1, DWORD type2,
+ DWORD size1, DWORD size2,
+ LPBYTE buffer1, LPBYTE buffer2)
+{
+ torture_assert_int_equal(tctx, type1, type2, "type mismatch");
+ torture_assert_int_equal(tctx, size1, size2, "size mismatch");
+ torture_assert_mem_equal(tctx, buffer1, buffer2, size1, "buffer mismatch");
+
+ return TRUE;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_PrinterData(struct torture_context *tctx,
+ LPSTR printername,
+ HANDLE handle)
+{
+ char tmp[1024];
+ LPSTR keyname = "torture_key";
+ LPSTR valuename = "torture_value";
+ BOOL ret = TRUE;
+ DWORD types[] = {
+ REG_SZ,
+ REG_DWORD,
+ REG_BINARY
+ };
+ DWORD value = 12345678;
+ LPSTR str = "abcdefghijklmnopqrstuvwxzy";
+ DWORD t, s;
+
+ for (t=0; t < ARRAY_SIZE(types); t++) {
+ for (s=0; s < strlen(str); s++) {
+
+ DWORD type, type_ex;
+ LPBYTE buffer, buffer_ex;
+ DWORD size, size_ex;
+
+ if (types[t] == REG_DWORD) {
+ s = 0xffff;
+ }
+
+ switch (types[t]) {
+ case REG_BINARY:
+ buffer = malloc(s);
+ memcpy(buffer, str, s);
+ size = s;
+ break;
+ case REG_DWORD:
+ buffer = malloc(4);
+ memcpy(buffer, &value, 4);
+ size = 4;
+ break;
+ case REG_SZ:
+ buffer = malloc(s);
+ memcpy(buffer, str, s);
+ size = s;
+ break;
+ default:
+ sprintf(tmp, "type %d untested\n", types[t]);
+ torture_fail(tctx, tmp);
+ break;
+ }
+
+ type = types[t];
+
+ torture_comment(tctx, "Testing PrinterData (type: %s, size: 0x%08x)", reg_type_str(type), size);
+
+ torture_assert(tctx,
+ test_SetPrinterDataEx(tctx, printername, keyname, valuename, handle, type, buffer, size),
+ "failed to call SetPrinterDataEx");
+ torture_assert(tctx,
+ test_GetPrinterDataEx(tctx, printername, keyname, valuename, handle, &type_ex, &buffer_ex, &size_ex),
+ "failed to call GetPrinterDataEx");
+
+ if (!PrinterDataEqual(tctx, type_ex, type, size_ex, size, buffer_ex, buffer)) {
+ torture_warning(tctx, "GetPrinterDataEx does not return the same info as we set with SetPrinterDataEx");
+ ret = FALSE;
+ }
+ ret &= test_DeletePrinterDataEx(tctx, printername, keyname, valuename, handle);
+ ret &= test_DeletePrinterKey(tctx, printername, keyname, handle);
+
+ free(buffer);
+ free(buffer_ex);
+ }
+ }
+
+ return ret;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static BOOL test_PrinterDataW(struct torture_context *tctx,
+ LPSTR printername,
+ HANDLE handle)
+{
+ char tmp[1024];
+ LPCWSTR keyname = L"torture_key";
+ LPCWSTR valuename = L"torture_value";
+ BOOL ret = TRUE;
+ DWORD types[] = {
+ REG_SZ,
+ REG_DWORD,
+ REG_BINARY
+ };
+ DWORD value = 12345678;
+ LPSTR str = "abcdefghijklmnopqrstuvwxzy";
+ DWORD t, s;
+
+ for (t=0; t < ARRAY_SIZE(types); t++) {
+ for (s=0; s < strlen(str); s++) {
+
+ DWORD type, type_ex;
+ LPBYTE buffer, buffer_ex;
+ DWORD size, size_ex;
+
+ if (types[t] == REG_DWORD) {
+ s = 0xffff;
+ }
+
+ switch (types[t]) {
+ case REG_BINARY:
+ buffer = malloc(s);
+ memcpy(buffer, str, s);
+ size = s;
+ break;
+ case REG_DWORD:
+ buffer = malloc(4);
+ memcpy(buffer, &value, 4);
+ size = 4;
+ break;
+ case REG_SZ:
+ buffer = malloc(s);
+ memcpy(buffer, str, s);
+ size = s;
+ break;
+ default:
+ sprintf(tmp, "type %d untested\n", types[t]);
+ torture_fail(tctx, tmp);
+ break;
+ }
+
+ type = types[t];
+
+ torture_comment(tctx, "Testing PrinterDataW (type: %s, size: 0x%08x)", reg_type_str(type), size);
+
+ torture_assert(tctx,
+ test_SetPrinterDataExW(tctx, printername, keyname, valuename, handle, type, buffer, size),
+ "failed to call SetPrinterDataExW");
+ torture_assert(tctx,
+ test_GetPrinterDataExW(tctx, printername, keyname, valuename, handle, &type_ex, &buffer_ex, &size_ex),
+ "failed to call GetPrinterDataExW");
+
+ if (!PrinterDataEqual(tctx, type_ex, type, size_ex, size, buffer_ex, buffer)) {
+ torture_warning(tctx, "GetPrinterDataExW does not return the same info as we set with SetPrinterDataExW");
+ ret = FALSE;
+ }
+ ret &= test_DeletePrinterDataExW(tctx, printername, keyname, valuename, handle);
+ ret &= test_DeletePrinterKeyW(tctx, printername, keyname, handle);
+
+ free(buffer);
+ free(buffer_ex);
+ }
+ }
+
+ return ret;
+}
+
+/****************************************************************************
+****************************************************************************/
+
+const char *get_string_param(const char *str)
+{
+ const char *p;
+
+ p = strchr(str, '=');
+ if (!p) {
+ return NULL;
+ }
+
+ return (p+1);
+}
+
+/****************************************************************************
+****************************************************************************/
+
+int main(int argc, char *argv[])
+{
+ BOOL ret = FALSE;
+ LPSTR servername;
+ LPSTR architecture = "Windows NT x86";
+ HANDLE server_handle;
+ PRINTER_DEFAULTS defaults_admin, defaults_use;
+ struct torture_context *tctx;
+ int i;
+
+ if (argc < 2) {
+ fprintf(stderr, "usage: %s <name> [print] [samba3] [architecture=ARCHITECTURE]\n\n", argv[0]);
+ fprintf(stderr, "\t<name> can be a server or printer name URI\n");
+ fprintf(stderr, "\t[print] will print all data that has been retrieved\n");
+ fprintf(stderr, "\t from the printserver\n");
+ fprintf(stderr, "\t[samba3] will skip some tests samba servers are known\n");
+ fprintf(stderr, "\t not to have implemented\n");
+ fprintf(stderr, "\t[architecture=X] allows one to define a specific\n");
+ fprintf(stderr, "\t architecture to test with. choose between:\n");
+ fprintf(stderr, "\t \"Windows NT x86\" or \"Windows x64\"\n");
+ exit(-1);
+ }
+
+ tctx = malloc(sizeof(struct torture_context));
+ if (!tctx) {
+ fprintf(stderr, "out of memory\n");
+ exit(-1);
+ }
+ memset(tctx, '\0', sizeof(*tctx));
+
+ servername = argv[1];
+
+ for (i=1; i < argc; i++) {
+ if (strcmp(argv[i], "print") == 0) {
+ tctx->print = TRUE;
+ }
+ if (strcmp(argv[i], "samba3") == 0) {
+ tctx->samba3 = TRUE;
+ }
+ if (strncmp(argv[i], "architecture", strlen("architecture")) == 0) {
+ architecture = get_string_param(argv[i]);
+ }
+ }
+
+ printf("Running testsuite with architecture: %s\n", architecture);
+
+ defaults_admin.pDatatype = NULL;
+ defaults_admin.pDevMode = NULL;
+ defaults_admin.DesiredAccess = PRINTER_ACCESS_ADMINISTER;
+
+ defaults_use.pDatatype = NULL;
+ defaults_use.pDevMode = NULL;
+ defaults_use.DesiredAccess = PRINTER_ACCESS_USE;
+
+ if ((servername[0] == '\\') && (servername[1] == '\\')) {
+ LPSTR p = servername+2;
+ LPSTR p2;
+ if ((p2 = strchr(p, '\\')) != NULL) {
+ ret = test_OnePrinter(tctx, servername, architecture, &defaults_admin);
+ goto done;
+ }
+ }
+
+ ret &= test_EnumPrinters(tctx, servername);
+ ret &= test_EnumDrivers(tctx, servername, architecture);
+ ret &= test_OpenPrinter(tctx, servername, NULL, &server_handle);
+/* ret &= test_EnumPrinterKey(tctx, servername, server_handle, ""); */
+ ret &= test_PrinterData_Server(tctx, servername, server_handle);
+ ret &= test_EnumForms(tctx, servername, server_handle);
+ ret &= test_ClosePrinter(tctx, server_handle);
+ ret &= test_EnumPorts(tctx, servername);
+ ret &= test_EnumMonitors(tctx, servername);
+ ret &= test_EnumPrintProcessors(tctx, servername, architecture);
+ ret &= test_EnumPrintProcessorDatatypes(tctx, servername);
+ ret &= test_GetPrintProcessorDirectory(tctx, servername, architecture);
+ ret &= test_GetPrinterDriverDirectory(tctx, servername, architecture);
+ ret &= test_EachPrinter(tctx, servername, architecture, &defaults_admin);
+
+ done:
+ if (!ret) {
+ if (tctx->last_reason) {
+ fprintf(stderr, "failed: %s\n", tctx->last_reason);
+ }
+ free(tctx);
+ return -1;
+ }
+
+ printf("%s run successfully\n", argv[0]);
+
+ free(tctx);
+ return 0;
+}
diff --git a/testprogs/win32/spoolss/testspoolss.h b/testprogs/win32/spoolss/testspoolss.h
new file mode 100644
index 0000000..eb19c64
--- /dev/null
+++ b/testprogs/win32/spoolss/testspoolss.h
@@ -0,0 +1,51 @@
+/*
+ Unix SMB/CIFS implementation.
+ test suite for spoolss rpc operations
+
+ Copyright (C) Guenther Deschner 2009
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#if 0
+#include "lib/replace/replace.h"
+#endif
+
+#include <windows.h>
+#include <stdio.h>
+
+#include "error.h"
+#include "printlib_proto.h"
+
+#if 0
+#include <talloc.h>
+#include "libcli/util/ntstatus.h"
+#include "lib/torture/torture.h"
+#endif
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
+#endif
+
+#ifndef true
+#define true TRUE
+#endif
+
+#ifndef false
+#define false FALSE
+#endif
+
+#ifndef PRINTER_ENUM_NAME
+#define PRINTER_ENUM_NAME 8
+#endif
diff --git a/testprogs/win32/spoolss/testspoolss.sln b/testprogs/win32/spoolss/testspoolss.sln
new file mode 100644
index 0000000..2082f5a
--- /dev/null
+++ b/testprogs/win32/spoolss/testspoolss.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testspoolss", "testspoolss.vcproj", "{60508731-0901-4B1D-9B11-DE070147DEF7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {60508731-0901-4B1D-9B11-DE070147DEF7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {60508731-0901-4B1D-9B11-DE070147DEF7}.Debug|Win32.Build.0 = Debug|Win32
+ {60508731-0901-4B1D-9B11-DE070147DEF7}.Release|Win32.ActiveCfg = Release|Win32
+ {60508731-0901-4B1D-9B11-DE070147DEF7}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/testprogs/win32/spoolss/testspoolss.vcproj b/testprogs/win32/spoolss/testspoolss.vcproj
new file mode 100644
index 0000000..45544bc
--- /dev/null
+++ b/testprogs/win32/spoolss/testspoolss.vcproj
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="testspoolss"
+ ProjectGUID="{60508731-0901-4B1D-9B11-DE070147DEF7}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\error.h"
+ >
+ </File>
+ <File
+ RelativePath=".\printlib_proto.h"
+ >
+ </File>
+ <File
+ RelativePath=".\string.h"
+ >
+ </File>
+ <File
+ RelativePath=".\testspoolss.h"
+ >
+ </File>
+ <File
+ RelativePath=".\torture.h"
+ >
+ </File>
+ <File
+ RelativePath=".\torture_proto.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\error.c"
+ >
+ </File>
+ <File
+ RelativePath=".\printlib.c"
+ >
+ </File>
+ <File
+ RelativePath=".\testspoolss.c"
+ >
+ </File>
+ <File
+ RelativePath=".\torture.c"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/testprogs/win32/spoolss/torture.c b/testprogs/win32/spoolss/torture.c
new file mode 100644
index 0000000..ff2824a
--- /dev/null
+++ b/testprogs/win32/spoolss/torture.c
@@ -0,0 +1,106 @@
+/*
+ Unix SMB/CIFS implementation.
+ SMB torture UI functions
+
+ Copyright (C) Jelmer Vernooij 2006
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testspoolss.h"
+#include "torture.h"
+
+/****************************************************************************
+****************************************************************************/
+
+void torture_warning(struct torture_context *context, const char *comment, ...)
+{
+ va_list ap;
+ char tmp[1024];
+
+#if 0
+ if (!context->results->ui_ops->warning)
+ return;
+#endif
+
+ va_start(ap, comment);
+ if (vsprintf(tmp, comment, ap) == -1) {
+ return;
+ }
+ va_end(ap);
+
+ fprintf(stderr, "WARNING: %s\n", tmp);
+#if 0
+ context->results->ui_ops->warning(context, tmp);
+
+ free(tmp);
+#endif
+}
+
+/****************************************************************************
+****************************************************************************/
+
+void torture_result(struct torture_context *context,
+ enum torture_result result, const char *fmt, ...)
+{
+ va_list ap;
+ char tmp[1024];
+
+ va_start(ap, fmt);
+
+ if (context->last_reason) {
+ torture_warning(context, "%s", context->last_reason);
+ free(context->last_reason);
+ context->last_reason = NULL;
+ }
+
+ context->last_result = result;
+ if (vsprintf(tmp, fmt, ap) == -1) {
+ return;
+ }
+ context->last_reason = malloc(sizeof(tmp));
+ if (!context->last_reason) {
+ return;
+ }
+ memcpy(context->last_reason, tmp, sizeof(tmp));
+
+ va_end(ap);
+}
+
+/****************************************************************************
+****************************************************************************/
+
+void torture_comment(struct torture_context *context, const char *comment, ...)
+{
+ va_list ap;
+ char tmp[1024];
+#if 0
+ if (!context->results->ui_ops->comment)
+ return;
+#endif
+ va_start(ap, comment);
+ if (vsprintf(tmp, comment, ap) == -1) {
+ return;
+ }
+ va_end(ap);
+
+#if 0
+ context->results->ui_ops->comment(context, tmp);
+#endif
+ fprintf(stdout, "%s\n", tmp);
+
+#if 0
+ free(tmp);
+#endif
+}
diff --git a/testprogs/win32/spoolss/torture.h b/testprogs/win32/spoolss/torture.h
new file mode 100644
index 0000000..7c9c443
--- /dev/null
+++ b/testprogs/win32/spoolss/torture.h
@@ -0,0 +1,92 @@
+/*
+ Unix SMB/CIFS implementation.
+ SMB torture UI functions
+
+ Copyright (C) Jelmer Vernooij 2006
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __TORTURE_UI_H__
+#define __TORTURE_UI_H__
+
+/****************************************************************************
+****************************************************************************/
+
+enum torture_result {
+ TORTURE_OK=0,
+ TORTURE_FAIL=1,
+ TORTURE_ERROR=2,
+ TORTURE_SKIP=3
+};
+
+struct torture_context {
+ enum torture_result last_result;
+ char *last_reason;
+ BOOL print;
+ BOOL samba3;
+};
+
+/****************************************************************************
+****************************************************************************/
+
+#define torture_assert(torture_ctx,expr,cmt) do {\
+ if (!(expr)) {\
+ torture_result(torture_ctx, TORTURE_FAIL, __location__": Expression `%s' failed: %s", __STRING(expr), cmt); \
+ return false;\
+ }\
+} while(0)
+
+#define torture_assert_str_equal(torture_ctx,got,expected,cmt)\
+ do { const char *__got = (got), *__expected = (expected); \
+ if (strcmp(__got, __expected) != 0) { \
+ torture_result(torture_ctx, TORTURE_FAIL, \
+ __location__": "#got" was %s, expected %s: %s", \
+ __got, __expected, cmt); \
+ return false; \
+ } \
+ } while(0)
+
+#define torture_assert_int_equal(torture_ctx,got,expected,cmt)\
+ do { int __got = (got), __expected = (expected); \
+ if (__got != __expected) { \
+ torture_result(torture_ctx, TORTURE_FAIL, \
+ __location__": "#got" was %d, expected %d: %s", \
+ __got, __expected, cmt); \
+ return false; \
+ } \
+ } while(0)
+
+#define torture_assert_mem_equal(torture_ctx,got,expected,len,cmt)\
+ do { const void *__got = (got), *__expected = (expected); \
+ if (memcmp(__got, __expected, len) != 0) { \
+ torture_result(torture_ctx, TORTURE_FAIL, \
+ __location__": "#got" of len %d did not match "#expected": %s", (int)len, cmt); \
+ return false; \
+ } \
+ } while(0)
+
+#define torture_skip(torture_ctx,cmt) do {\
+ torture_result(torture_ctx, TORTURE_SKIP, __location__": %s", cmt);\
+ return true; \
+ } while(0)
+
+#define torture_fail(torture_ctx,cmt) do {\
+ torture_result(torture_ctx, TORTURE_FAIL, __location__": %s", cmt);\
+ return false; \
+ } while (0)
+
+#include "torture_proto.h"
+
+#endif
diff --git a/testprogs/win32/spoolss/torture_proto.h b/testprogs/win32/spoolss/torture_proto.h
new file mode 100644
index 0000000..5d1dd88
--- /dev/null
+++ b/testprogs/win32/spoolss/torture_proto.h
@@ -0,0 +1,32 @@
+#ifndef __TORTURE_PROTO_H__
+#define __TORTURE_PROTO_H__
+
+#undef _PRINTF_ATTRIBUTE
+#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
+/* This file was automatically generated by mkproto.pl. DO NOT EDIT */
+
+/* this file contains prototypes for functions that are private
+ * to this subsystem or library. These functions should not be
+ * used outside this particular subsystem! */
+
+
+/* The following definitions come from torture.c */
+
+
+/****************************************************************************
+****************************************************************************/
+void torture_warning(struct torture_context *context, const char *comment, ...);
+
+/****************************************************************************
+****************************************************************************/
+void torture_result(struct torture_context *context,
+ enum torture_result result, const char *fmt, ...);
+
+/****************************************************************************
+****************************************************************************/
+void torture_comment(struct torture_context *context, const char *comment, ...);
+#undef _PRINTF_ATTRIBUTE
+#define _PRINTF_ATTRIBUTE(a1, a2)
+
+#endif /* __TORTURE_PROTO_H__ */
+
diff --git a/testprogs/win32/testmailslot/GNUmakefile b/testprogs/win32/testmailslot/GNUmakefile
new file mode 100644
index 0000000..a41fb91
--- /dev/null
+++ b/testprogs/win32/testmailslot/GNUmakefile
@@ -0,0 +1,16 @@
+INCLUDES=-I.
+CFLAGS=$(INCLUDES)
+MINGW_CC = i586-mingw32msvc-cc
+CC = $(MINGW_CC)
+
+all: testmailslot.exe
+
+clean:
+ rm -f *~ *.obj testmailslot.exe
+
+.SUFFIXES: .obj .exe .c
+
+testmailslot.exe: testmailslot.c
+
+.c.exe:
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
diff --git a/testprogs/win32/testmailslot/NMakefile b/testprogs/win32/testmailslot/NMakefile
new file mode 100644
index 0000000..7551d7b
--- /dev/null
+++ b/testprogs/win32/testmailslot/NMakefile
@@ -0,0 +1,13 @@
+#
+# use nmake /f NMakefile [<target>]
+#
+INCLUDES=-I
+CFLAGS=$(INCLUDES) -Zi -nologo
+
+all: testmailslot.exe
+
+clean:
+ del *~ *.obj testmailslot.exe
+
+testmailslot.exe: testmailslot.obj
+ $(CC) $(CFLAGS) -o testmailslot.exe testmailslot.obj $(LIBS)
diff --git a/testprogs/win32/testmailslot/testmailslot.c b/testprogs/win32/testmailslot/testmailslot.c
new file mode 100644
index 0000000..b953636
--- /dev/null
+++ b/testprogs/win32/testmailslot/testmailslot.c
@@ -0,0 +1,80 @@
+/*
+ * Very simple test application for mailslots
+ * (C) 2005 Jelmer Vernooij <jelmer@samba.org>
+ * Published to the public domain
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+int read_slot(const char *mailslotname)
+{
+ HANDLE h;
+ DWORD nr;
+ char data[30000];
+ DWORD nextsize, nummsg = 0;
+
+ if (strncmp(mailslotname, "\\\\.\\mailslot\\", 13) && strncmp(mailslotname, "\\\\*\\mailslot\\", 13)) {
+ printf("Must specify local mailslot name (starting with \\\\.\\mailslot\\)\n");
+ return 1;
+ }
+
+ h = CreateMailslot(mailslotname, 0, MAILSLOT_WAIT_FOREVER, NULL);
+
+ if (h == INVALID_HANDLE_VALUE) {
+ printf("Unable to create mailslot %s: %d\n", mailslotname, GetLastError());
+ return 1;
+ }
+
+ if (!ReadFile(h, data, sizeof(data)-1, &nr, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return 1;
+ }
+
+ data[nr] = '\0';
+
+ printf("%s\n", data);
+
+ CloseHandle(h);
+}
+
+int write_slot(const char *mailslotname)
+{
+ HANDLE h;
+ DWORD nw;
+ char data[30000];
+ h = CreateFile(mailslotname, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (h == INVALID_HANDLE_VALUE) {
+ printf("Unable to open file: %d\n", GetLastError());
+ return 1;
+ }
+
+ gets(data);
+
+ if (!WriteFile(h, data, strlen(data), &nw, NULL)) {
+ printf("Error writing file: %d\n", GetLastError());
+ return 1;
+ }
+
+ CloseHandle(h);
+}
+
+int main(int argc, char **argv)
+{
+ if (argc < 3 ||
+ (strcmp(argv[1], "read") && strcmp(argv[1], "write"))) {
+ printf("Usage: %s read|write mailslot\n", argv[0]);
+ return 1;
+ }
+
+ if (!strcmp(argv[1], "read")) {
+ return read_slot(argv[2]);
+ }
+
+ if (!strcmp(argv[1], "write")) {
+ return write_slot(argv[2]);
+ }
+
+ return 0;
+}
diff --git a/testprogs/win32/vs2010-metze.cmd b/testprogs/win32/vs2010-metze.cmd
new file mode 100644
index 0000000..de7a9d4
--- /dev/null
+++ b/testprogs/win32/vs2010-metze.cmd
@@ -0,0 +1,24 @@
+@echo off
+set ComSpec=C:\Windows\system32\cmd.exe
+set DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\
+set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include;
+set LIB=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib;
+set LIBPATH=C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Windows\Microsoft.NET\Framework\v3.5;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB;
+set Path=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Windows\Microsoft.NET\Framework\v3.5;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\VCPackages;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\idmu\common
+set PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
+set PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
+set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
+set VisualStudioDir=C:\Users\Administrator\Documents\Visual Studio 2010
+set VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
+set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0\
+set WindowsSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\
+cls
+cd C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
+C:
+call vcvarsall.bat help
+
+echo #
+echo # You may want to enter 'C:' followed by 'vcvarsall.bat amd64' and 'Y:'
+echo #
+Y:
+@cmd.exe
diff --git a/testprogs/win32/wmi/echoprocessor.vbs b/testprogs/win32/wmi/echoprocessor.vbs
new file mode 100755
index 0000000..8ce6f7a
--- /dev/null
+++ b/testprogs/win32/wmi/echoprocessor.vbs
@@ -0,0 +1,10 @@
+For Each Host In WScript.Arguments
+ Set WMIservice = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & host & "\root\cimv2")
+
+ Set colsettings = WMIservice.ExecQuery("SELECT * FROM Win32_Processor")
+
+
+ For Each proc In colsettings
+ Wscript.Echo(host & ": " & proc.description)
+ Next
+Next