summaryrefslogtreecommitdiff
path: root/librpc/gen_ndr/srv_spoolss.c
diff options
context:
space:
mode:
Diffstat (limited to 'librpc/gen_ndr/srv_spoolss.c')
-rw-r--r--librpc/gen_ndr/srv_spoolss.c135
1 files changed, 18 insertions, 117 deletions
diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index abf49766a4..64af1c4a16 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -57,12 +57,6 @@ static bool api_spoolss_EnumPrinters(pipes_struct *p)
return false;
}
- r->out.count = talloc_zero(r, uint32_t);
- if (r->out.count == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_EnumPrinters(p, r);
if (p->rng_fault_state) {
@@ -388,12 +382,6 @@ static bool api_spoolss_EnumJobs(pipes_struct *p)
return false;
}
- r->out.count = talloc_zero(r, uint32_t);
- if (r->out.count == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_EnumJobs(p, r);
if (p->rng_fault_state) {
@@ -858,12 +846,6 @@ static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p)
return false;
}
- r->out.count = talloc_zero(r, uint32_t);
- if (r->out.count == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_EnumPrinterDrivers(p, r);
if (p->rng_fault_state) {
@@ -1255,12 +1237,6 @@ static bool api_spoolss_EnumPrintProcessors(pipes_struct *p)
return false;
}
- r->out.count = talloc_zero(r, uint32_t);
- if (r->out.count == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_EnumPrintProcessors(p, r);
if (p->rng_fault_state) {
@@ -1787,7 +1763,7 @@ static bool api_spoolss_ReadPrinter(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.data = talloc_zero(r, DATA_BLOB);
+ r->out.data = talloc_zero_array(r, uint8_t, r->in.data_size);
if (r->out.data == NULL) {
talloc_free(r);
return false;
@@ -2098,12 +2074,6 @@ static bool api_spoolss_GetPrinterData(pipes_struct *p)
return false;
}
- r->out.data = talloc_zero(r, union spoolss_PrinterData);
- if (r->out.data == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.needed = talloc_zero(r, uint32_t);
if (r->out.needed == NULL) {
talloc_free(r);
@@ -2722,12 +2692,6 @@ static bool api_spoolss_EnumForms(pipes_struct *p)
return false;
}
- r->out.count = talloc_zero(r, uint32_t);
- if (r->out.count == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_EnumForms(p, r);
if (p->rng_fault_state) {
@@ -2814,12 +2778,6 @@ static bool api_spoolss_EnumPorts(pipes_struct *p)
return false;
}
- r->out.count = talloc_zero(r, uint32_t);
- if (r->out.count == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_EnumPorts(p, r);
if (p->rng_fault_state) {
@@ -2906,12 +2864,6 @@ static bool api_spoolss_EnumMonitors(pipes_struct *p)
return false;
}
- r->out.count = talloc_zero(r, uint32_t);
- if (r->out.count == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_EnumMonitors(p, r);
if (p->rng_fault_state) {
@@ -6064,7 +6016,7 @@ static bool api_spoolss_GetPrinterDataEx(pipes_struct *p)
return false;
}
- r->out.buffer = talloc_zero(r, DATA_BLOB);
+ r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
if (r->out.buffer == NULL) {
talloc_free(r);
return false;
@@ -6150,7 +6102,7 @@ static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.buffer = talloc_zero(r, DATA_BLOB);
+ r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
if (r->out.buffer == NULL) {
talloc_free(r);
return false;
@@ -6242,15 +6194,14 @@ static bool api_spoolss_EnumPrinterKey(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.needed = r->in.needed;
- r->out.key_buffer_size = talloc_zero(r, uint32_t);
- if (r->out.key_buffer_size == NULL) {
+ r->out.key_buffer = talloc_zero_array(r, uint16_t, r->in.key_buffer_size / 2);
+ if (r->out.key_buffer == NULL) {
talloc_free(r);
return false;
}
- r->out.key_buffer = talloc_zero_array(r, uint16_t, r->out.key_buffer_size);
- if (r->out.key_buffer == NULL) {
+ r->out.needed = talloc_zero(r, uint32_t);
+ if (r->out.needed == NULL) {
talloc_free(r);
return false;
}
@@ -6840,7 +6791,8 @@ static bool api_spoolss_XcvData(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.out_data = talloc_zero(r, DATA_BLOB);
+ r->out.status_code = r->in.status_code;
+ r->out.out_data = talloc_zero_array(r, uint8_t, r->in.out_data_size);
if (r->out.out_data == NULL) {
talloc_free(r);
return false;
@@ -6852,12 +6804,6 @@ static bool api_spoolss_XcvData(pipes_struct *p)
return false;
}
- r->out.unknown2 = talloc_zero(r, uint32_t);
- if (r->out.unknown2 == NULL) {
- talloc_free(r);
- return false;
- }
-
r->out.result = _spoolss_XcvData(p, r);
if (p->rng_fault_state) {
@@ -7533,11 +7479,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.count = talloc_zero(mem_ctx, uint32_t);
- if (r->out.count == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_EnumPrinters(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -7590,11 +7531,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.count = talloc_zero(mem_ctx, uint32_t);
- if (r->out.count == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_EnumJobs(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -7653,11 +7589,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.count = talloc_zero(mem_ctx, uint32_t);
- if (r->out.count == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_EnumPrinterDrivers(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -7710,11 +7641,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.count = talloc_zero(mem_ctx, uint32_t);
- if (r->out.count == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_EnumPrintProcessors(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -7770,7 +7696,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_SPOOLSS_READPRINTER: {
struct spoolss_ReadPrinter *r = (struct spoolss_ReadPrinter *)_r;
ZERO_STRUCT(r->out);
- r->out.data = talloc_zero(mem_ctx, DATA_BLOB);
+ r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_size);
if (r->out.data == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -7810,11 +7736,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.data = talloc_zero(mem_ctx, union spoolss_PrinterData);
- if (r->out.data == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.needed = talloc_zero(mem_ctx, uint32_t);
if (r->out.needed == NULL) {
return NT_STATUS_NO_MEMORY;
@@ -7892,11 +7813,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.count = talloc_zero(mem_ctx, uint32_t);
- if (r->out.count == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_EnumForms(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -7914,11 +7830,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.count = talloc_zero(mem_ctx, uint32_t);
- if (r->out.count == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_EnumPorts(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -7936,11 +7847,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.count = talloc_zero(mem_ctx, uint32_t);
- if (r->out.count == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_EnumMonitors(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -8266,7 +8172,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB);
+ r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
if (r->out.buffer == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -8283,7 +8189,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_SPOOLSS_ENUMPRINTERDATAEX: {
struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r;
ZERO_STRUCT(r->out);
- r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB);
+ r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
if (r->out.buffer == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -8305,14 +8211,13 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_SPOOLSS_ENUMPRINTERKEY: {
struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r;
ZERO_STRUCT(r->out);
- r->out.needed = r->in.needed;
- r->out.key_buffer_size = talloc_zero(mem_ctx, uint32_t);
- if (r->out.key_buffer_size == NULL) {
+ r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->in.key_buffer_size / 2);
+ if (r->out.key_buffer == NULL) {
return NT_STATUS_NO_MEMORY;
}
- r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->out.key_buffer_size);
- if (r->out.key_buffer == NULL) {
+ r->out.needed = talloc_zero(mem_ctx, uint32_t);
+ if (r->out.needed == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -8365,7 +8270,8 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_SPOOLSS_XCVDATA: {
struct spoolss_XcvData *r = (struct spoolss_XcvData *)_r;
ZERO_STRUCT(r->out);
- r->out.out_data = talloc_zero(mem_ctx, DATA_BLOB);
+ r->out.status_code = r->in.status_code;
+ r->out.out_data = talloc_zero_array(mem_ctx, uint8_t, r->in.out_data_size);
if (r->out.out_data == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -8375,11 +8281,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- r->out.unknown2 = talloc_zero(mem_ctx, uint32_t);
- if (r->out.unknown2 == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
r->out.result = _spoolss_XcvData(cli->pipes_struct, r);
return NT_STATUS_OK;
}