Link against samba-credentials library.
[jelmer/openchange-proposed.git/.git] / exchange.idl
1 #include "idl_types.h"
2
3 cpp_quote("#include <gen_ndr/ndr_misc.h>")
4
5 /*
6    http://support.microsoft.com/default.aspx?scid=KB;en-us;q159298
7    Any UUID starting with:
8    A4 - store
9    F5 - directory
10  */
11
12 [
13   uuid("99e64010-b032-11d0-97a4-00c04fd6551d"),
14   pointer_default(unique),
15   version(3.0)
16 ] interface exchange_store_admin3
17 {
18         void ec_store_admin3_dummy();
19 }
20
21
22 [
23   uuid("89742ace-a9ed-11cf-9c0c-08002be7ae86"),
24   pointer_default(unique),
25   version(2.0)
26 ] interface exchange_store_admin2
27 {
28         void ec_store_admin2_dummy();
29 }
30
31 [
32   uuid("a4f1db00-ca47-1067-b31e-00dd010662da"),
33   pointer_default(unique),
34   version(1.0)
35 ] interface exchange_store_admin1
36 {
37         void ec_store_admin1_dummy();
38 }
39
40
41 [
42   uuid("1544f5e0-613c-11d1-93df-00c04fd7bd09"),
43   endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]","ncacn_ip_tcp:[]"),
44   authservice("exchangeRFR"),
45   pointer_default(unique),
46   version(1.0),
47   helpstring("Exchange 2003 Directory Request For Response")
48 ] interface exchange_ds_rfr
49 {
50
51 #include "properties_enum.h"
52 #include "mapicodes_enum.h"
53
54         /*****************/
55         /* Function 0x00 */
56         MAPISTATUS RfrGetNewDSA(
57                 [in]                                    uint32  ulFlags,
58                 [in,string,charset(DOS)]                uint8   *pUserDN,
59                 [in,out,unique,string,charset(DOS)]     uint8   **ppszUnused,
60                 [in,out,unique,string,charset(DOS)]     uint8   **ppszServer
61                 );
62         
63         /*****************/
64         /* Function 0x01 */
65         MAPISTATUS RfrGetFQDNFromLegacyDN(
66                 [in]                                                    uint32  ulFlags,
67                 [in,range(10,1024)]                                     uint32  cbMailboxServerDN,
68                 [in,string,charset(DOS),size_is(cbMailboxServerDN)]     uint8   *szMailboxServerDN,
69                 [out,ref,string,charset(DOS)]                           uint8   **ppszServerFQDN
70                 );
71 }
72
73 [
74   uuid("f930c514-1215-11d3-99a5-00a0c9b61b04"),
75   helpstring("System Attendant Cluster Interface"),
76   pointer_default(unique),
77   version(1.0)
78 ] interface exchange_sysatt_cluster
79 {
80         void sysatt_cluster_dummy();
81 }
82
83 /*
84 [83d72bf0-0d89-11ce-b13f-00aa003bac6c] MS Exchange
85 System Attendant Private Interface
86 */
87
88 [
89   uuid("469d6ec0-0d87-11ce-b13f-00aa003bac6c"),
90   pointer_default(unique),
91   helpstring("Exchange 5.5 System Attendant Request for Response")
92 ] interface exchange_system_attendant
93 {
94         void sysatt_dummy();
95 }
96
97 [
98   uuid("9e8ee830-4559-11ce-979b-00aa005ffebe"),
99   pointer_default(unique),
100   version(2.0),
101   helpstring("Exchange 5.5 MTA")
102 ] interface exchange_mta
103 {
104         /*****************/
105         /* Function 0x00 */
106         void MtaBind();
107
108         /*****************/
109         /* Function 0x01 */
110         void MtaBindAck();
111 }
112
113 [
114   uuid("f5cc59b4-4264-101a-8c59-08002b2f8426"),
115   pointer_default(unique),
116   version(21.0),
117   helpstring("Exchange 5.5 DRS")
118 ] interface exchange_drs
119 {
120         /*****************/
121         /* Function 0x00 */
122         void ds_abandon();
123
124         /*****************/
125         /* Function 0x01 */
126         void ds_add_entry();
127
128         void ds_bind();
129         void ds_compare();
130         void ds_list();
131         void ds_modify_entry();
132         void ds_modify_rdn();
133         void ds_read();
134         void ds_receive_result();
135         void ds_remove_entry();
136         void ds_search();
137         void ds_unbind();
138         void ds_wait();
139         void dra_replica_add();
140         void dra_replica_delete();
141         void dra_replica_synchronize();
142         void dra_reference_update();
143         void dra_authorize_replica();
144         void dra_unauthorize_replica();
145         void dra_adopt();
146         void dra_set_status();
147         void dra_modify_entry();
148         void dra_delete_subref();
149 }
150
151 [
152   uuid("f5cc5a7c-4264-101a-8c59-08002b2f8426"),
153   version(21.0),
154   pointer_default(unique),
155   helpstring("Exchange 5.5 XDS")
156 ] interface exchange_xds
157 {
158         void xds_dummy();
159 }
160
161 [
162   uuid("38a94e72-a9bc-11d2-8faf-00c04fa378ff"),
163   pointer_default(unique),
164   version(1.0)
165 ] interface exchange_mta_qadmin
166 {
167         void exchange_mta_qadmin();
168 }
169
170
171 [
172   uuid("0e4a0156-dd5d-11d2-8c2f-00c04fb6bcde"),
173   pointer_default(unique),
174   version(1.0)
175 ] interface exchange_store_information
176 {
177         void exchange_store_information_dummy();
178 }
179
180 [
181   uuid("f5cc5a18-4264-101a-8c59-08002b2f8426"),
182   endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]","ncacn_ip_tcp:[]"),
183   authservice("exchangeAB"),
184   pointer_default(unique),
185   version(56.0),
186   helpstring("Exchange 5.5 Name Service Provider")
187 ] interface exchange_nsp
188 {
189
190 #define PT_UNSPECIFIED  0x0000
191 #define PT_NULL         0x0001
192 #define PT_I2           0x0002
193 #define PT_LONG         0x0003
194 #define PT_R4           0x0004
195 #define PT_DOUBLE       0x0005
196 #define PT_CURRENCY     0x0006
197 #define PT_APPTIME      0x0007
198 #define PT_ERROR        0x000a /* means the given attr contains no value */
199 #define PT_BOOLEAN      0x000b
200 #define PT_OBJECT       0x000d
201 #define PT_I8           0x0014
202 #define PT_STRING8      0x001e
203 #define PT_UNICODE      0x001f
204 #define PT_SYSTIME      0x0040
205 #define PT_CLSID        0x0048
206 #define PT_SVREID       0x00fb
207 #define PT_SRESTRICT    0x00fd
208 #define PT_ACTIONS      0x00fe
209 #define PT_BINARY       0x0102
210 /* Multi-valued properties */
211 #define PT_MV_I2        0x1002
212 #define PT_MV_LONG      0x1003
213 #define PT_MV_R4        0x1004
214 #define PT_MV_DOUBLE    0x1005
215 #define PT_MV_CURRENCY  0x1006
216 #define PT_MV_APPTIME   0x1007
217 #define PT_MV_I8        0x1014
218 #define PT_MV_STRING8   0x101e
219 #define PT_MV_TSTRING   0x101e
220 #define PT_MV_UNICODE   0x101f
221 #define PT_MV_SYSTIME   0x1040
222 #define PT_MV_CLSID     0x1048
223 #define PT_MV_BINARY    0x1102
224
225         typedef [v1_enum] enum {
226                 SortTypeDisplayName             = 0x00000000,
227                 SortTypePhoneticDisplayName     = 0x00000003,
228                 SortTypeDisplayName_RO          = 0x000003E8,
229                 SortTypeDisplayName_W           = 0x000003E9
230         } TableSortOrders;
231
232         typedef [v1_enum] enum {
233                 MID_BEGINNING_OF_TABLE  = 0x0,
234                 MID_END_OF_TABLE        = 0x2,
235                 MID_CURRENT             = 0x1
236         } NSPI_MID;
237
238         typedef [flag(NDR_NOALIGN)] struct {
239                 TableSortOrders SortType;
240                 uint32          ContainerID;
241                 NSPI_MID        CurrentRec;
242                 int32           Delta;
243                 uint32          NumPos;
244                 uint32          TotalRecs;
245                 uint32          CodePage;
246                 uint32          TemplateLocale;
247                 uint32          SortLocale;
248         } STAT;
249
250         typedef struct {
251                 uint8 ab[16];
252         } FlatUID_r;
253
254         /* like a SPropTagArray, but without the "value is a an enum MAPITAGS" semantics */
255         typedef struct {
256                 [range(0,100000)] uint32                        cValues;
257                 [size_is(cValues+1), length_is(cValues)] uint32 aulPropTag[];
258         } PropertyTagArray_r;
259     
260         typedef struct {
261                 FlatUID_r       *lpguid;
262                 uint32          ulReserved;
263                 uint32          lID;
264         } PropertyName_r;
265
266         typedef struct {
267                 [range(0,100000)] uint32                cNames;
268                 [size_is(cNames)] PropertyName_r        aNames[];
269         } PropertyNameSet_r;
270
271         typedef struct {
272                 [range(0,100000)] uint32                        cValues;
273                 [string,size_is(cValues),charset(DOS)] uint8    **lppszA;
274         } StringArray_r;
275
276         typedef struct {
277                 [range(0,100000)] uint32                        Count;
278                 [string,size_is(Count),charset(DOS)] uint8      *Strings[];
279         } StringsArray_r;
280
281         typedef struct {
282                 [range(0,100000)] uint32                        cValues;
283                 [string,size_is(cValues),charset(UTF16)] uint16 **lppszW;
284         } StringArrayW_r;
285
286         typedef struct {
287                 [range(0,100000)] uint32                        Count;
288                 [string,size_is(Count),charset(UTF16)] uint16   *Strings[];
289         } StringsArrayW_r;
290
291         typedef struct {
292                 [range(0,100001)] uint32                                cValues;
293                 [size_is(cValues+1),length_is(cValues)] MAPITAGS        aulPropTag[];
294         } SPropTagArray;
295
296         typedef [public,noprint] struct {
297                 [range(0,2097152)] uint32       cb;
298                 [size_is(cb)] uint8             *lpb;
299         } Binary_r;
300
301         typedef [public] struct {
302                 uint32 dwLowDateTime;
303                 uint32 dwHighDateTime;
304         } FILETIME;
305
306         typedef struct {
307                 [range(0,100000)] uint32        cValues;
308                 [size_is(cValues)] uint16       *lpi;
309         } ShortArray_r;
310
311         typedef struct {
312                 [range(0,100000)] uint32        cValues;
313                 [size_is(cValues)] uint32       *lpl; 
314         } LongArray_r;
315
316         typedef struct {
317                 [range(0,100000)] uint32        cValues;
318                 [size_is(cValues)] dlong        *lpi8; 
319         } I8Array_r;
320
321         typedef struct {
322                 [range(0,100000)] uint32        cValues;
323                 [size_is(cValues)] Binary_r     *lpbin;
324         } BinaryArray_r;
325
326         typedef [flag(NDR_NOALIGN)] struct {
327                 [range(0,100000)]uint32         cValues;
328                 [size_is(cValues)] FlatUID_r    **lpguid; 
329         } FlatUIDArray_r;
330
331         typedef struct {
332                 [range(0,100000)] uint32        cValues;
333                 [size_is(cValues)] FILETIME     *lpft;
334         } DateTimeArray_r;
335
336         typedef [switch_type(uint32)] union {
337                 [case(PT_I2)]                   uint16                  i;
338                 [case(PT_LONG)]                 uint32                  l;
339                 [case(PT_DOUBLE)]               dlong                   dbl;
340                 [case(PT_BOOLEAN)]              uint8                   b;
341                 [case(PT_I8)]                   dlong                   d;
342                 [case(PT_STRING8)][unique][string,charset(DOS)] uint8   *lpszA;
343                 [case(PT_BINARY)]               Binary_r                bin;
344                 [case(PT_SVREID)]               Binary_r                bin;
345                 [case(PT_UNICODE)][string,charset(UTF16)] uint16        *lpszW;
346                 [case(PT_CLSID)]                FlatUID_r               *lpguid;
347                 [case(PT_SYSTIME)]              FILETIME                ft;
348                 [case(PT_ERROR)]                MAPISTATUS              err;
349                 [case(PT_MV_I2)]                ShortArray_r            MVi;
350                 [case(PT_MV_LONG)]              LongArray_r             MVl;
351                 [case(PT_MV_I8)]                I8Array_r               MVi8;
352                 [case(PT_MV_STRING8)]           StringArray_r           MVszA;
353                 [case(PT_MV_BINARY)]            BinaryArray_r           MVbin;
354                 [case(PT_MV_CLSID)]             FlatUIDArray_r          MVguid;
355                 [case(PT_MV_UNICODE)]           StringArrayW_r          MVszW;
356                 [case(PT_MV_SYSTIME)]           DateTimeArray_r         MVft;
357                 [case(PT_NULL)]                 uint32                  null;
358                 [case(PT_OBJECT)]               uint32                  object;
359         } SPropValue_CTR;
360
361         typedef [public]struct {
362                 MAPITAGS ulPropTag;
363                 uint32 dwAlignPad;
364                 [switch_is(ulPropTag & 0xFFFF)] SPropValue_CTR value; 
365         } SPropValue;
366         
367         typedef struct {
368                 uint32                          ulAdrEntryPad;
369                 [range(0,100000)] uint32        cValues;
370                 [size_is(cValues)]SPropValue    *lpProps;
371         } SRow;
372
373
374         typedef [public] struct {
375                 [range(0,100000)] uint32        cRows;
376                 [size_is(cRows)] SRow           aRow[];
377         } SRowSet;
378         
379         typedef struct {
380                 [range(0,100000)] uint32                cRes;
381                 [size_is(cRes)] Restriction_r           *lpRes;
382         } AndRestriction_r;
383
384         typedef struct {
385                 [range(0,100000)] uint32                cRes;
386                 [size_is(cRes)] Restriction_r           *lpRes;
387         } OrRestriction_r;
388
389         typedef struct {
390                 Restriction_r                           *lpRes;
391         } NotRestriction_r;
392
393         typedef struct {
394                 uint32                                  ulFuzzyLevel;
395                 MAPITAGS                                ulPropTag;
396                 SPropValue                              *lpProp;
397         } ContentRestriction_r;
398
399         typedef struct {
400                 uint32                                  relop;
401                 MAPITAGS                                ulPropTag;
402                 SPropValue                              *lpProp;
403         } PropertyRestriction_r;
404
405         typedef struct {
406                 uint32                                  relop;
407                 MAPITAGS                                ulPropTag1;
408                 MAPITAGS                                ulPropTag2;
409         } ComparePropsRestriction_r;
410
411         typedef struct {
412                 uint32                                  relMBR;
413                 MAPITAGS                                ulPropTag;
414                 uint32                                  ulMask;
415         } BitMaskRestriction_r;
416
417         typedef struct {
418                 uint32                                  relop;
419                 MAPITAGS                                ulPropTag;
420                 uint32                                  cb;
421         } SizeRestriction_r;
422
423         typedef struct {
424                 uint32                                  ulReserved1;
425                 MAPITAGS                                ulPropTag;
426                 uint32                                  ulReserved2;
427         } ExistRestriction_r;
428
429         typedef struct {
430                 uint32                                  ulSubObject;
431                 Restriction_r                           *lpRes;
432         } SubRestriction_r;
433
434         typedef [v1_enum] enum {
435                 RES_AND                 = 0x0,
436                 RES_OR                  = 0x1,
437                 RES_NOT                 = 0x2,
438                 RES_CONTENT             = 0x3,
439                 RES_PROPERTY            = 0x4,
440                 RES_COMPAREPROPS        = 0x5,
441                 RES_BITMASK             = 0x6,
442                 RES_SIZE                = 0x7,
443                 RES_EXIST               = 0x8,
444                 RES_SUBRESTRICTION      = 0x9,
445                 RES_COMMENT             = 0xA
446         } RestrictionType_r;
447
448         typedef [switch_type(uint32)] union {
449                 [case(RES_AND)]                 AndRestriction_r                resAnd;
450                 [case(RES_OR)]                  OrRestriction_r                 resOr;
451                 [case(RES_NOT)]                 NotRestriction_r                resNot;
452                 [case(RES_CONTENT)]             ContentRestriction_r            resContent;
453                 [case(RES_PROPERTY)]            PropertyRestriction_r           resProperty;
454                 [case(RES_COMPAREPROPS)]        ComparePropsRestriction_r       resCompareProps;
455                 [case(RES_BITMASK)]             BitMaskRestriction_r            resBitMask;
456                 [case(RES_SIZE)]                SizeRestriction_r               resSize;
457                 [case(RES_EXIST)]               ExistRestriction_r              resExist;
458                 [case(RES_SUBRESTRICTION)]      SubRestriction_r                resSub;
459         } RestrictionUnion_r;
460
461         typedef [public] struct _Restriction_r{
462                 RestrictionType_r                       rt;
463                 [switch_is(rt)] RestrictionUnion_r      res;
464         } Restriction_r;
465
466         /*****************/
467         /* Function 0x00 */
468         typedef [bitmap32bit] bitmap {
469                 fAnonymousLogin = 0x00000020
470         } NspiBind_dwFlags;
471
472         MAPISTATUS NspiBind(
473                 [in] NspiBind_dwFlags   dwFlags,
474                 [in] STAT               *pStat,
475                 [in,out,unique] GUID    *mapiuid,
476                 [out] policy_handle     *handle
477                 );
478
479         /*****************/
480         /* Function 0x01 */
481         MAPISTATUS NspiUnbind(
482                 [in, out] policy_handle *handle,
483                 [in] uint32             Reserved
484                 );
485
486         /*****************/
487         /* Function 0x02 */
488         MAPISTATUS NspiUpdateStat(
489                 [in] policy_handle      *handle,
490                 [in] uint32             Reserved,
491                 [in,out] STAT           *pStat,
492                 [in,out,unique] uint32  *plDelta
493                 );
494
495         /*****************/
496         /* Function 0x03 */
497         typedef [bitmap32bit] bitmap {
498                 fSkipObjects    = 0x00000001,
499                 fEphID          = 0x00000002
500         } NspiQueryRows_dwFlags;
501
502         MAPISTATUS NspiQueryRows(
503                 [in]                                    policy_handle                   *handle,
504                 [in]                                    NspiQueryRows_dwFlags           dwFlags,
505                 [in,out]                                STAT                            *pStat,
506                 [in,range(0,100000)]                    uint32                          dwETableCount,
507                 [in,unique,size_is(dwETableCount)]      uint32                          *lpETable,
508                 [in]                                    uint32                          Count,
509                 [in,unique]                             SPropTagArray                   *pPropTags,
510                 [out]                                   SRowSet                         **ppRows
511                 );
512
513         /*****************/
514         /* Function 0x04 */
515         MAPISTATUS NspiSeekEntries(
516                 [in]            policy_handle           *handle,
517                 [in]            uint32                  Reserved,
518                 [in,out]        STAT                    *pStat,
519                 [in]            SPropValue              *pTarget,
520                 [in,unique]     PropertyTagArray_r      *lpETable,
521                 [in,unique]     SPropTagArray           *pPropTags,
522                 [out]           SRowSet                 **pRows
523                 );
524
525         /*****************/
526         /* Function 0x05 */
527         MAPISTATUS NspiGetMatches(
528                 [in]            policy_handle           *handle,
529                 [in]            uint32                  Reserved,
530                 [in,out]        STAT                    *pStat,
531                 [in][unique]    SPropTagArray           *pReserved,
532                 [in]            uint32                  Reserved2,
533                 [in][unique]    Restriction_r           *Filter,
534                 [in][unique]    PropertyName_r          *lpPropName,
535                 [in]            uint32                  ulRequested,
536                 [out]           PropertyTagArray_r      **ppOutMIds,
537                 [in][unique]    SPropTagArray           *pPropTags,
538                 [out]           SRowSet                 **ppRows
539                 );
540
541         /*****************/
542         /* Function 0x06 */
543         MAPISTATUS NspiResortRestriction(
544                 [in] policy_handle              *handle,
545                 [in] uint32                     Reserved,
546                 [in,out] STAT                   *pStat,
547                 [in] PropertyTagArray_r         *pInMIds,
548                 [in,out] PropertyTagArray_r     **ppMIds
549                 );
550
551         /*****************/
552         /* Function 0x07 */
553         MAPISTATUS NspiDNToMId(
554                 [in] policy_handle              *handle,
555                 [in] uint32                     Reserved,
556                 [in] StringsArray_r             *pNames,
557                 [out] PropertyTagArray_r        **ppMIds
558                 );
559
560         /*****************/
561         /* Function 0x08 */
562         MAPISTATUS NspiGetPropList(
563                 [in] policy_handle      *handle,
564                 [in] uint32             dwFlags,
565                 [in] uint32             dwMId,
566                 [in] uint32             CodePage,
567                 [out] SPropTagArray     **ppPropTags
568                 );
569
570         /*****************/
571         /* Function 0x09 */
572         MAPISTATUS NspiGetProps(
573                 [in]    policy_handle                   *handle,
574                 [in]    uint32                          dwFlags,
575                 [in]    STAT                            *pStat,
576                 [in,unique] SPropTagArray               *pPropTags,
577                 [out]   SRow                            **ppRows
578                 );
579
580         /*****************/
581         /* Funcion 0xa   */
582         MAPISTATUS NspiCompareMIds(
583                 [in] policy_handle      *handle,
584                 [in] uint32             Reserved,
585                 [in] STAT               *pStat,
586                 [in] uint32             MId1,
587                 [in] uint32             MId2,
588                 [out] uint32            *plResult
589                 );
590
591         /*****************/
592         /* Function 0xb  */
593         MAPISTATUS NspiModProps(
594                 [in] policy_handle              *handle,
595                 [in] uint32                     Reserved,
596                 [in] STAT                       *pStat,
597                 [in,unique] SPropTagArray       *pPropTags,
598                 [in] SRow                       *pRow
599                 );
600
601         /*****************/
602         /* Function 0x0c */
603         typedef [bitmap32bit] bitmap {
604                 NspiAddressCreationTemplates    = 0x00000002,
605                 NspiUnicodeStrings              = 0x00000004
606         } NspiGetSpecialTable_dwFlags;
607
608         MAPISTATUS NspiGetSpecialTable(
609                 [in] policy_handle                      *handle,
610                 [in] NspiGetSpecialTable_dwFlags        dwFlags,
611                 [in] STAT                               *pStat,
612                 [in,out] uint32                         *lpVersion,
613                 [out] SRowSet                           **ppRows
614                 );
615
616         /*******************/
617         /* Function 0x0d   */
618         typedef [bitmap32bit] bitmap {
619                 TI_TEMPLATE             = 0x00000001,
620                 TI_SCRIPT               = 0x00000004,
621                 TI_EMT                  = 0x00000010,
622                 TI_HELPFILE_NAME        = 0x00000020,
623                 TI_HELPFILE_CONTENTS    = 0x00000040
624         } TI_dwFlags;
625
626         MAPISTATUS NspiGetTemplateInfo(
627                 [in] policy_handle                      *handle,
628                 [in] TI_dwFlags                         dwFlags,
629                 [in] uint32                             ulType,
630                 [in,unique,string,charset(DOS)] uint8   *pDN,
631                 [in] uint32                             dwCodePage,
632                 [in] uint32                             dwLocaleID,
633                 [out] SRow                              **ppData
634                 );
635
636         /*******************/
637         /* Function 0x0e   */
638         MAPISTATUS NspiModLinkAtt(
639                 [in] policy_handle                      *handle,
640                 [in] uint32                             dwFlags,
641                 [in] MAPITAGS                           ulPropTag,
642                 [in] uint32                             MId,
643                 [in] BinaryArray_r                      *lpEntryIds
644                 );
645
646         /*************************************/
647         /* Function 0x0f: Not used on wire   */
648         MAPISTATUS NspiDeleteEntries(
649                 [in] policy_handle                      *Reserved1,
650                 [in] uint32                             Reserved2,
651                 [in] uint32                             Reserved3,
652                 [in] BinaryArray_r                      *Reserved4
653                 );
654
655         /*******************/
656         /* Function 0x10   */
657         typedef [bitmap32bit] bitmap {
658                 NspiUnicodeProptypes    = 0x80000000
659         } NspiQueryColumns_dwFlags;
660
661         MAPISTATUS NspiQueryColumns(
662                 [in] policy_handle                      *handle,
663                 [in] uint32                             Reserved,
664                 [in] NspiQueryColumns_dwFlags           dwFlags,
665                 [out] SPropTagArray                     **ppColumns
666                 );
667
668         /*******************/
669         /* Function 0x11   */
670         MAPISTATUS NspiGetNamesFromIDs(
671                 [in] policy_handle                      *handle,
672                 [in] uint32                             Reserved,
673                 [in,unique] FlatUID_r                   *lpGuid,
674                 [in,unique] SPropTagArray               *pPropTags,
675                 [out] SPropTagArray                     **ppReturnedPropTags,
676                 [out] PropertyNameSet_r                 **ppNames
677                 );
678
679         /*******************/
680         /* Function 0x12   */
681         MAPISTATUS NspiGetIDsFromNames(
682                 [in] policy_handle                      *handle,
683                 [in] uint32                             Reserved,
684                 [in] uint32                             dwFlags,
685                 [in,range(0,100000)] uint32             cPropNames,
686                 [in,size_is(cPropNames)] PropertyName_r **ppNames,
687                 [out] SPropTagArray                     **ppPropTags
688                 );
689
690         /*****************/
691         /* Function 0x13 */
692         MAPISTATUS NspiResolveNames(
693                 [in] policy_handle              *handle,
694                 [in] uint32                     Reserved,
695                 [in] STAT                       *pStat,
696                 [in,unique] SPropTagArray       *pPropTags,
697                 [in] StringsArray_r             *paStr,
698                 [out] PropertyTagArray_r        **ppMIds,
699                 [out] SRowSet                   **ppRows
700         );
701
702         /*****************/
703         /* Function 0x14 */
704         MAPISTATUS NspiResolveNamesW(
705                 [in] policy_handle              *handle,
706                 [in] uint32                     Reserved,
707                 [in] STAT                       *pStat,
708                 [in,unique] SPropTagArray       *pPropTags,
709                 [in] StringsArrayW_r            *paWStr,
710                 [out] PropertyTagArray_r        **ppMIds,
711                 [out] SRowSet                   **ppRows
712                 );
713 }
714
715 [
716   uuid("a4f1db00-ca47-1067-b31f-00dd010662da"),
717   pointer_default(unique),
718   endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]","ncacn_ip_tcp:"),
719   authservice("exchangeMDB"),
720   //version(0.81),
721   version(5308416),
722   helpstring("Exchange 5.5 EMSMDB")
723 ] interface exchange_emsmdb
724 {
725         /*****************/
726         /* Function 0x00 */
727
728         MAPISTATUS EcDoConnect(
729                 [out]                           policy_handle   *handle,
730                 [in,string,charset(DOS)]        uint8           szUserDN[],
731                 [in]                            uint32          ulFlags,
732                 [in]                            uint32          ulConMod,
733                 [in]                            uint32          cbLimit,
734                 [in]                            uint32          ulCpid,
735                 [in]                            uint32          ulLcidString,
736                 [in]                            uint32          ulLcidSort,
737                 [in]                            uint32          ulIcxrLink,
738                 [in]                            uint16          usFCanConvertCodePages,
739                 [out]                           uint32          *pcmsPollsMax,
740                 [out]                           uint32          *pcRetry,
741                 [out]                           uint32          *pcmsRetryDelay,
742                 [out]                           uint32          *picxr,
743                 [out,ref,string,charset(DOS)]uint8              **szDNPrefix,
744                 [out,ref,string,charset(DOS)]uint8              **szDisplayName,
745                 [out]                           uint16          rgwServerVersion[3],
746                 [in,out]                        uint16          rgwClientVersion[3],
747                 [in,out]                        uint32          *pullTimeStamp
748                 );
749
750         /*****************/
751         /* Function 0x01 */
752         MAPISTATUS EcDoDisconnect(
753                 [in,out]   policy_handle   *handle
754                 );
755
756         /*****************/
757         /* Function 0x02 */
758
759         /*
760           EcDoRpc opnums
761         */
762
763         typedef [public, enum8bit, flag(NDR_PAHEX)] enum 
764                 {
765                         MAPI_STORE      = 0x1,
766                         MAPI_ADDRBOOK   = 0x2,
767                         MAPI_FOLDER     = 0x3,
768                         MAPI_ABCONT     = 0x4,
769                         MAPI_MESSAGE    = 0x5,
770                         MAPI_MAILUSER   = 0x6, /* Individual Recipient */
771                         MAPI_ATTACH     = 0x7,
772                         MAPI_DISTLIST   = 0x8,
773                         MAPI_PROFSECT   = 0x9,
774                         MAPI_STATUS     = 0xA,
775                         MAPI_SESSION    = 0xB,
776                         MAPI_FORMINFO   = 0xC
777                 } MAPI_OBJTYPE;
778
779         typedef [public, v1_enum, flag(NDR_PAHEX)] enum 
780                 {
781                         RightsNone              = 0x00000000,
782                         RightsReadItems         = 0x00000001,
783                         RightsCreateItems       = 0x00000002,
784                         RightsEditOwn           = 0x00000008,
785                         RightsDeleteOwn         = 0x00000010,
786                         RightsEditAll           = 0x00000020,
787                         RightsDeleteAll         = 0x00000040,
788                         RightsCreateSubfolders  = 0x00000080,
789                         RightsFolderOwner       = 0x00000100,
790                         RightsFolderContact     = 0x00000200,
791                         RoleNone                = 0x00000400,
792                         RoleReviewer            = 0x00000401,
793                         RoleContributor         = 0x00000402,
794                         RoleNoneditingAuthor    = 0x00000413,
795                         RoleAuthor              = 0x0000041B,
796                         RoleEditor              = 0x0000047B,
797                         RolePublishAuthor       = 0x0000049B,
798                         RolePublishEditor       = 0x000004FB,
799                         RightsAll               = 0x000005FB,
800                         RoleOwner               = 0x000007FB
801                 } ACLRIGHTS;
802
803         typedef [public, enum8bit, flag(NDR_PAHEX)] enum
804                 {
805                         op_MAPI_Release                         = 0x1,
806                         op_MAPI_OpenFolder                      = 0x2,
807                         op_MAPI_OpenMessage                     = 0x3,
808                         op_MAPI_GetHierarchyTable               = 0x4,
809                         op_MAPI_GetContentsTable                = 0x5,
810                         op_MAPI_CreateMessage                   = 0x6,
811                         op_MAPI_GetProps                        = 0x7,
812                         op_MAPI_GetPropsAll                     = 0x8,
813                         op_MAPI_GetPropList                     = 0x9,
814                         op_MAPI_SetProps                        = 0xa,
815                         op_MAPI_DeleteProps                     = 0xb,
816                         op_MAPI_SaveChangesMessage              = 0xc,
817                         op_MAPI_RemoveAllRecipients             = 0xd,
818                         op_MAPI_ModifyRecipients                = 0xe,
819                         op_MAPI_ReadRecipients                  = 0xf,
820                         op_MAPI_ReloadCachedInformation         = 0x10,
821                         op_MAPI_SetMessageReadFlag              = 0x11,
822                         op_MAPI_SetColumns                      = 0x12,
823                         op_MAPI_SortTable                       = 0x13,
824                         op_MAPI_Restrict                        = 0x14,
825                         op_MAPI_QueryRows                       = 0x15,
826                         op_MAPI_GetStatus                       = 0x16,
827                         op_MAPI_QueryPosition                   = 0x17,
828                         op_MAPI_SeekRow                         = 0x18,
829                         op_MAPI_SeekRowBookmark                 = 0x19,
830                         op_MAPI_SeekRowApprox                   = 0x1a,
831                         op_MAPI_CreateBookmark                  = 0x1b,
832                         op_MAPI_CreateFolder                    = 0x1c,
833                         op_MAPI_DeleteFolder                    = 0x1d,
834                         op_MAPI_DeleteMessages                  = 0x1e,
835                         op_MAPI_GetMessageStatus                = 0x1f,
836                         op_MAPI_SetMessageStatus                = 0x20,
837                         op_MAPI_GetAttachmentTable              = 0x21,
838                         op_MAPI_OpenAttach                      = 0x22,
839                         op_MAPI_CreateAttach                    = 0x23,
840                         op_MAPI_DeleteAttach                    = 0x24,
841                         op_MAPI_SaveChangesAttachment           = 0x25,
842                         op_MAPI_SetReceiveFolder                = 0x26,
843                         op_MAPI_GetReceiveFolder                = 0x27,
844                         op_MAPI_RegisterNotification            = 0x29,
845                         op_MAPI_Notify                          = 0x2a,
846                         op_MAPI_OpenStream                      = 0x2b,
847                         op_MAPI_ReadStream                      = 0x2c,
848                         op_MAPI_WriteStream                     = 0x2d,
849                         op_MAPI_SeekStream                      = 0x2e,
850                         op_MAPI_SetStreamSize                   = 0x2f,
851                         op_MAPI_SetSearchCriteria               = 0x30,
852                         op_MAPI_GetSearchCriteria               = 0x31,
853                         op_MAPI_SubmitMessage                   = 0x32,
854                         op_MAPI_MoveCopyMessages                = 0x33,
855                         op_MAPI_AbortSubmit                     = 0x34,
856                         op_MAPI_MoveFolder                      = 0x35,
857                         op_MAPI_CopyFolder                      = 0x36,
858                         op_MAPI_QueryColumnsAll                 = 0x37,
859                         op_MAPI_Abort                           = 0x38,
860                         op_MAPI_CopyTo                          = 0x39,
861                         op_MAPI_CopyToStream                    = 0x3a,
862                         op_MAPI_CloneStream                     = 0x3b,
863                         op_MAPI_GetPermissionsTable             = 0x3e,
864                         op_MAPI_GetRulesTable                   = 0x3f,
865                         op_MAPI_ModifyPermissions               = 0x40,
866                         op_MAPI_ModifyRules                     = 0x41,
867                         op_MAPI_GetOwningServers                = 0x42,
868                         op_MAPI_LongTermIdFromId                = 0x43,
869                         op_MAPI_IdFromLongTermId                = 0x44,
870                         op_MAPI_PublicFolderIsGhosted           = 0x45,
871                         op_MAPI_OpenEmbeddedMessage             = 0x46,
872                         op_MAPI_SetSpooler                      = 0x47,
873                         op_MAPI_SpoolerLockMessage              = 0x48,
874                         op_MAPI_AddressTypes                    = 0x49,
875                         op_MAPI_TransportSend                   = 0x4a,
876                         op_MAPI_FastTransferSourceCopyMessages  = 0x4b,
877                         op_MAPI_FastTransferSourceCopyFolder    = 0x4c,
878                         op_MAPI_FastTransferSourceCopyTo        = 0x4d,
879                         op_MAPI_FastTransferSourceGetBuffer     = 0x4e,
880                         op_MAPI_FindRow                         = 0x4f,
881                         op_MAPI_Progress                        = 0x50,
882                         op_MAPI_TransportNewMail                = 0x51,
883                         op_MAPI_GetValidAttachments             = 0x52,
884                         op_MAPI_FastTransferDestConfigure       = 0x53,
885                         op_MAPI_FastTransferDestPutBuffer       = 0x54,
886                         op_MAPI_GetNamesFromIDs                 = 0x55,
887                         op_MAPI_GetIDsFromNames                 = 0x56,
888                         op_MAPI_UpdateDeferredActionMessages    = 0x57,
889                         op_MAPI_EmptyFolder                     = 0x58,
890                         op_MAPI_ExpandRow                       = 0x59,
891                         op_MAPI_CollapseRow                     = 0x5a,
892                         op_MAPI_LockRegionStream                = 0x5b,
893                         op_MAPI_UnlockRegionStream              = 0x5c,
894                         op_MAPI_CommitStream                    = 0x5d,
895                         op_MAPI_GetStreamSize                   = 0x5e,
896                         op_MAPI_QueryNamedProperties            = 0x5f,
897                         op_MAPI_GetPerUserLongTermIds           = 0x60,
898                         op_MAPI_GetPerUserGuid                  = 0x61,
899                         op_MAPI_ReadPerUserInformation          = 0x63,
900                         op_MAPI_WritePerUserInformation         = 0x64,
901                         op_MAPI_SetReadFlags                    = 0x66,
902                         op_MAPI_CopyProperties                  = 0x67,
903                         op_MAPI_GetReceiveFolderTable           = 0x68,
904                         op_MAPI_FastTransferSourceCopyProps     = 0x69,
905                         op_MAPI_GetCollapseState                = 0x6b,
906                         op_MAPI_SetCollapseState                = 0x6c,
907                         op_MAPI_GetTransportFolder              = 0x6d,
908                         op_MAPI_Pending                         = 0x6e,
909                         op_MAPI_OptionsData                     = 0x6f,
910                         op_MAPI_SyncConfigure                   = 0x70,
911                         op_MAPI_SyncImportMessageChange         = 0x72,
912                         op_MAPI_SyncImportHierarchyChange       = 0x73,
913                         op_MAPI_SyncImportDeletes               = 0x74,
914                         op_MAPI_SyncUploadStateStreamBegin      = 0x75,
915                         op_MAPI_SyncUploadStateStreamContinue   = 0x76,
916                         op_MAPI_SyncUploadStateStreamEnd        = 0x77,
917                         op_MAPI_SyncImportMessageMove           = 0x78,
918                         op_MAPI_SetPropertiesNoReplicate        = 0x79,
919                         op_MAPI_DeletePropertiesNoReplicate     = 0x7a,
920                         op_MAPI_GetStoreState                   = 0x7b,
921                         op_MAPI_SyncOpenCollector               = 0x7e,
922                         op_MAPI_GetLocalReplicaIds              = 0x7f,
923                         op_MAPI_SyncImportReadStateChanges      = 0x80,
924                         op_MAPI_ResetTable                      = 0x81,
925                         op_MAPI_SyncGetTransferState            = 0x82,
926                         op_MAPI_SyncOpenAdvisor                 = 0x83,
927                         op_MAPI_TellVersion                     = 0x86,
928                         op_MAPI_OpenPublicFolderByName          = 0x87,
929                         op_MAPI_SetSyncNotificationGuid         = 0x88,
930                         op_MAPI_FreeBookmark                    = 0x89,
931                         op_MAPI_WriteAndCommitStream            = 0x90,
932                         op_MAPI_HardDeleteMessages              = 0x91,
933                         op_MAPI_HardDeleteMessagesAndSubfolders = 0x92,
934                         op_MAPI_SetLocalReplicaMidsetDeleted    = 0x93,
935                         op_MAPI_Backoff                         = 0xf9,
936                         op_MAPI_Logon                           = 0xfe,
937                         op_MAPI_BufferTooSmall                  = 0xff,
938                         /****** custom MAPI opnum for mapiproxy ******/
939                         op_MAPI_proxypack                       = 0xa5
940                 } MAPI_OPNUM;
941
942
943         typedef [public,noprint,flag(NDR_NOALIGN)] struct {
944                 uint16                          cb;
945                 [flag(NDR_BUFFERS)]uint8        lpb[cb];
946         } SBinary_short;
947
948         typedef [public] struct {
949                 uint32 cValues;
950                 uint32 lpl[cValues]; 
951         } mapi_MV_LONG_STRUCT;
952
953         typedef struct {
954                 raw8string lppszA;
955         } mapi_LPSTR;
956
957         typedef [public] struct {
958                 uint32 cValues;
959                 mapi_LPSTR strings[cValues]; 
960         } mapi_SLPSTRArray;
961
962         typedef [public] struct {
963                 [flag(STR_NULLTERM)] string lppszW;
964         } mapi_LPWSTR;
965
966         typedef [public] struct {
967                 uint32 cValues;
968                 mapi_LPWSTR strings[cValues];
969         } mapi_SLPSTRArrayW;
970         
971         typedef [public] struct {
972                 uint32          cValues;
973                 SBinary_short   bin[cValues];
974         } mapi_SBinaryArray;
975
976         typedef [public] struct {
977                 uint32          cValues;
978                 GUID            lpguid[cValues];
979         } mapi_SGuidArray;
980
981         /******* part of the no-pointer deep recursion hack *******/
982         typedef [nopull,nopush,noprint,flag(NDR_NOALIGN)] struct {
983                 uint8 wrap[0x8000];
984         } mapi_SRestriction_wrap;
985
986         typedef [nopush,nopull,noprint,flag(NDR_NOALIGN)] struct {
987                 uint8   wrap[0x8000];
988         } mapi_SPropValue_wrap;
989
990         typedef [nopush,nopull,noprint,flag(NDR_NOALIGN)] struct {
991                 uint8   wrap[0x8000];
992         } mapi_SPropValue_array_wrap;
993         /**********************************************************/    
994
995         typedef [enum8bit] enum {
996                 ActionType_OP_MOVE              = 0x1,
997                 ActionType_OP_COPY              = 0x2,
998                 ActionType_OP_REPLY             = 0x3,
999                 ActionType_OP_OOF_REPLY         = 0x4,
1000                 ActionType_OP_DEFER_ACTION      = 0x5,
1001                 ActionType_OP_BOUNCE            = 0x6,
1002                 ActionType_OP_FORWARD           = 0x7,
1003                 ActionType_OP_DELEGATE          = 0x8,
1004                 ActionType_OP_TAG               = 0x9,
1005                 ActionType_OP_DELETE            = 0xA,
1006                 ActionType_OP_MARK_AS_READ      = 0xB
1007         } ActionType;
1008
1009         typedef [flag(NDR_NOALIGN)] struct {
1010                 boolean8                FolderInThisStore;
1011                 SBinary_short           StoreEID;
1012                 SBinary_short           FolderEID;
1013         } MoveCopy_Action;
1014
1015         typedef [flag(NDR_NOALIGN)] struct {
1016                 hyper                   ReplyTemplateFID;
1017                 hyper                   ReplyTemplateMID;
1018                 GUID                    ReplyTemplateGUID;                      
1019         } ReplyOOF_Action;
1020
1021         typedef [flag(NDR_NOALIGN)] struct {
1022                 uint8                           Reserved;
1023                 mapi_SPropValue_array_wrap      PropertyValue;
1024         } RecipientBlock;
1025
1026         typedef [flag(NDR_NOALIGN)] enum {
1027                 BOUNCE_MESSAGE_TOO_LARGE        = 0x0000000d,
1028                 BOUNCE_MESSAGE_NOT_DISPLAYED    = 0x0000001f,
1029                 BOUNCE_MESSAGE_DENIED           = 0x00000026
1030         } BounceCode;
1031
1032         typedef [flag(NDR_NOALIGN)] struct {
1033                 uint16                  RecipientCount;
1034                 RecipientBlock          RecipientBlock[RecipientCount];
1035         } ForwardDelegate_Action;
1036
1037         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1038                 [case(ActionType_OP_MOVE)]              MoveCopy_Action                 MoveAction;
1039                 [case(ActionType_OP_COPY)]              MoveCopy_Action                 CopyAction;
1040                 [case(ActionType_OP_REPLY)]             ReplyOOF_Action                 ReplyAction;
1041                 [case(ActionType_OP_OOF_REPLY)]         ReplyOOF_Action                 ReplyOOFAction;
1042                 [case(ActionType_OP_DEFER_ACTION)][flag(NDR_REMAINING)] DATA_BLOB       DeferAction;
1043                 [case(ActionType_OP_BOUNCE)]            BounceCode                      BounceCode;
1044                 [case(ActionType_OP_TAG)]               mapi_SPropValue_wrap            PropValue;
1045                 [case(ActionType_OP_FORWARD)]           ForwardDelegate_Action          ForwardAction;
1046                 [case(ActionType_OP_DELEGATE)]          ForwardDelegate_Action          DelegateAction;
1047                 [case(ActionType_OP_DELETE)];
1048                 [case(ActionType_OP_MARK_AS_READ)];
1049         } ActionData;
1050
1051         typedef [flag(NDR_NOALIGN)] struct {
1052                 ActionType                              ActionType;
1053                 uint32                                  ActionFlavor;
1054                 uint32                                  ActionFlags;
1055                 [switch_is(ActionType)] ActionData      ActionDataBuffer;
1056         } ActionBlockData;
1057
1058         typedef [flag(NDR_NOALIGN)] struct {
1059                 uint16                                  ActionLength;
1060                 [subcontext(0),subcontext_size(ActionLength),flag(NDR_REMAINING)] ActionBlockData ActionBlockData;
1061         } ActionBlock;
1062
1063         typedef [flag(NDR_NOALIGN)] struct {
1064                 uint16          count;
1065                 ActionBlock     ActionBlock[count];
1066         } RuleAction;
1067
1068         typedef [public,nodiscriminant,flag(NDR_NOALIGN)] union {
1069                 [case(PT_NULL)];
1070                 [case(PT_I2)]           uint16                  i;
1071                 [case(PT_LONG)]         uint32                  l;
1072                 [case(PT_DOUBLE)]       double                  dbl;
1073                 [case(PT_ERROR)]        uint32                  err;
1074                 [case(PT_BOOLEAN)]      uint8                   b;
1075                 [case(PT_I8)]           dlong                   d;
1076                 [case(PT_STRING8)]      raw8string              lpszA;
1077                 [case(PT_UNICODE)][flag(STR_NULLTERM)] string   lpszW;
1078                 [case(PT_SYSTIME)]      FILETIME                ft;
1079                 [case(PT_CLSID)]        GUID                    lpguid;
1080                 [case(PT_SRESTRICT)]    mapi_SRestriction_wrap  Restrictions;
1081                 [case(PT_ACTIONS)]      RuleAction              RuleAction;
1082                 [case(PT_BINARY)]       SBinary_short           bin;
1083                 [case(PT_SVREID)]       SBinary_short           bin;
1084                 [case(PT_MV_LONG)]      mapi_MV_LONG_STRUCT     MVl;    
1085                 [case(PT_MV_STRING8)]   mapi_SLPSTRArray        MVszA;
1086                 [case(PT_MV_UNICODE)]   mapi_SLPSTRArrayW       MVszW;
1087                 [case(PT_MV_CLSID)]     mapi_SGuidArray         MVguid;
1088                 [case(PT_MV_BINARY)]    mapi_SBinaryArray       MVbin;
1089         } mapi_SPropValue_CTR;
1090
1091         typedef [public,flag(NDR_NOALIGN)] struct {
1092                 MAPITAGS ulPropTag;
1093                 [switch_is(ulPropTag & 0xFFFF)] mapi_SPropValue_CTR value; 
1094         } mapi_SPropValue;
1095
1096         typedef [public,flag(NDR_NOALIGN)] struct {
1097                 uint16                                  cValues;
1098                 [flag(NDR_REMAINING)]mapi_SPropValue    lpProps[cValues];
1099         } mapi_SPropValue_array;
1100
1101         typedef [flag(NDR_NOALIGN)] struct {
1102                 uint16                                  cValues;
1103                 MAPITAGS                                aulPropTag[cValues];
1104         } mapi_SPropTagArray;
1105
1106         typedef [enum8bit, flag(NDR_PAHEX)] enum {
1107                 ROW_ADD         =       0x1,
1108                 ROW_MODIFY      =       0x2,
1109                 ROW_REMOVE      =       0x4
1110         } ulRowFlags;
1111
1112         /**************************/
1113         /* EcDoRpc Function 0x1   */
1114         typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
1115         } Release_req;
1116
1117         typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
1118         } Release_repl;
1119
1120         /**************************/
1121         /* EcDoRpc Function 0x2   */
1122         typedef [enum8bit] enum {
1123                 OpenModeFlags_Folder            = 0x0,
1124                 OpenModeFlags_SoftDeleted       = 0x4
1125         } OpenFolder_OpenModeFlags;
1126
1127         typedef [flag(NDR_NOALIGN)] struct {
1128                 uint8                           handle_idx;
1129                 hyper                           folder_id;
1130                 OpenFolder_OpenModeFlags        OpenModeFlags;
1131         } OpenFolder_req;
1132
1133         typedef [flag(NDR_NOALIGN)] struct {
1134                 uint16          ServerCount;
1135                 uint16          CheapServerCount;
1136                 astring         Servers[ServerCount];
1137         } OpenFolder_Replicas;
1138
1139         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1140                 [case(0x0)];
1141                 [case(0x1)] OpenFolder_Replicas Replicas;
1142         } IsGhosted;
1143
1144         typedef [flag(NDR_NOALIGN)] struct {
1145                 boolean8                                HasRules;
1146                 boolean8                                IsGhosted;
1147                 [switch_is(IsGhosted)] IsGhosted        Ghost;
1148         } OpenFolder_repl;
1149         
1150         /**************************/
1151         /* EcDoRpc Function 0x3   */
1152         typedef [enum8bit] enum {
1153                 StringType_NONE                 = 0x0,
1154                 StringType_EMPTY                = 0x1,
1155                 StringType_STRING8              = 0x2,
1156                 StringType_UNICODE_REDUCED      = 0x3,
1157                 StringType_UNICODE              = 0x4
1158         } StringType;
1159
1160         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1161                 [case(0x0)];
1162                 [case(0x1)];
1163                 [case(0x2)] raw8string                  lpszA;
1164                 [case(0x3)] raw8string                  lpszW_reduced;
1165                 [case(0x4)] [flag(STR_NULLTERM)] string lpszW;
1166         } String;
1167
1168         typedef [flag(NDR_NOALIGN)] struct {
1169                 StringType                      StringType;
1170                 [switch_is(StringType)] String  String;
1171         } TypedString;
1172
1173         typedef [enum8bit] enum {
1174                 ReadOnly        = 0x0,
1175                 ReadWrite       = 0x1,
1176                 BestAccess      = 0x3,
1177                 OpenSoftDelete  = 0x4
1178         } OpenMessage_OpenModeFlags;
1179
1180         typedef [flag(NDR_NOALIGN)] struct {
1181                 uint8                           handle_idx;
1182                 uint16                          CodePageId;
1183                 hyper                           FolderId;
1184                 OpenMessage_OpenModeFlags       OpenModeFlags;
1185                 hyper                           MessageId;
1186         } OpenMessage_req;
1187
1188         typedef [enum16bit, flag(NDR_PAHEX)] enum {
1189                 CP_USASCII      = 0x04E4,
1190                 CP_UNICODE      = 0x04B0,
1191                 CP_JAUTODETECT  = 0xC6F4,
1192                 CP_KAUTODETECT  = 0xC705,
1193                 CP_ISO2022JPESC = 0xC42D,
1194                 CP_ISO2022JPSIO = 0xC42E
1195         } CODEPAGEID;
1196
1197         typedef [enum8bit, flag(NDR_PAHEX)] enum {
1198                 MAPI_ORIG               = 0x0,
1199                 MAPI_TO                 = 0x1,
1200                 MAPI_CC                 = 0x2,
1201                 MAPI_BCC                = 0x3
1202         } ulRecipClass;
1203
1204         typedef [enum8bit, flag(NDR_PAHEX)] enum {
1205                 SINGLE_RECIPIENT        = 0x0,
1206                 DISTRIBUTION_LIST       = 0x1
1207         } addr_type;
1208
1209         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1210                 [case(0x1)] uint8       prefix_size;
1211                 [default];
1212         } recipient_AddressPrefixUsed;
1213
1214         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1215                 [case(0x1)] addr_type   display_type;
1216                 [default];
1217         } recipient_DisplayType;
1218
1219         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1220                 [case(0x1)] astring     recipient_x500name;
1221                 [default];
1222         } recipient_X500DN;
1223
1224         /* We're covering the PersonalDistributionList1 (0x0006) and PersonalDistributionList2
1225            (0x0007) variations here, since we mask off the low bit in the switch. */
1226         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1227                 [case(0x6)] SBinary_short                       entryid;
1228                 [default];
1229         } recipient_EntryId;
1230
1231         /* We're covering the PersonalDistributionList1 (0x0006) and PersonalDistributionList2
1232            (0x0007) variations here, since we mask off the low bit in the switch. */
1233         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1234                 [case(0x6)] SBinary_short                       searchkey;
1235                 [default];
1236         } recipient_SearchKey;
1237
1238         /* Present if the Type field is set to NoType (0x0) and the O flag (0x8000) is set */
1239         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1240                 [case(0x8000)] astring                          lpszA;
1241                 [default];
1242         } recipient_AddressType;
1243
1244         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1245                 [case(0x400)] raw8string                        lpszA;
1246                 [case(0x600)][flag(STR_NULLTERM)] string        lpszW;
1247                 [default];
1248         } recipient_SimpleDisplayName;
1249
1250         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1251                 [case(0x20)] raw8string                         lpszA;
1252                 [case(0x220)][flag(STR_NULLTERM)] string        lpszW;
1253                 [default];
1254         } recipient_TransmittableDisplayName;
1255
1256         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1257                 [case(0x10)] raw8string                         lpszA;
1258                 [case(0x210)][flag(STR_NULLTERM)] string        lpszW;
1259                 [default];
1260         } recipient_DisplayName;
1261
1262         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1263                 [case(0x8)] astring                             lpszA;
1264                 [case(0x208)][flag(STR_NULLTERM)] string        lpszW;
1265                 [default];
1266         } recipient_EmailAddress;
1267
1268         typedef [flag(NDR_NOALIGN)] struct {
1269                 uint16                                                                  RecipientFlags;
1270                 [switch_is(RecipientFlags & 0x0007)] recipient_AddressPrefixUsed        AddressPrefixUsed;
1271                 [switch_is(RecipientFlags & 0x0007)] recipient_DisplayType              DisplayType;
1272                 [switch_is(RecipientFlags & 0x0007)] recipient_X500DN                   X500DN;
1273                 [switch_is(RecipientFlags & 0x0006)] recipient_EntryId                  EntryId;
1274                 [switch_is(RecipientFlags & 0x0006)] recipient_SearchKey                SearchKey;
1275                 [switch_is(RecipientFlags & 0x8007)] recipient_AddressType              AddressType;
1276                 [switch_is(RecipientFlags & 0x0208)] recipient_EmailAddress             EmailAddress;
1277                 [switch_is(RecipientFlags & 0x0210)] recipient_DisplayName              DisplayName;
1278                 [switch_is(RecipientFlags & 0x0600)] recipient_SimpleDisplayName        SimpleDisplayName;
1279                 [switch_is(RecipientFlags & 0x0220)] recipient_TransmittableDisplayName TransmittableDisplayName;
1280                 uint16                                                                  prop_count;
1281 // TODO: figure out if "layout" can go
1282                 uint8                                                                   layout;
1283 // TODO: convert this to a proper structure - see if we already have one.
1284                 [flag(NDR_REMAINING)] DATA_BLOB                                         prop_values;
1285         } RecipientRow;
1286
1287         typedef [flag(NDR_NOALIGN)] struct {
1288                 boolean8                HasNamedProperties;
1289                 TypedString             SubjectPrefix;
1290                 TypedString             NormalizedSubject;
1291                 uint16                  RecipientCount;
1292                 mapi_SPropTagArray      RecipientColumns;
1293                 uint8                   RowCount;
1294                 OpenRecipientRow        RecipientRows[RowCount];
1295         } OpenMessage_repl;
1296
1297         /**************************/
1298         /* EcDoRpc Function 0x4   */
1299         typedef [bitmap8bit] bitmap {
1300                 TableFlags_Associated                   = 0x2, /* only for GetContentsTable */
1301                 TableFlags_Depth                        = 0x4, /* only for GetHierarchyTable */
1302                 TableFlags_DeferredErrors               = 0x8,
1303                 TableFlags_NoNotifications              = 0x10,
1304                 TableFlags_SoftDeletes                  = 0x20,
1305                 TableFlags_UseUnicode                   = 0x40,
1306                 TableFlags_SuppressNotifications        = 0x80
1307         } TableFlags;
1308
1309         typedef [flag(NDR_NOALIGN)] struct {
1310                 uint8           handle_idx;
1311                 TableFlags      TableFlags;
1312         } GetHierarchyTable_req;
1313
1314         typedef [flag(NDR_NOALIGN)] struct {
1315                 uint32          RowCount;
1316         } GetHierarchyTable_repl;
1317
1318         /**************************/
1319         /* EcDoRpc Function 0x5   */
1320         typedef [flag(NDR_NOALIGN)] struct {
1321                 uint8           handle_idx;
1322                 TableFlags      TableFlags;
1323         } GetContentsTable_req;
1324
1325         typedef [flag(NDR_NOALIGN)] struct {
1326                 uint32          RowCount;
1327         } GetContentsTable_repl;
1328
1329         /**************************/
1330         /* EcDoRpc Function 0x6   */
1331         typedef [flag(NDR_NOALIGN)] struct {
1332                 uint8           handle_idx;
1333                 uint16          CodePageId;
1334                 hyper           FolderId;
1335                 boolean8        AssociatedFlag;
1336         } CreateMessage_req;
1337
1338         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1339                 [case(0x0)];
1340                 [case(0x1)] hyper       MessageId;
1341         } CreateMessage_MessageId;
1342
1343         typedef [flag(NDR_NOALIGN)] struct {
1344                 boolean8                                                HasMessageId;
1345                 [switch_is(HasMessageId)] CreateMessage_MessageId       MessageId;
1346         } CreateMessage_repl;
1347
1348         /*************************/
1349         /* EcDoRpc Function 0x7  */
1350         typedef [flag(NDR_NOALIGN)] struct {
1351                 uint16          PropertySizeLimit;
1352                 uint16          WantUnicode;
1353                 uint16          prop_count;
1354                 MAPITAGS        properties[prop_count];
1355         } GetProps_req;
1356
1357         typedef [flag(NDR_NOALIGN)] struct {
1358                 uint8           layout;
1359                 [flag(NDR_REMAINING)] DATA_BLOB prop_data;
1360         } GetProps_repl;
1361
1362         /*************************/
1363         /* EcDoRpc Function 0x8  */
1364         typedef [flag(NDR_NOALIGN)] struct {
1365                 uint16          PropertySizeLimit;
1366                 uint16          WantUnicode;
1367         } GetPropsAll_req;
1368
1369         typedef [flag(NDR_NOALIGN)] struct {
1370                 mapi_SPropValue_array   properties;
1371         } GetPropsAll_repl;
1372
1373         /*************************/
1374         /* EcDoRpc Function 0x9  */
1375         typedef [flag(NDR_NOALIGN)] struct {
1376         } GetPropList_req;
1377
1378         typedef [flag(NDR_NOALIGN)] struct {
1379                 uint16          count;
1380                 MAPITAGS        tags[count];
1381         } GetPropList_repl;
1382
1383         /*************************/
1384         /* EcDoRpc Function 0xa  */
1385         typedef [flag(NDR_NOALIGN)] struct {
1386                 uint32          index;          /* index into array of property tags */
1387                 MAPITAGS        property_tag;   /* property for which there was an error */
1388                 MAPISTATUS      error_code;     /* the error that occurred for this property */
1389         } PropertyProblem;
1390
1391         typedef [flag(NDR_NOALIGN)] struct {
1392                 [subcontext(2)] mapi_SPropValue_array values;
1393         } SetProps_req;
1394
1395         typedef [flag(NDR_NOALIGN)] struct {
1396                 uint16          PropertyProblemCount;
1397                 PropertyProblem PropertyProblem[PropertyProblemCount];          
1398         } SetProps_repl;
1399
1400         /*************************/
1401         /* EcDoRpc Function 0xb  */
1402         typedef [flag(NDR_NOALIGN)] struct {
1403                 uint16          count;
1404                 MAPITAGS        tags[count];
1405         } DeleteProps_req;
1406
1407         typedef [flag(NDR_NOALIGN)] struct {
1408                 uint16          PropertyProblemCount;
1409                 PropertyProblem PropertyProblem[PropertyProblemCount];
1410         } DeleteProps_repl;
1411
1412         /*************************/
1413         /* EcDoRpc Function 0xc  */
1414         typedef [enum8bit] enum {
1415                 KeepOpenReadOnly        = 0x9,
1416                 KeepOpenReadWrite       = 0xA,
1417                 ForceSave               = 0xC
1418         } SaveFlags;
1419
1420         typedef [flag(NDR_NOALIGN)] struct {
1421                 uint8           handle_idx;
1422                 uint8           SaveFlags;
1423         } SaveChangesMessage_req;
1424
1425         typedef [flag(NDR_NOALIGN)] struct {
1426                 uint8           handle_idx;
1427                 hyper           MessageId;
1428         } SaveChangesMessage_repl;
1429
1430         /*************************/
1431         /* EcDoRpc Function 0xd  */
1432         typedef [flag(NDR_NOALIGN)] struct {
1433                 uint32          ulReserved;
1434         } RemoveAllRecipients_req;
1435
1436         typedef [flag(NDR_NOALIGN)] struct {
1437
1438         } RemoveAllRecipients_repl;
1439
1440         /*************************/
1441         /* EcDoRpc Function 0xe  */
1442
1443         /* 
1444          * MODRECIP_NULL and INVALID are not part of the msdn flags
1445          * but are added for printing support 
1446          */
1447         typedef [enum8bit,flag(NDR_PAHEX)] enum {
1448                 MODRECIP_NULL           = 0x0,
1449                 MODRECIP_INVALID        = 0x1,
1450                 MODRECIP_ADD            = 0x2,
1451                 MODRECIP_MODIFY         = 0x4,
1452                 MODRECIP_REMOVE         = 0x8
1453         } modrecip;
1454
1455         typedef [flag(NDR_NOALIGN)]struct {
1456                 uint32          idx;
1457                 ulRecipClass    RecipClass;             
1458                 [subcontext(2),flag(NDR_REMAINING)] RecipientRow RecipientRow;
1459         } ModifyRecipientRow;
1460
1461         typedef [flag(NDR_NOALIGN)] struct {
1462                 uint16                          prop_count;
1463                 MAPITAGS                        properties[prop_count];
1464                 uint16                          cValues;
1465                 ModifyRecipientRow              RecipientRow[cValues];
1466         } ModifyRecipients_req;
1467
1468         typedef [flag(NDR_NOALIGN)] struct {
1469
1470         } ModifyRecipients_repl;
1471
1472         /*************************/
1473         /* EcDoRpc Function 0xf  */
1474         typedef [flag(NDR_NOALIGN)] struct {
1475                 uint32          RowId;
1476                 uint16          ulReserved;
1477         } ReadRecipients_req;
1478
1479         typedef [flag(NDR_NOALIGN)] struct {
1480                 uint32                          RowId;
1481                 ulRecipClass                    RecipClass;
1482                 CODEPAGEID                      CodePageId;
1483                 uint16                          ulReserved;
1484                 [subcontext(2)] RecipientRow    RecipientRow;
1485         } ReadRecipientRow;
1486
1487         typedef [flag(NDR_NOALIGN)] struct {
1488                 uint8                   RowCount;
1489                 ReadRecipientRow        RecipientRows[RowCount];
1490         } ReadRecipients_repl;
1491
1492         /*************************/
1493         /* EcDoRpc Function 0x10 */
1494         typedef [public,flag(NDR_NOALIGN)] struct {
1495                 ulRecipClass            RecipientType;
1496                 CODEPAGEID              CodePageId;
1497                 uint16                  Reserved;
1498                 [subcontext(2)]RecipientRow             RecipientRow;
1499         } OpenRecipientRow;
1500
1501         typedef [flag(NDR_NOALIGN)] struct {
1502                 uint16          Reserved;
1503         } ReloadCachedInformation_req;
1504
1505         typedef [flag(NDR_NOALIGN)] struct {
1506                 boolean8                HasNamedProperties;
1507                 TypedString             SubjectPrefix;
1508                 TypedString             NormalizedSubject;
1509                 uint16                  RecipientCount;
1510                 mapi_SPropTagArray      RecipientColumns;
1511                 uint8                   RowCount;
1512                 OpenRecipientRow        RecipientRows[RowCount];
1513         } ReloadCachedInformation_repl;
1514
1515         /*************************/
1516         /* EcDoRpc Function 0x11 */
1517
1518         typedef [bitmap8bit] bitmap {
1519                 SUPPRESS_RECEIPT        = 0x01,
1520                 CLEAR_READ_FLAG         = 0x04,
1521                 GENERATE_RECEIPT_ONLY   = 0x10,
1522                 CLEAR_RN_PENDING        = 0x20,
1523                 CLEAR_NRN_PENDING       = 0x40
1524         } MSGFLAG_READ;
1525
1526         /* TODO: there is a variation that can provide "client data"
1527            here clientdata is a uint8 ClientData[24], but its
1528            existence within the request depends on flags associated to
1529            logon_id: it the private flag set or not
1530          */
1531         typedef [flag(NDR_NOALIGN)] struct {
1532                 uint8                           handle_idx;
1533                 MSGFLAG_READ                    flags;
1534                 /* TEMP HACK for editing notes without crashing Outlook:
1535                    [flag(NDR_REMAINING)] DATA_BLOB      clientdata; */
1536         } SetMessageReadFlag_req;
1537
1538         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1539                 [case(0x0)];
1540                 [case(0x1)] uint8       LogonId;
1541         } SetMessageReadFlag_LogonId;
1542
1543         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1544                 [case(0x0)];
1545                 [case(0x1)] uint8       ClientData[24];
1546         } SetMessageReadFlag_ClientData;
1547
1548         typedef [flag(NDR_NOALIGN)] struct {
1549                 boolean8                                                        ReadStatusChanged;
1550                 [switch_is(ReadStatusChanged)] SetMessageReadFlag_LogonId       LogonId;
1551                 /* TEMP HACK for editing notes without crashing Outlook:
1552                    [switch_is(ReadStatusChanged)]
1553                    SetMessageReadFlag_ClientData        ClientData; */
1554         } SetMessageReadFlag_repl;
1555
1556         /*************************/
1557         /* EcDoRpc Function 0x12 */
1558         typedef [enum8bit] enum {
1559                 SetColumns_TBL_SYNC     = 0x0,
1560                 SetColumns_TBL_ASYNC    = 0x1
1561         } SetColumnsFlags;
1562         
1563         typedef [enum8bit] enum {
1564                 TBLSTAT_COMPLETE        = 0x0,
1565                 TBLSTAT_SORTING         = 0x9,
1566                 TBLSTAT_SORT_ERROR      = 0xA,
1567                 TBLSTAT_SETTING_COLS    = 0xB,
1568                 TBLSTAT_SETCOL_ERROR    = 0xD,
1569                 TBLSTAT_RESTRICTING     = 0xE,
1570                 TBLSTAT_RESTRICT_ERROR  = 0xF
1571         } TableStatus;
1572
1573         typedef [flag(NDR_NOALIGN)] struct {
1574                 SetColumnsFlags SetColumnsFlags;
1575                 uint16          prop_count;
1576                 MAPITAGS        properties[prop_count];
1577         } SetColumns_req;
1578
1579         typedef [flag(NDR_NOALIGN)] struct {
1580                 TableStatus     TableStatus;
1581         } SetColumns_repl;
1582
1583         /**************************/
1584         /* EcDoRpc Function 0x13  */
1585         typedef [enum8bit, flag(NDR_PAHEX)] enum {
1586                 TBL_ASYNC = 0x1,
1587                 TBL_BATCH = 0x2
1588         } TBL_FLAGS;
1589         
1590         typedef [enum8bit, flag(NDR_PAHEX)] enum {
1591                 TABLE_SORT_ASCEND = 0x0,
1592                 TABLE_SORT_DESCEND = 0x1,
1593                 TABLE_SORT_MAXIMUM_CATEGORY = 0x4
1594                 /* old values :
1595                 TABLE_SORT_COMBINE = 0x1,
1596                 TABLE_SORT_DESCEND = 0x2
1597                 */
1598         } TABLE_SORT;
1599
1600         typedef [public, flag(NDR_NOALIGN)] struct _SSortOrder{
1601                 MAPITAGS ulPropTag;
1602                 TABLE_SORT ulOrder;
1603         } SSortOrder;
1604
1605         typedef [public, flag(NDR_NOALIGN)] struct _SSortOrderSet {
1606                 uint16          cSorts;
1607                 uint16          cCategories;
1608                 uint16          cExpanded;
1609                 SSortOrder      aSort[cSorts];
1610         } SSortOrderSet;
1611
1612         typedef [flag(NDR_NOALIGN)] struct {
1613                 uint8           SortTableFlags;
1614                 SSortOrderSet   lpSortCriteria;
1615         } SortTable_req;
1616
1617         typedef [flag(NDR_NOALIGN)] struct {
1618                 TableStatus     TableStatus;
1619         } SortTable_repl;
1620
1621         /**************************/
1622         /* EcDoRpc Function 0x14  */
1623         typedef [flag(NDR_NOALIGN)] struct {
1624                 uint16                  cRes;
1625                 mapi_SRestriction_and   res[cRes];
1626         } mapi_SAndRestriction;
1627
1628         typedef [flag(NDR_NOALIGN)] struct {
1629                 uint16  cRes;
1630                 mapi_SRestriction_or    res[cRes];
1631         } mapi_SOrRestriction;
1632
1633         typedef [flag(NDR_NOALIGN)] struct {
1634                 mapi_SRestriction_wrap  res;
1635         } mapi_SNotRestriction;
1636
1637         typedef [noprint, bitmap32bit] bitmap {
1638                 FL_FULLSTRING           = 0x00000,
1639                 FL_SUBSTRING            = 0x00001,
1640                 FL_PREFIX               = 0x00002,
1641                 FL_IGNORECASE           = 0x10000,
1642                 FL_IGNORENONSPACE       = 0x20000,
1643                 FL_LOOSE                = 0x40000
1644         } fuzzyLevel;
1645
1646         typedef [flag(NDR_NOALIGN)] struct {
1647                 fuzzyLevel      fuzzy;
1648                 MAPITAGS        ulPropTag;
1649                 mapi_SPropValue lpProp;
1650         } mapi_SContentRestriction;
1651
1652         typedef [enum8bit, flag(NDR_PAHEX)] enum {
1653                 BMR_EQZ = 0x0,
1654                 BMR_NEZ = 0x1
1655         } relMBR;
1656
1657         typedef [flag(NDR_NOALIGN)] struct {
1658                 relMBR          relMBR;
1659                 MAPITAGS        ulPropTag;
1660                 uint32          ulMask;
1661         } mapi_SBitmaskRestriction;
1662
1663         typedef [enum8bit, flag(NDR_PAHEX)] enum {
1664                 RELOP_LT = 0x0,         /* <  */
1665                 RELOP_LE = 0x1,         /* <= */
1666                 RELOP_GT = 0x2,         /* >  */
1667                 RELOP_GE = 0x3,         /* >= */
1668                 RELOP_EQ = 0x4,         /* == */
1669                 RELOP_NE = 0x5,         /* != */
1670                 RELOP_RE = 0x6          /* LIKE (Regular expression) */
1671         } CompareRelop;
1672
1673         typedef [flag(NDR_NOALIGN)] struct {
1674                 CompareRelop    relop;
1675                 MAPITAGS        ulPropTag;
1676                 uint32          size;
1677         } mapi_SSizeRestriction;
1678
1679         typedef [flag(NDR_NOALIGN)] struct {
1680                 uint8           relop;
1681                 MAPITAGS        ulPropTag;
1682                 mapi_SPropValue lpProp;
1683         } mapi_SPropertyRestriction;
1684
1685         typedef [flag(NDR_NOALIGN)] struct {
1686                 CompareRelop    relop;
1687                 MAPITAGS        ulPropTag1;
1688                 MAPITAGS        ulPropTag2;
1689         } mapi_SCompareProps;
1690
1691         typedef [flag(NDR_NOALIGN)] struct {
1692                 MAPITAGS        ulPropTag;
1693         } mapi_SExistRestriction;
1694
1695         typedef [flag(NDR_NOALIGN)] struct {
1696                 MAPITAGS                ulSubObject;
1697                 mapi_SRestriction_sub   res[ulSubObject - ulSubObject + 1]; /* nasty hack - generates fake pointer */
1698         } mapi_SSubRestriction;
1699
1700         typedef [nopush,nopull,noprint,nodiscriminant] union {
1701                 [case(0x0)];
1702                 [case(0x1)] mapi_SRestriction_comment *res;
1703         } RestrictionVariable;
1704
1705         typedef [flag(NDR_NOALIGN)] struct {
1706                 uint8                           TaggedValuesCount;
1707                 mapi_SPropValue                 TaggedValues[TaggedValuesCount];
1708                 boolean8                        RestrictionPresent;
1709                 [switch_is(RestrictionPresent)] RestrictionVariable Restriction;
1710         } mapi_SCommentRestriction;
1711
1712         typedef [public,nodiscriminant] union {
1713                 [case(RES_AND)]                 mapi_SAndRestriction            resAnd;
1714                 [case(RES_OR)]                  mapi_SOrRestriction             resOr;
1715                 [case(RES_NOT)]                 mapi_SNotRestriction            resNot;
1716                 [case(RES_CONTENT)]             mapi_SContentRestriction        resContent;
1717                 [case(RES_PROPERTY)]            mapi_SPropertyRestriction       resProperty;
1718                 [case(RES_COMPAREPROPS)]        mapi_SCompareProps              resCompareProps;
1719                 [case(RES_BITMASK)]             mapi_SBitmaskRestriction        resBitmask;
1720                 [case(RES_SIZE)]                mapi_SSizeRestriction           resSize;
1721                 [case(RES_EXIST)]               mapi_SExistRestriction          resExist;
1722                 [case(RES_SUBRESTRICTION)]      mapi_SSubRestriction            resSub;
1723                 [case(RES_COMMENT)]             mapi_SCommentRestriction        resComment;
1724                 [default];
1725         } mapi_SRestriction_CTR;
1726
1727         typedef [public,flag(NDR_NOALIGN)] struct {
1728                 uint8 rt;
1729                 [switch_is(rt)] mapi_SRestriction_CTR res;
1730         } mapi_SRestriction;
1731
1732         typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction {
1733                 uint8 rt;
1734                 [switch_is(rt)] mapi_SRestriction_CTR res;
1735         } mapi_SRestriction_and;
1736
1737         typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction {
1738                 uint8 rt;
1739                 [switch_is(rt)] mapi_SRestriction_CTR res;
1740         } mapi_SRestriction_or;
1741
1742         typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction {
1743                 uint8 rt;
1744                 [switch_is(rt)] mapi_SRestriction_CTR res;
1745         } mapi_SRestriction_sub;
1746
1747         typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction {
1748                 uint8 rt;
1749                 [switch_is(rt)] mapi_SRestriction_CTR res;
1750         } mapi_SRestriction_comment;
1751
1752         typedef [flag(NDR_NOALIGN)] struct {
1753                 uint8 handle_idx;
1754                 [subcontext(2)] mapi_SRestriction  restrictions;
1755         } Restrict_req;
1756
1757         typedef [flag(NDR_NOALIGN)] struct {
1758                 TableStatus     TableStatus;
1759         } Restrict_repl;
1760
1761         /**************************/
1762         /* EcDoRpc Function 0x15  */
1763         typedef [v1_enum] enum {
1764                 TBL_LEAF_ROW            = 0x1,
1765                 TBL_EMPTY_CATEGORY      = 0x2,
1766                 TBL_EXPANDED_CATEGORY   = 0x3,
1767                 TBL_COLLAPSED_CATEGORY  = 0x4
1768         } RowType;
1769
1770         typedef [enum8bit] enum {
1771                 TBL_ADVANCE             = 0x0,
1772                 TBL_NOADVANCE           = 0x1,
1773                 TBL_ENABLEPACKEDBUFFERS = 0x2
1774         } QueryRowsFlags;
1775
1776         typedef [flag(NDR_NOALIGN)] struct {
1777                 QueryRowsFlags  QueryRowsFlags;
1778                 uint8           ForwardRead;
1779                 uint16          RowCount;
1780         } QueryRows_req;
1781
1782         typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
1783                 uint8           Origin;
1784                 uint16          RowCount;
1785                 [flag(NDR_REMAINING)]DATA_BLOB  RowData;
1786         } QueryRows_repl;
1787
1788         /**************************/
1789         /* EcDoRpc Function 0x16  */
1790         typedef [flag(NDR_NOALIGN)] struct {
1791         } GetStatus_req;
1792
1793         typedef [flag(NDR_NOALIGN)] struct {
1794                 TableStatus     TableStatus;
1795         } GetStatus_repl;
1796
1797         /**************************/
1798         /* EcDoRpc Function 0x17  */
1799         typedef [flag(NDR_NOALIGN)] struct {
1800         } QueryPosition_req;
1801
1802         typedef [flag(NDR_NOALIGN)] struct {
1803                 uint32  Numerator;
1804                 uint32  Denominator;
1805         } QueryPosition_repl;
1806
1807         /**************************/
1808         /* EcDoRpc Function 0x18  */
1809         typedef [enum8bit] enum {
1810                 BOOKMARK_BEGINNING      = 0x0,
1811                 BOOKMARK_CURRENT        = 0x1,
1812                 BOOKMARK_END            = 0x2,
1813                 BOOKMARK_USER           = 0x3
1814         } BOOKMARK;
1815
1816         typedef [flag(NDR_NOALIGN)] struct {
1817                 BOOKMARK        origin;
1818                 int32           offset;
1819                 boolean8        WantRowMovedCount;
1820         } SeekRow_req;
1821
1822         typedef [flag(NDR_NOALIGN)] struct {
1823                 boolean8        HasSoughtLess;
1824                 int32           RowsSought;
1825         } SeekRow_repl;
1826
1827         /**************************/
1828         /* EcDoRpc Function 0x19  */
1829         typedef [flag(NDR_NOALIGN)] struct {
1830                 SBinary_short   Bookmark;
1831                 uint32          RowCount;
1832                 boolean8        WantRowMovedCount;
1833         } SeekRowBookmark_req;
1834
1835         typedef [flag(NDR_NOALIGN)] struct {
1836                 boolean8        RowNoLongerVisible;
1837                 boolean8        HasSoughtLess;
1838                 uint32          RowsSought;
1839         } SeekRowBookmark_repl;
1840
1841         /**************************/
1842         /* EcDoRpc Function 0x1a  */
1843         typedef [flag(NDR_NOALIGN)] struct {
1844                 uint32          ulNumerator;
1845                 uint32          ulDenominator;
1846         } SeekRowApprox_req;
1847
1848         typedef [flag(NDR_NOALIGN)] struct {
1849         } SeekRowApprox_repl;
1850         
1851         /**************************/
1852         /* EcDoRpc Function 0x1b  */
1853         typedef [flag(NDR_NOALIGN)] struct {
1854         } CreateBookmark_req;
1855
1856         typedef [flag(NDR_NOALIGN)] struct {
1857                 SBinary_short   bookmark;
1858         } CreateBookmark_repl;
1859
1860         /**************************/
1861         /* EcDoRpc Function 0x1c  */
1862         typedef [enum8bit] enum {
1863                 FOLDER_GENERIC  = 0x1,
1864                 FOLDER_SEARCH   = 0x2
1865         } FOLDER_TYPE;
1866
1867         typedef [enum8bit] enum {
1868                 MAPI_FOLDER_ANSI        = 0x0,
1869                 MAPI_FOLDER_UNICODE     = 0x1
1870         } FOLDER_STRING;
1871
1872         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1873                 [case(MAPI_FOLDER_ANSI)] raw8string                     lpszA;
1874                 [case(MAPI_FOLDER_UNICODE)][flag(STR_NULLTERM)] string  lpszW;
1875         } LPTSTR;
1876
1877         typedef [enum16bit] enum {
1878                 NONE            = 0x0000,
1879                 OPEN_IF_EXISTS  = 0x0001
1880         } FOLDER_FLAGS;
1881
1882         typedef [flag(NDR_NOALIGN)] struct {
1883                 uint8                           handle_idx;
1884                 FOLDER_TYPE                     ulFolderType;
1885                 FOLDER_STRING                   ulType;
1886                 FOLDER_FLAGS                    ulFlags;
1887                 [switch_is(ulType)] LPTSTR      FolderName;
1888                 [switch_is(ulType)] LPTSTR      FolderComment;
1889         } CreateFolder_req;
1890
1891         typedef [flag(NDR_NOALIGN)] struct {
1892                 boolean8                                HasRules;
1893                 boolean8                                IsGhosted;
1894                 [switch_is(IsGhosted)] IsGhosted        Ghost;
1895         } CreateFolder_GhostInfo;
1896
1897         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
1898                 [case(0x0)];
1899                 [case(0x1)] CreateFolder_GhostInfo      GhostInfo;
1900         } CreateFolder_GhostUnion;
1901
1902         typedef [flag(NDR_NOALIGN)] struct {
1903                 hyper                                                   folder_id;
1904                 boolean8                                                IsExistingFolder;
1905                 [switch_is(IsExistingFolder)]   CreateFolder_GhostUnion GhostUnion;
1906         } CreateFolder_repl;
1907
1908         /**************************/
1909         /* EcDoRpc Function 0x1d  */
1910         typedef [bitmap8bit] bitmap {
1911                 DEL_MESSAGES            = 0x1,
1912                 DEL_FOLDERS             = 0x4,
1913                 DELETE_HARD_DELETE      = 0x10
1914         } DeleteFolderFlags;
1915
1916         typedef [flag(NDR_NOALIGN)] struct {
1917                 DeleteFolderFlags       DeleteFolderFlags;
1918                 hyper                   FolderId;
1919         } DeleteFolder_req;
1920
1921         typedef [flag(NDR_NOALIGN)] struct {
1922                 boolean8                PartialCompletion;
1923         } DeleteFolder_repl;
1924
1925         /**************************/
1926         /* EcDoRpc Function 0x1e  */
1927         typedef [flag(NDR_NOALIGN)] struct {
1928                 boolean8        WantAsynchronous;
1929                 boolean8        NotifyNonRead;
1930                 uint16          cn_ids;
1931                 hyper           message_ids[cn_ids];
1932         } DeleteMessages_req;
1933
1934         typedef [flag(NDR_NOALIGN)] struct {
1935                 boolean8        PartialCompletion;
1936         } DeleteMessages_repl;
1937
1938         /**************************/
1939         /* EcDoRpc Function 0x1f  */
1940         typedef [flag(NDR_NOALIGN)] struct {
1941                 hyper           msgid;
1942         } GetMessageStatus_req;
1943
1944         /**************************/
1945         /* EcDoRpc Function 0x20  */
1946         typedef [bitmap32bit] bitmap {
1947                 MSGSTATUS_HIGHLIGHTED           = 0x1,
1948                 MSGSTATUS_TAGGED                = 0x2,
1949                 MSGSTATUS_HIDDEN                = 0x4,
1950                 MSGSTATUS_DELMARKED             = 0x8,
1951                 MSGSTATUS_REMOTE_DOWNLOAD       = 0x1000,
1952                 MSGSTATUS_REMOTE_DELETE         = 0x2000
1953         } ulMessageStatus;
1954
1955
1956         typedef [flag(NDR_NOALIGN)] struct {
1957                 hyper           msgid;
1958                 uint32          ulNewStatus;
1959                 ulMessageStatus ulNewStatusMask;
1960         } SetMessageStatus_req;
1961
1962         typedef [flag(NDR_NOALIGN)] struct {
1963                 ulMessageStatus ulOldStatus;
1964         } SetMessageStatus_repl;
1965
1966         /**************************/
1967         /* EcDoRpc Function 0x21  */
1968         typedef [flag(NDR_NOALIGN)] struct {
1969                 uint8           handle_idx;
1970                 TableFlags      TableFlags;
1971         } GetAttachmentTable_req;
1972
1973         typedef [flag(NDR_NOALIGN)] struct {
1974         } GetAttachmentTable_repl;
1975
1976         /*************************/
1977         /* EcDoRpc Function 0x22 */
1978         typedef [enum8bit] enum {
1979                 OpenAttachmentFlags_ReadOnly    = 0x0,
1980                 OpenAttachmentFlags_ReadWrite   = 0x1,
1981                 OpenAttachmentFlags_BestAccess  = 0x3
1982         } OpenAttachmentFlags;
1983
1984         typedef [flag(NDR_NOALIGN)] struct {
1985                 uint8                   handle_idx;
1986                 OpenAttachmentFlags     OpenAttachmentFlags;
1987                 uint32                  AttachmentID;
1988         } OpenAttach_req;
1989
1990         typedef [flag(NDR_NOALIGN)] struct {
1991         } OpenAttach_repl;
1992
1993         /*************************/
1994         /* EcDoRpc Function 0x23 */
1995         typedef [flag(NDR_NOALIGN)] struct {
1996                 uint8   handle_idx;
1997         } CreateAttach_req;
1998
1999         typedef [flag(NDR_NOALIGN)] struct {
2000                 uint32  AttachmentID;
2001         } CreateAttach_repl;
2002
2003         /*************************/
2004         /* EcDoRpc Function 0x24 */
2005         typedef [flag(NDR_NOALIGN)] struct {
2006                 uint32          AttachmentID;
2007         } DeleteAttach_req;
2008
2009
2010         typedef [flag(NDR_NOALIGN)] struct {
2011         } DeleteAttach_repl;
2012
2013         /*************************/
2014         /* EcDoRpc Function 0x25 */
2015         typedef [flag(NDR_NOALIGN)] struct {
2016                 uint8           handle_idx;
2017                 SaveFlags       SaveFlags;
2018         } SaveChangesAttachment_req;
2019
2020         typedef [flag(NDR_NOALIGN)] struct {
2021         } SaveChangesAttachment_repl;
2022
2023         /*************************/
2024         /* EcDoRpc Function 0x26 */
2025         typedef [flag(NDR_NOALIGN)] struct {
2026                 hyper           fid;
2027                 raw8string      lpszMessageClass;
2028         } SetReceiveFolder_req;
2029
2030         typedef [flag(NDR_NOALIGN)] struct {
2031         } SetReceiveFolder_repl;
2032
2033         /*************************/
2034         /* EcDoRpc Function 0x27 */
2035         typedef [flag(NDR_NOALIGN)] struct {
2036                 astring         MessageClass;
2037         } GetReceiveFolder_req;
2038
2039         typedef [flag(NDR_NOALIGN)] struct {
2040                 hyper           folder_id;
2041                 astring         MessageClass;
2042         } GetReceiveFolder_repl;
2043
2044         /*************************/
2045         /* EcDoRpc Function 0x29 */
2046         typedef [bitmap16bit] bitmap {
2047                 fnevCriticalError               = 0x0001,
2048                 fnevNewMail                     = 0x0002,
2049                 fnevObjectCreated               = 0x0004,
2050                 fnevObjectDeleted               = 0x0008,
2051                 fnevObjectModified              = 0x0010,
2052                 fnevObjectMoved                 = 0x0020,
2053                 fnevObjectCopied                = 0x0040,
2054                 fnevSearchComplete              = 0x0080,
2055                 fnevTableModified               = 0x0100,
2056                 fnevStatusObjectModified        = 0x0200,
2057                 fnevReserved                    = 0x0400,
2058                 fnevTbit                        = 0x1000,
2059                 fnevUbit                        = 0x2000,
2060                 fnevSbit                        = 0x4000,
2061                 fnevMbit                        = 0x8000
2062         } NotificationFlags;
2063
2064         typedef [nodiscriminant,flag(NDR_NOALIGN)] union {
2065                 [case(0x0)] hyper       ID;
2066                 [case(0x1)];
2067         } hyperbool;
2068
2069         typedef [flag(NDR_NOALIGN)] struct {
2070                 uint8                                   handle_idx;
2071                 NotificationFlags                       NotificationFlags;
2072                 boolean8                                WantWholeStore;
2073                 [switch_is(WantWholeStore)] hyperbool   FolderId;
2074                 [switch_is(WantWholeStore)] hyperbool   MessageId;
2075         } RegisterNotification_req;
2076
2077         typedef [flag(NDR_NOALIGN)] struct {
2078         } RegisterNotification_repl;
2079
2080         /*************************/
2081         /* EcDoRpc Function 0x2a */
2082         typedef [bitmap32bit] bitmap {
2083                 MSGFLAG_READ            = 0x1,
2084                 MSGFLAG_UNMODIFIED      = 0x2,
2085                 MSGFLAG_SUBMIT          = 0x4,
2086                 MSGFLAG_UNSENT          = 0x8,
2087                 MSGFLAG_HASATTACH       = 0x10,
2088                 MSGFLAG_FROMME          = 0x20,
2089                 MSGFLAG_ASSOCIATED      = 0x40,
2090                 MSGFLAG_RESEND          = 0x80,
2091                 MSGFLAG_RN_PENDING      = 0x100,
2092                 MSGFLAG_NRN_PENDING     = 0x200
2093         } MsgFlags;
2094
2095         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
2096                 [case(0x0)] raw8string                  lpszA;
2097                 [case(0x1)][flag(STR_NULLTERM)] string  lpszW;
2098         } MessageClass;
2099
2100         typedef [public,nodiscriminant, flag(NDR_NOALIGN)] union {
2101                 [case(0x1)] uint8       bytes[6];
2102                 [default] dlong         value;
2103         } GLOBCNT;
2104
2105         typedef [public,flag(NDR_NOALIGN)] struct {
2106                 GUID                    GUID;
2107                 [switch_is(1)] GLOBCNT  GLOBCNT;
2108         } GID;
2109
2110         typedef [public,flag(NDR_NOALIGN)] struct {
2111                 uint16                  ReplID;
2112                 [switch_is(1)] GLOBCNT  GLOBCNT;
2113         } ShortTermID; /* MID, FID, CN */
2114
2115         typedef [public,flag(NDR_NOALIGN)] struct {
2116                 GUID                    GUID;
2117                 uint8                   Size;
2118                 uint8                   Data[Size];
2119         } XID;
2120
2121         typedef [enum16bit] enum {
2122                 TABLE_CHANGED           =       0x1,
2123                 TABLE_ROW_ADDED         =       0x3,
2124                 TABLE_ROW_DELETED       =       0x4,
2125                 TABLE_ROW_MODIFIED      =       0x5,
2126                 TABLE_RESTRICT_DONE     =       0x7
2127         } RichTableNotificationType;
2128
2129         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
2130                 [case(0x0)];
2131                 [case(0xffff)];
2132                 [default] MAPITAGS              Tags[level];
2133         } NotificationTags;
2134
2135         /* NewMailNotification: case 0x2 and 0x8002 */
2136         typedef [flag(NDR_NOALIGN)] struct {
2137                 hyper                                   FID;
2138                 hyper                                   MID;
2139                 MsgFlags                                MessageFlags;
2140                 boolean8                                UnicodeFlag;
2141                 [switch_is(UnicodeFlag)] MessageClass   MessageClass;
2142         } NewMailNotification;
2143
2144         /* FolderCreatedNotification: case 0x4 */
2145         typedef [flag(NDR_NOALIGN)] struct {
2146                 hyper                                   FID;
2147                 hyper                                   ParentFID;
2148                 uint16                                  TagCount;
2149                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2150         } FolderCreatedNotification;
2151
2152         /* FolderDeletedNotification: case 0x8 */
2153         typedef [flag(NDR_NOALIGN)] struct {
2154                 hyper                                   FID;
2155                 hyper                                   ParentFID;
2156         } FolderDeletedNotification;
2157
2158         /* FolderModifiedNotification: case 0x10 */
2159         typedef [flag(NDR_NOALIGN)] struct {
2160                 hyper                   FID;
2161                 uint16                  TagCount;
2162                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2163         } FolderModifiedNotification_10;
2164
2165         /* FolderMoveCopyNotification: case 0x20 and 0x40 */
2166         typedef [flag(NDR_NOALIGN)] struct {
2167                 hyper                   FID;
2168                 hyper                   ParentFID;
2169                 hyper                   OldFID;
2170                 hyper                   OldParentFID;
2171         } FolderMoveCopyNotification;
2172
2173         /* SearchCompleteNotification: case 0x80 */
2174         typedef [flag(NDR_NOALIGN)] struct {
2175                 hyper                   FID;
2176         } SearchCompleteNotification;
2177
2178         /* HierarchyTable: case 0x100 */
2179         typedef [flag(NDR_NOALIGN)] struct {
2180                 hyper                           FID;
2181                 hyper                           InsertAfterFID;
2182                 [subcontext(2)] DATA_BLOB       Columns;
2183         } HierarchyRowAddedNotification;
2184
2185         typedef [flag(NDR_NOALIGN)] struct {
2186                 hyper                           FID;
2187         } HierarchyRowDeletedNotification;
2188         
2189         typedef [flag(NDR_NOALIGN)] struct {
2190                 hyper                           FID;
2191                 hyper                           InsertAfterFID;
2192                 [subcontext(2)] DATA_BLOB       Columns;
2193         } HierarchyRowModifiedNotification;
2194
2195         typedef [nodiscriminant] union {
2196                 [case(TABLE_ROW_ADDED)] HierarchyRowAddedNotification           HierarchyRowAddedNotification;
2197                 [case(TABLE_ROW_DELETED)] HierarchyRowDeletedNotification       HierarchyRowDeletedNotification;
2198                 [case(TABLE_ROW_MODIFIED)] HierarchyRowModifiedNotification     HierarchyRowModifiedNotification;
2199                 [default];
2200         } HierarchyTableChangeUnion;
2201
2202         typedef [flag(NDR_NOALIGN)] struct {
2203                 RichTableNotificationType                               TableEvent;
2204                 [switch_is(TableEvent)] HierarchyTableChangeUnion       HierarchyTableChangeUnion;
2205         } HierarchyTableChange;
2206
2207         /* IcsNotification: case 0x200 */
2208         typedef [flag(NDR_NOALIGN)] struct {
2209                 boolean8                HierChanged;
2210                 uint32                  GIDCount;
2211                 GID                     GID[GIDCount];
2212         } IcsNotification;
2213
2214         /* FolderModifiedNotification: case 0x1010 */
2215         typedef [flag(NDR_NOALIGN)] struct {
2216                 hyper                   FID;
2217                 uint16                  TagCount;
2218                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2219                 uint32                  TotalMessageCount;
2220         } FolderModifiedNotification_1010;
2221
2222         /* FolderModifiedNotification: case 0x2010 */
2223         typedef [flag(NDR_NOALIGN)] struct {
2224                 hyper                   FID;
2225                 uint16                  TagCount;
2226                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2227                 uint32                  UnreadMessageCount;
2228         } FolderModifiedNotification_2010;
2229
2230         /* FolderModifiedNotification: case 0x3010 */
2231         typedef [flag(NDR_NOALIGN)] struct {
2232                 hyper                   FID;
2233                 uint16                  TagCount;
2234                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2235                 uint32                  TotalMessageCount;
2236                 uint32                  UnreadMessageCount;
2237         } FolderModifiedNotification_3010;
2238
2239         /* MessageCreatedNotification: case 0x8004 */
2240         typedef [flag(NDR_NOALIGN)] struct {
2241                 hyper                                   FID;
2242                 hyper                                   MID;
2243                 uint16                                  TagCount;
2244                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2245         } MessageCreatedNotification;
2246
2247         /* MessageDeletedNotification: case 0x8008 */
2248         typedef [flag(NDR_NOALIGN)] struct {
2249                 hyper                                   FID;
2250                 hyper                                   MID;
2251         } MessageDeletedNotification;
2252
2253         /* MessageModifiedNotification: case 0x8010 */
2254         typedef [flag(NDR_NOALIGN)] struct {
2255                 hyper                                   FID;
2256                 hyper                                   MID;
2257                 uint16                                  TagCount;
2258                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2259         } MessageModifiedNotification;
2260
2261         /* MessageMoveCopyNotification: case 0x8020 and 0x8040 */
2262         typedef [flag(NDR_NOALIGN)] struct {
2263                 hyper                   FID;
2264                 hyper                   MID;
2265                 hyper                   OldFID;
2266                 hyper                   OldMID;
2267         } MessageMoveCopyNotification;  
2268
2269         /* ContentsTableChange: case 0x8100 and 0xc100 */
2270         typedef [flag(NDR_NOALIGN)] struct {
2271                 hyper                           FID;
2272                 hyper                           MID;
2273                 uint32                          Instance;
2274                 hyper                           InsertAfterFID;
2275                 hyper                           InsertAfterMID;
2276                 uint32                          InsertAfterInstance;
2277                 [subcontext(2)] DATA_BLOB       Columns;
2278         } ContentsRowAddedNotification;
2279
2280         typedef [flag(NDR_NOALIGN)] struct {
2281                 hyper                           FID;
2282                 hyper                           MID;
2283                 uint32                          Instance;
2284         } ContentsRowDeletedNotification;
2285
2286         typedef [flag(NDR_NOALIGN)] struct {
2287                 hyper                           FID;
2288                 hyper                           MID;
2289                 uint32                          Instance;
2290                 hyper                           InsertAfterFID;
2291                 hyper                           InsertAfterMID;
2292                 uint32                          InsertAfterInstance;
2293                 [subcontext(2)] DATA_BLOB       Columns;
2294         } ContentsRowModifiedNotification;
2295
2296         typedef [nodiscriminant] union {
2297                 [case(TABLE_ROW_ADDED)] ContentsRowAddedNotification            ContentsRowAddedNotification;
2298                 [case(TABLE_ROW_DELETED)] ContentsRowDeletedNotification        ContentsRowDeletedNotification;
2299                 [case(TABLE_ROW_MODIFIED)] ContentsRowModifiedNotification      ContentsRowModifiedNotification;
2300                 [default];
2301         } ContentsTableChangeUnion;
2302
2303         typedef [flag(NDR_NOALIGN)] struct {
2304                 RichTableNotificationType                               TableEvent;
2305                 [switch_is(TableEvent)] ContentsTableChangeUnion        ContentsTableChangeUnion;
2306         } ContentsTableChange;
2307
2308         /* SearchMessageCreatedNotification: case 0xc004 */
2309         typedef [flag(NDR_NOALIGN)] struct {
2310                 hyper                                   FID;
2311                 hyper                                   MID;
2312                 hyper                                   SearchFID;
2313                 uint16                                  TagCount;
2314                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2315         } SearchMessageCreatedNotification;
2316
2317         /* SearchMessageRemovedNotification: case 0xc008 */
2318         typedef [flag(NDR_NOALIGN)] struct {
2319                 hyper                                   FID;
2320                 hyper                                   MID;
2321                 hyper                                   SearchFID;
2322         } SearchMessageRemovedNotification;
2323
2324         /* SearchMessageModifiedNotification: 0xc010 */
2325         typedef [flag(NDR_NOALIGN)] struct {
2326                 hyper                                   FID;
2327                 hyper                                   MID;
2328                 uint16                                  TagCount;
2329                 [switch_is(TagCount)] NotificationTags  NotificationTags;
2330         } SearchMessageModifiedNotification;
2331
2332         typedef [nodiscriminant] union {
2333                 [case(0x0002)] NewMailNotification                      NewMailNotification;
2334                 [case(0x0004)] FolderCreatedNotification                FolderCreatedNotification;
2335                 [case(0x0008)] FolderDeletedNotification                FolderDeletedNotification;
2336                 [case(0x0010)] FolderModifiedNotification_10            FolderModifiedNotification_10;
2337                 [case(0x0020)] FolderMoveCopyNotification               FolderMoveNotification;
2338                 [case(0x0040)] FolderMoveCopyNotification               FolderCopyNotification;
2339                 [case(0x0080)] SearchCompleteNotification               SearchCompleteNotification;
2340                 [case(0x0100)] HierarchyTableChange                     HierarchyTableChange;
2341                 [case(0x0200)] IcsNotification                          IcsNotification;
2342                 [case(0x1010)] FolderModifiedNotification_1010          FolderModifiedNotification_1010;
2343                 [case(0x2010)] FolderModifiedNotification_2010          FolderModifiedNotification_2010;
2344                 [case(0x3010)] FolderModifiedNotification_3010          FolderModifiedNotification_3010;
2345                 [case(0x8002)] NewMailNotification                      NewMessageNotification;
2346                 [case(0x8004)] MessageCreatedNotification               MessageCreatedNotification;
2347                 [case(0x8008)] MessageDeletedNotification               MessageDeletedNotification;
2348                 [case(0x8010)] MessageModifiedNotification              MessageModifiedNotification;
2349                 [case(0x8020)] MessageMoveCopyNotification              MessageMoveNotification;
2350                 [case(0x8040)] MessageMoveCopyNotification              MessageCopyNotification;
2351                 [case(0x8100)] ContentsTableChange                      ContentsTableChange;
2352                 [case(0xc004)] SearchMessageCreatedNotification         SearchMessageCreatedNotification;
2353                 [case(0xc008)] SearchMessageRemovedNotification         SearchMessageRemovedNotification;
2354                 [case(0xc010)] SearchMessageModifiedNotification        SearchMessageModifiedNotification;
2355                 [case(0xc100)] ContentsTableChange                      SearchTableChange;
2356         } NotificationData;
2357
2358         typedef [flag(NDR_NOALIGN)] struct {
2359                 uint32                                          NotificationHandle;
2360                 uint8                                           LogonId;
2361                 NotificationFlags                               NotificationType;
2362                 [switch_is(NotificationType)] NotificationData  NotificationData;
2363         } Notify_repl;
2364
2365         /*************************/
2366         /* EcDoRpc Function 0x2b */
2367         typedef [enum8bit] enum {
2368                 OpenStream_ReadOnly     = 0x0,
2369                 OpenStream_ReadWrite    = 0x1,
2370                 OpenStream_Create       = 0x2,
2371                 OpenStream_BestAccess   = 0x3
2372         } OpenStream_OpenModeFlags;
2373
2374         typedef [flag(NDR_NOALIGN)] struct {
2375                 uint8                           handle_idx;
2376                 MAPITAGS                        PropertyTag;
2377                 OpenStream_OpenModeFlags        OpenModeFlags;
2378         } OpenStream_req;
2379
2380         typedef [flag(NDR_NOALIGN)] struct {
2381                 uint32          StreamSize;
2382         } OpenStream_repl;
2383
2384         /*************************/
2385         /* EcDoRpc Function 0x2c */
2386         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
2387                 [case(0xBABE)] uint32   value;
2388                 [default];
2389         } MaximumByteCount;
2390
2391         typedef [flag(NDR_NOALIGN)] struct {
2392                 uint16                                          ByteCount;
2393                 [switch_is(ByteCount)]  MaximumByteCount        MaximumByteCount;
2394         } ReadStream_req;
2395
2396         typedef [flag(NDR_NOALIGN)] struct {
2397                 [subcontext(2), flag(NDR_REMAINING)] DATA_BLOB data;
2398         } ReadStream_repl;
2399
2400         /*************************/
2401         /* EcDoRpc Function 0x2d */
2402         typedef [flag(NDR_NOALIGN)] struct {
2403                 [subcontext(2), flag(NDR_REMAINING)] DATA_BLOB  data;
2404         } WriteStream_req;
2405
2406
2407         typedef [flag(NDR_NOALIGN)] struct {
2408                 uint16          WrittenSize;
2409         } WriteStream_repl;
2410
2411         /*************************/
2412         /* EcDoRpc Function 0x2e */
2413         typedef [flag(NDR_NOALIGN)] struct {
2414                 uint8           Origin;
2415                 hyper           Offset;
2416         } SeekStream_req;
2417
2418         typedef [flag(NDR_NOALIGN)] struct {
2419                 hyper           NewPosition;
2420         } SeekStream_repl;
2421
2422         /*************************/
2423         /* EcDoRpc Function 0x2f */
2424         typedef [flag(NDR_NOALIGN)] struct {
2425                 hyper           SizeStream;
2426         } SetStreamSize_req;
2427
2428         typedef [flag(NDR_NOALIGN)] struct {
2429         } SetStreamSize_repl;
2430
2431         /*************************/
2432         /* EcDoRpc Function 0x30 */
2433         typedef [public, bitmap32bit, flag(NDR_PAHEX)] bitmap {
2434                 STOP_SEARCH                     = 0x00000001,
2435                 RESTART_SEARCH                  = 0x00000002,
2436                 RECURSIVE_SEARCH                = 0x00000004,
2437                 SHALLOW_SEARCH                  = 0x00000008,
2438                 FOREGROUND_SEARCH               = 0x00000010,
2439                 BACKGROUND_SEARCH               = 0x00000020,
2440                 CONTENT_INDEXED_SEARCH          = 0x00010000,
2441                 NON_CONTENT_INDEXED_SEARCH      = 0x00020000,
2442                 STATIC_SEARCH                   = 0x00040000
2443         } SearchFlags;
2444
2445         typedef [flag(NDR_NOALIGN)] struct {
2446                 [subcontext(2)] mapi_SRestriction       res;
2447                 uint16                                  FolderIdCount;
2448                 hyper                                   FolderIds[FolderIdCount];
2449                 SearchFlags                             SearchFlags;
2450         } SetSearchCriteria_req;
2451
2452         typedef [flag(NDR_NOALIGN)] struct {
2453         } SetSearchCriteria_repl;
2454
2455         /*************************/
2456         /* EcDoRpc Function 0x31 */
2457         typedef [flag(NDR_NOALIGN)] struct {
2458                 boolean8        UseUnicode;
2459                 boolean8        IncludeRestriction;
2460                 boolean8        IncludeFolders;
2461         } GetSearchCriteria_req;
2462
2463         typedef [nopush,nopull,noprint,flag(NDR_NOALIGN)] struct {
2464                 uint16                                  RestrictionDataSize;
2465                 [subcontext(0),subcontext_size(RestrictionDataSize)] mapi_SRestriction  RestrictionData;
2466                 uint8                                   LogonId;
2467                 uint16                                  FolderIdCount;
2468                 hyper                                   FolderIds[FolderIdCount];
2469                 SearchFlags                             SearchFlags;
2470         } GetSearchCriteria_repl;
2471
2472         /*************************/
2473         /* EcDoRpc Function 0x32 */
2474         typedef [enum8bit] enum {
2475                 None            = 0x0,  /* None */
2476                 PreProcess      = 0x1,  /* Needs to be preprocessed by the server */
2477                 NeedsSpooler    = 0x2   /* Is to be processed by a client spooler */
2478         } SubmitFlags;
2479
2480         typedef [flag(NDR_NOALIGN)] struct {
2481                 SubmitFlags     SubmitFlags;
2482         } SubmitMessage_req;
2483
2484         typedef [flag(NDR_NOALIGN)] struct {
2485         } SubmitMessage_repl;
2486
2487         /*************************/
2488         /* EcDoRpc Function 0x33 */
2489         typedef [flag(NDR_NOALIGN)] struct {
2490                 uint8           handle_idx;
2491                 uint16          count;
2492                 hyper           message_id[count];
2493                 boolean8        WantAsynchronous;
2494                 boolean8        WantCopy;
2495         } MoveCopyMessages_req;
2496
2497         typedef [flag(NDR_NOALIGN)] struct {
2498                 boolean8        PartialCompletion;
2499         } MoveCopyMessages_repl;
2500
2501         /*************************/
2502         /* EcDoRpc Function 0x34 */
2503         typedef [flag(NDR_NOALIGN)] struct {
2504                 hyper           FolderId;
2505                 hyper           MessageId;
2506         } AbortSubmit_req;
2507
2508         typedef [flag(NDR_NOALIGN)] struct {
2509         } AbortSubmit_repl;
2510
2511         /*************************/
2512         /* EcDoRpc Function 0x35 */
2513         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
2514                 [case(0x0)] raw8string                  lpszA;
2515                 [case(0x1)][flag(STR_NULLTERM)] string  lpszW;
2516         } Folder_name;
2517
2518         typedef [flag(NDR_NOALIGN)] struct {
2519                 uint8                                   handle_idx;
2520                 boolean8                                WantAsynchronous;
2521                 boolean8                                UseUnicode;
2522                 hyper                                   FolderId;
2523                 [switch_is(UseUnicode)] Folder_name     NewFolderName;
2524         } MoveFolder_req;
2525
2526         typedef [flag(NDR_NOALIGN)] struct {
2527                 boolean8                                PartialCompletion;
2528         } MoveFolder_repl;
2529
2530         /*************************/
2531         /* EcDoRpc Function 0x36 */
2532         typedef [flag(NDR_NOALIGN)] struct {
2533                 uint8                                   handle_idx;
2534                 boolean8                                WantAsynchronous;
2535                 boolean8                                WantRecursive;
2536                 boolean8                                UseUnicode;
2537                 hyper                                   FolderId;
2538                 [switch_is(UseUnicode)] Folder_name     NewFolderName;
2539         } CopyFolder_req;
2540
2541         typedef [flag(NDR_NOALIGN)] struct {
2542                 boolean8                                PartialCompletion;
2543         } CopyFolder_repl;
2544
2545         /*************************/
2546         /* EcDoRpc Function 0x37 */
2547         typedef [flag(NDR_NOALIGN)] struct {
2548         } QueryColumnsAll_req;
2549
2550         typedef [flag(NDR_NOALIGN)] struct {
2551                 uint16          PropertyTagCount;
2552                 MAPITAGS        PropertyTags[PropertyTagCount];
2553         } QueryColumnsAll_repl;
2554
2555         /*************************/
2556         /* EcDoRpc Function 0x38 */
2557         typedef [flag(NDR_NOALIGN)] struct {
2558         } Abort_req;
2559
2560         typedef [flag(NDR_NOALIGN)] struct {
2561                 TableStatus     TableStatus;
2562         } Abort_repl;
2563
2564         /*************************/
2565         /* EcDoRpc Function 0x39 */
2566         typedef [bitmap8bit] bitmap {
2567                 CopyFlagsMove           = 0x1,  /* Move properties */
2568                 CopyFlagsNoOverwrite    = 0x2   /* Do not overwrite existing properties */
2569         } CopyFlags;
2570
2571         typedef [flag(NDR_NOALIGN)] struct {
2572                 uint8                   handle_idx;
2573                 boolean8                WantAsynchronous;
2574                 boolean8                WantSubObjects;
2575                 CopyFlags               CopyFlags;
2576                 mapi_SPropTagArray      ExcludedTags;
2577         } CopyTo_req;
2578
2579         typedef [flag(NDR_NOALIGN)] struct {
2580                 uint16          PropertyProblemCount;
2581                 PropertyProblem PropertyProblem[PropertyProblemCount];
2582         } CopyTo_repl;
2583
2584         /*************************/
2585         /* EcDoRpc Function 0x3a */
2586         typedef [flag(NDR_NOALIGN)] struct {
2587                 uint8           handle_idx;
2588                 hyper           ByteCount;
2589         } CopyToStream_req;
2590
2591         typedef [flag(NDR_NOALIGN)] struct {
2592                 hyper           ReadByteCount;
2593                 hyper           WrittenByteCount;
2594         } CopyToStream_repl;
2595
2596         /*************************/
2597         /* EcDoRpc Function 0x3b */
2598         typedef [flag(NDR_NOALIGN)] struct {
2599                 uint8           handle_idx;
2600         } CloneStream_req;
2601
2602         typedef [flag(NDR_NOALIGN)] struct {
2603         } CloneStream_repl;
2604
2605         /*************************/
2606         /* EcDoRpc Function 0x3e */
2607         typedef [bitmap8bit] bitmap {
2608                 IncludeFreeBusy = 0x02
2609         } PermissionsTableFlags;
2610
2611         typedef [flag(NDR_NOALIGN)] struct {
2612                 uint8                   handle_idx;
2613                 PermissionsTableFlags   TableFlags;
2614         } GetPermissionsTable_req;
2615
2616         typedef [flag(NDR_NOALIGN)] struct {
2617         } GetPermissionsTable_repl;
2618
2619         /*************************/
2620         /* EcDoRpc Function 0x3f */
2621         typedef [bitmap8bit] bitmap {
2622                 RulesTableFlags_Unicode = 0x40
2623         } RulesTableFlags;
2624
2625         typedef [flag(NDR_NOALIGN)] struct {
2626                 uint8           handle_idx;
2627                 RulesTableFlags TableFlags;
2628         } GetRulesTable_req;
2629
2630         typedef [flag(NDR_NOALIGN)] struct {
2631         } GetRulesTable_repl;
2632
2633         /*************************/
2634         /* EcDoRpc Function 0x40 */
2635         typedef [bitmap8bit] bitmap {
2636                 ModifyPerms_IncludeFreeBusy     = 0x02,
2637                 ModifyPerms_ReplaceRows         = 0x01
2638         } ModifyPermissionsFlags;
2639
2640         typedef [flag(NDR_NOALIGN)] struct {
2641                 ulRowFlags              PermissionDataFlags;
2642                 mapi_SPropValue_array   lpProps;
2643         } PermissionData;
2644
2645         typedef [flag(NDR_NOALIGN)] struct {
2646                 ModifyPermissionsFlags  ModifyFlags;
2647                 uint16                  ModifyCount;
2648                 PermissionData          PermissionsData[ModifyCount];
2649         } mapi_PermissionsData;
2650
2651         typedef [flag(NDR_NOALIGN)] struct {
2652                 mapi_PermissionsData    rowList;
2653         } ModifyPermissions_req;
2654
2655         typedef [flag(NDR_NOALIGN)] struct {
2656         } ModifyPermissions_repl;
2657
2658         /*************************/
2659         /* EcDoRpc Function 0x41 */
2660         typedef [flag(NDR_NOALIGN)] struct {
2661                 ulRowFlags              RuleDataFlags;
2662                 mapi_SPropValue_array   PropertyValues;
2663         } RuleData;
2664
2665         typedef [bitmap8bit] bitmap {
2666                 ModifyRulesFlag_Replace = 0x01
2667         } ModifyRulesFlag;
2668
2669         typedef [flag(NDR_NOALIGN)] struct {
2670                 ModifyRulesFlag ModifyRulesFlags;
2671                 uint16          RulesCount;
2672                 RuleData        RulesData[RulesCount];
2673         } ModifyRules_req;
2674
2675         typedef [flag(NDR_NOALIGN)] struct {
2676         } ModifyRules_repl;
2677
2678         /*************************/
2679         /* EcDoRpc Function 0x42 */
2680         typedef [flag(NDR_NOALIGN)] struct {
2681                 hyper           FolderId;
2682         } GetOwningServers_req;
2683
2684         typedef [flag(NDR_NOALIGN)] struct {
2685                 uint16          OwningServersCount;
2686                 uint16          CheapServersCount;
2687                 astring         OwningServers[OwningServersCount];
2688         } GetOwningServers_repl;
2689
2690         /*************************/
2691         /* EcDoRpc Function 0x43 */
2692         typedef [flag(NDR_NOALIGN)] struct {
2693                 hyper   Id;
2694         } LongTermIdFromId_req;
2695
2696         typedef [flag(NDR_NOALIGN)] struct {
2697                 GUID    DatabaseGuid;
2698                 uint8   GlobalCounter[6];
2699                 uint16  padding;
2700         } LongTermId;
2701
2702         typedef [flag(NDR_NOALIGN)] struct {
2703                 LongTermId      LongTermId;
2704         } LongTermIdFromId_repl;
2705
2706         /*************************/
2707         /* EcDoRpc Function 0x44 */
2708         typedef [flag(NDR_NOALIGN)] struct {
2709                 LongTermId      LongTermId;
2710         } IdFromLongTermId_req;
2711
2712         typedef [flag(NDR_NOALIGN)] struct {
2713                 hyper           Id;
2714         } IdFromLongTermId_repl;
2715
2716         /*************************/
2717         /* EcDoRpc Function 0x45 */
2718         typedef [flag(NDR_NOALIGN)] struct {
2719                 hyper           FolderId;
2720         } PublicFolderIsGhosted_req;
2721
2722         typedef [flag(NDR_NOALIGN)] struct {
2723                 boolean8                                IsGhosted;
2724                 [switch_is(IsGhosted)] IsGhosted        Ghost;
2725         } PublicFolderIsGhosted_repl;
2726
2727         /*************************/
2728         /* EcDoRpc Function 0x46 */
2729         typedef [enum8bit, flag(NDR_PAHEX)] enum {
2730                 MAPI_READONLY   = 0x0,
2731                 MAPI_READWRITE  = 0x1,
2732                 MAPI_CREATE     = 0x2
2733         } OpenEmbeddedMessage_OpenModeFlags;
2734
2735         typedef [flag(NDR_NOALIGN)] struct {
2736                 uint8                                   handle_idx;
2737                 uint16                                  CodePageId;
2738                 OpenEmbeddedMessage_OpenModeFlags       OpenModeFlags;
2739         } OpenEmbeddedMessage_req;
2740
2741         typedef [flag(NDR_NOALIGN)] struct {
2742                 uint8                   Reserved;
2743                 hyper                   MessageId;
2744                 boolean8                HasNamedProperties;
2745                 TypedString             SubjectPrefix;
2746                 TypedString             NormalizedSubject;
2747                 uint16                  RecipientCount;
2748                 mapi_SPropTagArray      RecipientColumns;
2749                 uint8                   RowCount;
2750                 OpenRecipientRow        RecipientRows[RowCount];
2751         } OpenEmbeddedMessage_repl;
2752
2753         /*************************/
2754         /* EcDoRpc Function 0x47 */
2755         typedef [flag(NDR_NOALIGN)] struct {
2756         } SetSpooler_req;
2757
2758         typedef [flag(NDR_NOALIGN)] struct {
2759         } SetSpooler_repl;
2760
2761         /*************************/
2762         /* EcDoRpc Function 0x48 */
2763         typedef [enum8bit] enum {
2764                 LockState_1stLock       = 0x0,
2765                 LockState_1stUnlock     = 0x1,
2766                 LockState_1stFinished   = 0x2
2767         } LockState;
2768
2769         typedef [flag(NDR_NOALIGN)] struct {
2770                 hyper           MessageId;
2771                 LockState       LockState;
2772         } SpoolerLockMessage_req;
2773
2774         typedef [flag(NDR_NOALIGN)] struct {
2775         } SpoolerLockMessage_repl;
2776
2777         /*************************/
2778         /* EcDoRpc Function 0x49 */
2779         typedef [flag(NDR_NOALIGN)] struct {
2780         } AddressTypes_req;
2781
2782         typedef [flag(NDR_NOALIGN)] struct {
2783                 uint16          cValues;
2784                 uint16          size;
2785                 mapi_LPSTR      transport[cValues];
2786         } AddressTypes_repl;
2787
2788         /**************************/
2789         /* EcDoRpc Function 0x4a  */
2790         typedef [flag(NDR_NOALIGN)] struct {
2791         } TransportSend_req;
2792
2793         typedef [nodiscriminant] union {
2794                 [case(0x0)] mapi_SPropValue_array       lpProps;
2795                 [case(0x1)];
2796         } TransportSend_lpProps;
2797
2798         typedef [flag(NDR_NOALIGN)] struct {
2799                 boolean8                                                NoPropertiesReturned;
2800                 [switch_is(NoPropertiesReturned)] TransportSend_lpProps properties;
2801         } TransportSend_repl;
2802
2803         /**************************/
2804         /* EcDoRpc Function 0x4b  */
2805         typedef [bitmap8bit] bitmap {
2806                 FastTransferCopyMessage_Move            = 0x01,
2807                 FastTransferCopyMessage_Unknown1        = 0x02,
2808                 FastTransferCopyMessage_Unknown2        = 0x04,
2809                 FastTransferCopyMessage_Unknown3        = 0x08,
2810                 FastTransferCopyMessage_BestBody        = 0x10,
2811                 FastTransferCopyMessage_SendEntryId     = 0x20
2812         } FastCopyMessagesCopyFlags;
2813
2814         /* this one is used in a few ROPs */
2815         typedef [bitmap8bit] bitmap {
2816                 FastTransfer_Unicode            = 0x01,
2817                 FastTransfer_UseCpid            = 0x02,
2818                 FastTransfer_ForUpload          = FastTransfer_Unicode | FastTransfer_UseCpid,
2819                 FastTransfer_RecoverMode        = 0x04,
2820                 FastTransfer_ForceUnicode       = 0x08,
2821                 FastTransfer_PartialItem        = 0x10
2822         } FastCopySendOptions;
2823
2824         typedef [flag(NDR_NOALIGN)] struct {
2825                 uint8                           handle_idx;
2826                 uint16                          MessageIdCount;
2827                 hyper                           MessageIds[MessageIdCount];
2828                 FastCopyMessagesCopyFlags       CopyFlags;
2829                 FastCopySendOptions             SendOptions;
2830         } FastTransferSourceCopyMessages_req;
2831
2832         typedef [flag(NDR_NOALIGN)] struct {
2833         } FastTransferSourceCopyMessages_repl;
2834
2835         /**************************/
2836         /* EcDoRpc Function 0x4c  */
2837         typedef [bitmap8bit] bitmap {
2838                 FastTransferCopyFolder_Move             = 0x01,
2839                 FastTransferCopyFolder_Unused1          = 0x02,
2840                 FastTransferCopyFolder_Unused2          = 0x04,
2841                 FastTransferCopyFolder_Unused3          = 0x08,
2842                 FastTransferCopyFolder_CopySubfolders   = 0x10,
2843                 FastTransferCopyFolder_NoGhostedContent = 0x20
2844         } FastCopyFolderCopyFlags;
2845
2846         typedef [flag(NDR_NOALIGN)] struct {
2847                 uint8                           handle_idx;
2848                 FastCopyFolderCopyFlags         CopyFlags;
2849                 FastCopySendOptions             SendOptions;
2850         } FastTransferSourceCopyFolder_req;
2851
2852         typedef [flag(NDR_NOALIGN)] struct {
2853         } FastTransferSourceCopyFolder_repl;
2854
2855         /**************************/
2856         /* EcDoRpc Function 0x4d  */
2857         typedef [bitmap32bit] bitmap {
2858                 FastTransferCopyTo_Move         = 0x00000001,
2859                 FastTransferCopyToUnused1       = 0x00000002,
2860                 FastTransferCopyToUnused2       = 0x00000004,
2861                 FastTransferCopyToUnused3       = 0x00000008,
2862                 FastTransferCopyToUnused4       = 0x00000200,
2863                 FastTransferCopyToUnused5       = 0x00000400,
2864                 FastTransferCopyTo_BestBody     = 0x00002000
2865         } FastCopyToCopyFlags;
2866
2867         typedef [flag(NDR_NOALIGN)] struct {
2868                 uint8                   handle_idx;
2869                 uint8                   Level;
2870                 FastCopyToCopyFlags     CopyFlags;
2871                 FastCopySendOptions     SendOptions;
2872                 mapi_SPropTagArray      PropertyTags;
2873         } FastTransferSourceCopyTo_req;
2874
2875         typedef [flag(NDR_NOALIGN)] struct {
2876         } FastTransferSourceCopyTo_repl;
2877
2878         /**************************/
2879         /* EcDoRpc Function 0x4e  */
2880         typedef [nodiscriminant] union {
2881                 [case(0xBABE)] uint16   MaximumBufferSize;
2882                 [default];
2883         } FastTransferSourceGetBuffer_MaxBufferSize;
2884
2885         typedef [flag(NDR_NOALIGN)] struct {
2886                 uint16                                                            BufferSize;
2887                 [switch_is(BufferSize)] FastTransferSourceGetBuffer_MaxBufferSize MaximumBufferSize;
2888         } FastTransferSourceGetBuffer_req;
2889
2890         typedef [enum16bit] enum {
2891                 TransferStatus_Error    = 0x0000,
2892                 TransferStatus_Partial  = 0x0001,
2893                 TransferStatus_NoRoom   = 0x0002,
2894                 TransferStatus_Done     = 0x0003
2895         } TransferStatus;
2896
2897         typedef [flag(NDR_NOALIGN)] struct {
2898                 TransferStatus  TransferStatus;
2899                 uint16          InProgressCount;
2900                 uint16          TotalStepCount;
2901                 uint8           Reserved;
2902                 uint16          TransferBufferSize;
2903                 [subcontext(0),subcontext_size(TransferBufferSize),flag(NDR_REMAINING)] DATA_BLOB TransferBuffer;
2904         } FastTransferSourceGetBuffer_repl;
2905
2906         /**************************/
2907         /* EcDoRpc Function 0x4f  */
2908         typedef [enum8bit] enum {
2909                 DIR_FORWARD  = 0x0,
2910                 DIR_BACKWARD = 0x1
2911         } FindRow_ulFlags;
2912
2913         typedef [flag(NDR_NOALIGN)] struct {
2914                 FindRow_ulFlags ulFlags;
2915                 [subcontext(2)] mapi_SRestriction res;
2916                 BOOKMARK        origin;
2917                 SBinary_short   bookmark;
2918         } FindRow_req;
2919
2920         typedef [flag(NDR_NOALIGN)] struct {
2921                 uint8           RowNoLongerVisible;
2922                 uint8           HasRowData;
2923                 [flag(NDR_NOALIGN)] DATA_BLOB row;
2924         } FindRow_repl;
2925
2926         /**************************/
2927         /* EcDoRpc Function 0x50  */
2928         typedef [flag(NDR_NOALIGN)] struct {
2929                 boolean8        WantCancel;
2930         } Progress_req;
2931
2932         typedef [flag(NDR_NOALIGN)] struct {
2933                 uint32          CompletedTaskCount;
2934                 uint32          TotalTaskCount;
2935         } Progress_repl;
2936
2937         /**************************/
2938         /* EcDoRpc Function 0x51  */
2939         typedef [flag(NDR_NOALIGN)] struct {
2940                 hyper           MessageId;
2941                 hyper           FolderId;
2942                 astring         MessageClass;
2943                 uint32          MessageFlags;
2944         } TransportNewMail_req;
2945
2946         typedef [flag(NDR_NOALIGN)] struct {
2947         } TransportNewMail_repl;
2948
2949         /**************************/
2950         /* EcDoRpc Function 0x52  */
2951         typedef [flag(NDR_NOALIGN)] struct {
2952         } GetValidAttachments_req;
2953
2954         typedef [flag(NDR_NOALIGN)] struct {
2955                 uint16          AttachmentIdCount;
2956                 uint32          AttachmentIdArray[AttachmentIdCount];
2957         } GetValidAttachments_repl;
2958
2959         /**************************/
2960         /* EcDoRpc Function 0x53  */
2961         typedef [enum8bit] enum {
2962                 FastTransferDest_CopyTo         = 0x1,
2963                 FastTransferDest_CopyProperties = 0x2,
2964                 FastTransferDest_CopyMessages   = 0x3,
2965                 FastTransferDest_CopyFolder     = 0x4
2966         } FastTransferDestConfig_SourceOperation;
2967
2968         typedef [bitmap8bit] bitmap {
2969                 FastTransferDest_Move           = 0x01
2970         } FastTransferDestConfig_CopyFlags;
2971
2972         typedef [flag(NDR_NOALIGN)] struct {
2973                 uint8                                   handle_idx;
2974                 FastTransferDestConfig_SourceOperation  SourceOperation;
2975                 FastTransferDestConfig_CopyFlags        CopyFlags;
2976         } FastTransferDestinationConfigure_req;
2977
2978         typedef [flag(NDR_NOALIGN)] struct {
2979         } FastTransferDestinationConfigure_repl;
2980
2981         /**************************/
2982         /* EcDoRpc Function 0x54  */
2983         typedef [flag(NDR_NOALIGN)] struct {
2984                 uint16          TransferBufferSize;
2985                 [subcontext(0),subcontext_size(TransferBufferSize),flag(NDR_REMAINING)] DATA_BLOB TransferBuffer;
2986         } FastTransferDestinationPutBuffer_req;
2987
2988         typedef [flag(NDR_NOALIGN)] struct {
2989                 TransferStatus  TransferStatus;
2990                 uint16          InProgressCount;
2991                 uint16          TotalStepCount;
2992                 uint8           Reserved;
2993                 uint16          BufferUsedCount;
2994         } FastTransferDestinationPutBuffer_repl;
2995
2996         /*************************/
2997         /* EcDoRpc Function 0x55 */
2998         typedef [enum8bit] enum {
2999                 MNID_ID = 0,
3000                 MNID_STRING = 1
3001         } ulKind;
3002
3003         typedef [flag(NDR_NOALIGN)] struct {
3004                 uint8                           NameSize;
3005                 [flag(STR_NULLTERM)] string     Name;
3006         } mapi_name;
3007
3008         typedef [nodiscriminant] union {
3009                 [case(MNID_ID)] uint32          lid;
3010                 [case(MNID_STRING)] mapi_name   lpwstr;
3011         } Kind;
3012         
3013         typedef [flag(NDR_NOALIGN)] struct {
3014                 ulKind                          ulKind;
3015                 GUID                            lpguid;
3016                 [switch_is(ulKind)] Kind        kind;
3017         } MAPINAMEID;
3018
3019         typedef [flag(NDR_NOALIGN)] struct {
3020                 uint16          PropertyIdCount;
3021                 uint16          PropertyIds[PropertyIdCount];
3022         } GetNamesFromIDs_req;
3023
3024         typedef [flag(NDR_NOALIGN)] struct {
3025                 uint16          count;
3026                 MAPINAMEID      nameid[count];
3027         } GetNamesFromIDs_repl;
3028
3029         /*************************/
3030         /* EcDoRpc Function 0x56 */
3031         typedef [enum8bit, flag(NDR_PAHEX)] enum {
3032                 GetIDsFromNames_GetOnly         = 0x00,
3033                 GetIDsFromNames_GetOrCreate     = 0x02
3034         } GetIDsFromNamesFlags;
3035
3036         typedef [flag(NDR_NOALIGN)] struct {
3037                 GetIDsFromNamesFlags    ulFlags;
3038                 uint16                  count;
3039                 MAPINAMEID              nameid[count];
3040         } GetIDsFromNames_req;
3041
3042         typedef [flag(NDR_NOALIGN)] struct {
3043                 uint16          count;
3044                 uint16          propID[count];
3045         } GetIDsFromNames_repl;
3046
3047         /*************************/
3048         /* EcDoRpc Function 0x57 */
3049         typedef [flag(NDR_NOALIGN)] struct {
3050                 SBinary_short   ServerEntryId;
3051                 SBinary_short   ClientEntryId;
3052         } UpdateDeferredActionMessages_req;
3053
3054         typedef [flag(NDR_NOALIGN)] struct {
3055         } UpdateDeferredActionMessages_repl;
3056
3057         /*************************/
3058         /* EcDoRpc Function 0x58 */
3059         typedef [flag(NDR_NOALIGN)] struct {
3060                 boolean8        WantAsynchronous;
3061                 boolean8        WantDeleteAssociated;
3062         } EmptyFolder_req;
3063
3064         typedef [flag(NDR_NOALIGN)] struct {
3065                 boolean8        PartialCompletion;
3066         } EmptyFolder_repl;
3067
3068         /*************************/
3069         /* EcDoRpc Function 0x59 */
3070         typedef [flag(NDR_NOALIGN)] struct {
3071                 uint16          MaxRowCount;
3072                 hyper           CategoryId;
3073         } ExpandRow_req;
3074
3075         typedef [flag(NDR_NOALIGN)] struct {
3076                 uint32          ExpandedRowCount;
3077                 uint16          RowCount;
3078                 [flag(NDR_REMAINING)]DATA_BLOB  RowData;
3079         } ExpandRow_repl;
3080
3081         /*************************/
3082         /* EcDoRpc Function 0x5a */
3083         typedef [flag(NDR_NOALIGN)] struct {
3084                 hyper           CategoryId;
3085         } CollapseRow_req;
3086
3087         typedef [flag(NDR_NOALIGN)] struct {
3088                 uint32          CollapsedRowCount;
3089         } CollapseRow_repl;
3090
3091         /*************************/
3092         /* EcDoRpc Function 0x5b */
3093         typedef [flag(NDR_NOALIGN)] struct {
3094                 hyper           RegionOffset;
3095                 hyper           RegionSize;
3096                 uint32          LockFlags;
3097         } LockRegionStream_req;
3098
3099         typedef [flag(NDR_NOALIGN)] struct {
3100         } LockRegionStream_repl;
3101
3102         /*************************/
3103         /* EcDoRpc Function 0x5c */
3104         typedef [flag(NDR_NOALIGN)] struct {
3105                 hyper           RegionOffset;
3106                 hyper           RegionSize;
3107                 uint32          LockFlags;
3108         } UnlockRegionStream_req;
3109
3110         typedef [flag(NDR_NOALIGN)] struct {
3111         } UnlockRegionStream_repl;
3112
3113         /*************************/
3114         /* EcDoRpc Function 0x5d */
3115         typedef [flag(NDR_NOALIGN)] struct {
3116         } CommitStream_req;
3117
3118         typedef [flag(NDR_NOALIGN)] struct {
3119         } CommitStream_repl;
3120
3121         /*************************/
3122         /* EcDoRpc Function 0x5e */
3123         typedef [flag(NDR_NOALIGN)] struct {
3124         } GetStreamSize_req;
3125
3126         typedef [flag(NDR_NOALIGN)] struct {
3127                 uint32          StreamSize;
3128         } GetStreamSize_repl;
3129
3130         /*************************/
3131         /* EcDoRpc Function 0x5f */
3132         typedef [bitmap8bit] bitmap {
3133                 NoStrings       = 0x01,
3134                 NoIds           = 0x02
3135         } QueryFlags;
3136
3137         typedef [nodiscriminant] union {
3138                 [case(0x0)];
3139                 [case(0x1)] GUID guid;
3140         } QueryNamedProperties_guid;
3141
3142         typedef [flag(NDR_NOALIGN)] struct {
3143                 QueryFlags              QueryFlags;
3144                 boolean8                HasGuid;
3145                 [switch_is(HasGuid)]    QueryNamedProperties_guid PropertyGuid;
3146         } QueryNamedProperties_req;
3147
3148         typedef [flag(NDR_NOALIGN)] struct {
3149                 uint16          IdCount;
3150                 uint16          PropertyIds[IdCount];
3151                 MAPINAMEID      PropertyNames[IdCount];
3152         } QueryNamedProperties_repl;
3153   
3154         /*************************/
3155         /* EcDoRpc Function 0x60 */
3156         typedef [flag(NDR_NOALIGN)] struct {
3157                 GUID    DatabaseGuid;
3158         } GetPerUserLongTermIds_req;
3159
3160         typedef [flag(NDR_NOALIGN)] struct {
3161                 uint16          LongTermIdCount;
3162                 LongTermId      LongTermIds[LongTermIdCount];
3163         } GetPerUserLongTermIds_repl;
3164
3165         /*************************/
3166         /* EcDoRpc Function 0x61 */
3167         typedef [flag(NDR_NOALIGN)] struct {
3168                 LongTermId      LongTermId;
3169         } GetPerUserGuid_req;
3170
3171         typedef [flag(NDR_NOALIGN)] struct {
3172                 GUID            DatabaseGuid;
3173         } GetPerUserGuid_repl;
3174
3175         /*************************/
3176         /* EcDoRpc Function 0x63 */
3177         typedef [flag(NDR_NOALIGN)] struct {
3178                 uint8           FolderId[24];
3179                 boolean8        WhatIfChanged;
3180                 uint32          DataOffset;
3181                 uint16          MaxDataSize;
3182         } ReadPerUserInformation_req;
3183
3184         typedef [flag(NDR_NOALIGN)] struct {
3185                 boolean8        HasFinished;
3186                 uint16          DataSize;
3187                 [subcontext(0), subcontext_size(DataSize), flag(NDR_REMAINING)] DATA_BLOB Data;
3188         } ReadPerUserInformation_repl;
3189
3190         /*************************/
3191         /* EcDoRpc Function 0x64 */
3192         typedef [flag(NDR_NOALIGN)] struct {
3193                 LongTermId      FolderId;
3194                 boolean8        HasFinished;
3195                 uint32          DataOffset;
3196                 uint16          DataSize;
3197                 [subcontext(0), subcontext_size(DataSize), flag(NDR_REMAINING)] DATA_BLOB Data;
3198                 GUID            ReplGuid;       /* Note: ReplGuid gets only included under specific circumstances */
3199         } WritePerUserInformation_req;
3200
3201         typedef [flag(NDR_NOALIGN)] struct {
3202         } WritePerUserInformation_repl;
3203
3204         /*************************/
3205         /* EcDoRpc Function 0x66 */
3206         typedef [flag(NDR_NOALIGN)] struct {
3207                 boolean8        WantAsynchronous;
3208                 MSGFLAG_READ    ReadFlags;
3209                 uint16          MessageIdCount;
3210                 hyper           MessageIds[MessageIdCount];
3211         } SetReadFlags_req;
3212
3213         typedef [flag(NDR_NOALIGN)] struct {
3214                 boolean8        PartialCompletion;
3215         } SetReadFlags_repl;
3216
3217         /*************************/
3218         /* EcDoRpc Function 0x67 */
3219         typedef [flag(NDR_NOALIGN)] struct {
3220                 uint8                   handle_idx;
3221                 boolean8                WantAsynchronous;
3222                 CopyFlags               CopyFlags;
3223                 mapi_SPropTagArray      PropertyTags;
3224         } CopyProperties_req;
3225
3226         typedef [flag(NDR_NOALIGN)] struct {
3227                 uint16          PropertyProblemCount;
3228                 PropertyProblem PropertyProblem[PropertyProblemCount];
3229         } CopyProperties_repl;
3230
3231         /*************************/
3232         /* EcDoRpc Function 0x68 */
3233         typedef [flag(NDR_NOALIGN)] struct {
3234                 uint8           unknown;
3235                 hyper           fid;
3236                 astring         lpszMessageClass;
3237                 FILETIME        modiftime;
3238         } ReceiveFolder;
3239
3240         typedef [flag(NDR_NOALIGN)] struct {
3241         } GetReceiveFolderTable_req;
3242
3243         typedef [flag(NDR_NOALIGN)] struct {
3244                 uint32          cValues;
3245                 ReceiveFolder   entries[cValues];
3246         } GetReceiveFolderTable_repl;
3247
3248         /**************************/
3249         /* EcDoRpc Function 0x69  */
3250         typedef [bitmap8bit] bitmap {
3251                 FastTransferCopyProperties_Move         = 0x01,
3252                 FastTransferCopyProperties_Unused1      = 0x02,
3253                 FastTransferCopyProperties_Unused2      = 0x04,
3254                 FastTransferCopyProperties_Unused3      = 0x08
3255         } FastCopyPropertiesCopyFlags;
3256
3257         typedef [flag(NDR_NOALIGN)] struct {
3258                 uint8                           handle_idx;
3259                 uint8                           Level;
3260                 FastCopyPropertiesCopyFlags     CopyFlags;
3261                 FastCopySendOptions             SendOptions;
3262                 mapi_SPropTagArray              PropertyTags;
3263         } FastTransferSourceCopyProperties_req;
3264
3265         typedef [flag(NDR_NOALIGN)] struct {
3266         } FastTransferSourceCopyProperties_repl;
3267
3268         /*************************/
3269         /* EcDoRpc Function 0x6b */
3270         typedef [flag(NDR_NOALIGN)] struct {
3271                 hyper           RowId;
3272                 uint32          RowInstanceNumber;
3273         } GetCollapseState_req;
3274
3275         typedef [flag(NDR_NOALIGN)] struct {
3276                 SBinary_short   CollapseState;
3277         } GetCollapseState_repl;
3278
3279         /*************************/
3280         /* EcDoRpc Function 0x6c */
3281         typedef [flag(NDR_NOALIGN)] struct {
3282                 SBinary_short   CollapseState;
3283         } SetCollapseState_req;
3284
3285         typedef [flag(NDR_NOALIGN)] struct {
3286                 SBinary_short   bookmark;
3287         } SetCollapseState_repl;
3288
3289         /*************************/
3290         /* EcDoRpc Function 0x6d */
3291         typedef [flag(NDR_NOALIGN)] struct {
3292         } GetTransportFolder_req;
3293
3294         typedef [flag(NDR_NOALIGN)] struct {
3295                 hyper           FolderId;
3296         } GetTransportFolder_repl;
3297
3298         /*************************/
3299         /* EcDoRpc Function 0x6e */
3300         typedef [flag(NDR_NOALIGN)] struct {
3301                 uint16  SessionIndex;
3302         } Pending_repl;
3303
3304         /*************************/
3305         /* EcDoRpc Function 0x6f */
3306         typedef [flag(NDR_NOALIGN)] struct {
3307                 astring         AddressType;
3308                 boolean8        WantWin32;
3309         } OptionsData_req;
3310
3311         typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
3312                 [case(0x0)];
3313                 [default]  raw8string   HelpFileName;
3314         } OptionsData_HelpFileName;
3315
3316         typedef [flag(NDR_NOALIGN)] struct {
3317                 uint8                                                   Reserved;
3318                 SBinary_short                                           OptionsInfo;
3319                 uint16                                                  HelpFileSize;
3320                 uint8                                                   HelpFile[HelpFileSize];
3321                 [switch_is(HelpFileSize)] OptionsData_HelpFileName      HelpFileName;
3322         } OptionsData_repl;
3323
3324         /*************************/
3325         /* EcDoRpc Function 0x70 */
3326         typedef [enum8bit] enum {
3327                 Contents        = 0x1,
3328                 Hierarchy       = 0x2
3329         } SynchronizationType;
3330
3331         typedef [bitmap8bit] bitmap {
3332                 SendOptions_Unicode             = 0x1,
3333                 SendOptions_ForUpload           = 0x3,
3334                 SendOptions_RecoverMode         = 0x4,
3335                 SendOptions_ForceUnicode        = 0x8,
3336                 SendOptions_Partial             = 0x10
3337         } SendOptions;
3338
3339         typedef [bitmap16bit] bitmap {
3340                 SynchronizationFlag_Unicode                     = 0x1,
3341                 SynchronizationFlag_NoDeletions                 = 0x2,
3342                 SynchronizationFlag_NoSoftDeletions             = 0x4,
3343                 SynchronizationFlag_ReadState                   = 0x8,
3344                 SynchronizationFlag_FAI                         = 0x10,
3345                 SynchronizationFlag_Normal                      = 0x20,
3346                 SynchronizationFlag_OnlySpecifiedProperties     = 0x80,
3347                 SynchronizationFlag_NoForeignIdentifiers        = 0x100,
3348                 SynchronizationFlag_Reserved                    = 0x1000,
3349                 SynchronizationFlag_BestBody                    = 0x2000,
3350                 SynchronizationFlag_IgnoreSpecifiedOnFAI        = 0x4000,
3351                 SynchronizationFlag_Progress                    = 0x8000
3352         } SynchronizationFlag;
3353
3354         typedef [bitmap32bit] bitmap {
3355                 Eid                     = 0x00000001,
3356                 MessageSize             = 0x00000002,
3357                 Cn                      = 0x00000004,
3358                 OrderByDeliveryTime     = 0x00000008
3359         } SynchronizationExtraFlags;
3360
3361         typedef [flag(NDR_NOALIGN)] struct {
3362                 uint8                                   handle_idx;
3363                 SynchronizationType                     SynchronizationType;
3364                 SendOptions                             SendOptions;
3365                 SynchronizationFlag                     SynchronizationFlag;
3366                 uint16                                  RestrictionSize;
3367                 [subcontext(0),subcontext_size(RestrictionSize),flag(NDR_REMAINING)] DATA_BLOB  RestrictionData;
3368                 SynchronizationExtraFlags               SynchronizationExtraFlags;
3369                 mapi_SPropTagArray                      PropertyTags;
3370         } SyncConfigure_req;
3371
3372         typedef [flag(NDR_NOALIGN)] struct {
3373         } SyncConfigure_repl;
3374
3375         /*************************/
3376         /* EcDoRpc Function 0x72 */
3377         typedef [bitmap8bit] bitmap {
3378                 ImportFlag_Associated           = 0x10,
3379                 ImportFlag_FailOnConflict       = 0x40
3380         } ImportFlag;
3381
3382         typedef [flag(NDR_NOALIGN)] struct {
3383                 uint8                   handle_idx;
3384                 ImportFlag              ImportFlag;
3385                 mapi_SPropValue_array   PropertyValues;
3386         } SyncImportMessageChange_req;
3387
3388         typedef [flag(NDR_NOALIGN)] struct {
3389                 hyper           MessageId;
3390         } SyncImportMessageChange_repl;
3391
3392         /*************************/
3393         /* EcDoRpc Function 0x73 */
3394         typedef [flag(NDR_NOALIGN)] struct {
3395                 mapi_SPropValue_array   HierarchyValues;
3396                 mapi_SPropValue_array   PropertyValues;
3397         } SyncImportHierarchyChange_req;
3398
3399         typedef [flag(NDR_NOALIGN)] struct {
3400                 hyper                   FolderId;
3401         } SyncImportHierarchyChange_repl;
3402
3403         /*************************/
3404         /* EcDoRpc Function 0x74 */
3405         typedef [bitmap8bit] bitmap {
3406                 SyncImportDeletes_Hierarchy     = 0x01,
3407                 SyncImportDeletes_HardDelete    = 0x02
3408         } SyncImportDeletesFlags;
3409
3410         typedef [flag(NDR_NOALIGN)] struct {
3411                 SyncImportDeletesFlags  Flags;
3412                 mapi_SPropValue_array   PropertyValues;
3413         } SyncImportDeletes_req;
3414
3415         typedef [flag(NDR_NOALIGN)] struct {
3416         } SyncImportDeletes_repl;
3417
3418         /*************************/
3419         /* EcDoRpc Function 0x75 */
3420         typedef [v1_enum,flag(NDR_PAHEX)] enum {
3421                 SP_PidTagIdsetGiven     = 0x40170003,
3422                 SP_PidTagCnsetSeen      = 0x67960102,
3423                 SP_PidTagCnsetSeenFAI   = 0x67da0102,
3424                 SP_PidTagCnsetRead      = 0x67d20102
3425         } StateProperty;
3426
3427         typedef [v1_enum,flag(NDR_PAHEX)] enum {
3428                 DP_PidTagIdsetDeleted           = 0x67e50102,
3429                 DP_PidTagIdsetNoLongerInScope   = 0x40210102,
3430                 DP_PidTagIdsetExpired           = 0x67930102,
3431                 DP_PidTagIdsetRead              = 0x402d0102,
3432                 DP_PidTagIdsetUnread            = 0x402e0102
3433         } DeltaProperty;
3434
3435         typedef [flag(NDR_NOALIGN)] struct {
3436                 StateProperty           StateProperty;
3437                 uint32                  TransferBufferSize;
3438         } SyncUploadStateStreamBegin_req;
3439
3440         typedef [flag(NDR_NOALIGN)] struct {
3441         } SyncUploadStateStreamBegin_repl;
3442
3443         /*************************/
3444         /* EcDoRpc Function 0x76 */
3445         typedef [flag(NDR_NOALIGN)] struct {
3446                 uint32                  StreamDataSize;
3447                 uint8                   StreamData[StreamDataSize];
3448         } SyncUploadStateStreamContinue_req;
3449
3450         typedef [flag(NDR_NOALIGN)] struct {
3451         } SyncUploadStateStreamContinue_repl;
3452
3453         /*************************/
3454         /* EcDoRpc Function 0x77 */
3455         typedef [flag(NDR_NOALIGN)] struct {
3456         } SyncUploadStateStreamEnd_req;
3457
3458         typedef [flag(NDR_NOALIGN)] struct {
3459         } SyncUploadStateStreamEnd_repl;
3460
3461         /*************************/
3462         /* EcDoRpc Function 0x78 */
3463         typedef [flag(NDR_NOALIGN)] struct {
3464                 uint32          SourceFolderIdSize;
3465                 uint8           SourceFolderId[SourceFolderIdSize];
3466                 uint32          SourceMessageIdSize;
3467                 uint8           SourceMessageId[SourceMessageIdSize];
3468                 uint32          PredecessorChangeListSize;
3469                 uint8           PredecessorChangeList[PredecessorChangeListSize];
3470                 uint32          DestinationMessageIdSize;
3471                 uint8           DestinationMessageId[DestinationMessageIdSize];
3472                 uint32          ChangeNumberSize;
3473                 uint8           ChangeNumber[ChangeNumberSize];
3474         } SyncImportMessageMove_req;
3475
3476         typedef [flag(NDR_NOALIGN)] struct {
3477                 hyper           MessageId;
3478         } SyncImportMessageMove_repl;
3479
3480         /*************************/
3481         /* EcDoRpc Function 0x79 */
3482         typedef [flag(NDR_NOALIGN)] struct {
3483                 [subcontext(2)] mapi_SPropValue_array   values;
3484         } SetPropertiesNoReplicate_req;
3485
3486         typedef [flag(NDR_NOALIGN)] struct {
3487                 uint16          PropertyProblemCount;
3488                 PropertyProblem PropertyProblem[PropertyProblemCount];
3489         } SetPropertiesNoReplicate_repl;
3490
3491         /*************************/
3492         /* EcDoRpc Function 0x7a */
3493         typedef [flag(NDR_NOALIGN)] struct {
3494                 mapi_SPropTagArray      PropertyTags;
3495         } DeletePropertiesNoReplicate_req;
3496
3497         typedef [flag(NDR_NOALIGN)] struct {
3498                 uint16          PropertyProblemCount;
3499                 PropertyProblem PropertyProblem[PropertyProblemCount];
3500         } DeletePropertiesNoReplicate_repl;
3501
3502         /*************************/
3503         /* EcDoRpc Function 0x7b */
3504         typedef [public,bitmap32bit] bitmap {
3505                 STORE_HAS_SEARCHES              = 0x010000000
3506         } StoreState;
3507
3508         typedef [flag(NDR_NOALIGN)] struct {
3509         } GetStoreState_req;
3510
3511         typedef [flag(NDR_NOALIGN)] struct {
3512                 StoreState      StoreState;
3513         } GetStoreState_repl;
3514
3515         /*************************/
3516         /* EcDoRpc Function 0x7e */
3517         typedef [flag(NDR_NOALIGN)] struct {
3518                 uint8           handle_idx;
3519                 boolean8        IsContentsCollector;
3520         } SyncOpenCollector_req;
3521
3522         typedef [flag(NDR_NOALIGN)] struct {
3523         } SyncOpenCollector_repl;
3524
3525         /*************************/
3526         /* EcDoRpc Function 0x7f */
3527         typedef [flag(NDR_NOALIGN)] struct {
3528                 uint32          IdCount;
3529         } GetLocalReplicaIds_req;
3530
3531         typedef [flag(NDR_NOALIGN)] struct {
3532                 GUID            ReplGuid;
3533                 uint8           GlobalCount[6];
3534         } GetLocalReplicaIds_repl;
3535
3536         /*************************/
3537         /* EcDoRpc Function 0x80 */
3538         typedef [public,flag(NDR_NOALIGN)] struct {
3539                 uint16          MessageIdSize;
3540                 uint8           MessageId[MessageIdSize];
3541                 boolean8        MarkAsRead;
3542         } MessageReadState;
3543
3544         typedef [flag(NDR_NOALIGN)] struct {
3545                 [subcontext(2),flag(NDR_REMAINING)] DATA_BLOB MessageReadStates;
3546         } SyncImportReadStateChanges_req;
3547
3548         typedef [flag(NDR_NOALIGN)] struct {
3549         } SyncImportReadStateChanges_repl;
3550
3551         /*************************/
3552         /* EcDoRpc Function 0x81 */
3553         typedef [flag(NDR_NOALIGN)] struct {
3554         } ResetTable_req;
3555
3556         typedef [flag(NDR_NOALIGN)] struct {
3557         } ResetTable_repl;
3558
3559         /*************************/
3560         /* EcDoRpc Function 0x82 */
3561         typedef [flag(NDR_NOALIGN)] struct {
3562                 uint8           handle_idx;
3563         } SyncGetTransferState_req;
3564
3565         typedef [flag(NDR_NOALIGN)] struct {
3566         } SyncGetTransferState_repl;
3567
3568         /*************************/
3569         /* EcDoRpc Function 0x83 */
3570         typedef [flag(NDR_NOALIGN)] struct {
3571                 uint8           handle_idx;
3572         } SyncOpenAdvisor_req;
3573
3574         typedef [flag(NDR_NOALIGN)] struct {
3575         } SyncOpenAdvisor_repl;
3576
3577         /*************************/
3578         /* EcDoRpc Function 0x86 */
3579         typedef [flag(NDR_NOALIGN)] struct {
3580                 uint16          version[3];
3581         } TellVersion_req;
3582
3583         typedef [flag(NDR_NOALIGN)] struct {
3584         } TellVersion_repl;
3585
3586         /*************************/
3587         /* EcDoRpc Function 0x87 */
3588         typedef [flag(NDR_NOALIGN)] struct {
3589                 uint8           handle_idx;
3590                 asclstr         name;
3591         } OpenPublicFolderByName_req; 
3592
3593         typedef [flag(NDR_NOALIGN)] struct {
3594                 boolean8                                HasRules;
3595                 boolean8                                IsGhosted;
3596                 [switch_is(IsGhosted)] IsGhosted        Ghost;
3597         } OpenPublicFolderByName_repl;
3598
3599         /*************************/
3600         /* EcDoRpc Function 0x88 */
3601         typedef [flag(NDR_NOALIGN)] struct {
3602                 GUID    NotificationGuid;
3603         } SetSyncNotificationGuid_req;
3604
3605         typedef [flag(NDR_NOALIGN)] struct {
3606         } SetSyncNotificationGuid_repl;
3607
3608         /*************************/
3609         /* EcDoRpc Function 0x89 */
3610         typedef [flag(NDR_NOALIGN)] struct {
3611                 SBinary_short   bookmark;
3612         } FreeBookmark_req;
3613
3614         typedef [flag(NDR_NOALIGN)] struct {
3615         } FreeBookmark_repl;
3616
3617         /*************************/
3618         /* EcDoRpc Function 0x90 */
3619         typedef [flag(NDR_NOALIGN)] struct {
3620                 [subcontext(2), flag(NDR_REMAINING)] DATA_BLOB  data;
3621         } WriteAndCommitStream_req;
3622
3623
3624         typedef [flag(NDR_NOALIGN)] struct {
3625                 uint16          WrittenSize;
3626         } WriteAndCommitStream_repl;
3627
3628         /**************************/
3629         /* EcDoRpc Function 0x91  */
3630         typedef [flag(NDR_NOALIGN)] struct {
3631                 boolean8        WantAsynchronous;
3632                 boolean8        NotifyNonRead;
3633                 uint16          MessageIdCount;
3634                 hyper           MessageIds[MessageIdCount];
3635         } HardDeleteMessages_req;
3636
3637         typedef [flag(NDR_NOALIGN)] struct {
3638                 boolean8        PartialCompletion;
3639         } HardDeleteMessages_repl;
3640
3641         /*************************/
3642         /* EcDoRpc Function 0x92 */
3643         typedef [flag(NDR_NOALIGN)] struct {
3644                 boolean8        WantAsynchronous;
3645                 boolean8        WantDeleteAssociated;
3646         } HardDeleteMessagesAndSubfolders_req;
3647
3648         typedef [flag(NDR_NOALIGN)] struct {
3649                 boolean8        PartialCompletion;
3650         } HardDeleteMessagesAndSubfolders_repl;
3651
3652         /*************************/
3653         /* EcDoRpc Function 0x93 */
3654         typedef [public,flag(NDR_NOALIGN)] struct {
3655                 LongTermId      MinLongTermId;
3656                 LongTermId      MaxLongTermId;
3657         } LongTermIdRange;
3658
3659         typedef [flag(NDR_NOALIGN)] struct {
3660                 uint16                  DataSize;
3661                 uint32                  LongTermIdRangeCount;
3662                 LongTermIdRange         LongTermIdRanges[LongTermIdRangeCount];
3663         } SetLocalReplicaMidsetDeleted_req;
3664
3665         typedef [flag(NDR_NOALIGN)] struct {
3666         } SetLocalReplicaMidsetDeleted_repl;
3667
3668         /**************************/
3669         /* EcDoRpc Function 0xF9   */
3670         typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
3671         } Backoff_req;
3672
3673         typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
3674         } Backoff_repl;
3675
3676         /*************************/
3677         /* EcDoRpc Function 0xFE */
3678         typedef [public,bitmap8bit] bitmap {
3679                 LogonPrivate    = 0x1,
3680                 UnderCover      = 0x2,
3681                 Ghosted         = 0x4,
3682                 SpIProcess      = 0x8
3683         } LogonFlags;
3684
3685         typedef [public,bitmap32bit] bitmap {
3686                 PUBLIC                          = 0x2,
3687                 HOME_LOGON                      = 0x4,
3688                 TAKE_OWNERSHIP                  = 0x8,
3689                 ALTERNATE_SERVER                = 0x100,
3690                 IGNORE_HOME_MDB                 = 0x200,
3691                 NO_MAIL                         = 0x400,
3692                 USE_PER_MDB_REPLID_MAPPING      = 0x010000000
3693         } OpenFlags;
3694
3695         typedef [enum8bit] enum {
3696                 DayOfWeek_Sunday        = 0x0,
3697                 DayOfWeek_Monday        = 0x1,
3698                 DayOfWeek_Tuesday       = 0x2,
3699                 DayOfWeek_Wednesday     = 0x3,
3700                 DayOfWeek_Thursday      = 0x4,
3701                 DayOfWeek_Friday        = 0x5,
3702                 DayOfWeek_Saturday      = 0x6
3703         } DayOfWeek;
3704
3705         typedef [flag(NDR_NOALIGN)] struct {
3706                 uint8           Seconds;
3707                 uint8           Minutes;
3708                 uint8           Hour;
3709                 DayOfWeek       DayOfWeek;
3710                 uint8           Day;
3711                 uint8           Month;
3712                 uint16          Year;
3713         } LogonTime;
3714
3715         typedef [bitmap8bit] bitmap {
3716                 ResponseFlags_Reserved          = 0x1,
3717                 ResponseFlags_OwnerRight        = 0x2,
3718                 ResponseFlags_SendAsRight       = 0x4,
3719                 ResponseFlags_OOF               = 0x10
3720         } ResponseFlags;
3721
3722         typedef [flag(NDR_NOALIGN)] struct {
3723                 /* folders */
3724                 hyper                   Root;
3725                 hyper                   IPMSubTree;
3726                 hyper                   NonIPMSubTree;
3727                 hyper                   EFormsRegistry;
3728                 hyper                   FreeBusy;
3729                 hyper                   OAB;
3730                 hyper                   LocalizedEFormsRegistry;
3731                 hyper                   LocalFreeBusy;
3732                 hyper                   LocalOAB;
3733                 hyper                   NNTPIndex;
3734                 hyper                   _empty[3];
3735
3736                 uint16                  ReplId;
3737                 GUID                    Guid;
3738                 GUID                    PerUserGuid;
3739         } store_pf;
3740
3741         typedef [flag(NDR_NOALIGN)] struct {
3742                 /* folders */
3743                 hyper                   Root;
3744                 hyper                   DeferredAction;
3745                 hyper                   SpoolerQueue;
3746                 hyper                   IPMSubTree;
3747                 hyper                   Inbox;
3748                 hyper                   Outbox;
3749                 hyper                   SentItems;
3750                 hyper                   DeletedItems;
3751                 hyper                   CommonViews;
3752                 hyper                   Schedule;
3753                 hyper                   Search;
3754                 hyper                   Views;
3755                 hyper                   Shortcuts;
3756
3757                 ResponseFlags           ResponseFlags;
3758                 GUID                    MailboxGuid;
3759                 uint16                  ReplId;
3760                 GUID                    ReplGUID;
3761                 LogonTime               LogonTime;
3762                 hyper                   GwartTime;
3763                 StoreState              StoreState;
3764         } store_mailbox;
3765
3766         typedef [nodiscriminant] union {
3767                 [case(0x0)]             store_pf        store_pf;
3768                 [case(0x3)]             store_mailbox   store_mailbox;
3769                 [case(0x9)]             store_mailbox   store_mailbox;
3770                 [case(0x19)]            store_mailbox   store_mailbox;
3771                 [case(LogonPrivate)]    store_mailbox   store_mailbox;
3772         } LogonType;
3773
3774         typedef [nopush,flag(NDR_NOALIGN)] struct {
3775                 LogonFlags      LogonFlags;
3776                 OpenFlags       OpenFlags;
3777                 StoreState      StoreState;
3778                 ascstr3         EssDN;
3779         } Logon_req;
3780
3781         typedef [flag(NDR_NOALIGN)] struct {
3782                 LogonFlags                              LogonFlags;
3783                 [switch_is(LogonFlags)] LogonType       LogonType;
3784         } Logon_repl;
3785
3786         /* Logon redirect response buffer (error_code == ecWrongServer) */
3787         typedef [public,flag(NDR_NOALIGN)] struct {
3788                 LogonFlags      LogonFlags;
3789                 uint8           ServerNameSize;
3790                 astring         ServerName;
3791         } Logon_redirect;
3792
3793         /**************************/
3794         /* EcDoRpc Function 0xFF   */
3795         typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
3796         } BufferTooSmall_req;
3797
3798         typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
3799         } BufferTooSmall_repl;
3800
3801         /*************************/
3802         /* EcDoRpc Function 0xA5 */
3803         typedef [flag(NDR_NOALIGN)] struct {
3804                 SBinary_short   bin;
3805         } proxypack_req;
3806
3807         typedef [flag(NDR_NOALIGN)] struct {
3808                 SBinary_short   bin;
3809         } proxypack_repl;
3810
3811         typedef [public, nodiscriminant] union {
3812                 [case(op_MAPI_Release)] Release_req mapi_Release;
3813                 [case(op_MAPI_OpenFolder)] OpenFolder_req mapi_OpenFolder;
3814                 [case(op_MAPI_OpenMessage)] OpenMessage_req mapi_OpenMessage;
3815                 [case(op_MAPI_GetHierarchyTable)] GetHierarchyTable_req mapi_GetHierarchyTable;
3816                 [case(op_MAPI_GetContentsTable)] GetContentsTable_req mapi_GetContentsTable;
3817                 [case(op_MAPI_CreateMessage)] CreateMessage_req mapi_CreateMessage;
3818                 [case(op_MAPI_GetProps)] GetProps_req mapi_GetProps;
3819                 [case(op_MAPI_GetPropsAll)] GetPropsAll_req mapi_GetPropsAll;
3820                 [case(op_MAPI_GetPropList)] GetPropList_req mapi_GetPropList;
3821                 [case(op_MAPI_SetProps)] SetProps_req mapi_SetProps;
3822                 [case(op_MAPI_DeleteProps)] DeleteProps_req mapi_DeleteProps;
3823                 [case(op_MAPI_SaveChangesMessage)] SaveChangesMessage_req mapi_SaveChangesMessage;
3824                 [case(op_MAPI_SetMessageReadFlag)] SetMessageReadFlag_req mapi_SetMessageReadFlag;
3825                 [case(op_MAPI_ReloadCachedInformation)] ReloadCachedInformation_req mapi_ReloadCachedInformation;
3826                 [case(op_MAPI_SetColumns)] SetColumns_req mapi_SetColumns;
3827                 [case(op_MAPI_SortTable)] SortTable_req mapi_SortTable;
3828                 [case(op_MAPI_Restrict)] Restrict_req mapi_Restrict;
3829                 [case(op_MAPI_RemoveAllRecipients)] RemoveAllRecipients_req mapi_RemoveAllRecipients;
3830                 [case(op_MAPI_ModifyRecipients)] ModifyRecipients_req mapi_ModifyRecipients;
3831                 [case(op_MAPI_ReadRecipients)] ReadRecipients_req mapi_ReadRecipients;
3832                 [case(op_MAPI_QueryRows)] QueryRows_req mapi_QueryRows;
3833                 [case(op_MAPI_GetStatus)] GetStatus_req mapi_GetStatus;
3834                 [case(op_MAPI_QueryPosition)] QueryPosition_req mapi_QueryPosition;
3835                 [case(op_MAPI_SeekRow)] SeekRow_req mapi_SeekRow;
3836                 [case(op_MAPI_SeekRowBookmark)] SeekRowBookmark_req mapi_SeekRowBookmark;
3837                 [case(op_MAPI_SeekRowApprox)] SeekRowApprox_req mapi_SeekRowApprox;
3838                 [case(op_MAPI_CreateBookmark)] CreateBookmark_req mapi_CreateBookmark;
3839                 [case(op_MAPI_CreateFolder)] CreateFolder_req mapi_CreateFolder;
3840                 [case(op_MAPI_DeleteFolder)] DeleteFolder_req mapi_DeleteFolder;
3841                 [case(op_MAPI_DeleteMessages)] DeleteMessages_req mapi_DeleteMessages;
3842                 [case(op_MAPI_GetMessageStatus)] GetMessageStatus_req mapi_GetMessageStatus;
3843                 [case(op_MAPI_SetMessageStatus)] SetMessageStatus_req mapi_SetMessageStatus;
3844                 [case(op_MAPI_GetAttachmentTable)] GetAttachmentTable_req mapi_GetAttachmentTable;
3845                 [case(op_MAPI_OpenAttach)] OpenAttach_req mapi_OpenAttach;
3846                 [case(op_MAPI_CreateAttach)] CreateAttach_req mapi_CreateAttach;
3847                 [case(op_MAPI_DeleteAttach)] DeleteAttach_req mapi_DeleteAttach;
3848                 [case(op_MAPI_SaveChangesAttachment)] SaveChangesAttachment_req mapi_SaveChangesAttachment;
3849                 [case(op_MAPI_SetReceiveFolder)] SetReceiveFolder_req mapi_SetReceiveFolder;
3850                 [case(op_MAPI_GetReceiveFolder)] GetReceiveFolder_req mapi_GetReceiveFolder;
3851                 [case(op_MAPI_RegisterNotification)] RegisterNotification_req mapi_RegisterNotification;
3852                 [case(op_MAPI_OpenStream)] OpenStream_req mapi_OpenStream;
3853                 [case(op_MAPI_ReadStream)] ReadStream_req mapi_ReadStream;
3854                 [case(op_MAPI_WriteStream)] WriteStream_req mapi_WriteStream;
3855                 [case(op_MAPI_SeekStream)] SeekStream_req mapi_SeekStream;
3856                 [case(op_MAPI_SetStreamSize)] SetStreamSize_req mapi_SetStreamSize;
3857                 [case(op_MAPI_SetSearchCriteria)] SetSearchCriteria_req mapi_SetSearchCriteria;
3858                 [case(op_MAPI_GetSearchCriteria)] GetSearchCriteria_req mapi_GetSearchCriteria;
3859                 [case(op_MAPI_SubmitMessage)] SubmitMessage_req mapi_SubmitMessage;
3860                 [case(op_MAPI_MoveCopyMessages)] MoveCopyMessages_req mapi_MoveCopyMessages;
3861                 [case(op_MAPI_AbortSubmit)] AbortSubmit_req mapi_AbortSubmit;
3862                 [case(op_MAPI_MoveFolder)] MoveFolder_req mapi_MoveFolder;
3863                 [case(op_MAPI_CopyFolder)] CopyFolder_req mapi_CopyFolder;
3864                 [case(op_MAPI_QueryColumnsAll)] QueryColumnsAll_req mapi_QueryColumnsAll;
3865                 [case(op_MAPI_Abort)] Abort_req mapi_Abort;
3866                 [case(op_MAPI_CopyTo)] CopyTo_req mapi_CopyTo;
3867                 [case(op_MAPI_CopyToStream)] CopyToStream_req mapi_CopyToStream;
3868                 [case(op_MAPI_CloneStream)] CloneStream_req mapi_CloneStream;
3869                 [case(op_MAPI_GetPermissionsTable)] GetPermissionsTable_req mapi_GetPermissionsTable;
3870                 [case(op_MAPI_GetRulesTable)] GetRulesTable_req mapi_GetRulesTable;
3871                 [case(op_MAPI_ModifyPermissions)] ModifyPermissions_req mapi_ModifyPermissions;
3872                 [case(op_MAPI_ModifyRules)] ModifyRules_req mapi_ModifyRules;
3873                 [case(op_MAPI_GetOwningServers)] GetOwningServers_req mapi_GetOwningServers;
3874                 [case(op_MAPI_LongTermIdFromId)] LongTermIdFromId_req mapi_LongTermIdFromId;
3875                 [case(op_MAPI_IdFromLongTermId)] IdFromLongTermId_req mapi_IdFromLongTermId;
3876                 [case(op_MAPI_PublicFolderIsGhosted)] PublicFolderIsGhosted_req mapi_PublicFolderIsGhosted;
3877                 [case(op_MAPI_OpenEmbeddedMessage)] OpenEmbeddedMessage_req mapi_OpenEmbeddedMessage;
3878                 [case(op_MAPI_SetSpooler)] SetSpooler_req mapi_SetSpooler;
3879                 [case(op_MAPI_SpoolerLockMessage)] SpoolerLockMessage_req mapi_SpoolerLockMessage;
3880                 [case(op_MAPI_AddressTypes)] AddressTypes_req mapi_AddressTypes;
3881                 [case(op_MAPI_TransportSend)] TransportSend_req mapi_TransportSend;
3882                 [case(op_MAPI_FastTransferSourceCopyMessages)] FastTransferSourceCopyMessages_req mapi_FastTransferSourceCopyMessages;
3883                 [case(op_MAPI_FastTransferSourceCopyFolder)] FastTransferSourceCopyFolder_req mapi_FastTransferSourceCopyFolder;
3884                 [case(op_MAPI_FastTransferSourceCopyTo)] FastTransferSourceCopyTo_req mapi_FastTransferSourceCopyTo;
3885                 [case(op_MAPI_FastTransferSourceGetBuffer)] FastTransferSourceGetBuffer_req mapi_FastTransferSourceGetBuffer;
3886                 [case(op_MAPI_FindRow)] FindRow_req mapi_FindRow;
3887                 [case(op_MAPI_Progress)] Progress_req mapi_Progress;
3888                 [case(op_MAPI_TransportNewMail)] TransportNewMail_req mapi_TransportNewMail;
3889                 [case(op_MAPI_GetValidAttachments)] GetValidAttachments_req mapi_GetValidAttachments;
3890                 [case(op_MAPI_FastTransferDestConfigure)] FastTransferDestinationConfigure_req mapi_FastTransferDestinationConfigure;
3891                 [case(op_MAPI_FastTransferDestPutBuffer)] FastTransferDestinationPutBuffer_req mapi_FastTransferDestinationPutBuffer;
3892                 [case(op_MAPI_GetNamesFromIDs)] GetNamesFromIDs_req mapi_GetNamesFromIDs;
3893                 [case(op_MAPI_GetIDsFromNames)] GetIDsFromNames_req mapi_GetIDsFromNames;
3894                 [case(op_MAPI_UpdateDeferredActionMessages)] UpdateDeferredActionMessages_req mapi_UpdateDeferredActionMessages;
3895                 [case(op_MAPI_EmptyFolder)] EmptyFolder_req mapi_EmptyFolder;
3896                 [case(op_MAPI_ExpandRow)] ExpandRow_req mapi_ExpandRow;
3897                 [case(op_MAPI_CollapseRow)] CollapseRow_req mapi_CollapseRow;
3898                 [case(op_MAPI_LockRegionStream)] LockRegionStream_req mapi_LockRegionStream;
3899                 [case(op_MAPI_UnlockRegionStream)] UnlockRegionStream_req mapi_UnlockRegionStream;
3900                 [case(op_MAPI_CommitStream)] CommitStream_req mapi_CommitStream;
3901                 [case(op_MAPI_GetStreamSize)] GetStreamSize_req mapi_GetStreamSize;
3902                 [case(op_MAPI_QueryNamedProperties)] QueryNamedProperties_req mapi_QueryNamedProperties;
3903                 [case(op_MAPI_GetPerUserLongTermIds)] GetPerUserLongTermIds_req mapi_GetPerUserLongTermIds;
3904                 [case(op_MAPI_GetPerUserGuid)] GetPerUserGuid_req mapi_GetPerUserGuid;
3905                 [case(op_MAPI_ReadPerUserInformation)] ReadPerUserInformation_req mapi_ReadPerUserInformation;
3906                 [case(op_MAPI_WritePerUserInformation)] WritePerUserInformation_req mapi_WritePerUserInformation;
3907                 [case(op_MAPI_SetReadFlags)] SetReadFlags_req mapi_SetReadFlags;
3908                 [case(op_MAPI_CopyProperties)] CopyProperties_req mapi_CopyProperties;
3909                 [case(op_MAPI_GetReceiveFolderTable)] GetReceiveFolderTable_req mapi_GetReceiveFolderTable;
3910                 [case(op_MAPI_FastTransferSourceCopyProps)] FastTransferSourceCopyProperties_req mapi_FastTransferSourceCopyProperties;
3911                 [case(op_MAPI_GetCollapseState)] GetCollapseState_req mapi_GetCollapseState;
3912                 [case(op_MAPI_SetCollapseState)] SetCollapseState_req mapi_SetCollapseState;
3913                 [case(op_MAPI_GetTransportFolder)] GetTransportFolder_req mapi_GetTransportFolder;
3914                 [case(op_MAPI_OptionsData)] OptionsData_req mapi_OptionsData;
3915                 [case(op_MAPI_SyncConfigure)] SyncConfigure_req mapi_SyncConfigure;
3916                 [case(op_MAPI_SyncImportMessageChange)] SyncImportMessageChange_req mapi_SyncImportMessageChange;
3917                 [case(op_MAPI_SyncImportHierarchyChange)] SyncImportHierarchyChange_req mapi_SyncImportHierarchyChange;
3918                 [case(op_MAPI_SyncImportDeletes)] SyncImportDeletes_req mapi_SyncImportDeletes;
3919                 [case(op_MAPI_SyncUploadStateStreamBegin)] SyncUploadStateStreamBegin_req mapi_SyncUploadStateStreamBegin;
3920                 [case(op_MAPI_SyncUploadStateStreamContinue)] SyncUploadStateStreamContinue_req mapi_SyncUploadStateStreamContinue;
3921                 [case(op_MAPI_SyncUploadStateStreamEnd)] SyncUploadStateStreamEnd_req mapi_SyncUploadStateStreamEnd;
3922                 [case(op_MAPI_SyncImportMessageMove)] SyncImportMessageMove_req mapi_SyncImportMessageMove;
3923                 [case(op_MAPI_SetPropertiesNoReplicate)] SetPropertiesNoReplicate_req mapi_SetPropertiesNoReplicate;
3924                 [case(op_MAPI_DeletePropertiesNoReplicate)] DeletePropertiesNoReplicate_req mapi_DeletePropertiesNoReplicate;
3925                 [case(op_MAPI_GetStoreState)] GetStoreState_req mapi_GetStoreState;
3926                 [case(op_MAPI_SyncOpenCollector)] SyncOpenCollector_req mapi_SyncOpenCollector;
3927                 [case(op_MAPI_GetLocalReplicaIds)] GetLocalReplicaIds_req mapi_GetLocalReplicaIds;
3928                 [case(op_MAPI_SyncImportReadStateChanges)] SyncImportReadStateChanges_req mapi_SyncImportReadStateChanges;
3929                 [case(op_MAPI_ResetTable)] ResetTable_req mapi_ResetTable;
3930                 [case(op_MAPI_SyncGetTransferState)] SyncGetTransferState_req mapi_SyncGetTransferState;
3931                 [case(op_MAPI_SyncOpenAdvisor)] SyncOpenAdvisor_req mapi_SyncOpenAdvisor;
3932                 [case(op_MAPI_TellVersion)] TellVersion_req mapi_TellVersion;
3933                 [case(op_MAPI_OpenPublicFolderByName)] OpenPublicFolderByName_req mapi_OpenPublicFolderByName;
3934                 [case(op_MAPI_SetSyncNotificationGuid)] SetSyncNotificationGuid_req mapi_SetSyncNotificationGuid;
3935                 [case(op_MAPI_FreeBookmark)] FreeBookmark_req mapi_FreeBookmark;
3936                 [case(op_MAPI_WriteAndCommitStream)] WriteAndCommitStream_req mapi_WriteAndCommitStream;
3937                 [case(op_MAPI_HardDeleteMessages)] HardDeleteMessages_req mapi_HardDeleteMessages;
3938                 [case(op_MAPI_HardDeleteMessagesAndSubfolders)] HardDeleteMessagesAndSubfolders_req mapi_HardDeleteMessagesAndSubfolders;
3939                 [case(op_MAPI_SetLocalReplicaMidsetDeleted)] SetLocalReplicaMidsetDeleted_req mapi_SetLocalReplicaMidsetDeleted;
3940                 [case(op_MAPI_Backoff)] Backoff_req mapi_Backoff;
3941                 [case(op_MAPI_Logon)] Logon_req mapi_Logon;
3942                 [case(op_MAPI_BufferTooSmall)] BufferTooSmall_req mapi_BufferTooSmall;
3943                 [case(op_MAPI_proxypack)] proxypack_req mapi_proxypack;
3944         } EcDoRpc_MAPI_REQ_UNION;
3945
3946         typedef [public, nodiscriminant] union {
3947                 [case(op_MAPI_Release)] Release_repl mapi_Release;
3948                 [case(op_MAPI_OpenFolder)] OpenFolder_repl mapi_OpenFolder;
3949                 [case(op_MAPI_OpenMessage)] OpenMessage_repl mapi_OpenMessage;
3950                 [case(op_MAPI_GetHierarchyTable)] GetHierarchyTable_repl mapi_GetHierarchyTable;
3951                 [case(op_MAPI_GetContentsTable)] GetContentsTable_repl mapi_GetContentsTable;
3952                 [case(op_MAPI_CreateMessage)] CreateMessage_repl mapi_CreateMessage;
3953                 [case(op_MAPI_GetProps)] GetProps_repl mapi_GetProps;
3954                 [case(op_MAPI_GetPropsAll)] GetPropsAll_repl mapi_GetPropsAll;
3955                 [case(op_MAPI_GetPropList)] GetPropList_repl mapi_GetPropList;
3956                 [case(op_MAPI_SetProps)] SetProps_repl mapi_SetProps;
3957                 [case(op_MAPI_DeleteProps)] DeleteProps_repl mapi_DeleteProps;
3958                 [case(op_MAPI_SaveChangesMessage)] SaveChangesMessage_repl mapi_SaveChangesMessage;
3959                 [case(op_MAPI_RemoveAllRecipients)] RemoveAllRecipients_repl mapi_RemoveAllRecipients;
3960                 [case(op_MAPI_ModifyRecipients)] ModifyRecipients_repl mapi_ModifyRecipients;
3961                 [case(op_MAPI_ReadRecipients)] ReadRecipients_repl mapi_ReadRecipients;
3962                 [case(op_MAPI_SetMessageReadFlag)] SetMessageReadFlag_repl mapi_SetMessageReadFlag;
3963                 [case(op_MAPI_ReloadCachedInformation)] ReloadCachedInformation_repl mapi_ReloadCachedInformation;
3964                 [case(op_MAPI_SetColumns)] SetColumns_repl mapi_SetColumns;
3965                 [case(op_MAPI_SortTable)] SortTable_repl mapi_SortTable;
3966                 [case(op_MAPI_Restrict)] Restrict_repl mapi_Restrict;
3967                 [case(op_MAPI_QueryRows)] QueryRows_repl mapi_QueryRows;
3968                 [case(op_MAPI_GetStatus)] GetStatus_repl mapi_GetStatus;
3969                 [case(op_MAPI_QueryPosition)] QueryPosition_repl mapi_QueryPosition;
3970                 [case(op_MAPI_SeekRow)] SeekRow_repl mapi_SeekRow;
3971                 [case(op_MAPI_SeekRowBookmark)] SeekRowBookmark_repl mapi_SeekRowBookmark;
3972                 [case(op_MAPI_SeekRowApprox)] SeekRowApprox_repl mapi_SeekRowApprox;
3973                 [case(op_MAPI_CreateBookmark)] CreateBookmark_repl mapi_CreateBookmark;
3974                 [case(op_MAPI_CreateFolder)] CreateFolder_repl mapi_CreateFolder;
3975                 [case(op_MAPI_DeleteFolder)] DeleteFolder_repl mapi_DeleteFolder;
3976                 [case(op_MAPI_DeleteMessages)] DeleteMessages_repl mapi_DeleteMessages;
3977                 [case(op_MAPI_SetMessageStatus)] SetMessageStatus_repl mapi_SetMessageStatus;
3978                 [case(op_MAPI_GetAttachmentTable)] GetAttachmentTable_repl mapi_GetAttachmentTable;
3979                 [case(op_MAPI_OpenAttach)] OpenAttach_repl mapi_OpenAttach;
3980                 [case(op_MAPI_CreateAttach)] CreateAttach_repl mapi_CreateAttach;
3981                 [case(op_MAPI_DeleteAttach)] DeleteAttach_repl mapi_DeleteAttach;
3982                 [case(op_MAPI_SaveChangesAttachment)] SaveChangesAttachment_repl mapi_SaveChangesAttachment;
3983                 [case(op_MAPI_SetReceiveFolder)] SetReceiveFolder_repl mapi_SetReceiveFolder;
3984                 [case(op_MAPI_GetReceiveFolder)] GetReceiveFolder_repl mapi_GetReceiveFolder;
3985                 [case(op_MAPI_RegisterNotification)] RegisterNotification_repl mapi_RegisterNotification;
3986                 [case(op_MAPI_Notify)] Notify_repl mapi_Notify;
3987                 [case(op_MAPI_OpenStream)] OpenStream_repl mapi_OpenStream;
3988                 [case(op_MAPI_ReadStream)] ReadStream_repl mapi_ReadStream;
3989                 [case(op_MAPI_WriteStream)] WriteStream_repl mapi_WriteStream;
3990                 [case(op_MAPI_SeekStream)] SeekStream_repl mapi_SeekStream;
3991                 [case(op_MAPI_SetStreamSize)] SetStreamSize_repl mapi_SetStreamSize;
3992                 [case(op_MAPI_SetSearchCriteria)] SetSearchCriteria_repl mapi_SetSearchCriteria;
3993                 [case(op_MAPI_GetSearchCriteria)] GetSearchCriteria_repl mapi_GetSearchCriteria;
3994                 [case(op_MAPI_SubmitMessage)] SubmitMessage_repl mapi_SubmitMessage;
3995                 [case(op_MAPI_MoveCopyMessages)] MoveCopyMessages_repl mapi_MoveCopyMessages;
3996                 [case(op_MAPI_AbortSubmit)] AbortSubmit_repl mapi_AbortSubmit;
3997                 [case(op_MAPI_MoveFolder)] MoveFolder_repl mapi_MoveFolder;
3998                 [case(op_MAPI_CopyFolder)] CopyFolder_repl mapi_CopyFolder;
3999                 [case(op_MAPI_QueryColumnsAll)] QueryColumnsAll_repl mapi_QueryColumnsAll;
4000                 [case(op_MAPI_Abort)] Abort_repl mapi_Abort;
4001                 [case(op_MAPI_CopyTo)] CopyTo_repl mapi_CopyTo;
4002                 [case(op_MAPI_CopyToStream)] CopyToStream_repl mapi_CopyToStream;
4003                 [case(op_MAPI_CloneStream)] CloneStream_repl mapi_CloneStream;
4004                 [case(op_MAPI_GetPermissionsTable)] GetPermissionsTable_repl mapi_GetPermissionsTable;
4005                 [case(op_MAPI_GetRulesTable)] GetRulesTable_repl mapi_GetRulesTable;
4006                 [case(op_MAPI_ModifyPermissions)] ModifyPermissions_repl mapi_ModifyPermissions;
4007                 [case(op_MAPI_ModifyRules)] ModifyRules_repl mapi_ModifyRules;
4008                 [case(op_MAPI_GetOwningServers)] GetOwningServers_repl mapi_GetOwningServers;
4009                 [case(op_MAPI_LongTermIdFromId)] LongTermIdFromId_repl mapi_LongTermIdFromId;
4010                 [case(op_MAPI_IdFromLongTermId)] IdFromLongTermId_repl mapi_IdFromLongTermId;
4011                 [case(op_MAPI_PublicFolderIsGhosted)] PublicFolderIsGhosted_repl mapi_PublicFolderIsGhosted;
4012                 [case(op_MAPI_OpenEmbeddedMessage)] OpenEmbeddedMessage_repl mapi_OpenEmbeddedMessage;
4013                 [case(op_MAPI_SetSpooler)] SetSpooler_repl mapi_SetSpooler;
4014                 [case(op_MAPI_SpoolerLockMessage)] SpoolerLockMessage_repl mapi_SpoolerLockMessage;
4015                 [case(op_MAPI_AddressTypes)] AddressTypes_repl mapi_AddressTypes;
4016                 [case(op_MAPI_TransportSend)] TransportSend_repl mapi_TransportSend;
4017                 [case(op_MAPI_FastTransferSourceCopyMessages)] FastTransferSourceCopyMessages_repl mapi_FastTransferSourceCopyMessages;
4018                 [case(op_MAPI_FastTransferSourceCopyFolder)] FastTransferSourceCopyFolder_repl mapi_FastTransferSourceCopyFolder;
4019                 [case(op_MAPI_FastTransferSourceCopyTo)] FastTransferSourceCopyTo_repl mapi_FastTransferSourceCopyTo;
4020                 [case(op_MAPI_FastTransferSourceGetBuffer)] FastTransferSourceGetBuffer_repl mapi_FastTransferSourceGetBuffer;
4021                 [case(op_MAPI_FindRow)] FindRow_repl mapi_FindRow;
4022                 [case(op_MAPI_Progress)] Progress_repl mapi_Progress;
4023                 [case(op_MAPI_TransportNewMail)] TransportNewMail_repl mapi_TransportNewMail;
4024                 [case(op_MAPI_GetValidAttachments)] GetValidAttachments_repl mapi_GetValidAttachments;
4025                 [case(op_MAPI_FastTransferDestConfigure)] FastTransferDestinationConfigure_repl mapi_FastTransferDestinationConfigure;
4026                 [case(op_MAPI_FastTransferDestPutBuffer)] FastTransferDestinationPutBuffer_repl mapi_FastTransferDestinationPutBuffer;
4027                 [case(op_MAPI_GetNamesFromIDs)] GetNamesFromIDs_repl mapi_GetNamesFromIDs;
4028                 [case(op_MAPI_GetIDsFromNames)] GetIDsFromNames_repl mapi_GetIDsFromNames;
4029                 [case(op_MAPI_UpdateDeferredActionMessages)] UpdateDeferredActionMessages_repl mapi_UpdateDeferredActionMessages;
4030                 [case(op_MAPI_EmptyFolder)] EmptyFolder_repl mapi_EmptyFolder;
4031                 [case(op_MAPI_ExpandRow)] ExpandRow_repl mapi_ExpandRow;
4032                 [case(op_MAPI_CollapseRow)] CollapseRow_repl mapi_CollapseRow;
4033                 [case(op_MAPI_LockRegionStream)] LockRegionStream_repl mapi_LockRegionStream;
4034                 [case(op_MAPI_UnlockRegionStream)] UnlockRegionStream_repl mapi_UnlockRegionStream;
4035                 [case(op_MAPI_CommitStream)] CommitStream_repl mapi_CommitStream;
4036                 [case(op_MAPI_GetStreamSize)] GetStreamSize_repl mapi_GetStreamSize;
4037                 [case(op_MAPI_QueryNamedProperties)] QueryNamedProperties_repl mapi_QueryNamedProperties;
4038                 [case(op_MAPI_GetPerUserLongTermIds)] GetPerUserLongTermIds_repl mapi_GetPerUserLongTermIds;
4039                 [case(op_MAPI_GetPerUserGuid)] GetPerUserGuid_repl mapi_GetPerUserGuid;
4040                 [case(op_MAPI_ReadPerUserInformation)] ReadPerUserInformation_repl mapi_ReadPerUserInformation;
4041                 [case(op_MAPI_WritePerUserInformation)] WritePerUserInformation_repl mapi_WritePerUserInformation;
4042                 [case(op_MAPI_SetReadFlags)] SetReadFlags_repl mapi_SetReadFlags;
4043                 [case(op_MAPI_CopyProperties)] CopyProperties_repl mapi_CopyProperties;
4044                 [case(op_MAPI_GetReceiveFolderTable)] GetReceiveFolderTable_repl mapi_GetReceiveFolderTable;
4045                 [case(op_MAPI_Pending)] Pending_repl mapi_Pending;
4046                 [case(op_MAPI_FastTransferSourceCopyProps)] FastTransferSourceCopyProperties_repl mapi_FastTransferSourceCopyProperties;
4047                 [case(op_MAPI_GetCollapseState)] GetCollapseState_repl mapi_GetCollapseState;
4048                 [case(op_MAPI_SetCollapseState)] SetCollapseState_repl mapi_SetCollapseState;
4049                 [case(op_MAPI_GetTransportFolder)] GetTransportFolder_repl mapi_GetTransportFolder;
4050                 [case(op_MAPI_OptionsData)] OptionsData_repl mapi_OptionsData;
4051                 [case(op_MAPI_SyncConfigure)] SyncConfigure_repl mapi_SyncConfigure;
4052                 [case(op_MAPI_SyncImportMessageChange)] SyncImportMessageChange_repl mapi_SyncImportMessageChange;
4053                 [case(op_MAPI_SyncImportHierarchyChange)] SyncImportHierarchyChange_repl mapi_SyncImportHierarchyChange;
4054                 [case(op_MAPI_SyncImportDeletes)] SyncImportDeletes_repl mapi_SyncImportDeletes;
4055                 [case(op_MAPI_SyncUploadStateStreamBegin)] SyncUploadStateStreamBegin_repl mapi_SyncUploadStateStreamBegin;
4056                 [case(op_MAPI_SyncUploadStateStreamContinue)] SyncUploadStateStreamContinue_repl mapi_SyncUploadStateStreamContinue;
4057                 [case(op_MAPI_SyncUploadStateStreamEnd)] SyncUploadStateStreamEnd_repl mapi_SyncUploadStateStreamEnd;
4058                 [case(op_MAPI_SyncImportMessageMove)] SyncImportMessageMove_repl mapi_SyncImportMessageMove;
4059                 [case(op_MAPI_SetPropertiesNoReplicate)] SetPropertiesNoReplicate_repl mapi_SetPropertiesNoReplicate;
4060                 [case(op_MAPI_DeletePropertiesNoReplicate)] DeletePropertiesNoReplicate_repl mapi_DeletePropertiesNoReplicate;
4061                 [case(op_MAPI_GetStoreState)] GetStoreState_repl mapi_GetStoreState;
4062                 [case(op_MAPI_SyncOpenCollector)] SyncOpenCollector_repl mapi_SyncOpenCollector;
4063                 [case(op_MAPI_GetLocalReplicaIds)] GetLocalReplicaIds_repl mapi_GetLocalReplicaIds;
4064                 [case(op_MAPI_SyncImportReadStateChanges)] SyncImportReadStateChanges_repl mapi_SyncImportReadStateChanges;
4065                 [case(op_MAPI_ResetTable)] ResetTable_repl mapi_ResetTable;
4066                 [case(op_MAPI_SyncGetTransferState)] SyncGetTransferState_repl mapi_SyncGetTransferState;
4067                 [case(op_MAPI_SyncOpenAdvisor)] SyncOpenAdvisor_repl mapi_SyncOpenAdvisor;
4068                 [case(op_MAPI_TellVersion)] TellVersion_repl mapi_TellVersion;
4069                 [case(op_MAPI_OpenPublicFolderByName)] OpenPublicFolderByName_repl mapi_OpenPublicFolderByName;
4070                 [case(op_MAPI_SetSyncNotificationGuid)] SetSyncNotificationGuid_repl mapi_SetSyncNotificationGuid;
4071                 [case(op_MAPI_FreeBookmark)] FreeBookmark_repl mapi_FreeBookmark;
4072                 [case(op_MAPI_WriteAndCommitStream)] WriteAndCommitStream_repl mapi_WriteAndCommitStream;
4073                 [case(op_MAPI_HardDeleteMessages)] HardDeleteMessages_repl mapi_HardDeleteMessages;
4074                 [case(op_MAPI_HardDeleteMessagesAndSubfolders)] HardDeleteMessagesAndSubfolders_repl mapi_HardDeleteMessagesAndSubfolders;
4075                 [case(op_MAPI_SetLocalReplicaMidsetDeleted)] SetLocalReplicaMidsetDeleted_repl mapi_SetLocalReplicaMidsetDeleted;
4076                 [case(op_MAPI_Backoff)] Backoff_repl mapi_Backoff;
4077                 [case(op_MAPI_Logon)] Logon_repl mapi_Logon;
4078                 [case(op_MAPI_BufferTooSmall)] BufferTooSmall_repl mapi_BufferTooSmall;
4079                 [case(op_MAPI_proxypack)] proxypack_repl mapi_proxypack;
4080
4081         } EcDoRpc_MAPI_REPL_UNION;
4082
4083         typedef [public, nodiscriminant] union {
4084                 [case(op_MAPI_Logon)] Logon_redirect mapi_Logon;
4085                 [default];
4086         } EcDoRpc_MAPI_REPL_UNION_SPECIAL;
4087
4088         typedef [public,flag(NDR_NOALIGN)] struct {
4089                 uint8           opnum;
4090                 uint8           logon_id;
4091                 uint8           handle_idx;
4092                 [switch_is(opnum)] EcDoRpc_MAPI_REQ_UNION u;
4093         } EcDoRpc_MAPI_REQ;
4094
4095         typedef [public,nopush,nopull,noprint,flag(NDR_NOALIGN)] struct {
4096                 uint8           opnum;
4097                 uint8           handle_idx;
4098                 MAPISTATUS      error_code;
4099                 [switch_is(opnum)] EcDoRpc_MAPI_REPL_UNION u;
4100                 [switch_is(opnum)] EcDoRpc_MAPI_REPL_UNION_SPECIAL us;
4101         } EcDoRpc_MAPI_REPL;
4102
4103
4104         /*
4105           Abstract way to represent MAPI content
4106         */
4107
4108         typedef [public,nopull,nopush,noprint] struct {
4109                 uint32                  mapi_len;       /* whole mapi_data length */
4110                 uint16                  length;         /* content length */
4111                 EcDoRpc_MAPI_REQ        *mapi_req;
4112                 uint32                  *handles;       /* handles id array */
4113         } mapi_request;
4114
4115         typedef [public,nopull,nopush,noprint] struct {
4116                 uint32                  mapi_len;
4117                 uint16                  length;
4118                 EcDoRpc_MAPI_REPL       *mapi_repl;
4119                 uint32                  *handles;
4120         } mapi_response;
4121         
4122
4123         [public,nopull,nopush] MAPISTATUS EcDoRpc(
4124                 [in,out]                                                policy_handle   *handle,
4125                 [in,out]                                                uint32          size,
4126                 [in,out]                                                uint32          offset,
4127                 [in] [subcontext(4),flag(NDR_REMAINING|NDR_NOALIGN)]    mapi_request    *mapi_request,
4128                 [out][subcontext(4),flag(NDR_REMAINING|NDR_NOALIGN)]    mapi_response   *mapi_response,
4129                 [in,out]                                                uint16          *length,
4130                 [in]                                                    uint16          max_data
4131                 );
4132
4133         /*****************/
4134         /* Function 0x03 */
4135         void EcGetMoreRpc();
4136
4137         /*****************/
4138         /* Function 0x04 */
4139
4140         /*
4141           we could directly use a NOTIFKEY structure rather than
4142           a uint8 array, but this makes the IDL more robust
4143         
4144           sockaddr array is made of: 
4145            - family (unsigned short in) sa_family_t
4146            - address data sa_data[14];
4147          */
4148
4149         typedef struct {
4150                 uint16          cb;
4151                 uint8           ab[cb];
4152         } NOTIFKEY;
4153
4154         MAPISTATUS EcRRegisterPushNotification(
4155                [in,out] policy_handle                   *handle,
4156                [in] uint32                              iRpc,
4157                [in,size_is(cbContext)] uint8            rgbContext[*],
4158                [in] uint16                              cbContext,
4159                [in] uint32                              grbitAdviseBits,
4160                [in,size_is(cbCallbackAddress)] uint8    rgbCallbackAddress[*],
4161                [in] uint16                              cbCallbackAddress,
4162                [out,ref] uint32                         *hNotification
4163                 );
4164
4165         /*****************/
4166         /* Function 0x05 */
4167         MAPISTATUS EcRUnregisterPushNotification(
4168                 [in,out]        policy_handle           *handle,
4169                 [in]            uint32                  unknown[2]
4170                 );
4171
4172         /*****************/
4173         /* Function 0x06 */
4174         void EcDummyRpc();
4175
4176         /*****************/
4177         /* Function 0x07 */
4178         void EcRGetDCName();
4179
4180         /*****************/
4181         /* Function 0x08 */
4182         void EcRNetGetDCName();
4183
4184         /*****************/
4185         /* Function 0x09 */
4186         [public,noprint] MAPISTATUS EcDoRpcExt (
4187                  [in,out] policy_handle                                         *handle,
4188                  [in,out] uint32                                                *pulFlags,
4189                  [in, size_is(cbIn)] uint8                                      rgbIn[],
4190                  [in] uint32                                                    cbIn,
4191                  [out, length_is(*pcbOut), size_is(*pcbOut)] uint8              rgbOut[],
4192                  [in,out][range(0x0,0x40000)] uint32                            *pcbOut,
4193                  [in,out,length_is(*Reserved1),size_is(*Reserved1)] uint8       Reserved0[],
4194                  [in,out] uint32                                                *Reserved1,
4195                  [out] uint32                                                   *pulTransTime
4196                 );
4197
4198         /*****************/
4199         /* Function 0xa  */
4200         typedef [public,bitmap16bit] bitmap {
4201                 RHEF_Compressed         = 0x0001,
4202                 RHEF_XorMagic           = 0x0002,
4203                 RHEF_Last               = 0x0004
4204         } RPC_HEADER_EXT_Flags;
4205
4206         typedef [public] struct {
4207                 uint16                  Version;
4208                 RPC_HEADER_EXT_Flags    Flags;
4209                 uint16                  Size;
4210                 uint16                  SizeActual;
4211         } RPC_HEADER_EXT;
4212
4213         typedef [enum8bit,flag(NDR_PAHEX)] enum {
4214                 AUX_TYPE_PERF_REQUESTID         = 0x01,
4215                 AUX_TYPE_PERF_CLIENTDINFO       = 0x02,
4216                 AUX_TYPE_PERF_SERVERINFO        = 0x03,
4217                 AUX_TYPE_PERF_SESSIONINFO       = 0x04,
4218                 AUX_TYPE_PERF_DEFMDB_SUCCESS    = 0x05,
4219                 AUX_TYPE_PERF_DEFGC_SUCCESS     = 0x06,
4220                 AUX_TYPE_PERF_MDB_SUCCESS       = 0x07,
4221                 AUX_TYPE_PERF_GC_SUCCESS        = 0x08,
4222                 AUX_TYPE_PERF_FAILURE           = 0x09,
4223                 AUX_TYPE_CLIENT_CONTROL         = 0x0A,
4224                 AUX_TYPE_PERF_PROCESSINFO       = 0x0B,
4225                 AUX_TYPE_PERF_BG_DEFMDB_SUCCESS = 0x0C,
4226                 AUX_TYPE_PERF_BG_DEFGC_SUCCESS  = 0x0D,
4227                 AUX_TYPE_PERF_BG_MDB_SUCCESS    = 0x0E,
4228                 AUX_TYPE_PERF_BG_GC_SUCCESS     = 0x0F,
4229                 AUX_TYPE_PERF_BG_FAILURE        = 0x10,
4230                 AUX_TYPE_PERF_FG_DEFMDB_SUCCESS = 0x11,
4231                 AUX_TYPE_PERF_FG_DEFGC_SUCCESS  = 0x12,
4232                 AUX_TYPE_PERF_FG_MDB_SUCCESS    = 0x13,
4233                 AUX_TYPE_PERF_FG_GC_SUCCESS     = 0x14,
4234                 AUX_TYPE_PERF_FG_FAILURE        = 0x15,
4235                 AUX_TYPE_OSVERSIONINFO          = 0x16,
4236                 AUX_TYPE_EXORGINFO              = 0x17
4237         } AUX_HEADER_TYPE_1;
4238         
4239         typedef [enum8bit,flag(NDR_PAHEX)] enum {
4240                 AUX_TYPE_PERF_SESSIONINFO_2     = 0x04,
4241                 AUX_TYPE_PERF_MDB_SUCCESS_2     = 0x07,
4242                 AUX_TYPE_PERF_GC_SUCCESS_2      = 0x08,
4243                 AUX_TYPE_PERF_FAILURE_2         = 0x09
4244         } AUX_HEADER_TYPE_2;
4245
4246         typedef [public,enum8bit,flag(NDR_PAHEX)] enum {
4247                 AUX_VERSION_1   = 0x1,
4248                 AUX_VERSION_2   = 0x2
4249         } AUX_VERSION;
4250
4251         typedef [public,switch_type(uint8)] union {
4252                 [case(AUX_VERSION_1)] AUX_HEADER_TYPE_1 Type;
4253                 [case(AUX_VERSION_2)] AUX_HEADER_TYPE_2 Type_2;
4254                 [default];
4255         } AUX_HEADER_TYPE_ENUM;
4256
4257         /*************************/
4258         /* AUX_HEADER case (0x1) */
4259         typedef [flag(NDR_NOALIGN)] struct {
4260                 uint16          SessionID;
4261                 uint16          RequestID;
4262         } AUX_PERF_REQUESTID;
4263         
4264         /*************************/
4265         /* AUX_HEADER case (0x2) */
4266         typedef [public,enum16bit, flag(NDR_PAHEX)] enum {
4267                 CLIENTMODE_UNKNOWN      =       0x0,
4268                 CLIENTMODE_CLASSIC      =       0x1,
4269                 CLIENTMODE_CACHED       =       0x2
4270         } ClientMode;
4271
4272         typedef [public,flag(NDR_NOALIGN)] struct {
4273                 uint32          AdapterSpeed;
4274                 uint16          ClientID;
4275                 uint16          MachineNameOffset;
4276                 uint16          UserNameOffset;
4277                 uint16          ClientIPSize;
4278                 uint16          ClientIPOffset;
4279                 uint16          ClientIPMaskSize;
4280                 uint16          ClientIPMaskOffset;
4281                 uint16          AdapterNameOffset;
4282                 uint16          MacAddressSize;
4283                 uint16          MacAddressOffset;
4284                 ClientMode      ClientMode;
4285                 uint16          Reserved;
4286                 uint8           MacAddress[MacAddressSize];
4287                 uint8           ClientIP[ClientIPSize];
4288                 uint8           ClientIPMask[ClientIPMaskSize];
4289                 nstring         MachineName;
4290                 nstring         UserName;
4291                 nstring         AdapterName;
4292         } AUX_PERF_CLIENTINFO;
4293
4294         /*************************/
4295         /* AUX_HEADER case (0x3) */
4296         typedef [enum16bit,flag(NDR_PAHEX)] enum {
4297                 SERVERTYPE_UNKNOWN              = 0x0,
4298                 SERVERTYPE_PRIVATE              = 0x1,
4299                 SERVERTYPE_PUBLIC               = 0x2,
4300                 SERVERTYPE_DIRECTORY            = 0x3,
4301                 SERVERTYPE_REFERRAL             = 0x4
4302         } SERVERINFO_ServerType;
4303
4304         typedef [flag(NDR_NOALIGN)] struct {
4305                 uint16                  ServerID;
4306                 SERVERINFO_ServerType   ServerType;
4307                 uint16                  ServerDNOffset;
4308                 uint16                  ServerNameOffset;
4309                 nstring                 ServerDN;
4310                 nstring                 ServerName;
4311         } AUX_PERF_SERVERINFO;
4312
4313         /*************************/
4314         /* AUX_HEADER case (0x4) */
4315         typedef [flag(NDR_NOALIGN)] struct {
4316                 uint16          SessionID;
4317                 uint16          Reserved;
4318                 GUID            SessionGuid;
4319         } AUX_PERF_SESSIONINFO;
4320
4321         typedef [flag(NDR_NOALIGN)] struct {
4322                 uint16          SessionID;
4323                 uint16          Reserved;
4324                 GUID            SessionGuid;
4325                 uint32          ConnectionID;
4326         } AUX_PERF_SESSIONINFO_V2;
4327
4328         /**************************/
4329         /* AUX_HEADER case (0x5)  */
4330         /* AUX_HEADER case (0xC)  */
4331         /* AUX_HEADER case (0x11) */
4332         typedef [flag(NDR_NOALIGN)] struct {
4333                 uint32          TimeSinceRequest;
4334                 uint32          TimeToCompleteRequest;
4335                 uint16          RequestID;
4336                 uint16          Reserved;
4337         } AUX_PERF_DEFMDB_SUCCESS;
4338
4339         /**************************/
4340         /* AUX_HEADER case (0x6)  */
4341         /* AUX_HEADER case (0xD)  */
4342         typedef [flag(NDR_NOALIGN)] struct {
4343                 uint16          ServerID;
4344                 uint16          SessionID;
4345                 uint32          TimeSinceRequest;
4346                 uint32          TimeToCompleteRequest;
4347                 uint8           RequestOperation;
4348                 uint8           Reserved[3];
4349         } AUX_PERF_DEFGC_SUCCESS;
4350         
4351         /**************************/
4352         /* AUX_HEADER case (0x7)  */
4353         /* AUX_HEADER case (0xE)  */
4354         /* AUX_HEADER case (0x13) */
4355         typedef [flag(NDR_NOALIGN)] struct {
4356                 uint16          ClientID;
4357                 uint16          ServerID;
4358                 uint16          SessionID;
4359                 uint16          RequestID;
4360                 uint32          TimeSinceRequest;
4361                 uint32          TimeToCompleteRequest;
4362         } AUX_PERF_MDB_SUCCESS;
4363
4364         typedef [flag(NDR_NOALIGN)] struct {
4365                 uint16          ProcessID;
4366                 uint16          ClientID;
4367                 uint16          ServerID;
4368                 uint16          SessionID;
4369                 uint16          RequestID;
4370                 uint16          Reserved;
4371                 uint32          TimeSinceRequest;
4372                 uint32          TimeToCompleteRequest;
4373         } AUX_PERF_MDB_SUCCESS_V2;
4374
4375         /**************************/
4376         /* AUX_HEADER case (0x8)  */
4377         typedef [flag(NDR_NOALIGN)] struct {
4378                 uint16          ClientID;
4379                 uint16          ServerID;
4380                 uint16          SessionID;
4381                 uint16          Reserved_1;
4382                 uint32          TimeSinceRequest;
4383                 uint32          TimeToCompleteRequest;
4384                 uint8           RequestOperation;
4385                 uint8           Reserved_2[3];
4386         } AUX_PERF_GC_SUCCESS;
4387
4388         typedef [flag(NDR_NOALIGN)] struct {
4389                 uint16          ProcessID;
4390                 uint16          ClientID;
4391                 uint16          ServerID;
4392                 uint16          SessionID;
4393                 uint32          TimeSinceRequest;
4394                 uint32          TimeToCompleteRequest;
4395                 uint8           RequestOperation;
4396                 uint8           Reserved[3];
4397         } AUX_PERF_GC_SUCCESS_V2;
4398
4399         /**************************/
4400         /* AUX_HEADER case (0x9)  */
4401         typedef [flag(NDR_NOALIGN)] struct {
4402                 uint16          ClientID;
4403                 uint16          ServerID;
4404                 uint16          SessionID;
4405                 uint16          RequestID;
4406                 uint32          TimeSinceRequest;
4407                 uint32          TimeToFailRequest;
4408                 MAPISTATUS      ResultCode;
4409                 uint8           RequestOperation;
4410                 uint8           Reserved[3];
4411         } AUX_PERF_FAILURE;
4412
4413         typedef [flag(NDR_NOALIGN)] struct {
4414                 uint16          ProcessID;
4415                 uint16          ClientID;
4416                 uint16          ServerID;
4417                 uint16          SessionID;
4418                 uint16          RequestID;
4419                 uint16          Reserved_1;
4420                 uint32          TimeSinceRequest;
4421                 uint32          TimeToFailRequest;
4422                 MAPISTATUS      ResultCode;
4423                 uint8           RequestOperation;
4424                 uint8           Reserved_2[3];
4425         } AUX_PERF_FAILURE_V2;
4426
4427         /**************************/
4428         /* AUX_HEADER case (0xA)  */
4429         typedef [bitmap32bit] bitmap {
4430                 ENABLE_PERF_SENDTOSERVER        = 0x00000001,
4431                 ENABLE_PERF_SENDTOMAILBOX       = 0x00000002,
4432                 ENABLE_COMPRESSION              = 0x00000004,
4433                 ENABLE_HTTP_TUNNELING           = 0x00000008,
4434                 ENABLE_PERF_SENDGCDATA          = 0x00000010
4435         } CLIENT_CONTROL_EnableFlags;
4436
4437         typedef [flag(NDR_NOALIGN)] struct {
4438                 CLIENT_CONTROL_EnableFlags      EnableFlags;
4439                 uint32                          ExpiryTime;
4440         } AUX_CLIENT_CONTROL;
4441
4442         /*************************/
4443         /* AUX_HEADER case (0xB) */
4444         typedef [nodiscriminant] union {
4445                 [case(0x0)];
4446                 [default] nstring       ProcessName;
4447         } ProcessNameString;
4448
4449         typedef [flag(NDR_NOALIGN)] struct {
4450                 uint16          ProcessID;
4451                 uint16          Reserved1;
4452                 GUID            ProcessGuid;
4453                 uint16          ProcessNameOffset;
4454                 uint16          Reserved2;
4455                 [switch_is(ProcessNameOffset)] ProcessNameString ProcessName;
4456         } AUX_PERF_PROCESSINFO;
4457
4458         /**************************/
4459         /* AUX_HEADER case (0x16) */
4460         typedef [flag(NDR_NOALIGN)] struct {
4461                 uint32          OSVersionInfoSize;
4462                 uint32          MajorVersion;
4463                 uint32          MinorVersion;
4464                 uint32          BuildNumber;
4465                 [subcontext(0), subcontext_size(132), flag(NDR_NOALIGN|NDR_REMAINING)] DATA_BLOB Reserved_1;
4466                 uint16          ServicePackMajor;
4467                 uint16          ServicePackMinor;
4468                 uint32          Reserved_2;
4469         } AUX_OSVERSIONINFO;
4470
4471         /**************************/
4472         /* AUX_HEADER case (0x17) */
4473         typedef [bitmap32bit] bitmap {
4474                 PUBLIC_FOLDERS_ENABLED  = 0x00000001
4475         } EXORGINFO_OrgFlags;
4476
4477         typedef [flag(NDR_NOALIGN)] struct {
4478                 EXORGINFO_OrgFlags      OrgFlags;
4479         } AUX_EXORGINFO;
4480
4481         typedef [public,nodiscriminant,flag(NDR_NOALIGN)] union {
4482                 [case(AUX_TYPE_PERF_REQUESTID)]         AUX_PERF_REQUESTID              AUX_PERF_REQUESTID;
4483           //            [case(AUX_TYPE_PERF_CLIENTDINFO)]       AUX_PERF_CLIENTINFO             AUX_PERF_CLIENTINFO;
4484                 [case(AUX_TYPE_PERF_SERVERINFO)]        AUX_PERF_SERVERINFO             AUX_PERF_SERVERINFO;
4485                 [case(AUX_TYPE_PERF_SESSIONINFO)]       AUX_PERF_SESSIONINFO            AUX_PERF_SESSIONINFO;
4486                 [case(AUX_TYPE_PERF_DEFMDB_SUCCESS)]    AUX_PERF_DEFMDB_SUCCESS         AUX_PERF_DEFMDB_SUCCESS;
4487                 [case(AUX_TYPE_PERF_DEFGC_SUCCESS)]     AUX_PERF_DEFGC_SUCCESS          AUX_PERF_DEFGC_SUCCESS;
4488                 [case(AUX_TYPE_PERF_MDB_SUCCESS)]       AUX_PERF_MDB_SUCCESS            AUX_PERF_MDB_SUCCESS;
4489                 [case(AUX_TYPE_PERF_GC_SUCCESS)]        AUX_PERF_GC_SUCCESS             AUX_PERF_GC_SUCCESS;
4490                 [case(AUX_TYPE_PERF_FAILURE)]           AUX_PERF_FAILURE                AUX_PERF_FAILURE;
4491                 [case(AUX_TYPE_CLIENT_CONTROL)]         AUX_CLIENT_CONTROL              AUX_CLIENT_CONTROL;
4492                 [case(AUX_TYPE_PERF_PROCESSINFO)]       AUX_PERF_PROCESSINFO            AUX_PERF_PROCESSINFO;
4493                 [case(AUX_TYPE_PERF_BG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS         AUX_PERF_DEFMDB_SUCCESS;
4494                 [case(AUX_TYPE_PERF_BG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS          AUX_PERF_DEFGC_SUCCESS;
4495                 [case(AUX_TYPE_PERF_BG_MDB_SUCCESS)]    AUX_PERF_MDB_SUCCESS            AUX_PERF_MDB_SUCCESS;
4496                 [case(AUX_TYPE_PERF_BG_GC_SUCCESS)]     AUX_PERF_GC_SUCCESS             AUX_PERF_GC_SUCCESS;
4497                 [case(AUX_TYPE_PERF_BG_FAILURE)]        AUX_PERF_FAILURE                AUX_PERF_FAILURE;
4498                 [case(AUX_TYPE_PERF_FG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS         AUX_PERF_DEFMDB_SUCCESS;
4499                 [case(AUX_TYPE_PERF_FG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS          AUX_PERF_DEFGC_SUCCESS;
4500                 [case(AUX_TYPE_PERF_FG_MDB_SUCCESS)]    AUX_PERF_MDB_SUCCESS            AUX_PERF_MDB_SUCCESS;
4501                 [case(AUX_TYPE_PERF_FG_GC_SUCCESS)]     AUX_PERF_GC_SUCCESS             AUX_PERG_GC_SUCCESS;
4502                 [case(AUX_TYPE_PERF_FG_FAILURE)]        AUX_PERF_FAILURE                AUX_PERF_FAILURE;
4503                 [case(AUX_TYPE_OSVERSIONINFO)]          AUX_OSVERSIONINFO               AUX_OSVERSIONINFO;
4504                 [case(AUX_TYPE_EXORGINFO)]              AUX_EXORGINFO                   AUX_EXORGINFO;
4505                 [default][flag(NDR_REMAINING|NDR_NOALIGN)] DATA_BLOB    Payload;
4506         } AUX_HEADER_TYPE_UNION_1;
4507
4508         typedef [public,nodiscriminant,flag(NDR_NOALIGN)] union {
4509                 [case(AUX_TYPE_PERF_REQUESTID)]         AUX_PERF_REQUESTID              AUX_PERF_REQUESTID;
4510           //    [case(AUX_TYPE_PERF_CLIENTDINFO)]       AUX_PERF_CLIENTINFO             AUX_PERF_CLIENTINFO;
4511                 [case(AUX_TYPE_PERF_SERVERINFO)]        AUX_PERF_SERVERINFO             AUX_PERF_SERVERINFO;
4512                 [case(AUX_TYPE_PERF_SESSIONINFO_2)]     AUX_PERF_SESSIONINFO_V2         AUX_PERF_SESSIONINFO_V2;        /* V2 specific */
4513                 [case(AUX_TYPE_PERF_DEFMDB_SUCCESS)]    AUX_PERF_DEFMDB_SUCCESS         AUX_PERF_DEFMDB_SUCCESS;
4514                 [case(AUX_TYPE_PERF_DEFGC_SUCCESS)]     AUX_PERF_DEFGC_SUCCESS          AUX_PERF_DEFGC_SUCCESS;
4515                 [case(AUX_TYPE_PERF_MDB_SUCCESS_2)]     AUX_PERF_MDB_SUCCESS_V2         AUX_PERF_MDB_SUCCESS_V2;        /* V2 specific */
4516                 [case(AUX_TYPE_PERF_GC_SUCCESS_2)]      AUX_PERF_GC_SUCCESS_V2          AUX_PERF_GC_SUCCESS_V2;         /* V2 specific */
4517                 [case(AUX_TYPE_PERF_FAILURE_2)]         AUX_PERF_FAILURE_V2             AUX_PERF_FAILURE_V2;            /* V2 specific*/
4518                 [case(AUX_TYPE_CLIENT_CONTROL)]         AUX_CLIENT_CONTROL              AUX_CLIENT_CONTROL;
4519                 [case(AUX_TYPE_PERF_PROCESSINFO)]       AUX_PERF_PROCESSINFO            AUX_PERF_PROCESSINFO;
4520                 [case(AUX_TYPE_PERF_BG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS         AUX_PERF_DEFMDB_SUCCESS;
4521                 [case(AUX_TYPE_PERF_BG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS          AUX_PERF_DEFGC_SUCCESS;
4522                 [case(AUX_TYPE_PERF_BG_MDB_SUCCESS)]    AUX_PERF_MDB_SUCCESS            AUX_PERF_MDB_SUCCESS;
4523                 [case(AUX_TYPE_PERF_BG_GC_SUCCESS)]     AUX_PERF_GC_SUCCESS             AUX_PERF_GC_SUCCESS;
4524                 [case(AUX_TYPE_PERF_BG_FAILURE)]        AUX_PERF_FAILURE                AUX_PERF_FAILURE;
4525                 [case(AUX_TYPE_PERF_FG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS         AUX_PERF_DEFMDB_SUCCESS;
4526                 [case(AUX_TYPE_PERF_FG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS          AUX_PERF_DEFGC_SUCCESS;
4527                 [case(AUX_TYPE_PERF_FG_MDB_SUCCESS)]    AUX_PERF_MDB_SUCCESS            AUX_PERF_MDB_SUCCESS;
4528                 [case(AUX_TYPE_PERF_FG_GC_SUCCESS)]     AUX_PERF_GC_SUCCESS             AUX_PERG_GC_SUCCESS;
4529                 [case(AUX_TYPE_PERF_FG_FAILURE)]        AUX_PERF_FAILURE                AUX_PERF_FAILURE;
4530                 [case(AUX_TYPE_OSVERSIONINFO)]          AUX_OSVERSIONINFO               AUX_OSVERSIONINFO;
4531                 [case(AUX_TYPE_EXORGINFO)]              AUX_EXORGINFO                   AUX_EXORGINFO;
4532                 [default][flag(NDR_REMAINING|NDR_NOALIGN)] DATA_BLOB    Payload;
4533         } AUX_HEADER_TYPE_UNION_2;
4534
4535         typedef [public,nopull,noprint,flag(NDR_NOALIGN)] struct {
4536                 uint16                                                  Size;
4537                 AUX_VERSION                                             Version;
4538                 uint8                                                   Type;
4539                 [switch_is(Type)] AUX_HEADER_TYPE_UNION_1               Payload_1;
4540                 [switch_is(Type)] AUX_HEADER_TYPE_UNION_2               Payload_2;
4541         } AUX_HEADER;
4542
4543         typedef [public,nopull,noprint] struct {
4544                 RPC_HEADER_EXT                                                          RPC_HEADER_EXT;
4545                 [subcontext(0), subcontext_size(RPC_HEADER_EXT.Size)] AUX_HEADER        *AUX_HEADER;
4546         } mapi2k7_AuxInfo;
4547
4548
4549         [public,nopull,nopush,noprint] MAPISTATUS EcDoConnectEx(
4550                 [out]                           policy_handle                           *handle,
4551                 [in,string,charset(DOS)]        uint8                                   szUserDN[],
4552                 [in]                            uint32                                  ulFlags,
4553                 [in]                            uint32                                  ulConMod,
4554                 [in]                            uint32                                  cbLimit,
4555                 [in]                            uint32                                  ulCpid,
4556                 [in]                            uint32                                  ulLcidString,
4557                 [in]                            uint32                                  ulLcidSort,
4558                 [in]                            uint32                                  ulIcxrLink,
4559                 [in]                            uint16                                  usFCanConvertCodePages,
4560                 [out]                           uint32                                  *pcmsPollsMax,
4561                 [out]                           uint32                                  *pcRetry,
4562                 [out]                           uint32                                  *pcmsRetryDelay,
4563                 [out]                           uint32                                  *picxr,
4564                 [out,ref,string,charset(DOS)]uint8                                      **szDNPrefix,
4565                 [out,ref,string,charset(DOS)]uint8                                      **szDisplayName,
4566                 [in]                            uint16                                  rgwClientVersion[3],
4567                 [out]                           uint16                                  rgwServerVersion[3],
4568                 [out]                           uint16                                  rgwBestVersion[3],
4569                 [in,out]                        uint32                                  *pulTimeStamp,
4570                 [in,subcontext(4),flag(NDR_NOALIGN|NDR_REMAINING)] mapi2k7_AuxInfo      *rgbAuxIn,
4571                 [in]                            uint32                                  cbAuxIn,
4572                 [out, length_is(*pcbAuxOut), size_is(*pcbAuxOut)] mapi2k7_AuxInfo       *rgbAuxOut,
4573                 [in,out][range(0,0x1008)]       uint32                                  *pcbAuxOut
4574                 );
4575
4576         /*****************/
4577         /* Function 0xb  */
4578         typedef [public,bitmap32bit] bitmap {
4579                 pulFlags_NoCompression  = 0x00000001,
4580                 pulFlags_NoXorMagic     = 0x00000002,
4581                 pulFlags_Chain          = 0x00000004
4582         } pulFlags;
4583
4584         typedef [public,nopull] struct {
4585                 RPC_HEADER_EXT                                                  header;
4586                 [subcontext(0),flag(NDR_REMAINING|NDR_NOALIGN)] mapi_request    *mapi_request;
4587         } mapi2k7_request;
4588
4589         typedef [public,nopull] struct {
4590                 RPC_HEADER_EXT                                                  header;
4591                 [subcontext(0),flag(NDR_NOALIGN|NDR_REMAINING)] mapi_response   *mapi_response;
4592         } mapi2k7_response;
4593
4594         [public,noprint] MAPISTATUS EcDoRpcExt2(
4595                 [in,out]                                        policy_handle   *handle,
4596                 [in,out]                                        uint32          *pulFlags,
4597                 [in, size_is(cbIn)]                             uint8           rgbIn[],
4598                 [in]                                            uint32          cbIn,
4599                 [out, length_is(*pcbOut), size_is(*pcbOut)]     uint8           rgbOut[],
4600                 [in,out][range(0x0,0x40000)]                    uint32          *pcbOut,
4601                 [in, size_is(cbAuxIn)]                          uint8           rgbAuxIn[],
4602                 [in]                                            uint32          cbAuxIn,
4603                 [out, length_is(*pcbAuxOut), size_is(*pcbAuxOut)] uint32        rgbAuxOut[],
4604                 [in,out][range(0x0,0x1008)]                     uint32          *pcbAuxOut,
4605                 [out]                                           uint32          *pulTransTime
4606                 );
4607
4608         /*****************/
4609         /* Function 0xc  */
4610         void EcUnknown0xC();
4611
4612         /*****************/
4613         /* Function 0xd  */
4614         void EcUnknown0xD();
4615
4616         /*****************/
4617         /* Function 0xe  */
4618         [public] MAPISTATUS EcDoAsyncConnectEx(
4619                 [in] policy_handle      *handle,
4620                 [out] policy_handle     *async_handle
4621                 );
4622
4623 }
4624
4625 [
4626   uuid("5261574a-4572-206e-b268-6b199213b4e4"),
4627   pointer_default(unique),
4628   endpoint("ncacn_ip_tcp:"),
4629   version(0.01)
4630 ] interface exchange_async_emsmdb
4631 {
4632         [public] MAPISTATUS EcDoAsyncWaitEx(
4633                 [in] policy_handle      *async_handle,
4634                 [in] uint32             ulFlagsIn,
4635                 [out] uint32            *pulFlagsOut
4636                 );
4637 }
4638
4639 [
4640   uuid("c840a7dc-42c0-1a10-b4b9-08002b2fe182"),
4641   pointer_default(unique),
4642   helpstring("Unknown")
4643 ] interface exchange_unknown
4644 {
4645         void unknown_dummy();
4646 }
4647