git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
997e113
)
spoolenum commend (when compiled with the new prs_unistr())
author
Gerald Carter
<jerry@samba.org>
Mon, 10 Jul 2000 19:57:30 +0000
(19:57 +0000)
committer
Gerald Carter
<jerry@samba.org>
Mon, 10 Jul 2000 19:57:30 +0000
(19:57 +0000)
now works. :-)
jerry
(This used to be commit
588aadb29fbb7cc0e81ac19f95e97101a64dbd8e
)
source3/rpc_client/msrpc_spoolss.c
patch
|
blob
|
history
diff --git
a/source3/rpc_client/msrpc_spoolss.c
b/source3/rpc_client/msrpc_spoolss.c
index 9ff88ed23c80eb38175afe99f5fa815a000c974d..ea3d4828370f7a4c4868f73f17f978641759e9d7 100644
(file)
--- a/
source3/rpc_client/msrpc_spoolss.c
+++ b/
source3/rpc_client/msrpc_spoolss.c
@@
-35,18
+35,20
@@
extern FILE* out_hnd;
extern struct user_creds *usr_creds;
extern struct user_creds *usr_creds;
+/********************************************************************
+initialize a spoolss NEW_BUFFER.
+
+ ** WARNING ** Calling this function on an existing buffer
+ (which already hgolds data in the buffer->prs.data_p)
+ will result in memory leakage
+********************************************************************/
static void init_buffer(NEW_BUFFER *buffer, uint32 size)
{
static void init_buffer(NEW_BUFFER *buffer, uint32 size)
{
- int new_size = 0;
-
buffer->ptr = (size!=0)? 1:0;
buffer->size=size;
buffer->string_at_end=size;
buffer->ptr = (size!=0)? 1:0;
buffer->size=size;
buffer->string_at_end=size;
- prs_init(&(buffer->prs), MAX_PDU_FRAG_LEN, 4, MARSHALL);
- new_size = MAX(size,buffer->prs.buffer_size) - MIN(size,buffer->prs.buffer_size);
- prs_grow(&(buffer->prs), new_size);
- buffer->prs.io=MARSHALL;
- buffer->prs.data_offset=0;
+ prs_init(&(buffer->prs), size, 4, MARSHALL);
+ buffer->struct_start = prs_offset(&buffer->prs);
}
static void decode_printer_info_0(NEW_BUFFER *buffer, uint32 returned, PRINTER_INFO_0 **info)
}
static void decode_printer_info_0(NEW_BUFFER *buffer, uint32 returned, PRINTER_INFO_0 **info)