Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

570 lines
22 KiB

  1. /********************************************************
  2. //
  3. //
  4. //
  5. // MPSWab.H
  6. //
  7. // Header file for Microsoft Property Store dll
  8. //
  9. //
  10. ********************************************************/
  11. #ifndef _MPSWab_H_
  12. #define _MPSWab_H_
  13. //#define DEBUG
  14. #include <debug.h>
  15. typedef LPSPropValue LPPROPERTY_ARRAY;
  16. typedef ULONG PROPERTY_TAG;
  17. typedef SPropertyRestriction * LPSPropertyRestriction;
  18. #define IN
  19. #define OUT
  20. //The LPCONTENTLIST structure is just a different name for ADRLIST structure
  21. //However there is a very IMPORTANT difference in that the LPADRLIST structure
  22. //is created and freed using MAPIAllocateBuffer/MAPIFreeBuffer, while the
  23. //LPCONTENTLIST structure is created and freed using LocalAlloc/LocalFree
  24. //The LPCONTENTLIST is used by ReadPropArray
  25. #define LPCONTENTLIST LPADRLIST
  26. #define CONTENTLIST ADRLIST
  27. // This is the current GUID for Unicode version of the WAB
  28. // {8DCBCB9C-7513-11d2-9158-00C04F7956A4}
  29. static const GUID MPSWab_GUID =
  30. { 0x8dcbcb9c, 0x7513, 0x11d2, { 0x91, 0x58, 0x0, 0xc0, 0x4f, 0x79, 0x56, 0xa4 } };
  31. // This is the WAB guid for W3-alpha through IE5 Beta 2
  32. // This guid is also called from WAB.exe to identify the calling WAB process
  33. // {C1843281-0585-11d0-B290-00AA003CF676}
  34. static const GUID MPSWab_GUID_V4 =
  35. { 0xc1843281, 0x585, 0x11d0, { 0xb2, 0x90, 0x0, 0xaa, 0x0, 0x3c, 0xf6, 0x76 } };
  36. // This is the GUID for W1 and W2
  37. // {9CE9E8E0-D46E-11cf-A309-00AA002FC970}
  38. static const GUID MPSWab_W2_GUID =
  39. { 0x9ce9e8e0, 0xd46e, 0x11cf, { 0xa3, 0x9, 0x0, 0xaa, 0x0, 0x2f, 0xc9, 0x70 } };
  40. // This was the old GUID that identifies the old WAB file
  41. // {6F3C5C81-6C3F-11cf-8B85-00AA0044F941}
  42. static const GUID MPSWab_OldBeta1_GUID =
  43. { 0x6f3c5c81, 0x6c3f, 0x11cf, { 0x8b, 0x85, 0x0, 0xaa, 0x0, 0x44, 0xf9, 0x41 } };
  44. /// The structure of this file is as follows
  45. //
  46. // |---------------------------------|
  47. // | ----------------------------- |
  48. // | | File Header | |
  49. // | ----------------------------- |
  50. // | ----------------------------- |
  51. // | | Named Property storage | |
  52. // | ----------------------------- |
  53. // | ----------------------------- |
  54. // | | All the Indexes | |
  55. // | ----------------------------- |
  56. // | (Data) |
  57. // | ----------------------------- |
  58. // | ||-------------------------|| |
  59. // | ||Record Header || |
  60. // | ||-------------------------|| |
  61. // | ||Record Props Array || |
  62. // | ||-------------------------|| |
  63. // | ||Record || |
  64. // | ||Data || |
  65. // | ||-------------------------|| |
  66. // | |---------------------------| |
  67. // | .... |
  68. // | .... |
  69. // |---------------------------------|
  70. //We'll keep the indexes small to save memory
  71. #define MAX_INDEX_STRING 32
  72. //The Wab originally has space for these many entries and then grows to accomodate more ...
  73. #define MAX_INITIAL_INDEX_ENTRIES 500
  74. // At some point of time, entries and deletions in the property store will leave
  75. // wasted space. We need to know when to reclaim this wasted space
  76. #define MAX_ALLOWABLE_WASTED_SPACE_PERCENT 0.3 // 30%
  77. #define MAX_ALLOWABLE_WASTED_SPACE_ENTRIES 100 // 20 % of allowed space - delete/modify 50 entries and its time for compression
  78. // Amount of time aprocess waits to gain access to the property store
  79. #define MAX_LOCK_FILE_TIMEOUT 20000 // 20 seconds; in milliseconds
  80. typedef DWORD WAB_ENTRYID, *LPWAB_ENTRYID;
  81. #define SIZEOF_WAB_ENTRYID sizeof(WAB_ENTRYID)
  82. // These tags help tell us which index we are working with
  83. // Several internal functions are very dependent on the order of atleast
  84. // the first 2 elements so *** DO NOT MODIFY THIS ENUM ***!!!
  85. //
  86. // IMPORTANT NOTE: If you change this, you must change rgIndexArray in globals.c!
  87. //
  88. enum _IndexType
  89. {
  90. indexEntryID=0,
  91. indexDisplayName,
  92. indexLastName,
  93. indexFirstName,
  94. indexEmailAddress,
  95. indexAlias,
  96. indexMax
  97. };
  98. // Struct holding data about the Index portion of the file
  99. typedef struct _tagMPSWabIndexOffsetData
  100. {
  101. ULONG AllocatedBlockSize; //The total size in bytes allocated to the Index Block
  102. ULONG UtilizedBlockSize; //The actual # of bytes occupied in the block
  103. ULONG ulOffset; //The offset to this block
  104. ULONG ulcNumEntries; //Count of number of entries in the index
  105. } MPSWab_INDEX_OFFSET_DATA, * LPMPSWab_INDEX_OFFSET_DATA;
  106. // Struct holding data about each individual String Index entry
  107. typedef struct _tagMPSWabIndexEntryDataString
  108. {
  109. TCHAR szIndex[MAX_INDEX_STRING]; //We'll fix each index to a fixed-length string
  110. DWORD dwEntryID; //Points to entry id of the record that contains the string
  111. } MPSWab_INDEX_ENTRY_DATA_STRING, * LPMPSWab_INDEX_ENTRY_DATA_STRING;
  112. // Struct holding data about each individual EntryID Index entry
  113. typedef struct _tagMPSWabIndexEntryDataEntryID
  114. {
  115. DWORD dwEntryID; //Entry ID
  116. ULONG ulOffset; //Offset in the data where we can find the record corresponding to this index
  117. } MPSWab_INDEX_ENTRY_DATA_ENTRYID, * LPMPSWab_INDEX_ENTRY_DATA_ENTRYID;
  118. /***************************************************************************/
  119. // Structures related to Named Properties
  120. // We use a structure similar to the IndexOffsetData above for
  121. // handling the named prop data in the store
  122. #define MPSWab_NAMED_PROP_DATA MPSWab_INDEX_OFFSET_DATA
  123. #define LPMPSWab_NAMED_PROP_DATA LPMPSWab_INDEX_OFFSET_DATA
  124. typedef struct _NamedProp
  125. {
  126. ULONG ulPropTag; // Contains the proptag for this named prop
  127. LPTSTR lpsz; // Contains the string for this named prop
  128. } NAMED_PROP, * LPNAMED_PROP;
  129. typedef struct _tagGuidNamedProps
  130. {
  131. LPGUID lpGUID; // Application GUID for which these named props are
  132. ULONG cValues; // Number of entries in the lpmn array
  133. LPNAMED_PROP lpnm; // Array of Named Props for this Guid.
  134. } GUID_NAMED_PROPS, * LPGUID_NAMED_PROPS;
  135. #define NAMEDPROP_STORE_SIZE 2048
  136. #define NAMEDPROP_STORE_INCREMENT_SIZE 2048
  137. /***************************************************************************/
  138. // Struct holding data about the file
  139. // This is the header for files upto W2 - the file struct was
  140. // modified for post W2 files since post W2 now have 5 indexed fields
  141. // instead of the initial 3
  142. typedef struct _tagMPSWabFileHeaderW2
  143. {
  144. GUID MPSWabGuid; //Identifier to our MPSWab GUID
  145. ULONG ulModificationCount; //A janitorial maintainance counter - when it exists a predetermined count, we will have to compress the file - update counter only on deletions of records
  146. DWORD dwNextEntryID; //Holds the EntryID for next new record. Increment on record addition.
  147. MPSWab_INDEX_OFFSET_DATA IndexData[indexFirstName+1]; //Tells us about the incides
  148. ULONG ulcNumEntries; //Count of number of addresses in this address book
  149. ULONG ulcMaxNumEntries; //Maximum number of entries we can safely add to the file without needing to grow it
  150. ULONG ulFlags; //Signals various errors and messages
  151. ULONG ulReserved; //Signals that some errors were detected and need to cleanup
  152. } MPSWab_FILE_HEADER_W2, * LPMPSWab_FILE_HEADER_W2;
  153. // Struct holding data about the file
  154. typedef struct _tagMPSWabFileHeader
  155. {
  156. GUID MPSWabGuid; //Identifier to our MPSWab GUID
  157. ULONG ulModificationCount; //A janitorial maintainance counter - when it exists a predetermined count, we will have to compress the file - update counter only on deletions of records
  158. DWORD dwNextEntryID; //Holds the EntryID for next new record. Increment on record addition.
  159. MPSWab_INDEX_OFFSET_DATA IndexData[indexMax]; //Tells us about the incides
  160. ULONG ulcNumEntries; //Count of number of addresses in this address book
  161. ULONG ulcMaxNumEntries; //Maximum number of entries we can safely add to the file without needing to grow it
  162. ULONG ulFlags; //Signals various errors and messages
  163. MPSWab_NAMED_PROP_DATA NamedPropData; //Tells us about the named prop data
  164. ULONG ulReserved1; //reserved for future use
  165. ULONG ulReserved2; //reserved for future use
  166. ULONG ulReserved3; //reserved for future use
  167. ULONG ulReserved4; //reserved for future use
  168. } MPSWab_FILE_HEADER, * LPMPSWab_FILE_HEADER;
  169. // WAB Header Flags
  170. #define WAB_CLEAR 0x00000000
  171. #define WAB_ERROR_DETECTED 0x00000010
  172. #define WAB_WRITE_IN_PROGRESS 0x00000100
  173. #define WAB_BACKUP_NOW 0x00001000
  174. // Struct holding data about each record in the file
  175. typedef struct _tagMPSWabRecordHeader
  176. {
  177. #ifndef WIN16 // BOOL is 4 bytes for WIN32 and 2 bytes for WIN16
  178. BOOL bValidRecord; //When we delete an existing record we set this to FALSE, else TRUE
  179. #else
  180. ULONG bValidRecord; //When we delete an existing record we set this to FALSE, else TRUE
  181. #endif
  182. ULONG ulObjType; //Distinguish between DistList and Contact
  183. DWORD dwEntryID; //EntryID of this record
  184. ULONG ulcPropCount; //Count of how many props this object has
  185. ULONG ulPropTagArrayOffset;
  186. ULONG ulPropTagArraySize;
  187. ULONG ulRecordDataOffset;
  188. ULONG ulRecordDataSize;
  189. } MPSWab_RECORD_HEADER, * LPMPSWab_RECORD_HEADER;
  190. //struct representing the contact data
  191. typedef struct _tagMPSWabContact
  192. {
  193. ULONG ulObjType;
  194. ULONG ulcPropCount;
  195. ULONG ulDataSize;
  196. struct _tagSPropValue * Prop;
  197. } MPSWab_CONTACT, * LPMPSWab_CONTACT;
  198. //A pointer to this structure is handed around as the handle to the property store
  199. // The structure is first initialized in OpenPropertyStore and finally
  200. // deinitialized in ClosePropertyStore. In between, all the other functions
  201. // take the handle and then dereference it to get info on the file ...
  202. typedef struct _tagMPSWabFileInfo
  203. {
  204. #ifndef WIN16
  205. int nCurrentlyLoadedStrIndexType;
  206. BOOL bMPSWabInitialized;
  207. BOOL bReadOnlyAccess;
  208. #else
  209. DWORD nCurrentlyLoadedStrIndexType;
  210. DWORD bMPSWabInitialized;
  211. DWORD bReadOnlyAccess;
  212. #endif
  213. LPTSTR lpszMPSWabFileName;
  214. LPMPSWab_FILE_HEADER lpMPSWabFileHeader;
  215. LPMPSWab_INDEX_ENTRY_DATA_STRING lpMPSWabIndexStr; //at any given time, only one string index is in memory
  216. LPMPSWab_INDEX_ENTRY_DATA_ENTRYID lpMPSWabIndexEID;
  217. HANDLE hDataAccessMutex;
  218. } MPSWab_FILE_INFO, * LPMPSWab_FILE_INFO;
  219. //
  220. // We need a similar structure to deal with Files which are W2 and before
  221. //
  222. typedef struct _tagMPSWabFileInfoW2
  223. {
  224. int nCurrentlyLoadedStrIndexType;
  225. BOOL bMPSWabInitialized;
  226. BOOL bReadOnlyAccess;
  227. LPTSTR lpszMPSWabFileName;
  228. LPMPSWab_FILE_HEADER_W2 lpMPSWabFileHeaderW2;
  229. LPMPSWab_INDEX_ENTRY_DATA_STRING lpMPSWabIndexStr; //at any given time, only one string index is in memory
  230. LPMPSWab_INDEX_ENTRY_DATA_ENTRYID lpMPSWabIndexEID;
  231. HANDLE hDataAccessMutex;
  232. } MPSWab_FILE_INFO_W2, * LPMPSWab_FILE_INFO_W2;
  233. /****Flags for OpenPropertyStore*******************************************/
  234. //
  235. //Specify one of these when calling OpenPropertyStore
  236. #define AB_CREATE_NEW 0x00000001
  237. #define AB_CREATE_ALWAYS 0x00000010
  238. #define AB_OPEN_EXISTING 0x00000100
  239. #define AB_OPEN_ALWAYS 0x00001000
  240. //
  241. //May be specified with one of the above flags when calling OpenPropertyStore
  242. #define AB_OPEN_READ_ONLY 0x00010000
  243. //
  244. //For times when we want to open a file but dont want to restore it from a backup
  245. //if it has problems.
  246. #define AB_DONT_RESTORE 0x00100000
  247. //For times we dont want to backup on exit
  248. #define AB_DONT_BACKUP 0x01000000
  249. /***************************************************************************/
  250. //Flags used in property-type record searching (independent of property data)
  251. #define AB_MATCH_PROP_ONLY 0x00000001
  252. // Flag used in ReadPropArray (non-Outlook version) to return Unicode data
  253. #define AB_UNICODE 0x80000000
  254. /**Flags used for calling find HrFindFuzzyRecordMatches**/
  255. #define AB_FUZZY_FAIL_AMBIGUOUS 0x0000001
  256. #define AB_FUZZY_FIND_NAME 0x0000010
  257. #define AB_FUZZY_FIND_EMAIL 0x0000100
  258. #define AB_FUZZY_FIND_ALIAS 0x0001000
  259. #define AB_FUZZY_FIND_ALL AB_FUZZY_FIND_NAME | AB_FUZZY_FIND_EMAIL | AB_FUZZY_FIND_ALIAS
  260. /**Flag used for indicating that Profiles are enabled and the search should be
  261. restricted to the specified Folder/Container **/
  262. #define AB_FUZZY_FIND_PROFILEFOLDERONLY 0x10000000
  263. // Flags for growing the property store file
  264. #define AB_GROW_INDEX 0x00000001
  265. #define AB_GROW_NAMEDPROP 0x00000010
  266. // To force a call to a WAB propstore function even when running under Outlook
  267. #define AB_IGNORE_OUTLOOK 0x04000000
  268. // WAB object types
  269. #define RECORD_CONTACT 0x00000001
  270. #define RECORD_DISTLIST 0x00000002
  271. #define RECORD_CONTAINER 0x00000003
  272. //Function prototypes
  273. HRESULT OpenPropertyStore( IN LPTSTR lpszMPSWabFileName,
  274. IN ULONG ulFlags,
  275. IN HWND hWnd,
  276. OUT LPHANDLE lphPropertyStore);
  277. HRESULT ReadRecord( IN HANDLE hPropertyStore,
  278. IN LPSBinary lpsbEntryID,
  279. IN ULONG ulFlags,
  280. OUT LPULONG lpulcPropCount,
  281. OUT LPPROPERTY_ARRAY * lppPropArray);
  282. void ReadRecordFreePropArray(HANDLE hPropertyStore, ULONG ulcPropCount, LPSPropValue * lppPropArray);
  283. HRESULT HrDupeOlkPropsAtoWC(ULONG ulcCount, LPSPropValue lpPropArray, LPSPropValue * lppSPVNew);
  284. HRESULT WriteRecord(IN HANDLE hPropertyStore,
  285. IN LPSBinary pmbinFold,
  286. IN LPSBinary * lppsbEID,
  287. IN ULONG ulFlags,
  288. IN ULONG ulRecordType,
  289. IN ULONG ulcPropCount,
  290. IN LPPROPERTY_ARRAY lpPropArray);
  291. HRESULT FindRecords(IN HANDLE hPropertyStore,
  292. IN LPSBinary pmbinFold,
  293. IN ULONG ulFlags,
  294. IN BOOL bLockFile,
  295. IN LPSPropertyRestriction lpPropRes,
  296. IN OUT LPULONG lpulcEIDCount,
  297. OUT LPSBinary * rgsbEntryIDs);
  298. HRESULT DeleteRecord( IN HANDLE hPropertyStore,
  299. IN LPSBinary lpsbEID);
  300. HRESULT ReadIndex( IN HANDLE hPropertyStore,
  301. IN PROPERTY_TAG ulPropTag,
  302. OUT LPULONG lpulEIDCount,
  303. OUT LPPROPERTY_ARRAY * lppdwIndex);
  304. HRESULT ClosePropertyStore( IN HANDLE hPropertyStore, IN ULONG ulFlags);
  305. HRESULT LockPropertyStore( IN HANDLE hPropertyStore);
  306. HRESULT UnlockPropertyStore( IN HANDLE hPropertyStore);
  307. HRESULT BackupPropertyStore( IN HANDLE hPropertyStore,
  308. IN LPTSTR lpszBackupFileName);
  309. HRESULT GetNamedPropsFromPropStore( IN HANDLE hPropertyStore,
  310. OUT LPULONG lpulcGUIDCount,
  311. OUT LPGUID_NAMED_PROPS * lppgnp);
  312. HRESULT SetNamedPropsToPropStore( IN HANDLE hPropertyStore,
  313. IN ULONG ulcGUIDCount,
  314. OUT LPGUID_NAMED_PROPS lpgnp);
  315. HRESULT ReadPropArray( IN HANDLE hPropertyStore,
  316. IN LPSBinary pmbinFold,
  317. IN SPropertyRestriction * lpPropRes,
  318. IN ULONG ulSearchFlags,
  319. IN ULONG ulcPropTagCount,
  320. IN LPULONG lpPropTagArray,
  321. OUT LPCONTENTLIST * lppContentList);
  322. HRESULT FreeEntryIDs(IN HANDLE hPropertyStore,
  323. IN ULONG ulCount,
  324. IN LPSBinary rgsbEntryIDs);
  325. HRESULT HrFindFuzzyRecordMatches( HANDLE hPropertyStore,
  326. LPSBinary pmbinFold,
  327. LPTSTR lpszSearchStr,
  328. ULONG ulFlags,
  329. ULONG * lpcValues,
  330. LPSBinary * lprgsbEntryIDs);
  331. //Internal function prototypes
  332. BOOL BinSearchStr( IN struct _tagMPSWabIndexEntryDataString * lpIndexStr,
  333. IN LPTSTR lpszValue, //used for searching strings
  334. IN ULONG nArraySize,
  335. OUT ULONG * lpulMatchIndex);
  336. BOOL BinSearchEID( IN struct _tagMPSWabIndexEntryDataEntryID * lpIndexEID,
  337. IN DWORD dwValue, //used for comparing DWORDs
  338. IN ULONG nArraySize,
  339. OUT ULONG * lpulMatchIndex);
  340. BOOL CreateMPSWabFile(IN struct _tagMPSWabFileHeader * lpMPSWabFileHeader,
  341. IN LPTSTR lpszMPSWabFileName,
  342. IN ULONG ulcMaxEntries,
  343. IN ULONG ulNamedPropSize);
  344. BOOL LoadIndex( IN struct _tagMPSWabFileInfo * lpMPSWabFileInfo,
  345. IN ULONG nIndexType,
  346. IN HANDLE hMPSWabFile);
  347. BOOL ReloadMPSWabFileInfo( IN struct _tagMPSWabFileInfo * lpMPSWabFileInfo,
  348. IN HANDLE hMPSWabFile);
  349. ULONG SizeOfMultiPropData(IN SPropValue Prop);
  350. ULONG SizeOfSinglePropData(IN SPropValue Prop);
  351. BOOL LockFileAccess(LPMPSWab_FILE_INFO lpMPSWabFileInfo);
  352. BOOL UnLockFileAccess(LPMPSWab_FILE_INFO lpMPSWabFileInfo);
  353. BOOL CompressFile( IN struct _tagMPSWabFileInfo * lpMPSWabFileInfo,
  354. IN HANDLE hMPSWabFile,
  355. IN LPTSTR lpszBackupFileName,
  356. IN BOOL bGrowFile,
  357. IN ULONG ulFlags);
  358. void LocalFreePropArray(IN HANDLE hPropertyStore,
  359. IN ULONG ulcPropCount,
  360. IN OUT LPPROPERTY_ARRAY * lpPropArray);
  361. // Used for freeing up LPCONTENTLIST structures
  362. void FreePcontentlist(IN HANDLE hPropertyStore,
  363. IN LPCONTENTLIST lpContentList);
  364. //Private read record function
  365. HRESULT ReadRecordWithoutLocking(
  366. IN HANDLE hMPSWabFile,
  367. IN struct _tagMPSWabFileInfo * lpMPSWabFileInfo,
  368. IN DWORD dwEntryID,
  369. OUT LPULONG lpulcPropCount,
  370. OUT LPPROPERTY_ARRAY * lppPropArray);
  371. //Gets a backup file name from the WAB file name
  372. void GetWABBackupFileName(LPTSTR lpszWab, LPTSTR lpszBackup, ULONG cchBackup);
  373. //Does a quick check of the WAB indexes ...
  374. HRESULT HrDoQuickWABIntegrityCheck(LPMPSWab_FILE_INFO lpMPSWabFileInfo, HANDLE hMPSWabFile);
  375. //Does a detailed check of the WAB and rebuilds the indexes
  376. HRESULT HrDoDetailedWABIntegrityCheck(LPMPSWab_FILE_INFO lpMPSWabFileInfo, HANDLE hMPSWabFile);
  377. //Attempts to restore a WAB file from the Backup file. Called in case of critical errors
  378. HRESULT HrRestoreFromBackup(LPMPSWab_FILE_INFO lpMPSWabFileInfo, HANDLE hMPSWabFile);
  379. //Resets the contents of the WAB File to a fresh file
  380. HRESULT HrResetWABFileContents(LPMPSWab_FILE_INFO lpMPSWabFileInfo, HANDLE hMPSWabFile);
  381. // Does a quick check on the record header ...
  382. BOOL bIsValidRecord(MPSWab_RECORD_HEADER rh,
  383. DWORD dwNextEntryID,
  384. ULONG ulRecordOffset,
  385. ULONG ulFileSize);
  386. BOOL TagWABFileError( LPMPSWab_FILE_HEADER lpMPSWabFileHeader,
  387. HANDLE hMPSWabFile);
  388. // Reads a record from a file and returns a PropArray
  389. HRESULT HrGetPropArrayFromFileRecord(HANDLE hMPSWabFile,
  390. ULONG ulRecordOffset,
  391. BOOL * lpbErrorDetected,
  392. ULONG * lpulObjType,
  393. ULONG * lpulRecordSize,
  394. ULONG * lpulcValues,
  395. LPSPropValue * lppPropArray);
  396. // Verifies the WAB is the current version and upgrades it if
  397. // it is an older version
  398. HRESULT HrVerifyWABVersionAndUpdate(HWND hWnd, HANDLE hMPSWabFile,
  399. LPMPSWab_FILE_INFO lpMPSWabFileInfo);
  400. BOOL WriteDataToWABFile(HANDLE hMPSWabFile,
  401. ULONG ulOffset,
  402. LPVOID lpData,
  403. ULONG ulDataSize);
  404. BOOL ReadDataFromWABFile(HANDLE hMPSWabFile,
  405. ULONG ulOffset,
  406. LPVOID lpData,
  407. ULONG ulDataSize);
  408. void FreeGuidnamedprops(ULONG ulcGUIDCount,
  409. LPGUID_NAMED_PROPS lpgnp);
  410. HRESULT HrMigrateFromOldWABtoNew(HWND hWnd, HANDLE hMPSWabFile,
  411. LPMPSWab_FILE_INFO lpMPSWabFileInfo,
  412. GUID WabGUID);
  413. HRESULT OpenWABFile(LPTSTR lpszFileName, HWND hWndParent, HANDLE * lphMPSWabFile);
  414. BOOL CheckChangedWAB(LPPROPERTY_STORE lpPropertyStore, HANDLE hMutex, LPDWORD lpdwContact, LPDWORD lpdwFolder, LPFILETIME lpftLast);
  415. BOOL WABHasFreeDiskSpace(LPTSTR lpszName, HANDLE hFile);
  416. HRESULT HrGetBufferFromPropArray( ULONG ulcPropCount,
  417. LPSPropValue lpPropArray,
  418. ULONG * lpcbBuf,
  419. LPBYTE * lppBuf);
  420. HRESULT HrGetPropArrayFromBuffer( LPBYTE lpBuf,
  421. ULONG cbBuf,
  422. ULONG ulcPropCount,
  423. ULONG ulcNumExtraProps,
  424. LPSPropValue * lppPropArray);
  425. BOOL GetNamedPropsFromBuffer(LPBYTE szBuf,
  426. ULONG ulcGUIDCount,
  427. BOOL bDoAtoWConversion,
  428. OUT LPGUID_NAMED_PROPS * lppgnp);
  429. BOOL SetNamedPropsToBuffer( ULONG ulcGUIDCount,
  430. LPGUID_NAMED_PROPS lpgnp,
  431. ULONG * lpulSize,
  432. LPBYTE * lpp);
  433. LPTSTR GetWABFileName(IN HANDLE hPropertyStore, BOOL bRetOutlookStr);
  434. DWORD GetWABFileEntryCount(IN HANDLE hPropertyStore);
  435. void SetContainerObjectType(IN ULONG ulcPropCount,
  436. IN LPSPropValue lpPropArray,
  437. IN BOOL bSetToMailUser);
  438. void ConvertWCPropsToALocalAlloc(LPSPropValue lpProps, ULONG ulcValues);
  439. void ConvertAPropsToWCLocalAlloc(LPSPropValue lpProps, ULONG ulcValues);
  440. #endif