sharesec: don't ignore unknown options
[Samba.git] / librpc / idl / ODJ.idl
blob00c731b76a934a16765a4ce98894a3cca7918eb2
1 /*
2 The MIT License (MIT)
3 Copyright (c) Microsoft Corporation
5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6 associated documentation files (the "Software"), to deal in the Software without restriction,
7 including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all copies or substantial
12 portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
15 NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 The Offline Domain Join IDL has been derived from :
22 https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/NetMgmt/odj-idl.md
25 import "misc.idl", "lsa.idl", "netlogon.idl", "security.idl";
27 #include "idl_types.h"
29 cpp_quote("#define OP_JP2_FLAG_PERSISTENTSITE 0x00000001")
32 uuid("11111111-3333-5555-7777-99999999"),
33 version(0.0),
34 pointer_default(unique),
35 helpstring("Offline Domain Join IDL"),
36 helper("../librpc/ndr/ndr_ODJ.h")
38 interface ODJ
40 typedef struct {
41 uint32 cbBlob;
42 [size_is(cbBlob),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *pBlob;
43 } OP_BLOB;
45 /* Contains a serialized ODJ_WIN7_BLOB structure. */
46 const string ODJ_GUID_JOIN_PROVIDER = "{631c7621-5289-4321-bc9e-80f843f868c3}";
48 /* Contains a serialized OP_JOIN_PROV2_PART structure. */
49 const string ODJ_GUID_JOIN_PROVIDER2 = "{57BFC56B-52F9-480C-ADCB-91B3F8A82317}";
51 /* Contains a serialized OP_JOIN_PROV3_PART structure. */
52 const string ODJ_GUID_JOIN_PROVIDER3 = "{FC0CCF25-7FFA-474A-8611-69FFE269645F}";
54 /* Contains a serialized OP_CERT_PART structure. */
55 const string ODJ_GUID_CERT_PROVIDER = "{9c0971e9-832f-4873-8e87-ef1419d4781e}";
57 /* Contains a serialized OP_POLICY_PART structure. */
58 const string ODJ_GUID_POLICY_PROVIDER = "{68fb602a-0c09-48ce-b75f-07b7bd58f7ec}";
60 #if 0
61 typedef struct {
62 char Value[6];
63 } SID_IDENTIFIER_AUTHORITY;
65 typedef struct {
66 char Revision;
67 char SubAuthorityCount;
68 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
69 [size_is(SubAuthorityCount)] uint32 SubAuthority[*];
70 } ODJ_SID;
72 typedef struct {
73 USHORT Length;
74 USHORT MaximumLength;
75 [size_is(MaximumLength/2), length_is(Length/2)] PWSTR Buffer;
76 } ODJ_UNICODE_STRING;
77 #endif
78 #define ODJ_SID dom_sid2
79 #define ODJ_UNICODE_STRING lsa_StringLarge
81 #define ODJ_DECLARE_SERIALIZED_PTR(el_name) \
82 typedef [public] struct { \
83 el_name *p; \
84 } el_name ##_ctr; \
86 typedef [public,gensize] struct { \
87 [subcontext(0xFFFFFC01)] el_name ## _ctr s; \
88 } el_name ## _serialized_ptr;
90 typedef struct {
91 ODJ_UNICODE_STRING Name;
92 ODJ_UNICODE_STRING DnsDomainName;
93 ODJ_UNICODE_STRING DnsForestName;
94 GUID DomainGuid;
95 ODJ_SID *Sid;
96 } ODJ_POLICY_DNS_DOMAIN_INFO;
98 typedef struct {
99 [string,charset(UTF16)] uint16 *lpDomain;
100 [string,charset(UTF16)] uint16 *lpMachineName;
101 [string,charset(UTF16)] [flag(NDR_SECRET)] uint16 *lpMachinePassword;
103 * Not sure whether the following 4 bytes are padding or a
104 * pointer, at least it's value may not be 0 for Windows to accept our
105 * generated win7blobs - gd
107 #if 0
108 [flag(NDR_ALIGN8)] DATA_BLOB _pad;
109 #else
110 [value(0xffffffff)] uint32 _pad;
111 #endif
112 ODJ_POLICY_DNS_DOMAIN_INFO DnsDomainInfo;
113 netr_DsRGetDCNameInfo DcInfo;
114 DWORD Options;
115 } ODJ_WIN7BLOB;
117 typedef ODJ_WIN7BLOB *PODJ_WIN7BLOB;
119 typedef struct {
120 DWORD dwFlags;
121 [string,charset(UTF16)] uint16 *lpNetbiosName;
122 [string,charset(UTF16)] uint16 *lpSiteName;
123 [string,charset(UTF16)] uint16 *lpPrimaryDNSDomain;
124 DWORD dwReserved;
125 [string,charset(UTF16)] uint16 *lpReserved;
126 } OP_JOINPROV2_PART;
128 typedef struct {
129 DWORD Rid;
130 [string,charset(UTF16)] uint16 *lpSid;
131 } OP_JOINPROV3_PART;
133 typedef struct {
134 [string,charset(UTF16)] uint16 *pKeyPath;
135 [string,charset(UTF16)] uint16 *pValueName;
136 winreg_Type ulValueType;
137 uint32 cbValueData;
138 [size_is(cbValueData),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *pValueData;
139 } OP_POLICY_ELEMENT;
141 typedef struct {
142 [string,charset(UTF16)] uint16 *pSource;
143 uint32 ulRootKeyId;
144 uint32 cElements;
145 [size_is(cElements)] OP_POLICY_ELEMENT *pElements;
146 } OP_POLICY_ELEMENT_LIST;
148 typedef struct {
149 uint32 cElementLists;
150 [size_is(cElementLists)]
151 OP_POLICY_ELEMENT_LIST *pElementLists;
152 OP_BLOB Extension;
153 } OP_POLICY_PART;
155 typedef struct {
156 [string,charset(UTF16)] uint16 *pTemplateName;
157 uint32 ulPrivateKeyExportPolicy;
158 [string,charset(UTF16)] uint16 *pPolicyServerUrl;
159 uint32 ulPolicyServerUrlFlags;
160 [string,charset(UTF16)] uint16 *pPolicyServerId;
161 uint32 cbPfx;
162 [size_is(cbPfx)] uint8 *pPfx;
163 } OP_CERT_PFX_STORE;
165 typedef struct {
166 uint32 StoreLocation;
167 [string,charset(UTF16)] uint16 *pStoreName;
168 uint32 cbSst;
169 [size_is(cbSst)] uint8 *pSst;
170 } OP_CERT_SST_STORE;
172 typedef struct {
173 uint32 cPfxStores;
174 [size_is(cPfxStores)] OP_CERT_PFX_STORE *pPfxStores;
175 uint32 cSstStores;
176 [size_is(cSstStores)] OP_CERT_SST_STORE *pSstStores;
177 OP_BLOB Extension;
178 } OP_CERT_PART;
180 ODJ_DECLARE_SERIALIZED_PTR(ODJ_WIN7BLOB)
181 ODJ_DECLARE_SERIALIZED_PTR(OP_JOINPROV2_PART)
182 ODJ_DECLARE_SERIALIZED_PTR(OP_JOINPROV3_PART)
183 ODJ_DECLARE_SERIALIZED_PTR(OP_POLICY_PART)
184 ODJ_DECLARE_SERIALIZED_PTR(OP_CERT_PART)
186 typedef [public,nodiscriminant,gensize] union {
187 [case(1)] [subcontext(0xFFFFFC01)] ODJ_WIN7BLOB win7blob;
188 [case(2)] [subcontext(0xFFFFFC01)] OP_JOINPROV2_PART_ctr join_prov2;
189 [case(3)] [subcontext(0xFFFFFC01)] OP_JOINPROV3_PART_ctr join_prov3;
190 [case(4)] [subcontext(0xFFFFFC01)] OP_CERT_PART_ctr cert_part;
191 [case(5)] [subcontext(0xFFFFFC01)] OP_POLICY_PART_ctr policy_part;
192 [default];
193 } OP_PACKAGE_PART_u;
195 typedef [public,bitmap32bit] bitmap {
196 OPSPI_PACKAGE_PART_ESSENTIAL = 0x00000001
197 } ODJ_PackageFlags;
199 typedef struct {
200 GUID PartType;
201 uint32 ulFlags;
202 #if 1
203 [value(ndr_size_OP_PACKAGE_PART_u(Part, odj_switch_level_from_guid(&PartType), 0))] uint32 part_len;
204 [subcontext(4),subcontext_size(part_len),switch_is(odj_switch_level_from_guid(&PartType))] OP_PACKAGE_PART_u *Part;
205 #else
206 OP_BLOB Part;
207 #endif
208 OP_BLOB Extension;
209 } OP_PACKAGE_PART;
211 ODJ_DECLARE_SERIALIZED_PTR(OP_PACKAGE_PART)
213 typedef struct {
214 uint32 cParts;
215 [size_is(cParts)] OP_PACKAGE_PART *pParts;
216 OP_BLOB Extension;
217 } OP_PACKAGE_PART_COLLECTION;
219 ODJ_DECLARE_SERIALIZED_PTR(OP_PACKAGE_PART_COLLECTION)
221 typedef struct {
222 [value(ndr_size_OP_PACKAGE_PART_COLLECTION_serialized_ptr(w, 0))] uint32 cbBlob;
223 [subcontext(4), subcontext_size(cbBlob)] OP_PACKAGE_PART_COLLECTION_serialized_ptr *w;
224 } OP_PACKAGE_PART_COLLECTION_blob;
226 typedef struct {
227 GUID EncryptionType;
228 OP_BLOB EncryptionContext;
229 #if 1
230 OP_PACKAGE_PART_COLLECTION_blob WrappedPartCollection;
231 #else
232 OP_BLOB WrappedPartCollection;
233 #endif
234 uint32 cbDecryptedPartCollection;
235 OP_BLOB Extension;
236 } OP_PACKAGE;
238 ODJ_DECLARE_SERIALIZED_PTR(OP_PACKAGE)
240 typedef [v1_enum,public] enum {
241 ODJ_WIN7_FORMAT = 0x00000001, /* blob is ODJ_WIN7BLOB */
242 ODJ_WIN8_FORMAT = 0x00000002 /* blob is OP_PACKAGE */
243 } ODJFormat;
245 typedef [public,nodiscriminant,gensize] union {
246 [case(ODJ_WIN7_FORMAT)] [subcontext(0xFFFFFC01)] ODJ_WIN7BLOB odj_win7blob;
247 [case(ODJ_WIN8_FORMAT)] [subcontext(0xFFFFFC01)] OP_PACKAGE_ctr op_package;
248 [default] [subcontext(0xFFFFFC01)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB blob;
249 } ODJ_BLOB_u;
251 typedef struct {
252 ODJFormat ulODJFormat;
253 [value(ndr_size_ODJ_BLOB_u(pBlob, ulODJFormat, 0))] uint32 cbBlob;
254 #if 1
255 [switch_is(ulODJFormat), subcontext(4), subcontext_size(cbBlob)] ODJ_BLOB_u *pBlob;
256 #else
257 [size_is(cbBlob),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *pBlob;
258 #endif
259 } ODJ_BLOB;
261 typedef [public] struct {
262 [value(1)] uint32 ulVersion;
263 uint32 ulcBlobs;
264 [size_is(ulcBlobs)] ODJ_BLOB *pBlobs;
265 } ODJ_PROVISION_DATA;
267 ODJ_DECLARE_SERIALIZED_PTR(ODJ_PROVISION_DATA)