s3-rpcclient: add database_redo command.
[kai/samba.git] / source3 / rpcclient / cmd_ntsvcs.c
index b7b37e2fa6bb86c56f539b2a0a9f84b4f52b5f89..377a8a2a00efcb965b63c1744d4ed07ab16d243d 100644 (file)
@@ -177,13 +177,53 @@ static WERROR cmd_ntsvcs_get_hw_prof_info(struct rpc_pipe_client *cli,
        return werr;
 }
 
+static WERROR cmd_ntsvcs_get_dev_reg_prop(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         int argc,
+                                         const char **argv)
+{
+       NTSTATUS status;
+       WERROR werr;
+       const char *devicepath = NULL;
+       uint32_t property = DEV_REGPROP_DESC;
+       uint32_t unknown1 = 0;
+       uint8_t buffer;
+       uint32_t buffer_size = 0;
+       uint32_t unknown2 = 0;
+       uint32_t unknown3 = 0;
+
+       if (argc < 2) {
+               printf("usage: %s [devicepath]\n", argv[0]);
+               return WERR_OK;
+       }
+
+       devicepath = argv[1];
+
+       status = rpccli_PNP_GetDeviceRegProp(cli, mem_ctx,
+                                            devicepath,
+                                            property,
+                                            &unknown1,
+                                            &buffer,
+                                            &buffer_size,
+                                            &unknown2,
+                                            unknown3,
+                                            &werr);
+       if (!NT_STATUS_IS_OK(status)) {
+               return ntstatus_to_werror(status);
+       }
+
+       return werr;
+}
+
+
 struct cmd_set ntsvcs_commands[] = {
 
        { "NTSVCS" },
-       { "ntsvcs_getversion", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_version, PI_NTSVCS, NULL, "Query NTSVCS version", "" },
-       { "ntsvcs_validatedevinst", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_validate_dev_inst, PI_NTSVCS, NULL, "Query NTSVCS device instance", "" },
-       { "ntsvcs_getdevlistsize", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_device_list_size, PI_NTSVCS, NULL, "Query NTSVCS get device list", "" },
-       { "ntsvcs_hwprofflags", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_hw_prof_flags, PI_NTSVCS, NULL, "Query NTSVCS HW prof flags", "" },
-       { "ntsvcs_hwprofinfo", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_hw_prof_info, PI_NTSVCS, NULL, "Query NTSVCS HW prof info", "" },
+       { "ntsvcs_getversion", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_version, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS version", "" },
+       { "ntsvcs_validatedevinst", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_validate_dev_inst, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS device instance", "" },
+       { "ntsvcs_getdevlistsize", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_device_list_size, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS get device list", "" },
+       { "ntsvcs_hwprofflags", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_hw_prof_flags, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS HW prof flags", "" },
+       { "ntsvcs_hwprofinfo", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_hw_prof_info, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS HW prof info", "" },
+       { "ntsvcs_getdevregprop", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_dev_reg_prop, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS device registry property", "" },
        { NULL }
 };