summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_spoolss.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient/cmd_spoolss.c')
-rw-r--r--source3/rpcclient/cmd_spoolss.c229
1 files changed, 113 insertions, 116 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 9686fd1e24..3ce7f9e6ac 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -84,19 +84,19 @@ BOOL get_short_archi(char *short_archi, const char *long_archi)
/**********************************************************************
* dummy function -- placeholder
*/
-static NTSTATUS cmd_spoolss_not_implemented(struct cli_state *cli,
+static WERROR cmd_spoolss_not_implemented(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
printf ("(*) This command is not currently implemented.\n");
- return NT_STATUS_OK;
+ return WERR_OK;
}
#endif
/***********************************************************************
* Get printer information
*/
-static NTSTATUS cmd_spoolss_open_printer_ex(struct cli_state *cli,
+static WERROR cmd_spoolss_open_printer_ex(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -107,11 +107,11 @@ static NTSTATUS cmd_spoolss_open_printer_ex(struct cli_state *cli,
if (argc != 2) {
printf("Usage: %s <printername>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
if (!cli)
- return NT_STATUS_UNSUCCESSFUL;
+ return WERR_GENERAL_FAILURE;
slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper (servername);
@@ -134,7 +134,7 @@ static NTSTATUS cmd_spoolss_open_printer_ex(struct cli_state *cli,
}
}
- return W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
@@ -298,7 +298,7 @@ static void display_print_info_3(PRINTER_INFO_3 *i3)
/* Enumerate printers */
-static NTSTATUS cmd_spoolss_enum_printers(struct cli_state *cli,
+static WERROR cmd_spoolss_enum_printers(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -311,7 +311,7 @@ static NTSTATUS cmd_spoolss_enum_printers(struct cli_state *cli,
if (argc > 3)
{
printf("Usage: %s [level] [name]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
if (argc == 2)
@@ -367,7 +367,7 @@ static NTSTATUS cmd_spoolss_enum_printers(struct cli_state *cli,
}
done:
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/****************************************************************************
@@ -403,7 +403,7 @@ static void display_port_info_2(PORT_INFO_2 *i2)
/* Enumerate ports */
-static NTSTATUS cmd_spoolss_enum_ports(struct cli_state *cli,
+static WERROR cmd_spoolss_enum_ports(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -414,7 +414,7 @@ static NTSTATUS cmd_spoolss_enum_ports(struct cli_state *cli,
if (argc > 2) {
printf("Usage: %s [level]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
if (argc == 2)
@@ -449,13 +449,13 @@ static NTSTATUS cmd_spoolss_enum_ports(struct cli_state *cli,
}
}
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/***********************************************************************
* Set printer comment - use a level2 set.
*/
-static NTSTATUS cmd_spoolss_setprinter(struct cli_state *cli,
+static WERROR cmd_spoolss_setprinter(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -473,7 +473,7 @@ static NTSTATUS cmd_spoolss_setprinter(struct cli_state *cli,
if (argc == 1 || argc > 3) {
printf("Usage: %s printername comment\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Open a printer handle */
@@ -519,13 +519,13 @@ static NTSTATUS cmd_spoolss_setprinter(struct cli_state *cli,
if (opened_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &pol);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/***********************************************************************
* Get printer information
*/
-static NTSTATUS cmd_spoolss_getprinter(struct cli_state *cli,
+static WERROR cmd_spoolss_getprinter(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -541,7 +541,7 @@ static NTSTATUS cmd_spoolss_getprinter(struct cli_state *cli,
if (argc == 1 || argc > 3) {
printf("Usage: %s <printername> [level]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Open a printer handle */
@@ -601,7 +601,7 @@ static NTSTATUS cmd_spoolss_getprinter(struct cli_state *cli,
if (opened_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &pol);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
static void display_reg_value(REGISTRY_VALUE value)
@@ -644,7 +644,7 @@ static void display_reg_value(REGISTRY_VALUE value)
/***********************************************************************
* Get printer data
*/
-static NTSTATUS cmd_spoolss_getprinterdata(struct cli_state *cli,
+static WERROR cmd_spoolss_getprinterdata(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -661,7 +661,7 @@ static NTSTATUS cmd_spoolss_getprinterdata(struct cli_state *cli,
if (argc != 3) {
printf("Usage: %s <printername> <valuename>\n", argv[0]);
printf("<printername> of . queries print server\n");
- return NT_STATUS_OK;
+ return WERR_OK;
}
valuename = argv[2];
@@ -709,13 +709,13 @@ static NTSTATUS cmd_spoolss_getprinterdata(struct cli_state *cli,
if (opened_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &pol);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/***********************************************************************
* Get printer data
*/
-static NTSTATUS cmd_spoolss_getprinterdataex(struct cli_state *cli,
+static WERROR cmd_spoolss_getprinterdataex(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -733,7 +733,7 @@ static NTSTATUS cmd_spoolss_getprinterdataex(struct cli_state *cli,
printf("Usage: %s <printername> <keyname> <valuename>\n",
argv[0]);
printf("<printername> of . queries print server\n");
- return NT_STATUS_OK;
+ return WERR_OK;
}
valuename = argv[3];
keyname = argv[2];
@@ -784,7 +784,7 @@ static NTSTATUS cmd_spoolss_getprinterdataex(struct cli_state *cli,
if (opened_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &pol);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/****************************************************************************
@@ -900,13 +900,12 @@ static void display_print_driver_3(DRIVER_INFO_3 *i1)
/***********************************************************************
* Get printer information
*/
-static NTSTATUS cmd_spoolss_getdriver(struct cli_state *cli,
+static WERROR cmd_spoolss_getdriver(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
POLICY_HND pol;
WERROR werror;
- NTSTATUS result;
uint32 info_level = 3;
BOOL opened_hnd = False;
PRINTER_DRIVER_CTR ctr;
@@ -918,7 +917,7 @@ static NTSTATUS cmd_spoolss_getdriver(struct cli_state *cli,
if ((argc == 1) || (argc > 3))
{
printf("Usage: %s <printername> [level]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* get the arguments need to open the printer handle */
@@ -935,11 +934,9 @@ static NTSTATUS cmd_spoolss_getdriver(struct cli_state *cli,
PRINTER_ACCESS_USE,
servername, user, &pol);
- result = W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
-
- if (!NT_STATUS_IS_OK(result)) {
+ if (!W_ERROR_IS_OK(werror)) {
printf("Error opening printer handle for %s!\n", printername);
- return result;
+ return werror;
}
opened_hnd = True;
@@ -984,13 +981,13 @@ static NTSTATUS cmd_spoolss_getdriver(struct cli_state *cli,
if (opened_hnd)
cli_spoolss_close_printer (cli, mem_ctx, &pol);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
/***********************************************************************
* Get printer information
*/
-static NTSTATUS cmd_spoolss_enum_drivers(struct cli_state *cli,
+static WERROR cmd_spoolss_enum_drivers(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1003,7 +1000,7 @@ static NTSTATUS cmd_spoolss_enum_drivers(struct cli_state *cli,
if (argc > 2)
{
printf("Usage: enumdrivers [level]\n");
- return NT_STATUS_OK;
+ return WERR_OK;
}
if (argc == 2)
@@ -1058,7 +1055,7 @@ static NTSTATUS cmd_spoolss_enum_drivers(struct cli_state *cli,
}
}
- return W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
/****************************************************************************
@@ -1078,7 +1075,7 @@ static void display_printdriverdir_1(DRIVER_DIRECTORY_1 *i1)
/***********************************************************************
* Get printer driver directory information
*/
-static NTSTATUS cmd_spoolss_getdriverdir(struct cli_state *cli,
+static WERROR cmd_spoolss_getdriverdir(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1089,7 +1086,7 @@ static NTSTATUS cmd_spoolss_getdriverdir(struct cli_state *cli,
if (argc > 2) {
printf("Usage: %s [environment]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Get the arguments need to open the printer handle */
@@ -1111,7 +1108,7 @@ static NTSTATUS cmd_spoolss_getdriverdir(struct cli_state *cli,
if (W_ERROR_IS_OK(result))
display_printdriverdir_1(ctr.info1);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/*******************************************************************************
@@ -1222,7 +1219,7 @@ static BOOL init_drv_info_3_members (
}
-static NTSTATUS cmd_spoolss_addprinterdriver(struct cli_state *cli,
+static WERROR cmd_spoolss_addprinterdriver(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1241,7 +1238,7 @@ static NTSTATUS cmd_spoolss_addprinterdriver(struct cli_state *cli,
printf ("\t<Config File Name>:<Help File Name>:<Language Monitor Name>:\\\n");
printf ("\t<Default Data Type>:<Comma Separated list of Files>\n");
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Fill in the DRIVER_INFO_3 struct */
@@ -1249,7 +1246,7 @@ static NTSTATUS cmd_spoolss_addprinterdriver(struct cli_state *cli,
if (!get_short_archi(arch, argv[1]))
{
printf ("Error Unknown architechture [%s]\n", argv[1]);
- return NT_STATUS_INVALID_PARAMETER;
+ return WERR_INVALID_PARAM;
}
else
set_drv_info_3_env(&info3, arch);
@@ -1257,7 +1254,7 @@ static NTSTATUS cmd_spoolss_addprinterdriver(struct cli_state *cli,
if (!init_drv_info_3_members(mem_ctx, &info3, argv[2]))
{
printf ("Error Invalid parameter list - %s.\n", argv[2]);
- return NT_STATUS_INVALID_PARAMETER;
+ return WERR_INVALID_PARAM;
}
@@ -1271,11 +1268,11 @@ static NTSTATUS cmd_spoolss_addprinterdriver(struct cli_state *cli,
driver_name);
}
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
-static NTSTATUS cmd_spoolss_addprinterex(struct cli_state *cli,
+static WERROR cmd_spoolss_addprinterex(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1289,7 +1286,7 @@ static NTSTATUS cmd_spoolss_addprinterex(struct cli_state *cli,
if (argc != 5)
{
printf ("Usage: %s <name> <shared name> <driver> <port>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
@@ -1329,10 +1326,10 @@ static NTSTATUS cmd_spoolss_addprinterex(struct cli_state *cli,
if (W_ERROR_IS_OK(result))
printf ("Printer %s successfully installed.\n", argv[1]);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
-static NTSTATUS cmd_spoolss_setdriver(struct cli_state *cli,
+static WERROR cmd_spoolss_setdriver(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1351,7 +1348,7 @@ static NTSTATUS cmd_spoolss_setdriver(struct cli_state *cli,
if (argc != 3)
{
printf ("Usage: %s <printer> <driver>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
@@ -1406,11 +1403,11 @@ done:
if (opened_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &pol);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
-static NTSTATUS cmd_spoolss_deletedriver(struct cli_state *cli,
+static WERROR cmd_spoolss_deletedriver(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1422,7 +1419,7 @@ static NTSTATUS cmd_spoolss_deletedriver(struct cli_state *cli,
if (argc != 2)
{
printf ("Usage: %s <driver>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
@@ -1449,10 +1446,10 @@ static NTSTATUS cmd_spoolss_deletedriver(struct cli_state *cli,
}
}
- return W_ERROR_IS_OK(result) || W_ERROR_EQUAL(result, WERR_UNKNOWN_PRINTER_DRIVER) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
-static NTSTATUS cmd_spoolss_getprintprocdir(struct cli_state *cli,
+static WERROR cmd_spoolss_getprintprocdir(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1464,17 +1461,17 @@ static NTSTATUS cmd_spoolss_getprintprocdir(struct cli_state *cli,
/* parse the command arguements */
if (argc > 2) {
printf ("Usage: %s [environment]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
if (asprintf(&servername, "\\\\%s", cli->desthost) < 0)
- return NT_STATUS_NO_MEMORY;
+ return WERR_NOMEM;
strupper(servername);
if (asprintf(&environment, "%s", (argc == 2) ? argv[1] :
PRINTER_DRIVER_ARCHITECTURE) < 0) {
SAFE_FREE(servername);
- return NT_STATUS_NO_MEMORY;
+ return WERR_NOMEM;
}
result = cli_spoolss_getprintprocessordirectory(
@@ -1491,12 +1488,12 @@ static NTSTATUS cmd_spoolss_getprintprocdir(struct cli_state *cli,
SAFE_FREE(servername);
SAFE_FREE(environment);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/* Add a form */
-static NTSTATUS cmd_spoolss_addform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+static WERROR cmd_spoolss_addform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
POLICY_HND handle;
@@ -1509,7 +1506,7 @@ static NTSTATUS cmd_spoolss_addform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Get a printer handle */
@@ -1550,12 +1547,12 @@ static NTSTATUS cmd_spoolss_addform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
SAFE_FREE(servername);
SAFE_FREE(printername);
- return W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
/* Set a form */
-static NTSTATUS cmd_spoolss_setform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+static WERROR cmd_spoolss_setform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
POLICY_HND handle;
@@ -1568,7 +1565,7 @@ static NTSTATUS cmd_spoolss_setform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Get a printer handle */
@@ -1608,12 +1605,12 @@ static NTSTATUS cmd_spoolss_setform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
SAFE_FREE(servername);
SAFE_FREE(printername);
- return W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
/* Get a form */
-static NTSTATUS cmd_spoolss_getform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+static WERROR cmd_spoolss_getform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
POLICY_HND handle;
@@ -1627,7 +1624,7 @@ static NTSTATUS cmd_spoolss_getform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Get a printer handle */
@@ -1671,12 +1668,12 @@ static NTSTATUS cmd_spoolss_getform(struct cli_state *cli, TALLOC_CTX *mem_ctx,
SAFE_FREE(servername);
SAFE_FREE(printername);
- return W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
/* Delete a form */
-static NTSTATUS cmd_spoolss_deleteform(struct cli_state *cli,
+static WERROR cmd_spoolss_deleteform(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -1689,7 +1686,7 @@ static NTSTATUS cmd_spoolss_deleteform(struct cli_state *cli,
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Get a printer handle */
@@ -1718,12 +1715,12 @@ static NTSTATUS cmd_spoolss_deleteform(struct cli_state *cli,
SAFE_FREE(servername);
SAFE_FREE(printername);
- return W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
/* Enumerate forms */
-static NTSTATUS cmd_spoolss_enum_forms(struct cli_state *cli,
+static WERROR cmd_spoolss_enum_forms(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -1738,7 +1735,7 @@ static NTSTATUS cmd_spoolss_enum_forms(struct cli_state *cli,
if (argc != 2) {
printf ("Usage: %s <printer>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Get a printer handle */
@@ -1788,10 +1785,10 @@ static NTSTATUS cmd_spoolss_enum_forms(struct cli_state *cli,
SAFE_FREE(servername);
SAFE_FREE(printername);
- return W_ERROR_IS_OK(werror) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return werror;
}
-static NTSTATUS cmd_spoolss_setprinterdata(struct cli_state *cli,
+static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1807,7 +1804,7 @@ static NTSTATUS cmd_spoolss_setprinterdata(struct cli_state *cli,
/* parse the command arguements */
if (argc != 4) {
printf ("Usage: %s <printer> <value> <data>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
@@ -1869,7 +1866,7 @@ done:
if (opened_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &pol);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
static void display_job_info_1(JOB_INFO_1 *job)
@@ -1910,7 +1907,7 @@ static void display_job_info_2(JOB_INFO_2 *job)
/* Enumerate jobs */
-static NTSTATUS cmd_spoolss_enum_jobs(struct cli_state *cli,
+static WERROR cmd_spoolss_enum_jobs(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -1924,7 +1921,7 @@ static NTSTATUS cmd_spoolss_enum_jobs(struct cli_state *cli,
if (argc < 2 || argc > 3) {
printf("Usage: %s printername [level]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
if (argc == 3)
@@ -1980,12 +1977,12 @@ done:
if (got_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &hnd);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/* enumerate data */
-static NTSTATUS cmd_spoolss_enum_data( struct cli_state *cli,
+static WERROR cmd_spoolss_enum_data( struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -1998,7 +1995,7 @@ static NTSTATUS cmd_spoolss_enum_data( struct cli_state *cli,
if (argc != 2) {
printf("Usage: %s printername\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Open printer handle */
@@ -2039,12 +2036,12 @@ done:
if (got_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &hnd);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/* enumerate data for a given key */
-static NTSTATUS cmd_spoolss_enum_data_ex( struct cli_state *cli,
+static WERROR cmd_spoolss_enum_data_ex( struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -2059,7 +2056,7 @@ static NTSTATUS cmd_spoolss_enum_data_ex( struct cli_state *cli,
if (argc != 3) {
printf("Usage: %s printername <keyname>\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
keyname = argv[2];
@@ -2104,12 +2101,12 @@ done:
if (got_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &hnd);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/* enumerate subkeys */
-static NTSTATUS cmd_spoolss_enum_printerkey( struct cli_state *cli,
+static WERROR cmd_spoolss_enum_printerkey( struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -2124,7 +2121,7 @@ static NTSTATUS cmd_spoolss_enum_printerkey( struct cli_state *cli,
if (argc < 2 || argc > 3) {
printf("Usage: %s printername [keyname]\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
if (argc == 3)
@@ -2178,10 +2175,10 @@ done:
if (got_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &hnd);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
-static NTSTATUS cmd_spoolss_rffpcnex(struct cli_state *cli,
+static WERROR cmd_spoolss_rffpcnex(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
@@ -2257,7 +2254,7 @@ done:
if (got_hnd)
cli_spoolss_close_printer(cli, mem_ctx, &hnd);
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return result;
}
/* List of commands exported by this module */
@@ -2265,33 +2262,33 @@ struct cmd_set spoolss_commands[] = {
{ "SPOOLSS" },
- { "adddriver", cmd_spoolss_addprinterdriver, PI_SPOOLSS, "Add a print driver", "" },
- { "addprinter", cmd_spoolss_addprinterex, PI_SPOOLSS, "Add a printer", "" },
- { "deldriver", cmd_spoolss_deletedriver, PI_SPOOLSS, "Delete a printer driver", "" },
- { "enumdata", cmd_spoolss_enum_data, PI_SPOOLSS, "Enumerate printer data", "" },
- { "enumdataex", cmd_spoolss_enum_data_ex, PI_SPOOLSS, "Enumerate printer data for a key", "" },
- { "enumkey", cmd_spoolss_enum_printerkey, PI_SPOOLSS, "Enumerate printer keys", "" },
- { "enumjobs", cmd_spoolss_enum_jobs, PI_SPOOLSS, "Enumerate print jobs", "" },
- { "enumports", cmd_spoolss_enum_ports, PI_SPOOLSS, "Enumerate printer ports", "" },
- { "enumdrivers", cmd_spoolss_enum_drivers, PI_SPOOLSS, "Enumerate installed printer drivers", "" },
- { "enumprinters", cmd_spoolss_enum_printers, PI_SPOOLSS, "Enumerate printers", "" },
- { "getdata", cmd_spoolss_getprinterdata, PI_SPOOLSS, "Get print driver data", "" },
- { "getdataex", cmd_spoolss_getprinterdataex, PI_SPOOLSS, "Get printer driver data with keyname", ""},
- { "getdriver", cmd_spoolss_getdriver, PI_SPOOLSS, "Get print driver information", "" },
- { "getdriverdir", cmd_spoolss_getdriverdir, PI_SPOOLSS, "Get print driver upload directory", "" },
- { "getprinter", cmd_spoolss_getprinter, PI_SPOOLSS, "Get printer info", "" },
- { "getprintprocdir", cmd_spoolss_getprintprocdir, PI_SPOOLSS, "Get print processor directory", "" },
- { "openprinter", cmd_spoolss_open_printer_ex, PI_SPOOLSS, "Open printer handle", "" },
- { "setdriver", cmd_spoolss_setdriver, PI_SPOOLSS, "Set printer driver", "" },
- { "getprintprocdir", cmd_spoolss_getprintprocdir, PI_SPOOLSS, "Get print processor directory", "" },
- { "addform", cmd_spoolss_addform, PI_SPOOLSS, "Add form", "" },
- { "setform", cmd_spoolss_setform, PI_SPOOLSS, "Set form", "" },
- { "getform", cmd_spoolss_getform, PI_SPOOLSS, "Get form", "" },
- { "deleteform", cmd_spoolss_deleteform, PI_SPOOLSS, "Delete form", "" },
- { "enumforms", cmd_spoolss_enum_forms, PI_SPOOLSS, "Enumerate forms", "" },
- { "setprinter", cmd_spoolss_setprinter, PI_SPOOLSS, "Set printer comment", "" },
- { "setprinterdata", cmd_spoolss_setprinterdata, PI_SPOOLSS, "Set REG_SZ printer data", "" },
- { "rffpcnex", cmd_spoolss_rffpcnex, PI_SPOOLSS, "Rffpcnex test", "" },
+ { "adddriver", RPC_RTYPE_WERROR, NULL, cmd_spoolss_addprinterdriver, PI_SPOOLSS, "Add a print driver", "" },
+ { "addprinter", RPC_RTYPE_WERROR, NULL, cmd_spoolss_addprinterex, PI_SPOOLSS, "Add a printer", "" },
+ { "deldriver", RPC_RTYPE_WERROR, NULL, cmd_spoolss_deletedriver, PI_SPOOLSS, "Delete a printer driver", "" },
+ { "enumdata", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_data, PI_SPOOLSS, "Enumerate printer data", "" },
+ { "enumdataex", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_data_ex, PI_SPOOLSS, "Enumerate printer data for a key", "" },
+ { "enumkey", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_printerkey, PI_SPOOLSS, "Enumerate printer keys", "" },
+ { "enumjobs", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_jobs, PI_SPOOLSS, "Enumerate print jobs", "" },
+ { "enumports", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_ports, PI_SPOOLSS, "Enumerate printer ports", "" },
+ { "enumdrivers", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_drivers, PI_SPOOLSS, "Enumerate installed printer drivers", "" },
+ { "enumprinters", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_printers, PI_SPOOLSS, "Enumerate printers", "" },
+ { "getdata", RPC_RTYPE_WERROR, NULL, cmd_spoolss_getprinterdata, PI_SPOOLSS, "Get print driver data", "" },
+ { "getdataex", RPC_RTYPE_WERROR, NULL, cmd_spoolss_getprinterdataex, PI_SPOOLSS, "Get printer driver data with keyname", ""},
+ { "getdriver", RPC_RTYPE_WERROR, NULL, cmd_spoolss_getdriver, PI_SPOOLSS, "Get print driver information", "" },
+ { "getdriverdir", RPC_RTYPE_WERROR, NULL, cmd_spoolss_getdriverdir, PI_SPOOLSS, "Get print driver upload directory", "" },
+ { "getprinter", RPC_RTYPE_WERROR, NULL, cmd_spoolss_getprinter, PI_SPOOLSS, "Get printer info", "" },
+ { "getprintprocdir",RPC_RTYPE_WERROR, NULL, cmd_spoolss_getprintprocdir, PI_SPOOLSS, "Get print processor directory", "" },
+ { "openprinter", RPC_RTYPE_WERROR, NULL, cmd_spoolss_open_printer_ex, PI_SPOOLSS, "Open printer handle", "" },
+ { "setdriver", RPC_RTYPE_WERROR, NULL, cmd_spoolss_setdriver, PI_SPOOLSS, "Set printer driver", "" },
+ { "getprintprocdir", RPC_RTYPE_WERROR, NULL, cmd_spoolss_getprintprocdir, PI_SPOOLSS, "Get print processor directory", "" },
+ { "addform", RPC_RTYPE_WERROR, NULL, cmd_spoolss_addform, PI_SPOOLSS, "Add form", "" },
+ { "setform", RPC_RTYPE_WERROR, NULL, cmd_spoolss_setform, PI_SPOOLSS, "Set form", "" },
+ { "getform", RPC_RTYPE_WERROR, NULL, cmd_spoolss_getform, PI_SPOOLSS, "Get form", "" },
+ { "deleteform", RPC_RTYPE_WERROR, NULL, cmd_spoolss_deleteform, PI_SPOOLSS, "Delete form", "" },
+ { "enumforms", RPC_RTYPE_WERROR, NULL, cmd_spoolss_enum_forms, PI_SPOOLSS, "Enumerate forms", "" },
+ { "setprinter", RPC_RTYPE_WERROR, NULL, cmd_spoolss_setprinter, PI_SPOOLSS, "Set printer comment", "" },
+ { "setprinterdata", RPC_RTYPE_WERROR, NULL, cmd_spoolss_setprinterdata, PI_SPOOLSS, "Set REG_SZ printer data", "" },
+ { "rffpcnex", RPC_RTYPE_WERROR, NULL, cmd_spoolss_rffpcnex, PI_SPOOLSS, "Rffpcnex test", "" },
{ NULL }
};