summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-08 02:11:27 +0200
committerGünther Deschner <gd@samba.org>2009-04-08 11:03:53 +0200
commit8e3145e55194cfef56fa792edbed724ef4bf111a (patch)
tree07a7e90cac9a5577b561b4ca9ff88038353e37e0 /source3/rpc_server
parentb36fab0491a7f73ac9dffea6397167c5bdd82a2a (diff)
downloadsamba-8e3145e55194cfef56fa792edbed724ef4bf111a.tar.gz
samba-8e3145e55194cfef56fa792edbed724ef4bf111a.tar.bz2
samba-8e3145e55194cfef56fa792edbed724ef4bf111a.zip
svcctl: use offered/needed for buffer sizes as in spoolss.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_svcctl_nt.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index 6aafd5ab2c..ddfe0df10b 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -444,7 +444,7 @@ WERROR _svcctl_EnumServicesStatusW(pipes_struct *p,
buffer_size += buffer_size % 4;
- if (buffer_size > r->in.buf_size ) {
+ if (buffer_size > r->in.offered) {
num_services = 0;
result = WERR_MORE_DATA;
}
@@ -466,12 +466,12 @@ WERROR _svcctl_EnumServicesStatusW(pipes_struct *p,
}
blob = ndr_push_blob(ndr);
- if (blob.length >= r->in.buf_size) {
- memcpy(r->out.service, blob.data, r->in.buf_size);
+ if (blob.length >= r->in.offered) {
+ memcpy(r->out.service, blob.data, r->in.offered);
}
}
- *r->out.bytes_needed = (buffer_size > r->in.buf_size) ? buffer_size : r->in.buf_size;
+ *r->out.needed = (buffer_size > r->in.offered) ? buffer_size : r->in.offered;
*r->out.services_returned = (uint32)num_services;
*r->out.resume_handle = 0x0;
@@ -552,7 +552,7 @@ WERROR _svcctl_EnumDependentServicesW(pipes_struct *p,
incoming buffer size (even in the case of failure */
/* this is done in the autogenerated server already - gd */
- *r->out.bytes_needed = r->in.buf_size;
+ *r->out.needed = r->in.offered;
/* no dependent services...basically a stub function */
*r->out.services_returned = 0;
@@ -580,7 +580,7 @@ WERROR _svcctl_QueryServiceStatusEx(pipes_struct *p,
/* we have to set the outgoing buffer size to the same as the
incoming buffer size (even in the case of failure) */
- *r->out.bytes_needed = r->in.buf_size;
+ *r->out.needed = r->in.offered;
switch ( r->in.info_level ) {
case SVC_STATUS_PROCESS_INFO:
@@ -612,9 +612,9 @@ WERROR _svcctl_QueryServiceStatusEx(pipes_struct *p,
buffer_size += buffer_size % 4;
- *r->out.bytes_needed = (buffer_size > r->in.buf_size) ? buffer_size : r->in.buf_size;
+ *r->out.needed = (buffer_size > r->in.offered) ? buffer_size : r->in.offered;
- if (buffer_size > r->in.buf_size ) {
+ if (buffer_size > r->in.offered ) {
return WERR_INSUFFICIENT_BUFFER;
}
@@ -697,7 +697,7 @@ WERROR _svcctl_QueryServiceConfigW(pipes_struct *p,
/* we have to set the outgoing buffer size to the same as the
incoming buffer size (even in the case of failure */
- *r->out.bytes_needed = r->in.buf_size;
+ *r->out.needed = r->in.offered;
wresult = fill_svc_config( p->mem_ctx, info->name, r->out.query,
p->server_info->ptok);
@@ -705,9 +705,9 @@ WERROR _svcctl_QueryServiceConfigW(pipes_struct *p,
return wresult;
buffer_size = ndr_size_QUERY_SERVICE_CONFIG(r->out.query, NULL, 0);
- *r->out.bytes_needed = (buffer_size > r->in.buf_size) ? buffer_size : r->in.buf_size;
+ *r->out.needed = (buffer_size > r->in.offered) ? buffer_size : r->in.offered;
- if (buffer_size > r->in.buf_size ) {
+ if (buffer_size > r->in.offered ) {
ZERO_STRUCTP(r->out.query);
return WERR_INSUFFICIENT_BUFFER;
}
@@ -735,7 +735,7 @@ WERROR _svcctl_QueryServiceConfig2W(pipes_struct *p,
/* we have to set the outgoing buffer size to the same as the
incoming buffer size (even in the case of failure */
- *r->out.bytes_needed = r->in.buf_size;
+ *r->out.needed = r->in.offered;
switch ( r->in.info_level ) {
case SERVICE_CONFIG_DESCRIPTION:
@@ -792,9 +792,9 @@ WERROR _svcctl_QueryServiceConfig2W(pipes_struct *p,
}
buffer_size += buffer_size % 4;
- *r->out.bytes_needed = (buffer_size > r->in.buf_size) ? buffer_size : r->in.buf_size;
+ *r->out.needed = (buffer_size > r->in.offered) ? buffer_size : r->in.offered;
- if (buffer_size > r->in.buf_size )
+ if (buffer_size > r->in.offered)
return WERR_INSUFFICIENT_BUFFER;
return WERR_OK;