diff options
author | Günther Deschner <gd@samba.org> | 2009-03-17 14:43:50 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-03-17 18:39:17 +0100 |
commit | 47c024fd7516aa940b6b04f903cedff677e5543e (patch) | |
tree | 2f147abcd7223cb9bbf94b22ee811950acd59835 /source3/printing | |
parent | 28d16866ee639f828ea644753f29a678605883a5 (diff) | |
download | samba-47c024fd7516aa940b6b04f903cedff677e5543e.tar.gz samba-47c024fd7516aa940b6b04f903cedff677e5543e.tar.bz2 samba-47c024fd7516aa940b6b04f903cedff677e5543e.zip |
s3-spoolss: rename temporary convert_devicemode_new function.
Guenther
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 12e645f18a..6b6803dd3b 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -4583,24 +4583,25 @@ static uint32 update_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level) got to keep the endians happy :). ****************************************************************************/ -static bool convert_driver_init( TALLOC_CTX *ctx, NT_DEVICEMODE *nt_devmode, uint8 *data, uint32 data_len ) +static bool convert_driver_init(TALLOC_CTX *mem_ctx, NT_DEVICEMODE *nt_devmode, + const uint8_t *data, uint32_t data_len) { - bool result = False; - prs_struct ps; - DEVICEMODE devmode; + struct spoolss_DeviceMode devmode; + enum ndr_err_code ndr_err; + DATA_BLOB blob; ZERO_STRUCT(devmode); - prs_init_empty(&ps, ctx, UNMARSHALL); - ps.data_p = (char *)data; - ps.buffer_size = data_len; + blob = data_blob_const(data, data_len); - if (spoolss_io_devmode("phantom DEVMODE", &ps, 0, &devmode)) - result = convert_devicemode("", &devmode, &nt_devmode); - else - DEBUG(10,("convert_driver_init: error parsing DEVMODE\n")); + ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL, &devmode, + (ndr_pull_flags_fn_t)ndr_pull_spoolss_DeviceMode); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + DEBUG(10,("convert_driver_init: error parsing spoolss_DeviceMode\n")); + return false; + } - return result; + return convert_devicemode("", &devmode, &nt_devmode); } /**************************************************************************** |