summaryrefslogtreecommitdiffstats
path: root/source/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-07-26 00:10:45 +0000
committerJeremy Allison <jra@samba.org>2005-07-26 00:10:45 +0000
commit27ca8d2d9e7905bc1725e533a9af5e55d4863985 (patch)
tree2e18898e12361db7c5f556da231e1c980d1f024d /source/include
parent60c634edde4669222a660848fae15593efceb480 (diff)
downloadsamba-27ca8d2d9e7905bc1725e533a9af5e55d4863985.tar.gz
samba-27ca8d2d9e7905bc1725e533a9af5e55d4863985.tar.xz
samba-27ca8d2d9e7905bc1725e533a9af5e55d4863985.zip
r8762: Attempt to fix the winbindd crashing bug on Solaris (can't remember
the bugid). Make the functions in lib/util_unistr.c odd-alignment safe using some evil macros. Needs testing on bigendian. Jeremy.
Diffstat (limited to 'source/include')
-rw-r--r--source/include/smb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/include/smb.h b/source/include/smb.h
index 097fb87a3f6..d3374ccafcb 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -150,6 +150,7 @@ typedef union unid_t {
/*
* SMB UCS2 (16-bit unicode) internal type.
+ * smb_ucs2_t is *always* in little endian format.
*/
typedef uint16 smb_ucs2_t;
@@ -167,6 +168,10 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN];
/* turn a 7 bit character into a ucs2 character */
#define UCS2_CHAR(c) ((c) << UCS2_SHIFT)
+/* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */
+#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
+ ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
+
/* pipe string names */
#define PIPE_LANMAN "\\PIPE\\LANMAN"
#define PIPE_SRVSVC "\\PIPE\\srvsvc"