Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
nspi.idl
1 /*
2  NSPI Implementation
3 
4  OpenChange Project
5 
6  Copyright (C) Julien Kerihuel 2006
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22 
23 
24 #include "idl_types.h"
25 
26 [
27  uuid("f5cc5a18-4264-101a-8c59-08002b2f8426"),
28  endpoint("ncacn_np:[\\pipe\\exchange_nsp]", "ncacn_ip_tcp:"),
29  pointer_default(unique),
30  version(56.0),
31  helpstring("Exchange 5.5 Name Service Provider"),
32  helper("ndr_mapi.h")
33 ] interface nspi
34 {
35 
36 #include "mapitags_enum.h"
37 #include "mapicodes_enum.h"
38 
39  /*****************/
40  /* Function 0x00 */
41 
42  /*
43  ** MAPIUID explanation:
44  ** http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/c42065c2-b1f5-4930-84a6-6ef90c6162d0.asp
45  */
46 
47  typedef struct _MAPIUID{
48  uint8 ab[16];
49  } MAPIUID;
50 
51  /*
52  ** input locale combination:
53  ** http://www.microsoft.com/globaldev/reference/win2k/setup/lcid.mspx
54  */
55 
56  typedef struct {
57  uint32 language;
58  uint32 method;
59  } input_locale;
60 
61  typedef [flag(NDR_NOALIGN)] struct {
62  uint32 handle;
63  uint32 flag;
64  MAPIUID service_provider;
65  uint32 codepage; /* CPID */
66  input_locale input_locale; /* LCID */
67  } MAPI_SETTINGS;
68 
69  typedef struct {
70  [unique, length_is(cValues - 1), size_is(cValues - 1)] MAPITAGS *aulPropTag;
71  uint32 cValues;
72  } SPropTagArray;
73 
74  typedef struct {
75  [length_is(cValues - 1), size_is(cValues - 1)] uint32 *value;
76  uint32 cValues;
77  } instance_key;
78 
79 
80 
81  /*****************/
82  /* Function 0x00 */
83  MAPISTATUS NspiBind(
84  [in] uint32 unknown,
85  [in] MAPI_SETTINGS *settings,
86  [in,out,unique] GUID *mapiuid,
87  [out] policy_handle *handle
88  );
89 
90  /*****************/
91  /* Function 0x01 */
92  MAPISTATUS NspiUnbind(
93  [in, out] policy_handle *handle,
94  [in] uint32 status
95  );
96 
97 
98  void NspiUpdateStat();
99 
100  /*****************/
101  /* Function 0x03 */
102  MAPISTATUS NspiQueryRows(
103  [in] policy_handle *handle,
104  [in] uint32 flag,
105  [in,out] MAPI_SETTINGS *settings,
106  [in] uint32 lRows,
107  [in][size_is(lRows)][unique] uint32 *instance_key,
108  [in] uint32 unknown,
109  [in] SPropTagArray *REQ_properties,
110  [out] SRowSet **RowSet
111  );
112 
113  void NspiSeekEntries();
114 
115  /*****************/
116  /* Function 0x05 */
117 
118 
119 
120  typedef struct {
121  [unique] MAPIUID *lpguid;
122  uint32 ulKind;
123  uint32 lID; /* this is actually a union in mapidefs.h */
124  } MAPINAMEID;
125 
126  /* Restriction types */
127  typedef [v1_enum] enum {
128  RES_AND = 0,
129  RES_OR = 1,
130  RES_NOT = 2,
131  RES_CONTENT = 3,
132  RES_PROPERTY = 4,
133  RES_COMPAREPROPS = 5,
134  RES_BITMASK = 6,
135  RES_SIZE = 7,
136  RES_EXIST = 8,
137  RES_SUBRESTRICTION = 9,
138  RES_COMMENT = 10
139  } nspi_RestrictionType;
140 
141  typedef struct {
142  uint32 relop;
143  MAPITAGS ulPropTag;
144  SPropValue *lpProp;
145  } SPropertyRestriction;
146 
147  typedef struct {
148  uint32 cRes;
149  [size_is(cRes)][unique]SRestriction *lpRes;
150  } SAndRestriction;
151 
152  typedef [switch_type(nspi_RestrictionType)] union {
153  [case(RES_AND) ] SAndRestriction resAnd;
154 // [case(RES_OR) ] SOrRestriction resOr;
155 // [case(RES_NOT) ] SNotRestriction resNot;
156 // [case(RES_CONTENT) ] SContentRestriction resContent;
157  [case(RES_PROPERTY) ] SPropertyRestriction resProperty;
158 // [case(RES_COMPAREPROPS) ] SComparePropsRestriction resCompareProps;
159 // [case(RES_BITMASK) ] SBitMaskRestriction resBitMask;
160 // [case(RES_SUBRESTRICTION)] SSubRestriction resSub;
161 // [case(RES_SIZE) ] SSizeRestriction resSize;
162 // [case(RES_EXIST) ] SExistRestriction resExist;
163  } SRestriction_CTR;
164 
165  typedef [public] struct _SRestriction{
166  nspi_RestrictionType rt;
167  [switch_is(rt)] SRestriction_CTR res;
168  } SRestriction;
169 
170 /* Sort type */
171 #define TABLE_SORT_ASCEND 0
172 #define TABLE_SORT_DESCEND 0
173 
174  typedef [public] struct _SSortOrder{
175  uint32 ulPropTag;
176  uint32 ulOrder;
177  } SSortOrder;
178 
179  typedef [public] struct _SSortOrderSet{
180  uint32 cSorts;
181  uint32 cCategories;
182  uint32 cExpanded;
183  [size_is(cSorts)][unique]SSortOrder *aSort;
184  } SSortOrderSet;
185 
186  MAPISTATUS NspiGetMatches(
187  [in] policy_handle *handle,
188  [in] uint32 unknown1,
189  [in,out] MAPI_SETTINGS *settings,
190  [in][unique] SPropTagArray *PropTagArray,
191  [in] uint32 unknown2,
192  [in][unique] SRestriction *restrictions,
193  [in] uint32 unknown3,
194  [out] instance_key *instance_key,
195  [in][unique] SPropTagArray *REQ_properties,
196  [out] SRowSet **RowSet
197  );
198 
199 
200  void NspiResortRestriction();
201 
202  /*****************/
203  /* Function 0x07 */
204 
205  typedef struct {
206  [string, charset(DOS)] uint8 *str;
207  } NAME_STRING;
208 
209  MAPISTATUS NspiDNToEph(
210  [in] policy_handle *handle,
211  [in] uint32 flag,
212  [in] uint32 size,
213  [in,ref][size_is(size)] NAME_STRING *server_dn,
214  [out] instance_key *instance_key
215  );
216 
217  void NspiGetPropList();
218 
219  /*****************/
220  /* Function 0x09 */
221  MAPISTATUS NspiGetProps(
222  [in] policy_handle *handle,
223  [in] uint32 flag,
224  [in] MAPI_SETTINGS *settings,
225  [in] SPropTagArray *REQ_properties,
226  [out] SRow **REPL_values
227  );
228 
229 
230  void NspiCompareDNTs();
231  void NspiModProps();
232 
233  typedef [v1_enum] enum {
234  PT_UNSPECIFIED = 0x0000,
235  PT_NULL = 0x0001,
236  PT_I2 = 0x0002,
237  PT_LONG = 0x0003,
238  PT_R4 = 0x0004,
239  PT_DOUBLE = 0x0005,
240  PT_CURRENCY = 0x0006,
241  PT_APPTIME = 0x0007,
242  PT_ERROR = 0x000a, /* means the given attr contains no value */
243  PT_BOOLEAN = 0x000b,
244  PT_OBJECT = 0x000d,
245  PT_I8 = 0x0014,
246  PT_STRING8 = 0x001e,
247  PT_UNICODE = 0x001f,
248  PT_SYSTIME = 0x0040,
249  PT_CLSID = 0x0048,
250  PT_BINARY = 0x0102,
251 
252  /* Multi-valued properties */
253 
254  PT_MV_I2 = 0x1002,
255  PT_MV_LONG = 0x1003,
256  PT_MV_R4 = 0x1004,
257  PT_MV_DOUBLE = 0x1005,
258  PT_MV_CURRENCY = 0x1006,
259  PT_MV_APPTIME = 0x1007,
260  PT_MV_I8 = 0x1014,
261  PT_MV_STRING8 = 0x101e,
262 // PT_MV_TSTRING = 0x101e,
263  PT_MV_UNICODE = 0x101f,
264  PT_MV_SYSTIME = 0x1040,
265  PT_MV_CLSID = 0x1048,
266  PT_MV_BINARY = 0x1102
267  } property_types;
268 
269 
270  /*****************/
271  /* Function 0x0c */
272 
273  typedef struct {
274  uint32 cb;
275  [size_is(cb)][unique] uint8 *lpb;
276  } SBinary;
277 
278  typedef struct {
279  uint32 dwLowDateTime;
280  uint32 dwHighDateTime;
281  } FILETIME;
282 
283  typedef struct {
284  uint32 cValues;
285  [size_is(cValues)] uint16 *lpi;
286  } SShortArray;
287 
288  typedef struct {
289  uint32 cValues;
290  [size_is(cValues)] uint32 *lpl;
291  } MV_LONG_STRUCT;
292 
293  typedef struct {
294  ascstr_noterm lppszA;
295  } LPSTR;
296 
297  typedef struct {
298  uint32 cValues;
299  [size_is(cValues)] LPSTR **strings;
300  } SLPSTRArray;
301 
302  typedef struct {
303  uint32 cValues;
304  [size_is(cValues)] SBinary *lpbin;
305  } SBinaryArray;
306 
307  typedef [flag(NDR_NOALIGN)] struct {
308  uint32 cValues;
309  [size_is(cValues)] uint32 *lpguid;
310  } SGuidArray;
311 
312  typedef struct {
313  uint32 cValues;
314  [size_is(cValues)] uint32 *lpi;
315  } MV_UNICODE_STRUCT;
316 
317  typedef struct {
318  uint32 cValues;
319  [size_is(cValues)] FILETIME *lpft;
320  } SDateTimeArray;
321 
322  typedef [switch_type(property_types)] union {
323  [case(PT_I2)] uint16 i;
324  [case(PT_LONG)] uint32 l;
325  [case(PT_BOOLEAN)] uint16 b;
326  [case(PT_STRING8)][unique][string,charset(DOS)] uint8 *lpszA;
327  [case(PT_BINARY)] SBinary bin;
328  [case(PT_UNICODE)] [string,charset(UTF16)] uint16 *lpszW;
329  [case(PT_CLSID)] MAPIUID *lpguid;
330  [case(PT_SYSTIME)] FILETIME ft;
331  [case(PT_ERROR)] MAPISTATUS err;
332  [case(PT_MV_I2)] SShortArray MVi;
333  [case(PT_MV_LONG)] MV_LONG_STRUCT MVl;
334  [case(PT_MV_STRING8)] SLPSTRArray MVszA;
335  [case(PT_MV_BINARY)] SBinaryArray MVbin;
336  [case(PT_MV_CLSID)] SGuidArray MVguid;
337  [case(PT_MV_UNICODE)] MV_UNICODE_STRUCT MVszW;
338  [case(PT_MV_SYSTIME)] SDateTimeArray MVft;
339  [case(PT_NULL)] uint32 null;
340  [case(PT_OBJECT)] uint32 object;
341  } SPropValue_CTR;
342 
343  typedef [public]struct {
344  MAPITAGS ulPropTag;
345  uint32 dwAlignPad;
346  [switch_is(ulPropTag & 0xFFFF)] SPropValue_CTR value;
347  } SPropValue;
348 
349  typedef struct {
350  uint32 ulAdrEntryPad;
351  uint32 cValues;
352  [size_is(cValues)][unique] SPropValue *lpProps;
353  } SRow;
354 
355 
356  typedef [public] struct {
357  uint32 cRows;
358  [size_is(cRows)] SRow aRow[*];
359  } SRowSet;
360 
361  MAPISTATUS NspiGetHierarchyInfo(
362  [in] policy_handle *handle,
363  [in] uint32 unknown1,
364  [in] MAPI_SETTINGS *settings,
365  [in,out] uint32 *unknown2,
366  [out] SRowSet **RowSet
367  );
368 
369  void NspiGetTemplateInfo();
370  void NspiModLInkAtt();
371  void NspiDeleteEntries();
372  void NspiQueryColumns();
373  void NspiGetNamesFromIDs();
374  void NspiGetIDsFromNames();
375  void NspiResolveNames();
376  void NspiResolveNamesW();
377 }
Definition: packet-epl.h:72
Definition: conversation.c:27