Changeset 628
- Timestamp:
- Aug 24, 2011, 7:50:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/libsmb/cliprint.c
r414 r628 116 116 } 117 117 118 #ifdef __OS2__ 119 // this is a exact copy of the above cli_print_queue, but we need to pass the 120 // state also to the callback, as our client needs that!! 121 122 /**************************************************************************** 123 call fn() on each entry in a print queue 124 ****************************************************************************/ 125 126 int cli_print_queue_state(struct cli_state *cli, 127 void (*fn)(struct print_job_info *, void *), void *state) 128 { 129 char *rparam = NULL; 130 char *rdata = NULL; 131 char *p; 132 unsigned int rdrcnt, rprcnt; 133 char param[1024]; 134 int result_code=0; 135 int i = -1; 136 137 memset(param,'\0',sizeof(param)); 138 139 p = param; 140 SSVAL(p,0,76); /* API function number 76 (DosPrintJobEnum) */ 141 p += 2; 142 safe_strcpy_base(p,"zWrLeh", param, sizeof(param)); /* parameter description? */ 143 p = skip_string(param,sizeof(param),p); 144 safe_strcpy_base(p,"WWzWWDDzz", param, sizeof(param)); /* returned data format */ 145 p = skip_string(param,sizeof(param),p); 146 safe_strcpy_base(p,cli->share, param, sizeof(param)); /* name of queue */ 147 p = skip_string(param,sizeof(param),p); 148 SSVAL(p,0,2); /* API function level 2, PRJINFO_2 data structure */ 149 SSVAL(p,2,1000); /* size of bytes of returned data buffer */ 150 p += 4; 151 safe_strcpy_base(p,"", param,sizeof(param)); /* subformat */ 152 p = skip_string(param,sizeof(param),p); 153 154 DEBUG(4,("doing cli_print_queue for %s\n", cli->share)); 155 156 if (cli_api(cli, 157 param, PTR_DIFF(p,param), 1024, /* Param, length, maxlen */ 158 NULL, 0, CLI_BUFFER_SIZE, /* data, length, maxlen */ 159 &rparam, &rprcnt, /* return params, length */ 160 &rdata, &rdrcnt)) { /* return data, length */ 161 int converter; 162 result_code = SVAL(rparam,0); 163 converter = SVAL(rparam,2); /* conversion factor */ 164 165 if (result_code == 0) { 166 struct print_job_info job; 167 168 p = rdata; 169 170 for (i = 0; i < SVAL(rparam,4); ++i) { 171 job.id = SVAL(p,0); 172 job.priority = SVAL(p,2); 173 fstrcpy(job.user, 174 fix_char_ptr(SVAL(p,4), converter, 175 rdata, rdrcnt)); 176 job.t = cli_make_unix_date3(cli, p + 12); 177 job.size = IVAL(p,16); 178 fstrcpy(job.name,fix_char_ptr(SVAL(p,24), 179 converter, 180 rdata, rdrcnt)); 181 fn(&job, state); 182 p += 28; 183 } 184 } 185 } 186 187 /* If any parameters or data were returned, free the storage. */ 188 SAFE_FREE(rparam); 189 SAFE_FREE(rdata); 190 191 return i; 192 } 193 #endif 194 118 195 /**************************************************************************** 119 196 cancel a print job
Note:
See TracChangeset
for help on using the changeset viewer.