diff options
author | Gerald Carter <jerry@samba.org> | 2005-05-31 13:46:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:02 -0500 |
commit | f24d88cf9da46680d52b42b92bd484e7b09ce99b (patch) | |
tree | b30342fd7677a0d17306130077995110bfae344a /source3/rpc_server/srv_spoolss_nt.c | |
parent | 450e8d5749504f8392c0cfe8b79218f03b88076a (diff) | |
download | samba-f24d88cf9da46680d52b42b92bd484e7b09ce99b.tar.gz samba-f24d88cf9da46680d52b42b92bd484e7b09ce99b.tar.bz2 samba-f24d88cf9da46680d52b42b92bd484e7b09ce99b.zip |
r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1
(This used to be commit 9727d05241574042dd3aa8844ae5c701d22e2da1)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 2fee1972ab..39c294fa45 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2355,7 +2355,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *ctx, fstring value, uint if ( !(*data = TALLOC_ZERO_ARRAY(ctx, uint8, *needed)) ) return WERR_NOMEM; - + SIVAL(*data, 0, *needed); /* size */ SIVAL(*data, 4, 5); /* Windows 2000 == 5.0 */ SIVAL(*data, 8, 0); @@ -7247,18 +7247,19 @@ static void fill_port_2(PORT_INFO_2 *port, const char *name) port->reserved=0x0; } + /**************************************************************************** wrapper around the enumer ports command ****************************************************************************/ WERROR enumports_hook( int *count, char ***lines ) { - char *cmd = lp_enumports_cmd(); - char **qlines; - pstring command; - int numlines; - int ret; - int fd; + char *cmd = lp_enumports_cmd(); + char **qlines; + pstring command; + int numlines; + int ret; + int fd; /* if no hook then just fill in the default port */ @@ -7310,24 +7311,24 @@ static WERROR enumports_level_1(RPC_BUFFER *buffer, uint32 offered, uint32 *need if ( !W_ERROR_IS_OK(result = enumports_hook( &numlines, &qlines )) ) return result; - - if(numlines) { - if((ports=SMB_MALLOC_ARRAY( PORT_INFO_1, numlines )) == NULL) { - DEBUG(10,("Returning WERR_NOMEM [%s]\n", - dos_errstr(WERR_NOMEM))); - file_lines_free(qlines); - return WERR_NOMEM; - } - - for (i=0; i<numlines; i++) { - DEBUG(6,("Filling port number [%d] with port [%s]\n", i, qlines[i])); - fill_port_1(&ports[i], qlines[i]); - } - + + if(numlines) { + if((ports=SMB_MALLOC_ARRAY( PORT_INFO_1, numlines )) == NULL) { + DEBUG(10,("Returning WERR_NOMEM [%s]\n", + dos_errstr(WERR_NOMEM))); file_lines_free(qlines); + return WERR_NOMEM; + } + + for (i=0; i<numlines; i++) { + DEBUG(6,("Filling port number [%d] with port [%s]\n", i, qlines[i])); + fill_port_1(&ports[i], qlines[i]); } - *returned = numlines; + file_lines_free(qlines); + } + + *returned = numlines; /* check the required size. */ for (i=0; i<*returned; i++) { @@ -7369,28 +7370,28 @@ static WERROR enumports_level_2(RPC_BUFFER *buffer, uint32 offered, uint32 *need PORT_INFO_2 *ports=NULL; int i=0; WERROR result = WERR_OK; - char **qlines; - int numlines; + char **qlines; + int numlines; if ( !W_ERROR_IS_OK(result = enumports_hook( &numlines, &qlines )) ) return result; - - - if(numlines) { - if((ports=SMB_MALLOC_ARRAY( PORT_INFO_2, numlines)) == NULL) { - file_lines_free(qlines); - return WERR_NOMEM; - } - - for (i=0; i<numlines; i++) { - DEBUG(6,("Filling port number [%d] with port [%s]\n", i, qlines[i])); - fill_port_2(&(ports[i]), qlines[i]); - } - + + + if(numlines) { + if((ports=SMB_MALLOC_ARRAY( PORT_INFO_2, numlines)) == NULL) { file_lines_free(qlines); + return WERR_NOMEM; } - *returned = numlines; + for (i=0; i<numlines; i++) { + DEBUG(6,("Filling port number [%d] with port [%s]\n", i, qlines[i])); + fill_port_2(&(ports[i]), qlines[i]); + } + + file_lines_free(qlines); + } + + *returned = numlines; /* check the required size. */ for (i=0; i<*returned; i++) { |