SAM database "set user info".
[samba.git] / source3 / include / rpc_misc.h
index 3e1a6052b5cb514f43a9e19e69f27794d7e22c57..3e4d52a0380fc92ec8fdf61605cd7caad7a59e66 100644 (file)
 
 #include "rpc_dce.h"
 
-/* pipe string names */
-#define PIPE_SRVSVC   "\\PIPE\\srvsvc"
-#define PIPE_SAMR     "\\PIPE\\samr"
-#define PIPE_WINREG   "\\PIPE\\winreg"
-#define PIPE_WKSSVC   "\\PIPE\\wkssvc"
-#define PIPE_NETLOGON "\\PIPE\\NETLOGON"
-#define PIPE_NTLSA    "\\PIPE\\ntlsa"
-#define PIPE_NTSVCS   "\\PIPE\\ntsvcs"
-#define PIPE_LSASS    "\\PIPE\\lsass"
-#define PIPE_LSARPC   "\\PIPE\\lsarpc"
-
 /* well-known RIDs - Relative IDs */
 
 /* RIDs - Well-known users ... */
 #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 bit. */
-#define RID_TYPE_MASK 1
-#define RID_MULTIPLIER 2
+/* Take the bottom bits. */
+#define RID_TYPE_MASK 2
+#define RID_MULTIPLIER 4
 
-/* The two common types. */
-#define USER_RID_TYPE 0
-#define GROUP_RID_TYPE 1
+/* The three common types. */
+#define RID_TYPE_USER    0
+#define RID_TYPE_GROUP   1
+#define RID_TYPE_ALIAS   2
 
 /* ENUM_HND */
 typedef struct enum_hnd_info
@@ -90,22 +78,6 @@ typedef struct lookup_level_info
 
 } LOOKUP_LEVEL;
 
-#define MAXSUBAUTHS 15 /* max sub authorities in a SID */
-
-/* DOM_SID - security id */
-typedef struct sid_info
-{
-  uint8  sid_rev_num;             /* SID revision number */
-  uint8  num_auths;               /* number of sub-authorities */
-  uint8  id_auth[6];              /* Identifier Authority */
-  /*
-   * Note that the values in these uint32's are in *native* byteorder,
-   * not neccessarily little-endian...... JRA.
-   */
-  uint32 sub_auths[MAXSUBAUTHS];  /* pointer to sub-authorities. */
-
-} DOM_SID;
-
 /* DOM_SID2 - security id */
 typedef struct sid_info_2
 {
@@ -118,17 +90,26 @@ typedef struct sid_info_2
 /* STRHDR - string header */
 typedef struct header_info
 {
-  uint16 str_max_len;
   uint16 str_str_len;
+  uint16 str_max_len;
   uint32 buffer; /* non-zero */
 
 } 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
 {
-  uint16 uni_max_len;
   uint16 uni_str_len;
+  uint16 uni_max_len;
   uint32 buffer; /* usually has a value of 4 */
 
 } UNIHDR;
@@ -144,6 +125,7 @@ typedef struct unihdr2_info
 /* clueless as to what maximum length should be */
 #define MAX_UNISTRLEN 256
 #define MAX_STRINGLEN 256
+#define MAX_BUFFERLEN 512
 
 /* UNISTR - unicode string size and buffer */
 typedef struct unistr_info
@@ -152,17 +134,34 @@ typedef struct unistr_info
 
 } UNISTR;
 
-/* UNINOTSTR2 - unicode string, size (in uint8 ascii chars) and buffer */
+/* BUFHDR - buffer header */
+typedef struct bufhdr_info
+{
+  uint32 buf_max_len;
+  uint32 buf_len;
+
+} BUFHDR;
+
+/* 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 */
-typedef struct uninotstr2_info
+typedef struct buffer2_info
 {
-  uint32 uni_max_len;
+  uint32 buf_max_len;
   uint32 undoc;
-  uint32 uni_buf_len;
+  uint32 buf_len;
   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
 
-} UNINOTSTR2;
+} BUFFER2;
+
+/* BUFFER3 */
+typedef struct buffer3_info
+{
+  uint32 buf_max_len;
+  uint8  buffer[MAX_BUFFERLEN]; /* data */
+  uint32 buf_len;
+
+} BUFFER3;
 
 /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */
 typedef struct unistr2_info
@@ -184,36 +183,35 @@ typedef struct string2_info
 
 } STRING2;
 
+/* UNISTR3 - XXXX not sure about this structure */
+typedef struct unistr3_info
+{
+       uint32 uni_str_len;
+       UNISTR str;
+
+} UNISTR3;
+
 
 /* DOM_RID2 - domain RID structure for ntlsa pipe */
 typedef struct domrid2_info
 {
-  uint32 type; /* value is 5 */
-  uint32 undoc; /* value is non-zero */
-  uint32 rid;
-  uint32 rid_idx; /* don't know what this is */
+       uint8 type; /* value is SID_NAME_USE enum */
+       uint32 rid;
+       uint32 rid_idx; /* referenced domain index */
 
 } DOM_RID2;
 
 /* DOM_RID3 - domain RID structure for samr pipe */
 typedef struct domrid3_info
 {
-  uint32 rid;        /* domain-relative (to a SID) id */
-  uint32 type1;      /* value is 0x1 */
-  uint32 ptr_type;   /* undocumented pointer */
-  uint32 type2;      /* value is 0x1 */
+       uint32 rid;        /* domain-relative (to a SID) id */
+       uint32 type1;      /* value is 0x1 */
+       uint32 ptr_type;   /* undocumented pointer */
+       uint32 type2;      /* value is 0x1 */
+       uint32 unk; /* value is 0x2 */
 
 } 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
 {