summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-04-06 22:27:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:30 -0500
commitb137b7cc4720ca9d99eab2bb198be1b112c2e24c (patch)
tree357cbbc9122d1766d2532ffe60aa463686f57c81 /source3/rpc_parse/parse_misc.c
parent978ca8486031e43754a3c23757f361bf3a85f335 (diff)
downloadsamba-b137b7cc4720ca9d99eab2bb198be1b112c2e24c.tar.gz
samba-b137b7cc4720ca9d99eab2bb198be1b112c2e24c.tar.bz2
samba-b137b7cc4720ca9d99eab2bb198be1b112c2e24c.zip
r6228: remove BUFHDR2 and clean up LsaEnumTrustedDomains()
Tested client and server code. (This used to be commit efb3ac4c69c72c0fa01c558951fa357893562bce)
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c69
1 files changed, 36 insertions, 33 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 57f44f9f85..858366d4ad 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -4,6 +4,7 @@
* Copyright (C) Andrew Tridgell 1992-1997,
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
* Copyright (C) Paul Ashton 1997.
+ * Copyright (C) Gerald (Jerry) Carter 2005
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -280,6 +281,33 @@ void init_dom_sid2(DOM_SID2 *sid2, const DOM_SID *sid)
Reads or writes a DOM_SID2 structure.
********************************************************************/
+BOOL smb_io_dom_sid2_p(const char *desc, prs_struct *ps, int depth, DOM_SID2 **sid2)
+{
+ uint32 data_p;
+
+ /* caputure the pointer value to stream */
+
+ data_p = (uint32) *sid2;
+
+ if ( !prs_uint32("dom_sid2_p", ps, depth, &data_p ))
+ return False;
+
+ /* we're done if there is no data */
+
+ if ( !data_p )
+ return True;
+
+ if (UNMARSHALLING(ps)) {
+ if ( !(*sid2 = PRS_ALLOC_MEM(ps, DOM_SID2, 1)) )
+ return False;
+ }
+
+ return True;
+}
+/*******************************************************************
+ Reads or writes a DOM_SID2 structure.
+********************************************************************/
+
BOOL smb_io_dom_sid2(const char *desc, DOM_SID2 *sid, prs_struct *ps, int depth)
{
if (sid == NULL)
@@ -485,39 +513,6 @@ BOOL smb_io_hdrbuf(const char *desc, BUFHDR *hdr, prs_struct *ps, int depth)
}
/*******************************************************************
-creates a UNIHDR2 structure.
-********************************************************************/
-
-void init_uni_hdr2(UNIHDR2 *hdr, UNISTR2 *str2)
-{
- init_uni_hdr(&hdr->unihdr, str2);
- hdr->buffer = (str2->uni_str_len > 0) ? 1 : 0;
-}
-
-/*******************************************************************
- Reads or writes a UNIHDR2 structure.
-********************************************************************/
-
-BOOL smb_io_unihdr2(const char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth)
-{
- if (hdr2 == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "smb_io_unihdr2");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_unihdr("hdr", &hdr2->unihdr, ps, depth))
- return False;
- if(!prs_uint32("buffer", ps, depth, &hdr2->buffer))
- return False;
-
- return True;
-}
-
-/*******************************************************************
Inits a UNISTR structure.
********************************************************************/
@@ -913,6 +908,14 @@ void init_unistr4(UNISTR4 *uni4, const char *buf, enum unistr2_term_codes flags)
uni4->size = 2 * (uni4->string->uni_max_len);
}
+void init_unistr4_w( TALLOC_CTX *ctx, UNISTR4 *uni4, const smb_ucs2_t *buf )
+{
+ uni4->string = TALLOC_P( ctx, UNISTR2 );
+ init_unistr2_w( ctx, uni4->string, buf );
+
+ uni4->length = 2 * (uni4->string->uni_str_len);
+ uni4->size = 2 * (uni4->string->uni_max_len);
+}
/**
* Inits a UNISTR2 structure.