From: Stefan Metzmacher Date: Fri, 1 Oct 2010 04:16:34 +0000 (+0200) Subject: midletests bla... X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=3f1d1b18a3aeedd9903dcfeafbc282dedeeb9aa4 midletests bla... --- diff --git a/testprogs/win32/midltests/midltests.acf b/testprogs/win32/midltests/midltests.acf index a04bb5dcd987..28b77a7af0e5 100644 --- a/testprogs/win32/midltests/midltests.acf +++ b/testprogs/win32/midltests/midltests.acf @@ -3,4 +3,7 @@ ] interface midltests { + [async] midltests_fn(); + [async] midltests_ping(); + } diff --git a/testprogs/win32/midltests/midltests.idl b/testprogs/win32/midltests/midltests.idl index 3e652b4342ad..41b15517bc47 100644 --- a/testprogs/win32/midltests/midltests.idl +++ b/testprogs/win32/midltests/midltests.idl @@ -11,11 +11,10 @@ * 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)); diff --git a/testprogs/win32/midltests/midltests_tcp.c b/testprogs/win32/midltests/midltests_tcp.c index 3046f6debc6d..d29620eac948 100644 --- a/testprogs/win32/midltests/midltests_tcp.c +++ b/testprogs/win32/midltests/midltests_tcp.c @@ -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);