mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
spoolss: make spoolss deal with ndr64 ULONG_PTR of devmode_ptr and secdesc_ptr.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
This commit is contained in:
committed by
David Disseldorp
parent
e1d50a6b24
commit
e8feca012e
@ -1011,9 +1011,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *print_processor;
|
||||
[string,charset(UTF16)] uint16 *parameters;
|
||||
[string,charset(UTF16)] uint16 *driver_name;
|
||||
uint32 _devmode_ptr; /* pointer to truncated devicemode */
|
||||
uint32 *_devmode_ptr; /* pointer to truncated devicemode */
|
||||
[string,charset(UTF16)] uint16 *text_status;
|
||||
uint32 _secdesc_ptr;
|
||||
uint32 *_secdesc_ptr;
|
||||
spoolss_JobStatus status;
|
||||
[range(0,99)] uint32 priority;
|
||||
uint32 position;
|
||||
@ -1037,9 +1037,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *print_processor;
|
||||
[string,charset(UTF16)] uint16 *parameters;
|
||||
[string,charset(UTF16)] uint16 *driver_name;
|
||||
uint32 _devmode_ptr; /* pointer to truncated devicemode */
|
||||
uint32 *_devmode_ptr; /* pointer to truncated devicemode */
|
||||
[string,charset(UTF16)] uint16 *text_status;
|
||||
uint32 _secdesc_ptr;
|
||||
uint32 *_secdesc_ptr;
|
||||
spoolss_JobStatus status;
|
||||
[range(0,99)] uint32 priority;
|
||||
uint32 position;
|
||||
@ -1200,12 +1200,12 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *drivername;
|
||||
[string,charset(UTF16)] uint16 *comment;
|
||||
[string,charset(UTF16)] uint16 *location;
|
||||
uint32 devmode_ptr;
|
||||
uint32 *devmode_ptr;
|
||||
[string,charset(UTF16)] uint16 *sepfile;
|
||||
[string,charset(UTF16)] uint16 *printprocessor;
|
||||
[string,charset(UTF16)] uint16 *datatype;
|
||||
[string,charset(UTF16)] uint16 *parameters;
|
||||
uint32 secdesc_ptr;
|
||||
uint32 *secdesc_ptr;
|
||||
spoolss_PrinterAttributes attributes;
|
||||
[range(0,99)] uint32 priority;
|
||||
uint32 defaultpriority;
|
||||
@ -1217,7 +1217,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
} spoolss_SetPrinterInfo2;
|
||||
|
||||
typedef struct {
|
||||
uint32 sec_desc_ptr;
|
||||
uint32 *sec_desc_ptr;
|
||||
} spoolss_SetPrinterInfo3;
|
||||
|
||||
typedef struct {
|
||||
@ -1244,11 +1244,11 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
} spoolss_SetPrinterInfo7;
|
||||
|
||||
typedef struct {
|
||||
uint32 devmode_ptr;
|
||||
uint32 *devmode_ptr;
|
||||
} spoolss_SetPrinterInfo8;
|
||||
|
||||
typedef struct {
|
||||
uint32 devmode_ptr;
|
||||
uint32 *devmode_ptr;
|
||||
} spoolss_SetPrinterInfo9;
|
||||
|
||||
typedef [switch_type(uint32)] union {
|
||||
|
@ -252,8 +252,6 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
devmode_ctr.devmode = &dm;
|
||||
|
||||
info2.devmode_ptr = 1;
|
||||
}
|
||||
|
||||
result = winreg_update_printer(mem_ctx, b,
|
||||
|
@ -107,12 +107,12 @@ void spoolss_printerinfo2_to_setprinterinfo2(const struct spoolss_PrinterInfo2 *
|
||||
s->drivername = i->drivername;
|
||||
s->comment = i->comment;
|
||||
s->location = i->location;
|
||||
s->devmode_ptr = 0;
|
||||
s->devmode_ptr = NULL;
|
||||
s->sepfile = i->sepfile;
|
||||
s->printprocessor = i->printprocessor;
|
||||
s->datatype = i->datatype;
|
||||
s->parameters = i->parameters;
|
||||
s->secdesc_ptr = 0;
|
||||
s->secdesc_ptr = NULL;
|
||||
s->attributes = i->attributes;
|
||||
s->priority = i->priority;
|
||||
s->defaultpriority = i->defaultpriority;
|
||||
|
@ -1796,8 +1796,8 @@ static WERROR cmd_spoolss_addprinterex(struct rpc_pipe_client *cli,
|
||||
info2.comment = "Created by rpcclient";
|
||||
info2.printprocessor = "winprint";
|
||||
info2.datatype = "RAW";
|
||||
info2.devmode_ptr = 0;
|
||||
info2.secdesc_ptr = 0;
|
||||
info2.devmode_ptr = NULL;
|
||||
info2.secdesc_ptr = NULL;
|
||||
info2.attributes = PRINTER_ATTRIBUTE_SHARED;
|
||||
info2.priority = 0;
|
||||
info2.defaultpriority = 0;
|
||||
|
@ -244,12 +244,12 @@ static bool PrinterInfo_to_SetPrinterInfo(struct torture_context *tctx,
|
||||
s->info2->drivername = i->info2.drivername;
|
||||
s->info2->comment = i->info2.comment;
|
||||
s->info2->location = i->info2.location;
|
||||
s->info2->devmode_ptr = 0;
|
||||
s->info2->devmode_ptr = NULL;
|
||||
s->info2->sepfile = i->info2.sepfile;
|
||||
s->info2->printprocessor = i->info2.printprocessor;
|
||||
s->info2->datatype = i->info2.datatype;
|
||||
s->info2->parameters = i->info2.parameters;
|
||||
s->info2->secdesc_ptr = 0;
|
||||
s->info2->secdesc_ptr = NULL;
|
||||
s->info2->attributes = i->info2.attributes;
|
||||
s->info2->priority = i->info2.priority;
|
||||
s->info2->defaultpriority = i->info2.defaultpriority;
|
||||
@ -1417,8 +1417,8 @@ static bool test_SetPrinter_errors(struct torture_context *tctx,
|
||||
static void clear_info2(struct spoolss_SetPrinterInfoCtr *r)
|
||||
{
|
||||
if ((r->level == 2) && (r->info.info2)) {
|
||||
r->info.info2->secdesc_ptr = 0;
|
||||
r->info.info2->devmode_ptr = 0;
|
||||
r->info.info2->secdesc_ptr = NULL;
|
||||
r->info.info2->devmode_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1883,7 +1883,7 @@ static bool test_sd_set_level(struct torture_context *tctx,
|
||||
case 3: {
|
||||
struct spoolss_SetPrinterInfo3 info3;
|
||||
|
||||
info3.sec_desc_ptr = 0;
|
||||
info3.sec_desc_ptr = NULL;
|
||||
|
||||
info_ctr.level = 3;
|
||||
info_ctr.info.info3 = &info3;
|
||||
@ -2054,7 +2054,7 @@ static bool test_devmode_set_level(struct torture_context *tctx,
|
||||
case 8: {
|
||||
struct spoolss_SetPrinterInfo8 info8;
|
||||
|
||||
info8.devmode_ptr = 0;
|
||||
info8.devmode_ptr = NULL;
|
||||
|
||||
info_ctr.level = 8;
|
||||
info_ctr.info.info8 = &info8;
|
||||
|
@ -389,12 +389,12 @@ static bool test_SetPrinter(struct torture_context *tctx,
|
||||
info2.drivername = info.info2.drivername;
|
||||
info2.comment = talloc_asprintf(tctx, "torture_comment %d\n", (int)time(NULL));
|
||||
info2.location = info.info2.location;
|
||||
info2.devmode_ptr = 0;
|
||||
info2.devmode_ptr = NULL;
|
||||
info2.sepfile = info.info2.sepfile;
|
||||
info2.printprocessor = info.info2.printprocessor;
|
||||
info2.datatype = info.info2.datatype;
|
||||
info2.parameters = info.info2.parameters;
|
||||
info2.secdesc_ptr = 0;
|
||||
info2.secdesc_ptr = NULL;
|
||||
info2.attributes = info.info2.attributes;
|
||||
info2.priority = info.info2.priority;
|
||||
info2.defaultpriority = info.info2.defaultpriority;
|
||||
|
Reference in New Issue
Block a user