r26163: Add IDL and torture test for wkssvc_NetrGetJoinInformation().
authorGünther Deschner <gd@samba.org>
Tue, 27 Nov 2007 11:08:01 +0000 (12:08 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:46:30 +0000 (05:46 +0100)
Guenther
(This used to be commit 234b380669a146cfe4a8a28d66c4efafcae93446)

source4/librpc/idl/wkssvc.idl
source4/rpc_server/wkssvc/dcesrv_wkssvc.c
source4/torture/rpc/wkssvc.c

index 8ed0b2443b37a71ac469a1ce61ff9d21791fe5d9..3055099538afd41c3d6b3785194267c53bc628e9 100644 (file)
@@ -489,7 +489,18 @@ import "srvsvc.idl", "lsa.idl";
 
        /*****************************/
        /* Function        0x14      */
-       WERROR WKSSVC_NETRGETJOININFORMATION ();
+       typedef enum {
+               NetSetupUnknownStatus = 0,
+               NetSetupUnjoined = 1,
+               NetSetupWorkgroupName = 2,
+               NetSetupDomainName = 3
+       } wkssvc_NetJoinStatus;
+
+       WERROR wkssvc_NetrGetJoinInformation(
+               [in] [string,charset(UTF16)] uint16 *server_name,
+               [in,out,ref] [string,charset(UTF16)] uint16 **name_buffer,
+               [out,ref] wkssvc_NetJoinStatus *name_type
+               );
 
        /*****************************/
        /* Function        0x15      */
index 699cd5d266cf62e05cf8ef6285a141abbbe15629..864c9857d236850855a95f05d94ecd2c654542a4 100644 (file)
@@ -303,10 +303,10 @@ static WERROR dcesrv_wkssvc_NetrValidateName(struct dcesrv_call_state *dce_call,
 
 
 /*
-  WKSSVC_NETRGETJOININFORMATION
+  wkssvc_NetrGetJoinInformation
 */
-static WERROR dcesrv_WKSSVC_NETRGETJOININFORMATION(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
-                      struct WKSSVC_NETRGETJOININFORMATION *r)
+static WERROR dcesrv_wkssvc_NetrGetJoinInformation(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+                      struct wkssvc_NetrGetJoinInformation *r)
 {
        DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }
index 8c86b7e98a14f6a9875f652607cdc0ba2b3ce9f1..4ab6b79ce6f87d098444a86d62446ae72840bf7b 100644 (file)
@@ -978,6 +978,28 @@ static bool test_NetrMessageBufferSend(struct torture_context *tctx,
        return true;
 }
 
+static bool test_NetrGetJoinInformation(struct torture_context *tctx,
+                                       struct dcerpc_pipe *p)
+{
+       NTSTATUS status;
+       struct wkssvc_NetrGetJoinInformation r;
+       enum wkssvc_NetJoinStatus join_status;
+       const char *name_buffer = "";
+
+       r.in.server_name = dcerpc_server_name(p);
+       r.in.name_buffer = r.out.name_buffer = &name_buffer;
+       r.out.name_type = &join_status;
+
+       torture_comment(tctx, "testing NetrGetJoinInformation\n");
+
+       status = dcerpc_wkssvc_NetrGetJoinInformation(p, tctx, &r);
+       torture_assert_ntstatus_ok(tctx, status,
+                                  "NetrGetJoinInformation failed");
+       torture_assert_werr_ok(tctx, r.out.result,
+                              "NetrGetJoinInformation failed");
+       return true;
+}
+
 struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx)
 {
        struct torture_suite *suite;
@@ -1036,6 +1058,9 @@ struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx)
        torture_rpc_tcase_add_test(tcase, "NetrEnumerateComputerNames",
                                   test_NetrEnumerateComputerNames);
 
+       torture_rpc_tcase_add_test(tcase, "NetrGetJoinInformation",
+                                  test_NetrGetJoinInformation);
+
        torture_rpc_tcase_add_test(tcase, "NetrWorkstationStatisticsGet",
                                   test_NetrWorkstationStatisticsGet);
        torture_rpc_tcase_add_test(tcase, "NetrMessageBufferSend",