s3-rpcclient: some corrections for the PNP_GetDeviceRegProp client.
authorGünther Deschner <gd@samba.org>
Wed, 12 Nov 2008 08:23:38 +0000 (09:23 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 12 Nov 2008 09:18:46 +0000 (10:18 +0100)
Guenther

source3/rpcclient/cmd_ntsvcs.c

index a3ddde22a3abf505fba02fffe142d0954f5f31ba..20d6928473917640e989689ee6bf3f5da2358437 100644 (file)
@@ -148,11 +148,11 @@ static WERROR cmd_ntsvcs_get_dev_reg_prop(struct rpc_pipe_client *cli,
        WERROR werr;
        const char *devicepath = NULL;
        uint32_t property = DEV_REGPROP_DESC;
-       uint32_t unknown1 = 0;
+       uint32_t reg_data_type = REG_NONE;
        uint8_t buffer;
        uint32_t buffer_size = 0;
-       uint32_t unknown2 = 0;
-       uint32_t unknown3 = 0;
+       uint32_t needed = 0;
+       uint32_t flags = 0;
 
        if (argc < 2) {
                printf("usage: %s [devicepath]\n", argv[0]);
@@ -161,14 +161,19 @@ static WERROR cmd_ntsvcs_get_dev_reg_prop(struct rpc_pipe_client *cli,
 
        devicepath = argv[1];
 
+       if (argc >= 3) {
+               buffer_size = atoi(argv[2]);
+               needed = buffer_size;
+       }
+
        status = rpccli_PNP_GetDeviceRegProp(cli, mem_ctx,
                                             devicepath,
                                             property,
-                                            &unknown1,
+                                            &reg_data_type,
                                             &buffer,
                                             &buffer_size,
-                                            &unknown2,
-                                            unknown3,
+                                            &needed,
+                                            flags,
                                             &werr);
        if (!NT_STATUS_IS_OK(status)) {
                return ntstatus_to_werror(status);