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