mirror of
https://github.com/samba-team/samba.git
synced 2025-11-19 04:23:48 +03:00
r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what everyone is waiting for.... Jeremy.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
f131bf8f16
commit
9dafb7f48c
@@ -624,9 +624,10 @@ BOOL prs_uint8(const char *name, prs_struct *ps, int depth, uint8 *data8)
|
||||
********************************************************************/
|
||||
|
||||
BOOL prs_pointer( const char *name, prs_struct *ps, int depth,
|
||||
void **data, size_t data_size,
|
||||
void *dta, size_t data_size,
|
||||
BOOL(*prs_fn)(const char*, prs_struct*, int, void*) )
|
||||
{
|
||||
void ** data = (void **)dta;
|
||||
uint32 data_p;
|
||||
|
||||
/* output f000baaa to stream if the pointer is non-zero. */
|
||||
@@ -1793,3 +1794,32 @@ BOOL schannel_decode(struct schannel_auth_struct *a, enum pipe_auth_level auth_l
|
||||
return (memcmp(digest_final, verf->packet_digest,
|
||||
sizeof(verf->packet_digest)) == 0);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
creates a new prs_struct containing a DATA_BLOB
|
||||
********************************************************************/
|
||||
BOOL prs_init_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
if (!prs_init( prs, RPC_MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL ))
|
||||
return False;
|
||||
|
||||
|
||||
if (!prs_copy_data_in(prs, (char *)blob->data, blob->length))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
return the contents of a prs_struct in a DATA_BLOB
|
||||
********************************************************************/
|
||||
BOOL prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
blob->length = prs_offset(prs);
|
||||
blob->data = talloc_zero_size(mem_ctx, blob->length);
|
||||
|
||||
if (!prs_copy_all_data_out((char *)blob->data, prs))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user