diff options
author | Jean-François Micouleau <jfm@samba.org> | 2000-03-07 09:06:03 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2000-03-07 09:06:03 +0000 |
commit | 0f987d77becebc7d528f5fda6d0e23325035131c (patch) | |
tree | 7d4f0a08d0bef22cb74c1c64e27d5b1aacb7de38 | |
parent | 78d7ba5ca021518ec5c088eb492b36710e556c31 (diff) | |
download | samba-0f987d77becebc7d528f5fda6d0e23325035131c.tar.gz samba-0f987d77becebc7d528f5fda6d0e23325035131c.tar.bz2 samba-0f987d77becebc7d528f5fda6d0e23325035131c.zip |
fixed enumprinterdata.
J.F.
(This used to be commit 2b4f09e7bbcbf1bf835f299e9f6bf89b32a7f03f)
-rw-r--r-- | source3/include/nterr.h | 9 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 21 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 4 |
3 files changed, 20 insertions, 14 deletions
diff --git a/source3/include/nterr.h b/source3/include/nterr.h index 8793509119..df2cde61f7 100644 --- a/source3/include/nterr.h +++ b/source3/include/nterr.h @@ -3,10 +3,17 @@ #define STATUS_BUFFER_OVERFLOW (5) #define STATUS_MORE_ENTRIES (0x105) + +/* Win32 Error codes. */ + +#define ERROR_ACCESS_DENIED (5) #define ERROR_INVALID_HANDLE (6) #define ERROR_INVALID_PARAMETER (87) #define ERROR_INSUFFICIENT_BUFFER (122) -#define STATUS_1804 (1804) +#define ERROR_INVALID_NAME (123) +#define ERROR_NO_MORE_ITEMS (259) +#define ERROR_INVALID_PRINTER_NAME (1801) +#define ERROR_INVALID_DATATYPE (1804) /* these are the NT error codes less than 1000. They are here for when we start supporting NT error codes in Samba. They were extracted diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index a880184f3d..061b41e123 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1272,17 +1272,16 @@ BOOL get_specific_param_by_index(NT_PRINTER_INFO_LEVEL printer, uint32 level, ui i++; } - if (param != NULL) - { - /* exited because it exist */ - *type=param->type; - StrnCpy(value, param->value, sizeof(value)-1); - *data=(uint8 *)malloc(param->data_len*sizeof(uint8)); - memcpy(*data, param->data, param->data_len); - *len=param->data_len; - return (True); - } - return (False); + if (param == NULL) + return False; + + /* exited because it exist */ + *type=param->type; + StrnCpy(value, param->value, sizeof(fstring)-1); + *data=(uint8 *)malloc(param->data_len*sizeof(uint8)); + memcpy(*data, param->data, param->data_len); + *len=param->data_len; + return True; } /**************************************************************************** diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 9d465ca145..f15fc75181 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2483,7 +2483,7 @@ uint32 _spoolss_startdocprinter( const POLICY_HND *handle, uint32 level, if (strcmp(datatype, "RAW") != 0) { (*jobid)=0; - return STATUS_1804; + return ERROR_INVALID_DATATYPE; } } @@ -3674,7 +3674,7 @@ uint32 _spoolss_enumprinterdata(const POLICY_HND *handle, uint32 index, if (!get_specific_param_by_index(printer, 2, index, value, &data, &type, &data_len)) { free_a_printer(printer, 2); - return 0x0103; /* ERROR_NO_MORE_ITEMS */ + return ERROR_NO_MORE_ITEMS; } /* |