Source code of Windows XP (NT5)
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.

253 lines
6.0 KiB

  1. //+============================================================================
  2. //
  3. // File: pch.cxx
  4. //
  5. // Purpose: This file composes the pre-compiled header for the
  6. // PropTest DRT.
  7. //
  8. //+============================================================================
  9. #pragma warning( disable : 4291 )
  10. #ifdef _MAC_NODOC
  11. // ================
  12. // Mac NODOC Format
  13. // ================
  14. // The following set of pre-compiler directives is used in the
  15. // Mac "NODOC" build environment.
  16. // ----------------------------------------
  17. // Build Environment Configuration Settings
  18. // ----------------------------------------
  19. #define _PPCMAC // Macintosh PPC build
  20. #define OLE2ANSI // Ansi OLE (OLECHAR == char)
  21. #undef WIN32 // Do not include Win32 information
  22. #define IPROPERTY_DLL // Use code for IProp.DLL
  23. #define BIGENDIAN 1 // Enable byte-swapping.
  24. #define IPROP_NO_OLEAUTO_H 1 // Don't try to include "oleauto.h"
  25. // If the NODOC environment's "debug" flag is set, then set the
  26. // NT environment's corresponding flag.
  27. #ifdef _DEBUG
  28. #define DBG 1
  29. #endif
  30. // ------
  31. // Macros
  32. // ------
  33. // The default Ansi CodePage
  34. #define CP_ACP 0
  35. // unsigned-long to Ansi
  36. #define ULTOA(ul, ch, i) _ultoa( ul, ch, i )
  37. // NTSTATUS and HRESULT information not available in the NODOC build.
  38. #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
  39. #define FACILITY_WIN32 7
  40. #define FACILITY_NT_BIT 0x10000000
  41. #define HRESULT_FROM_WIN32(x) (x ? ((HRESULT) (((x) &0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)) : 0 )
  42. #define ERROR_NO_UNICODE_TRANSLATION 1113L
  43. #define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
  44. #define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL)
  45. // --------------
  46. // Basic Includes
  47. // --------------
  48. // NOOP two #defines that are unnecessary in the NODOC environment.
  49. #define __RPC_FAR
  50. #define __RPC_STUB
  51. // Include the property set information (this same file is included
  52. // in the shipping package for use by ISVs.
  53. #include "iprop.h"
  54. // Include macros for dealing with OLECHARs
  55. #include <olechar.h>
  56. // --------
  57. // TypeDefs
  58. // --------
  59. typedef LONG NTSTATUS;
  60. typedef ULONG PROPID;
  61. // ----------
  62. // Prototypes
  63. // ----------
  64. // IMalloc wrappers
  65. LPVOID __cdecl CoTaskMemAlloc( ULONG cb );
  66. LPVOID __cdecl CoTaskMemRealloc( LPVOID pvInput, ULONG cb );
  67. VOID __cdecl CoTaskMemFree( LPVOID pv );
  68. // wide-character routines.
  69. int wcscmp( const WCHAR*, const WCHAR* );
  70. UINT __cdecl wcslen( const WCHAR* ); // MACBUG: size_t?
  71. int wcsnicmp( const WCHAR*, const WCHAR*, UINT );
  72. WCHAR *wcscpy( WCHAR* wszDest, const WCHAR* wszSource );
  73. // Ansi/Unicode routines
  74. UINT __cdecl GetACP();
  75. // BSTR routines
  76. BSTR SysAllocString(BSTR);
  77. VOID SysFreeString(BSTR);
  78. // -------
  79. // Externs
  80. // -------
  81. // An array used by UuidCreate()
  82. extern GUID g_curUuid;
  83. // -------
  84. // Inlines
  85. // -------
  86. // Compare two FMTIDs
  87. inline BOOL operator == (const FMTID &fmtid1, const FMTID &fmtid2)
  88. {
  89. return IsEqualGUID( fmtid1, fmtid2 );
  90. }
  91. // Stub out the Win32 GetLastError() API.
  92. inline DWORD GetLastError(){ return 0; }
  93. // Stub out UuidCreate() by using a global list of
  94. // GUIDs
  95. inline void UuidCreate ( OUT GUID * pUuid )
  96. {
  97. g_curUuid.Data1++;
  98. *pUuid = g_curUuid; // member to member copy
  99. }
  100. // -----------------
  101. // Extended Includes
  102. // -----------------
  103. #include <propmac.hxx> // Property macros
  104. #include "cpropvar.hxx" // CPropVariant class
  105. #include "CDisplay.hxx" // CDisplay class (used by PRINTF macros)
  106. #include "PropTest.hxx" // General information
  107. #else // #ifdef _MAC_NODOC
  108. // =========
  109. // NT Format
  110. // =========
  111. #include <new.h>
  112. // We'll take all the same abstractions that IProp.dll uses
  113. #define IPROPERTY_DLL
  114. #define DfpAssert Win4Assert
  115. #define _OLE32_ 1
  116. extern "C"
  117. {
  118. #include <nt.h>
  119. #include <ntrtl.h>
  120. #include <nturtl.h>
  121. #include <windows.h>
  122. }
  123. #define _CAIROSTG_
  124. #include <stdio.h>
  125. #include <time.h>
  126. #define INITGUID
  127. #include "initguid.h"
  128. // Don't use the Win32 Unicode wcs routines, since they're
  129. // not available on Win95.
  130. #ifndef OLE2ANSI
  131. #undef ocscpy
  132. #undef ocscmp
  133. #undef ocscat
  134. #undef ocschr
  135. #define ocscpy wcscpy
  136. #define ocscmp wcscmp
  137. #define ocscat wcscat
  138. #define ocschr wcschr
  139. #endif
  140. #include <safedecl.hxx>
  141. #include <infs.hxx>
  142. #include <oaidl.h>
  143. #include <propset.h>
  144. #include <expdf.hxx>
  145. #include <propmac.hxx>
  146. #include <olechar.h>
  147. #include <propidl.h>
  148. /*
  149. #define NT5PROPS_CI_APIS
  150. #include "..\\..\\iprop\\nt5props.h" // Map PrivStgEx to StgEx APIs
  151. #define PROPS_DLL "nt5props.dll"
  152. */
  153. #include "global.hxx"
  154. #include "cpropvar.hxx"
  155. #include "PStgServ.h"
  156. #include "PropMshl.hxx"
  157. #include "PropTest.hxx"
  158. #include "cli.hxx"
  159. // We include these here instead of #including stgprops.hxx, because proptest
  160. // is built with DBG turned off so that it can run on Win95, and these declarations
  161. // are DBG only.
  162. EXTERN_C const IID IID_IStorageTest; //40621cf8-a17f-11d1-b28d-00c04fb9386d
  163. interface IStorageTest : public IUnknown
  164. {
  165. public:
  166. STDMETHOD(UseNTFS4Streams)( BOOL fUseNTFS4Streams ) = 0;
  167. STDMETHOD(GetFormatVersion)(WORD *pw) = 0;
  168. STDMETHOD(SimulateLowMemory)( BOOL fSimulate ) = 0;
  169. STDMETHOD(GetLockCount)() = 0;
  170. STDMETHOD(IsDirty)() = 0;
  171. };
  172. #pragma hdrstop
  173. #endif
  174. // ==================
  175. // NT/Mac Information
  176. // ==================
  177. // ------
  178. // Macros
  179. // ------