summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-09 19:35:30 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-09 19:35:30 +0000
commit826ad16b363accc4029178cf9087b02362245e11 (patch)
treee97642e777c4843139b99258ea6885101b3633be /source3/include
parent97398b4c7433b449b074373a7f552c58854c7a49 (diff)
downloadsamba-826ad16b363accc4029178cf9087b02362245e11.tar.gz
samba-826ad16b363accc4029178cf9087b02362245e11.tar.bz2
samba-826ad16b363accc4029178cf9087b02362245e11.zip
debugging rpcclient spoolenum and spooljobs commands. oh, did i forget
to mention, there's a spooljobs <printer name> command, and it uses command-line completion? prints out NT print jobs really nicely, too. (This used to be commit e6e5caf16c8d120f0c11fa63061f2786098e3357)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/ntdomain.h2
-rw-r--r--source3/include/nterr.h4
-rw-r--r--source3/include/proto.h44
-rwxr-xr-xsource3/include/rpc_spoolss.h5
4 files changed, 44 insertions, 11 deletions
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index 1b7a7b55a6..c36f619ef2 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -194,6 +194,8 @@ struct acct_info
#define PRINT_INFO_FN(fn)\
void (*fn)(const char*, uint32, uint32, void *const *const)
+#define JOB_INFO_FN(fn)\
+ void (*fn)(const char*, const char*, uint32, uint32, void *const *const)
#endif /* _NT_DOMAIN_H */
diff --git a/source3/include/nterr.h b/source3/include/nterr.h
index 21e245d287..86c049495c 100644
--- a/source3/include/nterr.h
+++ b/source3/include/nterr.h
@@ -2,6 +2,10 @@
#define STATUS_BUFFER_OVERFLOW (5)
#define STATUS_MORE_ENTRIES (0x105)
+#define ERROR_INVALID_HANDLE (6)
+#define ERROR_INVALID_PARAMETER (87)
+#define ERROR_INSUFFICIENT_BUFFER (122)
+
/* 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/include/proto.h b/source3/include/proto.h
index f98dffad2a..0b0ca16c54 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -490,6 +490,7 @@ void free_unistr_array(uint32 num_entries, UNISTR2 **entries);
UNISTR2* add_unistr_to_array(uint32 *len, UNISTR2 ***array, UNISTR2 *name);
void free_sid_array(uint32 num_entries, DOM_SID **entries);
DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
+void free_devmode(DEVICEMODE *devmode);
void free_printer_info_2(PRINTER_INFO_2 *printer);
void free_print2_array(uint32 num_entries, PRINTER_INFO_2 **entries);
PRINTER_INFO_2 *add_print2_to_array(uint32 *len, PRINTER_INFO_2 ***array,
@@ -2059,11 +2060,19 @@ BOOL spoolss_enum_printers(struct cli_state *cli, uint16 fnum,
uint32 level,
uint32 *count,
void ***printers);
+uint32 spoolss_enum_jobs(struct cli_state *cli, uint16 fnum,
+ const PRINTER_HND *hnd,
+ uint32 firstjob,
+ uint32 numofjobs,
+ uint32 level,
+ uint32 *buf_size,
+ uint32 *count,
+ void ***jobs);
BOOL spoolss_open_printer_ex(struct cli_state *cli, uint16 fnum,
- char *printername,
+ const char *printername,
uint32 cbbuf, uint32 devmod, uint32 des_access,
- char *station,
- char *username,
+ const char *station,
+ const char *username,
PRINTER_HND *hnd);
BOOL spoolss_closeprinter(struct cli_state *cli, uint16 fnum, PRINTER_HND *hnd);
@@ -2952,10 +2961,10 @@ BOOL smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data,
prs_struct *ps, int depth);
BOOL spoolss_io_r_open_printer_ex(char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_struct *ps, int depth);
BOOL make_spoolss_q_open_printer_ex(SPOOL_Q_OPEN_PRINTER_EX *q_u,
- char *printername,
+ const char *printername,
uint32 cbbuf, uint32 devmod, uint32 des_access,
- char *station,
- char *username);
+ const char *station,
+ const char *username);
BOOL spoolss_io_q_open_printer_ex(char *desc, SPOOL_Q_OPEN_PRINTER_EX *q_u, prs_struct *ps, int depth);
BOOL make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u,
PRINTER_HND *handle,
@@ -3019,7 +3028,7 @@ BOOL spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int de
BOOL spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int depth);
void free_r_enumjobs(SPOOL_R_ENUMJOBS *r_u);
BOOL spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth);
-BOOL make_spoolss_q_enumjobs(SPOOL_Q_ENUMJOBS *q_u, PRINTER_HND *hnd,
+BOOL make_spoolss_q_enumjobs(SPOOL_Q_ENUMJOBS *q_u, const PRINTER_HND *hnd,
uint32 firstjob,
uint32 numofjobs,
uint32 level,
@@ -3460,12 +3469,22 @@ void cmd_sam_enum_groups(struct client_info *info);
/*The following definitions come from rpcclient/cmd_spoolss.c */
BOOL msrpc_spoolss_enum_printers(struct cli_state *cli,
+ const char* srv_name,
uint32 level,
uint32 *num,
void ***ctr,
PRINT_INFO_FN(fn));
void cmd_spoolss_enum_printers(struct client_info *info);
void cmd_spoolss_open_printer_ex(struct client_info *info);
+BOOL msrpc_spoolss_enum_jobs(struct cli_state *cli,
+ const char* srv_name,
+ const char* user_name,
+ const char* printer_name,
+ uint32 level,
+ uint32 *num,
+ void ***ctr,
+ JOB_INFO_FN(fn));
+void cmd_spoolss_enum_jobs(struct client_info *info);
/*The following definitions come from rpcclient/cmd_srvsvc.c */
@@ -3632,6 +3651,17 @@ void display_printer_info_1_ctr(FILE *out_hnd, enum action_type action,
void display_printer_info_ctr(FILE *out_hnd, enum action_type action,
uint32 level, uint32 count,
void *const *const ctr);
+void display_job_info_2(FILE *out_hnd, enum action_type action,
+ JOB_INFO_2 *const i2);
+void display_job_info_1(FILE *out_hnd, enum action_type action,
+ JOB_INFO_1 *const i1);
+void display_job_info_2_ctr(FILE *out_hnd, enum action_type action,
+ uint32 count, JOB_INFO_2 *const *const ctr);
+void display_job_info_1_ctr(FILE *out_hnd, enum action_type action,
+ uint32 count, JOB_INFO_1 *const *const ctr);
+void display_job_info_ctr(FILE *out_hnd, enum action_type action,
+ uint32 level, uint32 count,
+ void *const *const ctr);
/*The following definitions come from rpcclient/rpcclient.c */
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index 8eb0c7efb1..8b3410e87c 100755
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -478,10 +478,6 @@ typedef struct devicemode_container
#define COLLATE_FALSE 0
#define COLLATE_TRUE 1
-#define ERROR_INVALID_HANDLE 6
-#define ERROR_INVALID_PARAMETER 87
-#define ERROR_INSUFFICIENT_BUFFER 122
-
typedef struct s_header_type
{
uint32 type;
@@ -1015,6 +1011,7 @@ typedef struct spool_r_enumjobs
union {
JOB_INFO_1 **job_info_1;
JOB_INFO_2 **job_info_2;
+ void *info;
} job;
uint32 offered;
uint32 numofjobs;