Import mapi32 from Wine
Modified: trunk/reactos/baseaddress.xml
Modified: trunk/reactos/bootdata/packages/reactos.dff
Modified: trunk/reactos/include/wine/shlwapi.h
Modified: trunk/reactos/lib/directory.xml
Added: trunk/reactos/lib/mapi32/
Deleted: trunk/reactos/lib/mapi32/Makefile.in
Added: trunk/reactos/lib/mapi32/mapi32.xml
Modified: trunk/reactos/lib/mapi32/prop.c
Modified: trunk/reactos/lib/uuid/uuid.c
Modified: trunk/reactos/media/doc/README.WINE
Added: trunk/reactos/w32api/include/mapicode.h
Added: trunk/reactos/w32api/include/mapidefs.h
Added: trunk/reactos/w32api/include/mapiguid.h
Added: trunk/reactos/w32api/include/mapitags.h
Added: trunk/reactos/w32api/include/mapiutil.h
Added: trunk/reactos/w32api/include/mapival.h
Added: trunk/reactos/w32api/include/mapix.h
Modified: trunk/reactos/w32api/include/wtypes.h
Added: trunk/reactos/w32api/include/xcmc.h

Modified: trunk/reactos/baseaddress.xml
--- trunk/reactos/baseaddress.xml	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/baseaddress.xml	2006-01-14 19:36:04 UTC (rev 20861)
@@ -10,6 +10,7 @@
 <property name="BASEADDRESS_OBJSEL" value="0x5B400000" />
 <property name="BASEADDRESS_SLAYER" value="0x5C7E0000" />
 <property name="BASEADDRESS_DINPUT" value="0x5F580000" />
+<property name="BASEADDRESS_MAPI32" value="0x62250000" />
 <property name="BASEADDRESS_HDWWIZ" value="0x64D40000" />
 <property name="BASEADDRESS_TIMEDATE" value="0x64DA0000" />
 <property name="BASEADDRESS_SYSDM" value="0x64DD0000" />

Modified: trunk/reactos/bootdata/packages/reactos.dff
--- trunk/reactos/bootdata/packages/reactos.dff	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/bootdata/packages/reactos.dff	2006-01-14 19:36:04 UTC (rev 20861)
@@ -120,6 +120,7 @@
 lib\kernel32\kernel32.dll               1
 lib\lsasrv\lsasrv.dll                   1
 lib\lzexpand\lz32.dll                   1
+lib\mapi32\mapi32.dll                   1
 lib\mesa32\mesa32.dll                   1
 lib\winmm\midimap\midimap.dll           1
 lib\mmdrv\mmdrv.dll                     1

Modified: trunk/reactos/include/wine/shlwapi.h
--- trunk/reactos/include/wine/shlwapi.h	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/include/wine/shlwapi.h	2006-01-14 19:36:04 UTC (rev 20861)
@@ -14,6 +14,8 @@
 
 #define URL_FILE_USE_PATHURL 0x00010000
 
+HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR,DWORD,DWORD,BOOL,struct IStream*,struct IStream**);
+
 #define INTERFACE IQueryAssociations
 DECLARE_INTERFACE_(IQueryAssociations,IUnknown)
 {

Modified: trunk/reactos/lib/directory.xml
--- trunk/reactos/lib/directory.xml	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/lib/directory.xml	2006-01-14 19:36:04 UTC (rev 20861)
@@ -152,6 +152,9 @@
 <directory name="lzexpand">
 	<xi:include href="lzexpand/lz32.xml" />
 </directory>
+<directory name="mapi32">
+	<xi:include href="mapi32/mapi32.xml" />
+</directory>
 <directory name="mesa32">
 	<xi:include href="mesa32/mesa32.xml" />
 </directory>

Copied: trunk/reactos/lib/mapi32 (from rev 20860, vendor/wine/dlls/mapi32/current)
Property changes on: trunk/reactos/lib/mapi32 ___________________________________________________________________ Name: svn:ignore   + GNUmakefile
Deleted: trunk/reactos/lib/mapi32/Makefile.in
--- vendor/wine/dlls/mapi32/current/Makefile.in	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/lib/mapi32/Makefile.in	2006-01-14 19:36:04 UTC (rev 20861)
@@ -1,20 +0,0 @@
-TOPSRCDIR = @top_srcdir@
-TOPOBJDIR = ../..
-SRCDIR    = @srcdir@
-VPATH     = @srcdir@
-MODULE    = mapi32.dll
-IMPORTLIB = libmapi32.$(IMPLIBEXT)
-IMPORTS   = shlwapi ole32 user32 kernel32 ntdll
-EXTRALIBS = -luuid $(LIBUNICODE)
-
-C_SRCS = \
-	imalloc.c \
-	mapi32_main.c \
-	prop.c \
-	util.c
-
-SUBDIRS = tests
-
-@MAKE_DLL_RULES@
-
-### Dependencies:

Added: trunk/reactos/lib/mapi32/mapi32.xml
--- vendor/wine/dlls/mapi32/current/mapi32.xml	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/lib/mapi32/mapi32.xml	2006-01-14 19:36:04 UTC (rev 20861)
@@ -0,0 +1,19 @@
+<module name="mapi32" type="win32dll" baseaddress="${BASEADDRESS_MAPI32}" installbase="system32" installname="mapi32.dll">
+	<importlibrary definition="mapi32.spec.def" />
+	<include base="mapi32">.</include>
+	<include base="ReactOS">include/wine</include>
+	<define name="__USE_W32API" />
+	<define name="_WIN32_WINNT">0x501</define>
+	<define name="__WINESRC__" />
+	<library>ntdll</library>
+	<library>kernel32</library>
+	<library>shlwapi</library>
+	<library>wine</library>
+	<library>uuid</library>
+	<library>advapi32</library>
+	<file>mapi32_main.c</file>
+	<file>imalloc.c</file>
+	<file>prop.c</file>
+	<file>util.c</file>
+	<file>mapi32.spec</file>
+</module>
Property changes on: trunk/reactos/lib/mapi32/mapi32.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/reactos/lib/mapi32/prop.c
--- vendor/wine/dlls/mapi32/current/prop.c	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/lib/mapi32/prop.c	2006-01-14 19:36:04 UTC (rev 20861)
@@ -1404,7 +1404,7 @@
     ULONG            ulObjAccess; /* Object access level */
     ULONG            ulNumValues; /* Number of items in values list */
     struct list      values;      /* List of property values */
-    CRITICAL_SECTION cs;          /* Lock for thread safety */
+    RTL_CRITICAL_SECTION cs;          /* Lock for thread safety */
 } IPropDataImpl;
 
 /* Internal - Get a property value, assumes lock is held */

Modified: trunk/reactos/lib/uuid/uuid.c
--- trunk/reactos/lib/uuid/uuid.c	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/lib/uuid/uuid.c	2006-01-14 19:36:04 UTC (rev 20861)
@@ -60,6 +60,7 @@
 /* other GUIDs */
 
 #include "vfw.h"
+#include "mapiguid.h"
 
 #if 0 /* FIXME */
 #include "uuids.h"

Modified: trunk/reactos/media/doc/README.WINE
--- trunk/reactos/media/doc/README.WINE	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/media/doc/README.WINE	2006-01-14 19:36:04 UTC (rev 20861)
@@ -51,6 +51,7 @@
 reactos/lib/imm32		# Synced to Wine-0_9_5
 reactos/lib/iphlpapi		# Out of sync
 reactos/lib/imagehlp		# Patches for BindImage need review and submission to winehq.
+reactos/lib/mapi32		# Synced to Wine-0_9_5
 reactos/lib/msvcrt20		# Out of sync
 reactos/lib/mpr                 # Synced to Wine-0_9_5
 reactos/lib/msacm		# Out of sync

Added: trunk/reactos/w32api/include/mapicode.h
--- trunk/reactos/w32api/include/mapicode.h	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/w32api/include/mapicode.h	2006-01-14 19:36:04 UTC (rev 20861)
@@ -0,0 +1,110 @@
+/*
+ * Status codes returned by MAPI
+ *
+ * Copyright (C) 2002 Aric Stewart
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef MAPICODE_H
+#define MAPICODE_H
+
+#include <winerror.h>
+
+#define MAKE_MAPI_SCODE(sev,fac,code) \
+    ((SCODE)(((ULONG)(sev)<<31)|((ULONG)(fac)<<16)|((ULONG)(code))))
+
+#define MAKE_MAPI_E(e) (MAKE_MAPI_SCODE(1,FACILITY_ITF,(e)))
+#define MAKE_MAPI_S(e) (MAKE_MAPI_SCODE(0,FACILITY_ITF,(e)))
+
+/* Errors */
+#define MAPI_E_ACCOUNT_DISABLED            ((SCODE)0x80040124)
+#define MAPI_E_AMBIGUOUS_RECIP             ((SCODE)0x80040700)
+#define MAPI_E_BAD_CHARWIDTH               ((SCODE)0x80040103)
+#define MAPI_E_BAD_COLUMN                  ((SCODE)0x80040118)
+#define MAPI_E_BAD_VALUE                   ((SCODE)0x80040301)
+#define MAPI_E_BUSY                        ((SCODE)0x8004010B)
+#define MAPI_E_CALL_FAILED                 E_FAIL
+#define MAPI_E_CANCEL                      ((SCODE)0x80040501)
+#define MAPI_E_COLLISION                   ((SCODE)0x80040604)
+#define MAPI_E_COMPUTED                    ((SCODE)0x8004011A)
+#define MAPI_E_CORRUPT_DATA                ((SCODE)0x8004011B)
+#define MAPI_E_CORRUPT_STORE               ((SCODE)0x80040600)
+#define MAPI_E_DECLINE_COPY                ((SCODE)0x80040306)
+#define MAPI_E_DISK_ERROR                  ((SCODE)0x80040116)
+#define MAPI_E_END_OF_SESSION              ((SCODE)0x80040200)
+#define MAPI_E_EXTENDED_ERROR              ((SCODE)0x80040119)
+#define MAPI_E_FAILONEPROVIDER             ((SCODE)0x8004011D)
+#define MAPI_E_FOLDER_CYCLE                ((SCODE)0x8004060B)
+#define MAPI_E_HAS_FOLDERS                 ((SCODE)0x80040609)
+#define MAPI_E_HAS_MESSAGES                ((SCODE)0x8004060A)
+#define MAPI_E_INTERFACE_NOT_SUPPORTED     E_NOINTERFACE
+#define MAPI_E_INVALID_ACCESS_TIME         ((SCODE)0x80040123)
+#define MAPI_E_INVALID_BOOKMARK            ((SCODE)0x80040405)
+#define MAPI_E_INVALID_ENTRYID             ((SCODE)0x80040107)
+#define MAPI_E_INVALID_OBJECT              ((SCODE)0x80040108)
+#define MAPI_E_INVALID_PARAMETER           E_INVALIDARG
+#define MAPI_E_INVALID_TYPE                ((SCODE)0x80040302)
+#define MAPI_E_INVALID_WORKSTATION_ACCOUNT ((SCODE)0x80040122)
+#define MAPI_E_LOGON_FAILED                ((SCODE)0x80040111)
+#define MAPI_E_MISSING_REQUIRED_COLUMN     ((SCODE)0x80040202)
+#define MAPI_E_NETWORK_ERROR               ((SCODE)0x80040115)
+#define MAPI_E_NO_ACCESS                   E_ACCESSDENIED
+#define MAPI_E_NON_STANDARD                ((SCODE)0x80040606)
+#define MAPI_E_NO_RECIPIENTS               ((SCODE)0x80040607)
+#define MAPI_E_NO_SUPPORT                  ((SCODE)0x80040102)
+#define MAPI_E_NO_SUPPRESS                 ((SCODE)0x80040602)
+#define MAPI_E_NOT_ENOUGH_DISK             ((SCODE)0x8004010D)
+#define MAPI_E_NOT_ENOUGH_MEMORY           E_OUTOFMEMORY
+#define MAPI_E_NOT_ENOUGH_RESOURCES        ((SCODE)0x8004010E)
+#define MAPI_E_NOT_FOUND                   ((SCODE)0x8004010F)
+#define MAPI_E_NOT_INITIALIZED             ((SCODE)0x80040605)
+#define MAPI_E_NOT_IN_QUEUE                ((SCODE)0x80040601)
+#define MAPI_E_NOT_ME                      ((SCODE)0x80040502)
+#define MAPI_E_OBJECT_CHANGED              ((SCODE)0x80040109)
+#define MAPI_E_OBJECT_DELETED              ((SCODE)0x8004010A)
+#define MAPI_E_PASSWORD_CHANGE_REQUIRED    ((SCODE)0x80040120)
+#define MAPI_E_PASSWORD_EXPIRED            ((SCODE)0x80040121)
+#define MAPI_E_SESSION_LIMIT               ((SCODE)0x80040112)
+#define MAPI_E_STRING_TOO_LONG             ((SCODE)0x80040105)
+#define MAPI_E_SUBMITTED                   ((SCODE)0x80040608)
+#define MAPI_E_TABLE_EMPTY                 ((SCODE)0x80040402)
+#define MAPI_E_TABLE_TOO_BIG               ((SCODE)0x80040403)
+#define MAPI_E_TIMEOUT                     ((SCODE)0x80040401)
+#define MAPI_E_TOO_BIG                     ((SCODE)0x80040305)
+#define MAPI_E_TOO_COMPLEX                 ((SCODE)0x80040117)
+#define MAPI_E_TYPE_NO_SUPPORT             ((SCODE)0x80040303)
+#define MAPI_E_UNABLE_TO_ABORT             ((SCODE)0x80040114)
+#define MAPI_E_UNABLE_TO_COMPLETE          ((SCODE)0x80040400)
+#define MAPI_E_UNCONFIGURED                ((SCODE)0x8004011C)
+#define MAPI_E_UNEXPECTED_ID               ((SCODE)0x80040307)
+#define MAPI_E_UNEXPECTED_TYPE             ((SCODE)0x80040304)
+#define MAPI_E_UNKNOWN_CPID                ((SCODE)0x8004011E)
+#define MAPI_E_UNKNOWN_ENTRYID             ((SCODE)0x80040201)
+#define MAPI_E_UNKNOWN_FLAGS               ((SCODE)0x80040106)
+#define MAPI_E_UNKNOWN_LCID                ((SCODE)0x8004011F)
+#define MAPI_E_USER_CANCEL                 ((SCODE)0x80040113)
+#define MAPI_E_VERSION                     ((SCODE)0x80040110)
+#define MAPI_E_WAIT                        ((SCODE)0x80040500)
+
+/* Warnings */
+#define MAPI_W_APPROX_COUNT                ((SCODE)0x00040482)
+#define MAPI_W_CANCEL_MESSAGE              ((SCODE)0x00040580)
+#define MAPI_W_ERRORS_RETURNED             ((SCODE)0x00040380)
+#define MAPI_W_NO_SERVICE                  ((SCODE)0x00040203)
+#define MAPI_W_PARTIAL_COMPLETION          ((SCODE)0x00040680)
+#define MAPI_W_POSITION_CHANGED            ((SCODE)0x00040481)
+
+#endif /* MAPICODE_H */
Property changes on: trunk/reactos/w32api/include/mapicode.h
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/reactos/w32api/include/mapidefs.h
--- trunk/reactos/w32api/include/mapidefs.h	2006-01-14 19:31:10 UTC (rev 20860)
+++ trunk/reactos/w32api/include/mapidefs.h	2006-01-14 19:36:04 UTC (rev 20861)
@@ -0,0 +1,953 @@
+/*
+ * Copyright (C) 1998 Justin Bradford
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef MAPIDEFS_H
+#define MAPIDEFS_H
+
+#ifndef __WINESRC__
+# include <windows.h>
+#endif
+
+#include <winerror.h>
+#ifndef _OBJBASE_H_
+#include <objbase.h>
+#endif
+
+/* Some types from other headers */
+#ifndef __LHANDLE
+#define __LHANDLE
+typedef ULONG_PTR LHANDLE, *LPLHANDLE;
+#endif
+
+#ifndef _tagCY_DEFINED
+#define _tagCY_DEFINED
+typedef union tagCY
+{
+    struct
+    {
+#ifdef WORDS_BIGENDIAN
+        LONG  Hi;
+        ULONG Lo;
+#else
+        ULONG Lo;
+        LONG  Hi;
+#endif
+    } DUMMYSTRUCTNAME;
+    LONGLONG int64;
+} CY;
+typedef CY CURRENCY;
+#endif /* _tagCY_DEFINED */
+
+
+#ifndef _FILETIME_
+#define _FILETIME_
+typedef struct _FILETIME
+{
+#ifdef WORDS_BIGENDIAN
+    DWORD dwHighDateTime;
+    DWORD dwLowDateTime;
+#else
+    DWORD dwLowDateTime;
+    DWORD dwHighDateTime;
+#endif
+} FILETIME, *PFILETIME, *LPFILETIME;
+#endif
+
+/* Memory allocation routines */
+typedef SCODE (WINAPI ALLOCATEBUFFER)(ULONG,LPVOID*);
+typedef SCODE (WINAPI ALLOCATEMORE)(ULONG,LPVOID,LPVOID*);
+typedef ULONG (WINAPI FREEBUFFER)(LPVOID);
+
+typedef ALLOCATEBUFFER *LPALLOCATEBUFFER;
+typedef ALLOCATEMORE *LPALLOCATEMORE;
+typedef FREEBUFFER *LPFREEBUFFER;
+
+/* MAPI exposed interfaces */
+typedef const IID *LPCIID;
+
+typedef struct IAddrBook IAddrBook;
+typedef IAddrBook *LPADRBOOK;
+typedef struct IABContainer IABContainer;
+typedef IABContainer *LPABCONT;
+typedef struct IAttach IAttach;
+typedef IAttach *LPATTACH;
+typedef struct IDistList IDistList;
+typedef IDistList *LPDISTLIST;
+typedef struct IMailUser IMailUser;
+typedef IMailUser *LPMAILUSER;
+typedef struct IMAPIAdviseSink *LPMAPIADVISESINK;
+typedef struct IMAPIContainer IMAPIContainer;
+typedef IMAPIContainer *LPMAPICONTAINER;
+typedef struct IMAPIFolder IMAPIFolder;
+typedef IMAPIFolder *LPMAPIFOLDER;
+typedef struct IMAPIProgress IMAPIProgress;
+typedef IMAPIProgress *LPMAPIPROGRESS;
+typedef struct IMAPIStatus IMAPIStatus;
+typedef IMAPIStatus *LPMAPISTATUS;
+typedef struct IMessage IMessage;
+typedef IMessage *LPMESSAGE;
+typedef struct IMsgStore IMsgStore;
+typedef IMsgStore *LPMDB;
+typedef struct IProfSect IProfSect;
+typedef IProfSect *LPPROFSECT;
+typedef struct IProviderAdmin IProviderAdmin;
+typedef IProviderAdmin *LPPROVIDERADMIN;
+
+#ifndef MAPI_DIM
+# define MAPI_DIM 1 /* Default to one dimension for variable length arrays */
+#endif
+
+/* Flags for abFlags[0] */
+#define MAPI_NOTRESERVED 0x08
+#define MAPI_NOW         0x10
+#define MAPI_THISSESSION 0x20
+#define MAPI_NOTRECIP    0x40
+#define MAPI_SHORTTERM   0x80
+
+/* Flags for abFlags[1]  */
+#define MAPI_COMPOUND    0x80
+
+typedef struct _ENTRYID
+{
+    BYTE abFlags[4];
+    BYTE ab[MAPI_DIM];
+} ENTRYID, *LPENTRYID;
+
+/* MAPI GUID's */
+typedef struct _MAPIUID
+{
+    BYTE ab[sizeof(GUID)];
+} MAPIUID, *LPMAPIUID;
+
+#define IsEqualMAPIUID(pl,pr) (!memcmp((pl),(pr),sizeof(MAPIUID)))
+
+#define MAPI_ONE_OFF_UID { 0x81,0x2b,0x1f,0xa4,0xbe,0xa3,0x10,0x19,0x9d,0x6e, \
+                           0x00,0xdd,0x01,0x0f,0x54,0x02 }
+#define MAPI_ONE_OFF_UNICODE      0x8000
+#define MAPI_ONE_OFF_NO_RICH_INFO 0x0001
+
+/* Object types */
+#define MAPI_STORE    1U
+#define MAPI_ADDRBOOK 2U
+#define MAPI_FOLDER   3U
+#define MAPI_ABCONT   4U
+#define MAPI_MESSAGE  5U
+#define MAPI_MAILUSER 6U
+#define MAPI_ATTACH   7U
+#define MAPI_DISTLIST 8U
+#define MAPI_PROFSECT 9U
+#define MAPI_STATUS   10U
+#define MAPI_SESSION  11U
+#define MAPI_FORMINFO 12U
+
+/* Flags for various calls */
+#define MAPI_MODIFY                   0x00000001U /* Object can be modified */
+#define MAPI_ACCESS_MODIFY            MAPI_MODIFY /* Want write access */
+#define MAPI_ACCESS_READ              0x00000002U /* Want read access */
+#define MAPI_ACCESS_DELETE            0x00000004U /* Want delete access */
+#define MAPI_ACCESS_CREATE_HIERARCHY  0x00000008U
+#define MAPI_ACCESS_CREATE_CONTENTS   0x00000010U
+#define MAPI_ACCESS_CREATE_ASSOCIATED 0x00000020U
+#define MAPI_UNICODE                  0x80000000U /* Strings in this call are Unicode */
+
+#if defined (UNICODE) || defined (__WINESRC__)
+#define fMapiUnicode MAPI_UNICODE
+#else
+#define fMapiUnicode 0U
+#endif
+
+/* Types of message receivers */
+#ifndef MAPI_ORIG
+#define MAPI_ORIG      0          /* The original author */
+#define MAPI_TO        1          /* The primary message receiver */
+#define MAPI_CC        2          /* A carbon copy receiver */
+#define MAPI_BCC       3          /* A blind carbon copy receiver */
+#define MAPI_P1        0x10000000 /* A message resend */
+#define MAPI_SUBMITTED 0x80000000 /* This message has already been sent */
+#endif
+
+#ifndef cchProfileNameMax
+#define cchProfileNameMax 64 /* Maximum length of a profile name */
+#define cchProfilePassMax 64 /* Maximum length of a profile password */
+#endif
+
+/* Properties: The are the contents of cells in MAPI tables, as well as the
+ * values returned when object properties are queried.
+ */
+
+/* Property types */
+#define PT_UNSPECIFIED 0U
+#define PT_NULL        1U
+#define PT_I2          2U
+#define PT_SHORT       PT_I2
+#define PT_LONG        3U
+#define PT_I4          PT_LONG
+#define PT_R4          4U
+#define PT_FLOAT       PT_R4
+#define PT_DOUBLE      5U
+#define PT_R8          PT_DOUBLE
+#define PT_CURRENCY    6U
+#define PT_APPTIME     7U
+#define PT_ERROR       10U
+#define PT_BOOLEAN     11U
+#define PT_OBJECT      13U
+#define PT_I8          20U
+#define PT_LONGLONG    PT_I8
+#define PT_STRING8     30U
+#define PT_UNICODE     31U
+#define PT_SYSTIME     64U
+#define PT_CLSID       72U
+#define PT_BINARY      258U
+
+#define MV_FLAG     0x1000 /* This property type is multi-valued (an array) */
+#define MV_INSTANCE 0x2000
+#define MVI_FLAG    (MV_FLAG|MV_INSTANCE)
+#define MVI_PROP(t) ((t)|MVI_FLAG)
+
+#ifndef __WINESRC__
+# ifdef UNICODE
+# define PT_TSTRING      PT_UNICODE
+# define PT_MV_TSTRING   (MV_FLAG|PT_UNICODE)
+# define LPSZ            lpszW
+# define LPPSZ           lppszW
+# define MVSZ            MVszW
+# else
+# define PT_TSTRING      PT_STRING8
+# define PT_MV_TSTRING   (MV_FLAG|PT_STRING8)
+# define LPSZ            lpszA
+# define LPPSZ           lppszA
+# define MVSZ            MVszA
+# endif
+#endif
+
+#define PROP_TYPE_MASK  0xFFFFU
+#define PROP_TYPE(t)    ((t) & PROP_TYPE_MASK)
+#define PROP_ID(t)      ((t) >> 16)
+#define PROP_TAG(t,id)  (((id) << 16) | t)
+#define PROP_ID_NULL    0
+#define PROP_ID_INVALID 0xFFFF
+#define PR_NULL         PROP_TAG(PT_NULL, PROP_ID_NULL)
+
+#define CHANGE_PROP_TYPE(t,typ) ((0xFFFF0000 & t) | typ)
+
+/* Multi-valued property types */
+#define PT_MV_I2       (MV_FLAG|PT_I2)
+#define PT_MV_SHORT    PT_MV_I2
+#define PT_MV_LONG     (MV_FLAG|PT_LONG)
+#define PT_MV_I4       PT_MV_LONG
+#define PT_MV_R4       (MV_FLAG|PT_R4)
+#define PT_MV_FLOAT    PT_MV_R4
+#define PT_MV_DOUBLE   (MV_FLAG|PT_DOUBLE)
+#define PT_MV_R8       PT_MV_DOUBLE
+#define PT_MV_CURRENCY (MV_FLAG|PT_CURRENCY)
+#define PT_MV_APPTIME  (MV_FLAG|PT_APPTIME)
+#define PT_MV_SYSTIME  (MV_FLAG|PT_SYSTIME)
+#define PT_MV_STRING8  (MV_FLAG|PT_STRING8)
+#define PT_MV_BINARY   (MV_FLAG|PT_BINARY)
+#define PT_MV_UNICODE  (MV_FLAG|PT_UNICODE)
+#define PT_MV_CLSID    (MV_FLAG|PT_CLSID)
+#define PT_MV_I8       (MV_FLAG|PT_I8)
+#define PT_MV_LONGLONG PT_MV_I8
+
+
+/* The property tag structure. This describes a list of columns */
+typedef struct _SPropTagArray
+{
+    ULONG cValues;              /* Number of elements in aulPropTag */
+    ULONG aulPropTag[MAPI_DIM]; /* Property tags */
+} SPropTagArray, *LPSPropTagArray;
+
+#define CbNewSPropTagArray(c) (offsetof(SPropTagArray,aulPropTag)+(c)*sizeof(ULONG))
+#define CbSPropTagArray(p)    CbNewSPropTagArray((p)->cValues)
+#define SizedSPropTagArray(n,id) \
+    struct _SPropTagArray_##id { ULONG cValues; ULONG aulPropTag[n]; } id
+
+/* Multi-valued PT_APPTIME property value */
+typedef struct _SAppTimeArray
+{
+    ULONG   cValues; /* Number of doubles in lpat */
+    double *lpat;    /* Pointer to double array of length cValues */
+} SAppTimeArray;
+
+/* PT_BINARY property value */
+typedef struct _SBinary
+{
+    ULONG  cb;  /* Number of bytes in lpb */
+    LPBYTE lpb; /* Pointer to byte array of length cb */
+} SBinary, *LPSBinary;
+
+/* Multi-valued PT_BINARY property value */
+typedef struct _SBinaryArray
+{
+    ULONG    cValues; /* Number of SBinarys in lpbin */
+    SBinary *lpbin;   /* Pointer to SBinary array of length cValues */
+} SBinaryArray;
+
+typedef SBinaryArray ENTRYLIST, *LPENTRYLIST;
+
+/* Multi-valued PT_CY property value */
+typedef struct _SCurrencyArray
+{
+    ULONG  cValues; /* Number of CYs in lpcu */
+    CY    *lpcur;   /* Pointer to CY array of length cValues */
+} SCurrencyArray;
+
+/* Multi-valued PT_SYSTIME property value */
+typedef struct _SDateTimeArray
+{
+    ULONG     cValues; /* Number of FILETIMEs in lpft */
+    FILETIME *lpft;    /* Pointer to FILETIME array of length cValues */
+} SDateTimeArray;
+
+/* Multi-valued PT_DOUBLE property value */
+typedef struct _SDoubleArray
+{
+    ULONG   cValues; /* Number of doubles in lpdbl */
+    double *lpdbl;   /* Pointer to double array of length cValues */
+} SDoubleArray;
+
+/* Multi-valued PT_CLSID property value */
+typedef struct _SGuidArray
+{
+    ULONG cValues; /* Number of GUIDs in lpguid */
+    GUID *lpguid;  /* Pointer to GUID array of length cValues */
+} SGuidArray;
+
+/* Multi-valued PT_LONGLONG property value */
+typedef struct _SLargeIntegerArray
+{
+    ULONG          cValues; /* Number of long64s in lpli */
+    LARGE_INTEGER *lpli;    /* Pointer to long64 array of length cValues */
+} SLargeIntegerArray;
+
+/* Multi-valued PT_LONG property value */
+typedef struct _SLongArray
+{
+    ULONG  cValues; /* Number of longs in lpl */
+    LONG  *lpl;     /* Pointer to long array of length cValues */
+} SLongArray;
+
+/* Multi-valued PT_STRING8 property value */
+typedef struct _SLPSTRArray
+{
+    ULONG  cValues; /* Number of Ascii strings in lppszA */
+    LPSTR *lppszA;  /* Pointer to Ascii string array of length cValues */
+} SLPSTRArray;
+
+/* Multi-valued PT_FLOAT property value */
+typedef struct _SRealArray
+{
+    ULONG cValues; /* Number of floats in lpflt */
+    float *lpflt;  /* Pointer to float array of length cValues */
+} SRealArray;
+
+/* Multi-valued PT_SHORT property value */
+typedef struct _SShortArray
+{
+    ULONG      cValues; /* Number of shorts in lpb */
+    short int *lpi;     /* Pointer to short array of length cValues */
+} SShortArray;
+
+/* Multi-valued PT_UNICODE property value */
+typedef struct _SWStringArray
+{
+    ULONG   cValues; /* Number of Unicode strings in lppszW */
+    LPWSTR *lppszW;  /* Pointer to Unicode string array of length cValues */
+} SWStringArray;
+
+/* A property value */
+typedef union _PV
+{
+    short int          i;
+    LONG               l;
+    ULONG              ul;
+    float              flt;
+    double             dbl;
+    unsigned short     b;
+    CY                 cur;
+    double             at;
+    FILETIME           ft;
+    LPSTR              lpszA;
+    SBinary            bin;
+    LPWSTR             lpszW;
+    LPGUID             lpguid;
+    LARGE_INTEGER      li;
+    SShortArray        MVi;
+    SLongArray         MVl;
+    SRealArray         MVflt;
+    SDoubleArray       MVdbl;
+    SCurrencyArray     MVcur;
+    SAppTimeArray      MVat;
+    SDateTimeArray     MVft;
+    SBinaryArray       MVbin;
+    SLPSTRArray        MVszA;
+    SWStringArray      MVszW;
+    SGuidArray         MVguid;
+    SLargeIntegerArray MVli;
+    SCODE              err;
+    LONG               x;
+} __UPV;
+
+/* Property value structure. This is essentially a mini-Variant */
+typedef struct _SPropValue
+{
+    ULONG     ulPropTag;  /* The property type */
+    ULONG     dwAlignPad; /* Alignment, treat as reserved */
+    union _PV Value;      /* The property value */
+} SPropValue, *LPSPropValue;
+
+/* Structure describing a table row (a collection of property values) */
+typedef struct _SRow
+{
+    ULONG        ulAdrEntryPad; /* Padding, treat as reserved */
+    ULONG        cValues;       /* Count of property values in lpProbs */
+    LPSPropValue lpProps;       /* Pointer to an array of property values of length cValues */
+} SRow, *LPSRow;
+
+/* Structure describing a set of table rows */
+typedef struct _SRowSet
+{
+    ULONG cRows;          /* Count of rows in aRow */
+    SRow  aRow[MAPI_DIM]; /* Array of rows of length cRows */
+} SRowSet, *LPSRowSet;
+
+#define CbNewSRowSet(c) (offsetof(SRowSet,aRow)+(c)*sizeof(SRow))
+#define CbSRowSet(p)    CbNewSRowSet((p)->cRows)
+#define SizedSRowSet(n,id) \
+    struct _SRowSet_##id { ULONG cRows; SRow aRow[n]; } id
+
+/* Structure describing a problem with a property */
+typedef struct _SPropProblem
+{
+    ULONG ulIndex;   /* Index of the property */
+    ULONG ulPropTag; /* Proprty tag of the property */
+    SCODE scode;     /* Error code of the problem */
+} SPropProblem, *LPSPropProblem;
+
+/* A collection of property problems */
+typedef struct _SPropProblemArray
+{
+    ULONG        cProblem;           /* Number of problems in aProblem */
+    SPropProblem aProblem[MAPI_DIM]; /* Array of problems of length cProblem */
+} SPropProblemArray, *LPSPropProblemArray;
+
+/* FPropContainsProp flags */
+#define FL_FULLSTRING     0x00000ul /* Exact string match */
+#define FL_SUBSTRING      0x00001ul /* Substring match */
+#define FL_PREFIX         0x00002ul /* Prefix match */
+#define FL_IGNORECASE     0x10000ul /* Case insensitive */
+#define FL_IGNORENONSPACE 0x20000ul /* Ignore non spacing characters */
+#define FL_LOOSE          0x40000ul /* Try very hard to match */
+
+
+/* Table types returned by IMAPITable_GetStatus() */
+#define TBLTYPE_SNAPSHOT 0U /* Table is fixed at creation time and contents do not change */
+#define TBLTYPE_KEYSET   1U /* Table has a fixed number of rows, but row values may change */
+#define TBLTYPE_DYNAMIC  2U /* Table values and the number of rows may change */
+
+/* Table status returned by IMAPITable_GetStatus() */
+#define TBLSTAT_COMPLETE       0U  /* All operations have completed (normal status) */
+#define TBLSTAT_QCHANGED       7U  /* Table data has changed as expected */
+#define TBLSTAT_SORTING        9U  /* Table is being asynchronously sorted */
+#define TBLSTAT_SORT_ERROR     10U /* An error occurred while sorting the table */
+#define TBLSTAT_SETTING_COLS   11U /* Table columns are being asynchronously changed */
+#define TBLSTAT_SETCOL_ERROR   13U /* An error occurred during column changing */
+#define TBLSTAT_RESTRICTING    14U /* Table rows are being asynchronously restricted */
+#define TBLSTAT_RESTRICT_ERROR 15U /* An error occurred during row restriction */
+
+/* Flags for IMAPITable operations that can be asynchronous */
+#define TBL_NOWAIT 1U         /* Perform the operation asynchronously */
+#define TBL_BATCH  2U         /* Perform the operation when the results are needed */
+#define TBL_ASYNC  TBL_NOWAIT /* Synonym for TBL_NOWAIT */
+
+/* Flags for IMAPITable_FindRow() */
+#define DIR_BACKWARD 1U /* Read rows backwards from the start bookmark */
+
+/* Table bookmarks */
+typedef ULONG BOOKMARK;
+
+#define BOOKMARK_BEGINNING ((BOOKMARK)0) /* The first row */
+#define BOOKMARK_CURRENT   ((BOOKMARK)1) /* The curent table row */
+#define BOOKMARK_END       ((BOOKMARK)2) /* The last row */
+
+/* Row restrictions */
+typedef struct _SRestriction* LPSRestriction;
+
+typedef struct _SAndRestriction
+{
+    ULONG          cRes;
+    LPSRestriction lpRes;
+} SAndRestriction;
+
+typedef struct _SBitMaskRestriction
+{
+    ULONG relBMR;
+    ULONG ulPropTag;
+    ULONG ulMask;
+} SBitMaskRestriction;
+
+typedef struct _SCommentRestriction
+{
+    ULONG          cValues;
+    LPSRestriction lpRes;
+    LPSPropValue   lpProp;
+} SCommentRestriction;
+
+#define RELOP_LT 0U
+#define RELOP_LE 1U
+#define RELOP_GT 2U
+#define RELOP_GE 3U
+#define RELOP_EQ 4U
+#define RELOP_NE 5U
+#define RELOP_RE 6U
+
+typedef struct _SComparePropsRestriction
+{
+    ULONG relop;
+    ULONG ulPropTag1;
+    ULONG ulPropTag2;
+} SComparePropsRestriction;
+
+typedef struct _SContentRestriction
+{
+    ULONG        ulFuzzyLevel;
+    ULONG        ulPropTag;
+    LPSPropValue lpProp;
+} SContentRestriction;
+
+typedef struct _SExistRestriction
+{
+    ULONG ulReserved1;
+    ULONG ulPropTag;
+    ULONG ulReserved2;
+} SExistRestriction;
+
+typedef struct _SNotRestriction
+{
+    ULONG          ulReserved;
+    LPSRestriction lpRes;
+} SNotRestriction;
+
+typedef struct _SOrRestriction
+{
+    ULONG          cRes;
+    LPSRestriction lpRes;
+} SOrRestriction;
+
+typedef struct _SPropertyRestriction
+{
+    ULONG        relop;
+    ULONG        ulPropTag;
+    LPSPropValue lpProp;
+} SPropertyRestriction;
+
+typedef struct _SSizeRestriction
+{
+    ULONG relop;
+    ULONG ulPropTag;
+    ULONG cb;
+} SSizeRestriction;
+
+typedef struct _SSubRestriction
+{
+    ULONG          ulSubObject;
+    LPSRestriction lpRes;
+} SSubRestriction;
+
+/* Restriction types */
+#define RES_AND            0U
+#define RES_OR             1U
+#define RES_NOT            2U
+#define RES_CONTENT        3U
+#define RES_PROPERTY       4U
+#define RES_COMPAREPROPS   5U
+#define RES_BITMASK        6U
+#define RES_SIZE           7U
+#define RES_EXIST          8U
+#define RES_SUBRESTRICTION 9U
+#define RES_COMMENT        10U
+
+typedef struct _SRestriction
+{
+    ULONG rt;
+    union
+    {
+        SAndRestriction          resAnd;
+        SBitMaskRestriction      resBitMask;
+        SCommentRestriction      resComment;
+        SComparePropsRestriction resCompareProps;
+        SContentRestriction      resContent;
+        SExistRestriction        resExist;
+        SNotRestriction          resNot;
+        SOrRestriction           resOr;
+        SPropertyRestriction     resProperty;
+        SSizeRestriction         resSize;
+        SSubRestriction          resSub;
+    } res;
+} SRestriction;
+
+/* Errors */
+typedef struct _MAPIERROR
+{
+    ULONG  ulVersion;       /* Mapi version */
+#if defined (UNICODE) || defined (__WINESRC__)
+    LPWSTR lpszError;       /* Error and component strings. These are Ascii */
+    LPWSTR lpszComponent;   /* unless the MAPI_UNICODE flag is passed in */
+#else
+    LPSTR  lpszError;
+    LPSTR  lpszComponent;
+#endif
+    ULONG  ulLowLevelError;
+    ULONG  ulContext;
+} MAPIERROR, *LPMAPIERROR;
+
+/* Sorting */
+#define TABLE_SORT_ASCEND  0U
+#define TABLE_SORT_DESCEND 1U
+#define TABLE_SORT_COMBINE 2U
+
+typedef struct _SSortOrder
+{
+    ULONG ulPropTag;
+    ULONG ulOrder;
+} SSortOrder, *LPSSortOrder;
+
+typedef struct _SSortOrderSet
+{
+    ULONG      cSorts;
+    ULONG      cCategories;
+    ULONG      cExpanded;
+    SSortOrder aSort[MAPI_DIM];
+} SSortOrderSet, * LPSSortOrderSet;
+
+#define MNID_ID     0
+#define MNID_STRING 1
+
+typedef struct _MAPINAMEID
+{
+    LPGUID lpguid;
+    ULONG ulKind;
+    union
+    {
+        LONG lID;
+        LPWSTR lpwstrName;
+    } Kind;
+} MAPINAMEID, *LPMAPINAMEID;
+
+/* Desired notification types (bitflags) */
+#define fnevCriticalError        0x00000001UL
+#define fnevNewMail              0x00000002UL
+#define fnevObjectCreated        0x00000004UL
+#define fnevObjectDeleted        0x00000008UL
+#define fnevObjectModified       0x00000010UL
+#define fnevObjectMoved          0x00000020UL
+#define fnevObjectCopied         0x00000040UL
+#define fnevSearchComplete       0x00000080UL
+#define fnevTableModified        0x00000100UL
+#define fnevStatusObjectModified 0x00000200UL
+#define fnevReservedForMapi      0x40000000UL
+#define fnevExtended             0x80000000UL
+
+/* Type of notification event */
+#define TABLE_CHANGED       1U
+#define TABLE_ERROR         2U
+#define TABLE_ROW_ADDED     3U
+#define TABLE_ROW_DELETED   4U
+#define TABLE_ROW_MODIFIED  5U
+#define TABLE_SORT_DONE     6U
+#define TABLE_RESTRICT_DONE 7U
+#define TABLE_SETCOL_DONE   8U
+#define TABLE_RELOAD        9U
+
+/* fnevCriticalError notification */
+typedef struct _ERROR_NOTIFICATION
+{
+    ULONG       cbEntryID;
+    LPENTRYID   lpEntryID;
+    SCODE       scode;
+    ULONG       ulFlags;
+    LPMAPIERROR lpMAPIError;
+} ERROR_NOTIFICATION;
+
+/* fnevNewMail notification */
+typedef struct _NEWMAIL_NOTIFICATION
+{
+    ULONG     cbEntryID;
+    LPENTRYID lpEntryID;
+    ULONG     cbParentID;
+    LPENTRYID lpParentID;
+    ULONG     ulFlags;
+#if defined (UNICODE) || defined (__WINESRC__)
+    LPWSTR    lpszMessageClass;
+#else
+    LPSTR     lpszMessageClass;
+#endif
+    ULONG     ulMessageFlags;
+} NEWMAIL_NOTIFICATION;
+
+/* fnevObjectCreated/Deleted/Modified/Moved/Copied notification */
+typedef struct _OBJECT_NOTIFICATION
+{
+    ULONG           cbEntryID;
+    LPENTRYID       lpEntryID;
+    ULONG           ulObjType;
+    ULONG           cbParentID;
+    LPENTRYID       lpParentID;
+    ULONG           cbOldID;
+    LPENTRYID       lpOldID;
+    ULONG           cbOldParentID;
+    LPENTRYID       lpOldParentID;
+    LPSPropTagArray lpPropTagArray;
+} OBJECT_NOTIFICATION;
+
+/* fnevTableModified notification */
+typedef struct _TABLE_NOTIFICATION
+{
+    ULONG      ulTableEvent;
+    HRESULT    hResult;
+    SPropValue propIndex;
+    SPropValue propPrior;
+    SRow       row;
+    ULONG      ulPad;
+} TABLE_NOTIFICATION;
+
[truncated at 1000 lines; 2133 more skipped]