s3-spoolss: move SYSTEMTIME parsing to a more generic place, as suggested.
[Samba.git] / source3 / include / rpc_misc.h
blob37dffbb00592941b8d76005b6d0192f7e6b98196
1 /*
2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Tridgell 1992-1997
5 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6 Copyright (C) Paul Ashton 1997
7 Copyright (C) Gerald (Jerry) Carter 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef _RPC_MISC_H /* _RPC_MISC_H */
24 #define _RPC_MISC_H
26 #define SMB_RPC_INTERFACE_VERSION 1
27 #define PRS_POINTER_CAST bool (*)(const char*, prs_struct*, int, void*)
29 enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3, UNI_STR_DBLTERMINATE = 4 };
33 /**********************************************************************
34 * well-known RIDs - Relative IDs
35 **********************************************************************/
37 /* RIDs - Well-known users ... */
38 #define DOMAIN_USER_RID_ADMIN (0x000001F4L)
39 #define DOMAIN_USER_RID_GUEST (0x000001F5L)
40 #define DOMAIN_USER_RID_KRBTGT (0x000001F6L)
42 /* RIDs - well-known groups ... */
43 #define DOMAIN_GROUP_RID_ADMINS (0x00000200L)
44 #define DOMAIN_GROUP_RID_USERS (0x00000201L)
45 #define DOMAIN_GROUP_RID_GUESTS (0x00000202L)
46 #define DOMAIN_GROUP_RID_COMPUTERS (0x00000203L)
48 #define DOMAIN_GROUP_RID_CONTROLLERS (0x00000204L)
49 #define DOMAIN_GROUP_RID_CERT_ADMINS (0x00000205L)
50 #define DOMAIN_GROUP_RID_SCHEMA_ADMINS (0x00000206L)
51 #define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS (0x00000207L)
53 /* is the following the right number? I bet it is --simo
54 #define DOMAIN_GROUP_RID_POLICY_ADMINS (0x00000208L)
57 /* RIDs - well-known aliases ... */
58 #define BUILTIN_ALIAS_RID_ADMINS (0x00000220L)
59 #define BUILTIN_ALIAS_RID_USERS (0x00000221L)
60 #define BUILTIN_ALIAS_RID_GUESTS (0x00000222L)
61 #define BUILTIN_ALIAS_RID_POWER_USERS (0x00000223L)
63 #define BUILTIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L)
64 #define BUILTIN_ALIAS_RID_SYSTEM_OPS (0x00000225L)
65 #define BUILTIN_ALIAS_RID_PRINT_OPS (0x00000226L)
66 #define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L)
68 #define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L)
69 #define BUILTIN_ALIAS_RID_RAS_SERVERS (0x00000229L)
70 #define BUILTIN_ALIAS_RID_PRE_2K_ACCESS (0x0000022aL)
73 /**********************************************************************
74 * Masks for mappings between unix uid and gid types and
75 * NT RIDS.
76 **********************************************************************/
78 #define BASE_RID (0x000003E8L)
80 /* Take the bottom bit. */
81 #define RID_TYPE_MASK 1
82 #define RID_MULTIPLIER 2
84 /* The two common types. */
85 #define USER_RID_TYPE 0
86 #define GROUP_RID_TYPE 1
90 /**********************************************************************
91 * RPC policy handle used pretty much everywhere
92 **********************************************************************/
94 typedef struct policy_handle POLICY_HND;
96 #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\
97 ( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \
98 "OTHER")), ((unsigned int)IVAL((hnd)->uuid.node,2)),\
99 ((unsigned int)sys_getpid() )
102 /**********************************************************************
103 * Buffers use by spoolss (i might be able to replace it with
104 * an RPC_DATA_BLOB)
105 **********************************************************************/
107 typedef struct {
108 uint32 buf_len;
109 uint16 *buffer; /* data */
110 } BUFFER5;
113 /**********************************************************************
114 * UNICODE string variations
115 **********************************************************************/
118 typedef struct { /* UNISTR - unicode string size and buffer */
119 uint16 *buffer; /* unicode characters. ***MUST*** be
120 little-endian. ***MUST*** be null-terminated */
121 } UNISTR;
123 typedef struct { /* UNISTR2 - unicode string size (in
124 uint16 unicode chars) and buffer */
125 uint32 uni_max_len;
126 uint32 offset;
127 uint32 uni_str_len;
128 uint16 *buffer; /* unicode characters. ***MUST*** be little-endian.
129 **must** be null-terminated and the uni_str_len
130 should include the NULL character */
131 } UNISTR2;
133 /* i think this is the same as a BUFFER5 used in the spoolss code --jerry */
134 /* not sure about how the termination matches between the uint16 buffers thought */
136 typedef struct { /* UNISTR3 - XXXX not sure about this structure */
137 uint32 uni_str_len;
138 UNISTR str;
139 } UNISTR3;
142 * I'm really wondering how many different time formats
143 * I will have to cope with
145 * JFM, 09/13/98 In a mad mood ;-(
147 typedef struct systemtime
149 uint16 year;
150 uint16 month;
151 uint16 dayofweek;
152 uint16 day;
153 uint16 hour;
154 uint16 minute;
155 uint16 second;
156 uint16 milliseconds;
158 SYSTEMTIME;
160 #endif /* _RPC_MISC_H */