first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[ira/wip.git] / source / include / rpc_misc.h
index ed8cbd96bb443f9cecf5c28fd7b45b8c09edf101..b837c8a67c5952ef9fd757fb867813eca98e734b 100644 (file)
 #ifndef _RPC_MISC_H /* _RPC_MISC_H */
 #define _RPC_MISC_H 
 
-/*
- * macros to wrap prs_xxxx routines.
- */
-#define prs_uint8(name, ps, depth, data8) \
-       if (!_prs_uint8(name, ps, depth, data8)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint16(name, ps, depth, data16) \
-       if (!_prs_uint16(name, ps, depth, data16)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_hash1(x_ps, x_offset, x_sess_key) \
-       if (!_prs_hash1(x_ps, x_offset, x_sess_key)) \
-       {\
-               x_ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint32(name, ps, depth, data32) \
-       if (!_prs_uint32(name, ps, depth, data32)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint8s(charmode, name, ps, depth, data8s, len) \
-       if (!_prs_uint8s(charmode, name, ps, depth, data8s, len)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint16s(charmode, name, ps, depth, data16s, len) \
-       if (!_prs_uint16s(charmode, name, ps, depth, data16s, len)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint32s(charmode, name, ps, depth, data32s, len) \
-       if (!_prs_uint32s(charmode, name, ps, depth, data32s, len)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_buffer2(charmode, name, ps, depth, str) \
-       if (!_prs_buffer2(charmode, name, ps, depth, str)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_string2(charmode, name, ps, depth, str) \
-       if (!_prs_string2(charmode, name, ps, depth, str)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_unistr2(charmode, name, ps, depth, str) \
-       if (!_prs_unistr2(charmode, name, ps, depth, str)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_unistr3(charmode, name, str, ps, depth) \
-       if (!_prs_unistr3(charmode, name, str, ps, depth)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_unistr(name, ps, depth, str) \
-       if (!_prs_unistr(name, ps, depth, str)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_string(name, ps, depth, str, len, max_buf_size) \
-       if (!_prs_string(name, ps, depth, str, len, max_buf_size)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset) \
-       if (!_prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset)) \
-       {\
-               x_ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size) \
-       if (!_prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset) \
-       if (!_prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset)) \
-       {\
-               x_ps->offset = 0;\
-               return False;\
-       }
-#define prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size) \
-       if (!_prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size)) \
-       {\
-               ps->offset = 0;\
-               return False;\
-       }
 
 #include "rpc_dce.h"
 
 #define BUILTIN_ALIAS_RID_USERS         (0x00000221L)
 #define BUILTIN_ALIAS_RID_GUESTS        (0x00000222L)
 #define BUILTIN_ALIAS_RID_POWER_USERS   (0x00000223L)
+
 #define BUILTIN_ALIAS_RID_ACCOUNT_OPS   (0x00000224L)
 #define BUILTIN_ALIAS_RID_SYSTEM_OPS    (0x00000225L)
 #define BUILTIN_ALIAS_RID_PRINT_OPS     (0x00000226L)
 #define BUILTIN_ALIAS_RID_BACKUP_OPS    (0x00000227L)
+
 #define BUILTIN_ALIAS_RID_REPLICATOR    (0x00000228L)
 
 /*
  * NT RIDS.
  */
 
-/* Take the bottom bits. */
-#define RID_TYPE_MASK 2
-#define RID_MULTIPLIER 4
-
-/* The three common types. */
-#define RID_TYPE_USER    0
-#define RID_TYPE_GROUP   1
-#define RID_TYPE_ALIAS   2
-
-/* BIGINT - NT-style 64-bit integer */
-typedef struct bigint_info
-{
-       uint32 low;
-       uint32 high;
-
-} BIGINT;
+/* Take the bottom bit. */
+#define RID_TYPE_MASK 1
+#define RID_MULTIPLIER 2
 
+/* The two common types. */
+#define USER_RID_TYPE 0
+#define GROUP_RID_TYPE 1
 
 /* ENUM_HND */
 typedef struct enum_hnd_info
@@ -210,15 +97,6 @@ typedef struct header_info
 
 } STRHDR;
 
-/* STRHDR2 - string header, 32-bit lengths */
-typedef struct header2_info
-{
-  uint32 str_str_len;
-  uint32 str_max_len;
-  uint32 buffer;
-
-} STRHDR2;
-
 /* UNIHDR - unicode string header */
 typedef struct unihdr_info
 {
@@ -244,8 +122,8 @@ typedef struct unihdr2_info
 /* UNISTR - unicode string size and buffer */
 typedef struct unistr_info
 {
-  uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */
-
+  /* unicode characters. ***MUST*** be little-endian. ***MUST*** be null-terminated */
+  uint16 buffer[MAX_UNISTRLEN];
 } UNISTR;
 
 /* BUFHDR - buffer header */
@@ -256,15 +134,6 @@ typedef struct bufhdr_info
 
 } BUFHDR;
 
-/* BUFHDR2 - another buffer header, with info level */
-typedef struct bufhdr2_info
-{
-  uint32 info_level;
-  uint32 length; /* uint8 chars */
-  uint32 buffer;
-
-} BUFHDR2;
-
 /* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */
 /* pathetic.  some stupid team of \PIPE\winreg writers got the concept */
 /* of a unicode string different from the other \PIPE\ writers */
@@ -273,7 +142,8 @@ typedef struct buffer2_info
   uint32 buf_max_len;
   uint32 undoc;
   uint32 buf_len;
-  uint8 buffer[MAX_UNISTRLEN];
+  /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */
+  uint16 buffer[MAX_UNISTRLEN];
 
 } BUFFER2;
 
@@ -286,28 +156,14 @@ typedef struct buffer3_info
 
 } BUFFER3;
 
-/* BUFFER4 - simple length and buffer */
-typedef struct buffer4_info
-{
-  uint32 buf_len;
-  uint8  buffer[MAX_BUFFERLEN];
-
-} BUFFER4;
-
-/* BUFFER5 */
-typedef struct buffer5_info
-{
-  uint32 buf_len;
-  uint16 *buffer; /* data */
-} BUFFER5;
-
 /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */
 typedef struct unistr2_info
 {
   uint32 uni_max_len;
   uint32 undoc;
   uint32 uni_str_len;
-  uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
+  /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */
+  uint16 buffer[MAX_UNISTRLEN];
 
 } UNISTR2;
 
@@ -350,6 +206,15 @@ typedef struct domrid3_info
 
 } DOM_RID3;
 
+/* DOM_RID4 - rid + user attributes */
+typedef struct domrid4_info
+{
+  uint32 unknown;
+  uint16 attr;
+  uint32 rid;  /* user RID */
+
+} DOM_RID4;
+
 /* DOM_CLNT_SRV - client / server names */
 typedef struct clnt_srv_info
 {
@@ -422,4 +287,3 @@ typedef struct lsa_policy_info
 } POLICY_HND;
 
 #endif /* _RPC_MISC_H */
-