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.

118 lines
2.3 KiB

  1. //+================================================================
  2. //
  3. // File: CTest.hxx
  4. //
  5. // Purpose: Declare the CTest class.
  6. //
  7. // This class is the test engine for the CreateFileMonikerEx
  8. // API (CFMEx) DRTs.
  9. //
  10. //+================================================================
  11. #ifndef _C_TEST_HXX_
  12. #define _C_TEST_HXX_
  13. // --------
  14. // Includes
  15. // --------
  16. #include "CDir.hxx"
  17. // -----
  18. // CTest
  19. // -----
  20. class CTest
  21. {
  22. // (De)Construction
  23. public:
  24. CTest( );
  25. ~CTest();
  26. // Public member routines.
  27. public:
  28. BOOL Initialize( const CDirectory& cDirectoryOriginal,
  29. const CDirectory& cDirectoryFinal );
  30. BOOL CreateFileMonikerEx();
  31. BOOL BindToStorage();
  32. BOOL BindToObject();
  33. BOOL IPersist();
  34. BOOL ComposeWith();
  35. BOOL GetDisplayName();
  36. BOOL GetTimeOfLastChange();
  37. BOOL DeleteLinkSource( DWORD dwDelay = INFINITE );
  38. BOOL GetOversizedBindOpts();
  39. BOOL GetUndersizedBindOpts();
  40. BOOL SetOversizedBindOpts();
  41. BOOL SetUndersizedBindOpts();
  42. // Private member routines.
  43. private:
  44. void DisplayErrors( BOOL bSuccess, WCHAR * wszFunctionName );
  45. // Private member variables.
  46. private:
  47. CMoniker m_cMoniker;
  48. long m_lError;
  49. WCHAR m_wszErrorMessage[ 512 ];
  50. const CDirectory* m_pcDirectoryOriginal;
  51. const CDirectory* m_pcDirectoryFinal;
  52. };
  53. // --------------
  54. // Inline Members
  55. // --------------
  56. #define OUTFILE stdout
  57. inline void CTest::DisplayErrors( BOOL bSuccess, WCHAR * wszFunctionName )
  58. {
  59. if( !bSuccess )
  60. fwprintf( OUTFILE, L"Error in %s (%08x)\n %s \n",
  61. wszFunctionName, m_lError, m_wszErrorMessage );
  62. }
  63. // ------
  64. // Macros
  65. // ------
  66. #undef EXIT
  67. #define EXIT( error ) \
  68. {\
  69. wcscpy( m_wszErrorMessage, ##error );\
  70. goto Exit;\
  71. }
  72. #define ERROR_IN_EXIT( error ) \
  73. {\
  74. wcscpy( m_wszErrorMessage, ##error );\
  75. bSuccess = FALSE; \
  76. }
  77. // -------
  78. // Defines
  79. // -------
  80. #define SIZE_OF_LARGE_BIND_OPTS ( 2 * sizeof( BIND_OPTS2 ))
  81. #define SIZE_OF_SMALL_BIND_OPTS ( 3 * sizeof( DWORD ))
  82. #endif // _C_TEST_HXX_