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.

100 lines
2.5 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright � Microsoft Corporation. All rights reserved.
  4. //
  5. // FWcommon.h
  6. //
  7. // Purpose: Definition of EventProvider class
  8. //
  9. //***************************************************************************
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #define FRAMEWORK_ALLOW_DEPRECATED 0
  14. // ALWAYS INCLUDE THIS FILE FIRST!
  15. #ifndef _FW_COMMON_H_
  16. #define _FW_COMMON_H_
  17. // move warnings to level four
  18. #pragma warning(4 : 4275 4800 4786 4251)
  19. // C4275: non DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
  20. // C4800: forcing bool variable to one or zero, possible performance loss
  21. // C4786: 'identifier' : identifier was truncated to 'number' characters in the debug information
  22. // C4251: 'identifier' : class 'type' needs to have dll-interface to export class 'type2'
  23. #include "windows.h"
  24. // This function gets macro'ed to GetObjectW and GetObjectA based on the
  25. // contents of UNICODE. However, we USE a function called GetObject. For
  26. // single binary support, we can't have this being macro'ed. If the actual
  27. // win32 api GetObject is needed, call the GetObjectW or GetObjectA directly.
  28. #undef GetObject
  29. #include <wbemidl.h>
  30. #include <wmiutils.h>
  31. // If USE_POLARITY not defined, some Framedyn.dll symbols may not resolve correctly
  32. // It's a declspec(dllimport/dllexport) issue.
  33. #ifndef USE_POLARITY
  34. // For most users, this is the correct setting for POLARITY.
  35. #define USE_POLARITY
  36. #endif
  37. // Required since TCHAR.H defines _ttoi64 -> atoi64, which requires oldnames.lib, which
  38. // we don't use.
  39. #define atoi64 _atoi64
  40. #include <Polarity.h>
  41. #ifndef EXPORT_LOCKIT
  42. #undef _CRTIMP
  43. #define _CRTIMP
  44. #include <yvals.h>
  45. #undef _CRTIMP
  46. #else
  47. #undef _CRTIMP
  48. #define _CRTIMP POLARITY
  49. #include <yvals.h>
  50. #undef _CRTIMP
  51. #endif
  52. #include <stllock.h>
  53. extern POLARITY CCritSec g_cs;
  54. #include "utillib.h"
  55. #include "ThrdBase.h"
  56. #include "RefPtrCo.h"
  57. #include "MethodCo.h"
  58. #include "FRQuery.h"
  59. #include "wbemglue.h"
  60. #include "instance.h"
  61. class CFramework_Exception
  62. {
  63. private:
  64. CHString m_sErrorText;
  65. HRESULT m_hr;
  66. public:
  67. CFramework_Exception ( LPCWSTR lpwszErrorText, HRESULT hr) : m_hr ( hr ) , m_sErrorText ( lpwszErrorText) {}
  68. CFramework_Exception ( LPCWSTR lpwszErrorText) : m_hr ( WBEM_S_NO_ERROR ) , m_sErrorText ( lpwszErrorText) {}
  69. ~CFramework_Exception () {}
  70. HRESULT GetHRESULT() { return m_hr ; }
  71. CHString &GetErrorText() { return m_sErrorText; }
  72. } ;
  73. #endif