summaryrefslogtreecommitdiff
path: root/source3/include/smb.h
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include/smb.h')
-rw-r--r--source3/include/smb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 097fb87a3f..d3374ccafc 100644
--- a/source3/include/smb.h
+++ b/source3/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"