diff options
author | Tim Potter <tpot@samba.org> | 2001-12-10 05:03:17 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-12-10 05:03:17 +0000 |
commit | 4f53486d78102d8080293eeafd7b4ed701d81a2e (patch) | |
tree | 2aaca817b8f8dbbb1fb09abff6ad482398b7dd1d /source3/libsmb/cli_spoolss.c | |
parent | ce654f5e557544451fb198b32af89152a2aeed60 (diff) | |
download | samba-4f53486d78102d8080293eeafd7b4ed701d81a2e.tar.gz samba-4f53486d78102d8080293eeafd7b4ed701d81a2e.tar.bz2 samba-4f53486d78102d8080293eeafd7b4ed701d81a2e.zip |
Added client and server code for the GetPrintProcessorDirectory SPOOLSS
rpc. This was supposed to fix a printer driver download bug but it didn't
but it seemed a shame to trash all this code so I'm commiting it #ifdef'ed
out in case someone needs it one day.
(This used to be commit bef43656471741c6c10b12e7516c15de9ae76394)
Diffstat (limited to 'source3/libsmb/cli_spoolss.c')
-rw-r--r-- | source3/libsmb/cli_spoolss.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/source3/libsmb/cli_spoolss.c b/source3/libsmb/cli_spoolss.c index 2663e311e0..d455bb7196 100644 --- a/source3/libsmb/cli_spoolss.c +++ b/source3/libsmb/cli_spoolss.c @@ -1070,4 +1070,63 @@ done: return result; } +NTSTATUS cli_spoolss_getprintprocessordirectory(struct cli_state *cli, + TALLOC_CTX *mem_ctx, + char *name, + char *environment, + fstring procdir) +{ + prs_struct qbuf, rbuf; + SPOOL_Q_GETPRINTPROCESSORDIRECTORY q; + SPOOL_R_GETPRINTPROCESSORDIRECTORY r; + NTSTATUS result; + int level = 1; + NEW_BUFFER buffer; + uint32 needed = 100; + + ZERO_STRUCT(q); + ZERO_STRUCT(r); + + /* Initialise parse structures */ + + + /* Initialise input parameters */ + + do { + init_buffer(&buffer, needed, mem_ctx); + + prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL); + prs_init(&rbuf, 0, mem_ctx, UNMARSHALL); + + make_spoolss_q_getprintprocessordirectory(&q, name, + environment, level, + &buffer, needed); + + /* Marshall data and send request */ + if (!spoolss_io_q_getprintprocessordirectory("", &q, &qbuf, 0) || + !rpc_api_pipe_req(cli, SPOOLSS_GETPRINTPROCESSORDIRECTORY, &qbuf, &rbuf)) { + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + + /* Unmarshall response */ + + if (!spoolss_io_r_getprintprocessordirectory("", &r, &rbuf, 0)) { + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + + /* Return output parameters */ + + result = werror_to_ntstatus(r.status); + + } while (NT_STATUS_V(result) == + NT_STATUS_V(ERROR_INSUFFICIENT_BUFFER)); + + done: + prs_mem_free(&qbuf); + prs_mem_free(&rbuf); + + return result; +} |