diff options
author | Sean Finney <seanius@seanius.net> | 2011-05-31 09:49:19 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-01 00:30:40 +0200 |
commit | 08abd1f5e851c4f40a863f5c3ff6acc93d691efb (patch) | |
tree | 04bef33f02528f120dd726aaf3f959fb453501de /librpc/idl | |
parent | c51795c747198f9e002505ffa39ad710beff0358 (diff) | |
download | samba-08abd1f5e851c4f40a863f5c3ff6acc93d691efb.tar.gz samba-08abd1f5e851c4f40a863f5c3ff6acc93d691efb.tar.bz2 samba-08abd1f5e851c4f40a863f5c3ff6acc93d691efb.zip |
librpc/ndr: add new LIBNDR_FLAG_STR_RAW8 for ndr_pull_string
Introduce a new flag, LIBNDR_FLAG_STR_RAW8, which indicates that libndr
should not attempt to convert the corresponding byte sequence, and place
the responsibility on the caller to do so later.
This is needed in cases where the string is known to be 8-bit and either
NULL terminated or of known length, but in an unspecified character set.
For example, when pulling PT_STRING8 properties from an exchange server
via libmapi + libndr, the codepage is neither known nor in the control
of the caller, and is determined by subsequent properties requested from
the server. Therefore the client would like to fetch all properties in
one large batch, and convert the resulting strings locally.
This commit also includes some (basic) tests of each of the flags'
respective behaviors with the ndr push/pull string functions, in a new
source4 torture test suite ndr.ndr_string.
Signed-off-by: Sean Finney <seanius@seanius.net>
Diffstat (limited to 'librpc/idl')
-rw-r--r-- | librpc/idl/idl_types.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/librpc/idl/idl_types.h b/librpc/idl/idl_types.h index 023c04020e..c50eface0d 100644 --- a/librpc/idl/idl_types.h +++ b/librpc/idl/idl_types.h @@ -8,6 +8,7 @@ #define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT #define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN #define STR_UTF8 LIBNDR_FLAG_STR_UTF8 +#define STR_RAW8 LIBNDR_FLAG_STR_RAW8 /* a null terminated UCS2 string @@ -25,6 +26,11 @@ #define utf8string [flag(STR_UTF8|STR_NULLTERM)] string /* + a null terminated "raw" string (null terminated byte sequence) +*/ +#define raw8string [flag(STR_RAW8|STR_NULLTERM)] string + +/* a null terminated UCS2 string */ #define nstring_array [flag(STR_NULLTERM|NDR_ALIGN2)] string_array |