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.

230 lines
7.4 KiB

  1. /***
  2. *apglobal.h - Header file for the C/C++ version of the apglobal functions
  3. *
  4. * Copyright (C) 1992, Microsoft Corporation. All Rights Reserved.
  5. * Information Contained Herein Is Proprietary and Confidential.
  6. *
  7. *Purpose: Defines the apglobal functions
  8. *
  9. *Revision History:
  10. *
  11. * [00] 25-Nov-92 ChrisKau : created
  12. * [01] 13-Dec-92 Brandonb : changed to DLL, added apLogExtra
  13. * [02] 04-Jan-93 ChrisKau : added apSPrintf
  14. * [03] 19-Jan-94 MesfinK : added WriteDebugStr lWriteAnsi
  15. *
  16. *Implementation Notes:
  17. *
  18. *****************************************************************************/
  19. #define E_TEST_FAILED MAKE_SCODE(SEVERITY_ERROR, FACILITY_DISPATCH, 1024)
  20. #define E_BAD_TEST MAKE_SCODE(SEVERITY_ERROR, FACILITY_DISPATCH, 1025)
  21. #ifdef _MAC
  22. // ************************* MAC MAC MAC **************************
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #define XCHAR char
  27. #define LPXSTR char *
  28. #define XSTR(x) x
  29. #define SYSCHAR char
  30. #define LPSYSSTR char *
  31. #define SYSSTR(x) x
  32. int apLogFailInfo(char FAR *szDescription, char FAR *szExpected, char FAR *szActual, char FAR *szBugNum);
  33. int apInitTest(char FAR *szTestName);
  34. int apInitScenario(char FAR *szScenario);
  35. void apEndTest();
  36. int apWriteDebug(char FAR *szFormat, ...);
  37. #define osStrCpy strcpy
  38. #define osStrCmp strcmp
  39. #define osStrCmpi strcmpi
  40. #define osStrCat strcat
  41. #define osStrLen strlen
  42. #define apSPrintf sprintf
  43. short FSpFileExists(FSSpec *f);
  44. short FSpOpenForAppend(FSSpec *fs);
  45. short FSpOpenForOutput( FSSpec *fs );
  46. OSErr FSpAppend(FSSpec *fileA, FSSpec *fileB);
  47. OSErr WriteLn(short fRefNum, StringPtr s);
  48. void Yield();
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #else // ******************* NOT MAC ******************************
  53. #ifdef OAU
  54. #define XCHAR WCHAR
  55. #define LPXSTR LPWSTR
  56. #define XSTR(x) L##x
  57. #else
  58. #define XCHAR char
  59. #define LPXSTR LPSTR
  60. #define XSTR(x) x
  61. #endif
  62. #ifdef UNICODE
  63. #define SYSCHAR WCHAR
  64. #define LPSYSSTR LPWSTR
  65. #define SYSSTR(x) L##x
  66. #else
  67. #define SYSCHAR char
  68. #define LPSYSSTR LPSTR
  69. #define SYSSTR(x) x
  70. #endif
  71. #if defined(WIN16)
  72. #define lstrcpyA lstrcpy
  73. #define lstrcatA lstrcat
  74. #define FILETHING HFILE
  75. #else
  76. #define FILETHING FILE *
  77. #endif
  78. #ifdef __cplusplus
  79. extern "C" {
  80. #endif
  81. void FAR PASCAL apEndTest ();
  82. int FAR PASCAL apInitTestCore (SYSCHAR FAR * szTestName);
  83. int FAR PASCAL apLogFailInfoCore (LPSYSSTR szDescription, LPSYSSTR szExpected, LPSYSSTR szActual, LPSYSSTR szBugNum);
  84. int FAR PASCAL apInitScenarioCore (SYSCHAR FAR * szScenarioName);
  85. int FAR __cdecl apWriteDebugCore (SYSCHAR FAR *szFormat, ...);
  86. int FAR PASCAL apInitPerfCore (SYSCHAR FAR * szServerType, SYSCHAR FAR * szProcType, int bitness, int server_bitness);
  87. int FAR PASCAL apLogPerfCore (SYSCHAR FAR * szTestType, DWORD microsecs, float std_deviation);
  88. // wrap function with pascal calling convention so you can call from vb3
  89. #if defined(WIN16)
  90. DATE FAR PASCAL apDateFromStr(char FAR *str, LCID lcid);
  91. #endif
  92. #if defined(_NTWIN)
  93. int FAR PASCAL apInitTestA (LPSTR szTestName);
  94. int FAR PASCAL apLogFailInfoA (LPSTR szDescription, LPSTR szExpected, LPSTR szActual, LPSTR szBugNum);
  95. int FAR PASCAL apInitScenarioA (LPSTR szScenarioName);
  96. int FAR __cdecl apWriteDebugA (char FAR *szFormat, ...);
  97. int FAR PASCAL apInitPerfA (char FAR * szServerType, char FAR * szProcType, int bitness, int server_bitness);
  98. int FAR PASCAL apLogPerfA (char FAR * szTestType, DWORD microsecs, float std_deviation);
  99. #else // win16 || chicago || win32s
  100. #if defined(WIN32)
  101. int FAR PASCAL apInitTestW (LPWSTR szTestName);
  102. int FAR PASCAL apLogFailInfoW (LPWSTR szDescription, LPWSTR szExpected, LPWSTR szActual, LPWSTR szBugNum);
  103. int FAR PASCAL apInitScenarioW (LPWSTR szScenarioName);
  104. int FAR __cdecl apWriteDebugW (LPWSTR szFormat, ...);
  105. int FAR PASCAL apInitPerfW (LPWSTR szServerType, LPWSTR szProcType, int bitness, int server_bitness);
  106. int FAR PASCAL apLogPerfW (LPWSTR szTestType, DWORD microsecs, float std_deviation);
  107. LPWSTR FAR PASCAL lstrcatWrap (LPWSTR sz1, LPWSTR sz2);
  108. LPWSTR FAR PASCAL lstrcpyWrap (LPWSTR sz1, LPWSTR sz2);
  109. int FAR PASCAL lstrcmpWrap (LPWSTR sz1, LPWSTR sz2);
  110. int FAR PASCAL lstrcmpiWrap (LPWSTR sz1, LPWSTR sz2);
  111. SIZE_T FAR PASCAL lstrlenWrap (LPWSTR sz1);
  112. int FAR __cdecl wsprintfWrap (LPWSTR szDest, WCHAR FAR *szFormat, ...);
  113. #endif //win32
  114. #endif //_ntwin
  115. #if !defined(_APGLOBAL_)
  116. #if defined(_NTWIN)
  117. #if defined (OAU)
  118. #define apInitTest apInitTestCore
  119. #define apLogFailInfo apLogFailInfoCore
  120. #define apInitScenario apInitScenarioCore
  121. #define apWriteDebug apWriteDebugCore
  122. #define apInitPerf apInitPerfCore
  123. #define apLogPerf apLogPerfCore
  124. #define osStrCmp lstrcmp
  125. #define osStrCmpi lstrcmpi
  126. #define osStrCpy lstrcpy
  127. #define osStrCat lstrcat
  128. #define osStrLen lstrlen
  129. #define apSPrintf wsprintf
  130. #define apSPrintfA wsprintfA
  131. #else
  132. #define osStrCmp lstrcmpA
  133. #define osStrCmpi lstrcmpiA
  134. #define osStrCpy lstrcpyA
  135. #define osStrCat lstrcatA
  136. #define osStrLen lstrlenA
  137. #define apSPrintf wsprintfA
  138. #define apSPrintfW wsprintf
  139. #define apInitTest apInitTestA
  140. #define apLogFailInfo apLogFailInfoA
  141. #define apInitScenario apInitScenarioA
  142. #define apWriteDebug apWriteDebugA
  143. #define apInitPerf apInitPerfA
  144. #define apLogPerf apLogPerfA
  145. #endif // OAU
  146. #else // win16 || chicago || win32s
  147. #if defined (OAU)
  148. #define osStrCmp lstrcmpWrap
  149. #define osStrCmpi lstrcmpiWrap
  150. #define osStrCpy lstrcpyWrap
  151. #define osStrCat lstrcatWrap
  152. #define osStrLen lstrlenWrap
  153. #define apInitTestA apInitTestCore
  154. #define apLogFailInfoA apLogFailInfoCore
  155. #define apInitScenarioA apInitScenarioCore
  156. #define apWriteDebugA apWriteDebugCore
  157. #define apInitTest apInitTestW
  158. #define apLogFailInfo apLogFailInfoW
  159. #define apInitScenario apInitScenarioW
  160. #define apWriteDebug apWriteDebugW
  161. #define apInitPerf apInitPerfW
  162. #define apLogPerf apLogPerfW
  163. #define apSPrintf wsprintfWrap
  164. #define apSPrintfA wsprintf
  165. #else
  166. #define apInitTest apInitTestCore
  167. #define apLogFailInfo apLogFailInfoCore
  168. #define apInitScenario apInitScenarioCore
  169. #define apWriteDebug apWriteDebugCore
  170. #define apInitPerf apInitPerfCore
  171. #define apLogPerf apLogPerfCore
  172. #define osStrCmp lstrcmp
  173. #define osStrCmpi lstrcmpi
  174. #define osStrCpy lstrcpy
  175. #define osStrCat lstrcat
  176. #define osStrLen lstrlen
  177. #define apSPrintf wsprintf
  178. #define apSPrintfW wsprintfWrap
  179. #endif // OAU
  180. #endif
  181. #endif // !_APGLOBAL_
  182. // functions internal to apglobal
  183. #if defined(_APGLOBAL_)
  184. #if defined(WIN32)
  185. extern "C"
  186. BOOL WINAPI _CRT_INIT(HINSTANCE, DWORD, LPVOID);
  187. #endif
  188. LPSTR Unicode2Ansi (SYSCHAR FAR *);
  189. SIZE_T lWriteAnsi (FILETHING , SYSCHAR FAR *, int);
  190. FILETHING lOpenAnsi (char FAR *);
  191. int _cdecl FilePrintf (FILETHING, SYSCHAR FAR *, ...);
  192. int lCloseAnsi (FILETHING f);
  193. #endif // _APGLOBAL_
  194. #ifdef __cplusplus
  195. }
  196. #endif
  197. #endif // !_MAC