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.

184 lines
4.9 KiB

  1. #ifndef PABTEST_H
  2. #define PABTEST_H
  3. //#define TESTPASS
  4. // Set the provider to either PAB or WAB
  5. //#define PAB
  6. #ifndef PAB
  7. #define WAB
  8. #endif
  9. #include <windows.h>
  10. #include <windowsx.h>
  11. #ifdef WAB
  12. //
  13. // WAB Headers
  14. //
  15. #include <wab.h>
  16. #endif
  17. #ifdef PAB
  18. //
  19. // MAPI headers
  20. //
  21. #include <mapiwin.h>
  22. #include <mapidefs.h>
  23. #include <mapicode.h>
  24. #include <mapitags.h>
  25. //#include <mapispi.h>
  26. #include <mapiutil.h>
  27. #include <mapival.h>
  28. #include <mapix.h>
  29. #include <mapiutil.h>
  30. #endif
  31. //MAPI Headers that are needed for WAB
  32. #include <mapiguid.h>
  33. #include <limits.h>
  34. #include <memory.h>
  35. #include <commdlg.h>
  36. #include <stdio.h>
  37. #include <string.h>
  38. #include <mbstring.h>
  39. #include <time.h>
  40. #include <math.h>
  41. #include <unknwn.h>
  42. LRESULT CALLBACK WndProc (HWND hwnd, UINT message, UINT wParam, LONG lParam);
  43. // Foreign Address Book Provider MAPIUID
  44. //#define MUIDFAB {0x45,0xef,0xe6,0xe0,0xfd,0xd8,0x11,0xce,0xa4,0x88,0x00,0xaa,0x00,0x47,0xfa,0xa4}
  45. // Test for PT_ERROR property tag
  46. #define PROP_ERROR(prop) (prop.ulPropTag == PROP_TAG(PT_ERROR, PROP_ID(prop.ulPropTag)))
  47. // Blank tags
  48. #define IN
  49. #define OUT
  50. #define BIG_BUF 256
  51. #define MAX_BUF 1000
  52. #define SML_BUF 50
  53. #define MAXMENU 20
  54. #define MAXSTRING 64
  55. #define INIFILENAME "c:\\Pabtests.ini"
  56. // Flag used only in sample code shell toswitch between operations
  57. // using and not-using UI
  58. #define SAMPWAB_ADDRESS_UI 0x00000001
  59. #define BUFFERSIZE 1024
  60. #define BUFFERSIZE2 2003
  61. #define BUFFERSIZE3 4096
  62. #define PATTERN 0xA5 // 1 byte test pattern for verifying memory
  63. #define INVALIDPTR 0xfeeefeee
  64. #define AUTONUM_OFF 0xFFFF
  65. HRESULT OpenPABID(
  66. IN LPADRBOOK lpAdrBook,
  67. OUT ULONG *lpcbEidPAB,
  68. OUT LPENTRYID *lppEidPAB,
  69. OUT LPABCONT *lppPABCont,
  70. OUT ULONG *lpulObjType);
  71. #ifdef PAB
  72. BOOL MapiUnInit(IN LPMAPISESSION);
  73. BOOL MapiInitLogon(OUT LPMAPISESSION *);
  74. #endif
  75. BOOL GetPropsFromIniBufEntry(LPSTR,ULONG,char (*)[BIG_BUF]);
  76. HRESULT HrCreateEntryListFromID(LPWABOBJECT,
  77. IN ULONG , // count of bytes in Entry ID
  78. IN LPENTRYID , // pointer to Entry ID
  79. OUT LPENTRYLIST FAR *); // pointer to address variable of Entry
  80. // list
  81. BOOL GetAB(OUT LPADRBOOK*);
  82. BOOL ValidateAdrList(LPADRLIST, ULONG);
  83. BOOL PabCreateEntry();
  84. BOOL PabDeleteEntry();
  85. BOOL PabEnumerateAll();
  86. BOOL ClearPab(int);
  87. BOOL CreateOneOff();
  88. BOOL PABResolveName();
  89. BOOL PABSetProps();
  90. BOOL PABQueryInterface();
  91. BOOL PABPrepareRecips();
  92. BOOL PABCopyEntries();
  93. BOOL PABRunBVT();
  94. BOOL PABAllocateBuffer();
  95. BOOL PABAllocateMore();
  96. BOOL PABFreeBuffer();
  97. BOOL PAB_IABOpenEntry();
  98. BOOL PAB_IABContainerCreateEntry();
  99. BOOL PAB_IMailUserSetGetProps();
  100. BOOL PAB_IMailUserSaveChanges();
  101. BOOL PAB_IABContainerResolveNames();
  102. BOOL PAB_IABContainerOpenEntry();
  103. BOOL PAB_IABAddress();
  104. BOOL PAB_AddMultipleEntries();
  105. BOOL PAB_IABResolveName();
  106. BOOL PAB_IABNewEntry_Details();
  107. BOOL ThreadManager();
  108. BOOL ThreadStress(LPVOID);
  109. BOOL Performance();
  110. BOOL PAB_IDLSuite();
  111. BOOL NamedPropsSuite();
  112. BOOL AllocateAdrList(LPWABOBJECT, int, int, LPADRLIST *);
  113. BOOL FreeAdrList(LPWABOBJECT, LPADRLIST *);
  114. BOOL FreePartAdrList(IN LPADRLIST *);
  115. BOOL GrowAdrList(UINT, UINT, LPADRLIST *);
  116. BOOL ParseIniBuffer(LPSTR, UINT, LPSTR);
  117. BOOL VerifyBuffer(DWORD **, DWORD);
  118. BOOL DisplayAdrList(LPADRLIST, ULONG);
  119. BOOL VerifyResolvedAdrList(LPADRLIST, char*);
  120. BOOL CALLBACK SetIniFile(HWND,UINT, WPARAM, LONG);
  121. BOOL LogIt(HRESULT, int, char *);
  122. BOOL PropError(ULONG, ULONG);
  123. BOOL FindProp(LPADRENTRY, ULONG, unsigned int*);
  124. BOOL FreeEntryList(LPWABOBJECT, IN LPENTRYLIST *);
  125. BOOL FreeRows(LPWABOBJECT, LPSRowSet far*);
  126. BOOL DisplayRows(LPSRowSet lpRows);
  127. BOOL FindPropinRow(LPSRow, ULONG, unsigned int*);
  128. BOOL DeleteWABFile();
  129. BOOL MyRegOpenKeyEx(HKEY, char*, REGSAM, HKEY*);
  130. BOOL CreateMultipleEntries(IN UINT, OUT DWORD*);
  131. HRESULT HrCreateEntryListFromRows(LPWABOBJECT, LPSRowSet far*, LPENTRYLIST FAR *);
  132. void GenerateRandomPhoneNumber(char **lppPhone);
  133. void GenerateRandomText(char **lppPhone, UINT);
  134. void CreateProps(LPTSTR, LPTSTR, SPropValue**, ULONG*, UINT, char**, char**);
  135. BOOL CompareProps(SPropValue*, ULONG, SPropValue*, ULONG);
  136. BOOL DisplayProp(SPropValue *, ULONG, ULONG);
  137. void GenerateRandomBoolean(unsigned short *);
  138. void GenerateRandomLong(long *);
  139. void GenerateRandomBinary(SBinary *, UINT);
  140. struct EntryID {
  141. char* lpDisplayName;
  142. ULONG cb;
  143. LPBYTE lpb;
  144. };
  145. struct PropTableEntry {
  146. ULONG ulPropTag; //MAPI Property ID
  147. char* lpszPropTag; //String version of the prop name for lookup in ini file
  148. // void* lpValue; //ptr to the value if supplied or NULL if don't use or create random
  149. UINT unSize; //size of rand value to create or 0 if don't use or value supplied in lpValue
  150. };
  151. #endif