s3: Remove procid_self() from do_lock()
[samba.git] / source3 / rpcclient / cmd_ntsvcs.c
index 7a253529439717197a48defbd82f4723a7a8e850..95b905ab2ddf3330a8d5df0d0f38246a4b3e3703 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "rpcclient.h"
+#include "../librpc/gen_ndr/cli_ntsvcs.h"
 
 static WERROR cmd_ntsvcs_get_version(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
@@ -122,15 +123,15 @@ static WERROR cmd_ntsvcs_get_hw_prof_info(struct rpc_pipe_client *cli,
        WERROR werr;
        uint32_t idx = 0;
        struct PNP_HwProfInfo info;
-       uint32_t unknown1 = 0, unknown2 = 0;
+       uint32_t size = 0, flags = 0;
 
        ZERO_STRUCT(info);
 
        status = rpccli_PNP_GetHwProfInfo(cli, mem_ctx,
                                          idx,
                                          &info,
-                                         unknown1,
-                                         unknown2,
+                                         size,
+                                         flags,
                                          &werr);
        if (!NT_STATUS_IS_OK(status)) {
                return ntstatus_to_werror(status);
@@ -149,13 +150,13 @@ static WERROR cmd_ntsvcs_get_dev_reg_prop(struct rpc_pipe_client *cli,
        const char *devicepath = NULL;
        uint32_t property = DEV_REGPROP_DESC;
        uint32_t reg_data_type = REG_NONE;
-       uint8_t buffer;
+       uint8_t *buffer;
        uint32_t buffer_size = 0;
        uint32_t needed = 0;
        uint32_t flags = 0;
 
        if (argc < 2) {
-               printf("usage: %s [devicepath]\n", argv[0]);
+               printf("usage: %s [devicepath] [buffersize]\n", argv[0]);
                return WERR_OK;
        }
 
@@ -166,11 +167,14 @@ static WERROR cmd_ntsvcs_get_dev_reg_prop(struct rpc_pipe_client *cli,
                needed = buffer_size;
        }
 
+       buffer = talloc_array(mem_ctx, uint8_t, buffer_size);
+       W_ERROR_HAVE_NO_MEMORY(buffer);
+
        status = rpccli_PNP_GetDeviceRegProp(cli, mem_ctx,
                                             devicepath,
                                             property,
                                             &reg_data_type,
-                                            &buffer,
+                                            buffer,
                                             &buffer_size,
                                             &needed,
                                             flags,
@@ -232,17 +236,21 @@ static WERROR cmd_ntsvcs_get_dev_list(struct rpc_pipe_client *cli,
        uint32_t length = 0;
        uint32_t flags = 0;
 
-       if (argc > 3) {
-               printf("usage: %s [length] [filter]\n", argv[0]);
+       if (argc > 4) {
+               printf("usage: %s [filter] [length] [flags]\n", argv[0]);
                return WERR_OK;
        }
 
        if (argc >= 2) {
-               length = atoi(argv[1]);
+               filter = argv[1];
        }
 
        if (argc >= 3) {
-               filter = argv[2];
+               length = atoi(argv[2]);
+       }
+
+       if (argc >= 4) {
+               flags = atoi(argv[3]);
        }
 
        buffer = talloc(mem_ctx, uint16_t);