midletests bla...
authorStefan Metzmacher <metze@samba.org>
Fri, 1 Oct 2010 04:16:34 +0000 (06:16 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 4 Jun 2019 11:14:55 +0000 (13:14 +0200)
testprogs/win32/midltests/midltests.acf
testprogs/win32/midltests/midltests.idl
testprogs/win32/midltests/midltests_tcp.c

index a04bb5dcd987c7a03915b2bf3326c03ba1a450b8..28b77a7af0e5081848901944e5862946aa1b4799 100644 (file)
@@ -3,4 +3,7 @@
 ]
 interface midltests
 {
+       [async] midltests_fn();
+       [async] midltests_ping();
+
 }
index 3e652b4342ad86d93d1ad878a94895c5402df6e3..41b15517bc4778bc5ad78672317d905493a55457 100644 (file)
  * 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.
@@ -217,6 +216,7 @@ static void midltests(void)
 {
        RPC_ASYNC_STATE aping;
        RPC_ASYNC_STATE afn;
+       RPC_STATUS status = 0;
        long ret;
        struct msg out1;
        unsigned char out1b[3];
@@ -225,7 +225,11 @@ static void midltests(void)
        struct pipe_structtype_state ins;
        ASYNC_pipe_structtype inp;
        struct msg in1;
-       unsigned char in1b[3000];
+       unsigned char in1b[300];
+       structtype inpb[2500];
+       structtype *outb = NULL;
+       unsigned long outb_size = 0;
+       unsigned long outb_len = 0;
 
        in1.l = sizeof(in1b);
        memset(&in1b, 0xAA, sizeof(in1b));
@@ -241,7 +245,7 @@ static void midltests(void)
 
        memset(&ins, 0, sizeof(ins));
        ins.name = "inp";
-       ins.count = 35;
+       ins.count = 0;
        memset(&inp, 0, sizeof(inp));
        inp.pull = pipe_structtype_pull;
        inp.push = pipe_structtype_push;
@@ -251,9 +255,10 @@ static void midltests(void)
        out1.l = sizeof(out1b);
        memset(&out1b, 0xFF, sizeof(out1b));
        out1.m = out1b;
-
+#if 0
        RpcAsyncInitializeHandle(&aping, sizeof(aping));
        cli_midltests_ping(&aping, in1);
+
        while (TRUE) {
                RPC_STATUS status;
                status = RpcAsyncCompleteCall(&aping, &ret);
@@ -262,16 +267,41 @@ static void midltests(void)
                }
                Sleep(100);
        }
+#endif
+       ret = 0;
+
+       printf("HERE:%s:%d:%s()\n", __FILE__, __LINE__, __FUNCTION__);
        RpcAsyncInitializeHandle(&afn, sizeof(afn));
        cli_midltests_fn(&afn, &out1, &outp, &inp, in1);
+#if 0
+       printf("HERE:%s:%d:%s()\n", __FILE__, __LINE__, __FUNCTION__);
+       Sleep(500);
+       memset(inpb, 0xEE, sizeof(inpb));
+       printf("HERE:%s:%d:%s()\n", __FILE__, __LINE__, __FUNCTION__);
+       inp.push(inp.state, inpb, sizeof(inpb));
+       Sleep(500);
+#endif
+       printf("HERE:%s:%d:%s()\n", __FILE__, __LINE__, __FUNCTION__);
+       inp.push(inp.state, inpb, 0);
+       outb_size = 0;
+       do {
+               outp.pull(outp.state, outb, sizeof(outb), &outb_len);
+               Sleep(1000);
+               printf("HERE:%s:%d:%s() %d\n", __FILE__, __LINE__, __FUNCTION__,
+outb_len);
+               outb_size--;
+       } while (outb_len > 0);
        while (TRUE) {
-               RPC_STATUS status;
-               status = RpcAsyncCompleteCall(&aping, &ret);
+       printf("HERE:%s:%d:%s()\n", __FILE__, __LINE__, __FUNCTION__);
+               status = RpcAsyncCompleteCall(&afn, &ret);
                if (status != RPC_S_ASYNC_CALL_PENDING) {
                        break;
                }
-               Sleep(100);
+               Sleep(2000);
        }
+       printf("HERE:%s:%d:%s() %\n",
+               __FILE__, __LINE__, __FUNCTION__,
+               status, ret);
 }
 
 void srv_midltests_fn(
@@ -297,7 +327,7 @@ void srv_midltests_fn(
                fflush(stdout);
        } while (inb_len > 0);
 
-       outb_size = 50;
+       outb_size = 0;
        do {
                outp->alloc(outp->state, outb_size, &outb, &outb_len);
                memset(outb, 0xCC, outb_len * sizeof(*outb));
index 3046f6debc6db97e6ef8252c202bd4ce584bc298..d29620eac948653c0c6bf635dfdb9f65c0b1d85f 100644 (file)
@@ -611,7 +611,7 @@ int main(int argc, char **argv)
        ctx_ndr32.stop = TRUE;
 
        Sleep(250);
-
+#if 0
        printf("\nTest NDR64\n\n");
        binding = "ncacn_ip_tcp:" CONNECT_IP "[5064]";
        status = RpcBindingFromStringBinding(
@@ -630,6 +630,7 @@ int main(int argc, char **argv)
                printf("Runtime error 0x%x\n", ret);
                fflush(stdout);
        } RpcEndExcept
+#endif
        ctx_ndr64.stop = TRUE;
 
        WaitForMultipleObjects(3, hThreadArray, TRUE, 2000);