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.

146 lines
3.5 KiB

  1. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Microsoft WMI OLE DB Provider
  4. //
  5. // (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
  6. //
  7. // A common header file included in all implementation files
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////
  9. #pragma message("Including precompiled header...")
  10. #ifndef _HEADERS_H_
  11. #define _HEADERS_H_
  12. #include <assert.h>
  13. #define DEBUGCODE(p) p
  14. #define ASSERT(x) assert(x);
  15. #define THISPROVIDER LOG_WMIOLEDB
  16. // Don't include everything from windows.h, but always bring in OLE 2 support
  17. #ifndef WIN32_LEAN_AND_MEAN
  18. #define WIN32_LEAN_AND_MEAN
  19. #endif
  20. #define INC_OLE2
  21. // Basic Windows and OLE everything
  22. #include <windows.h>
  23. #include <accctrl.h>
  24. #include <aclapi.h>
  25. #include <limits.h>
  26. #include <stdio.h> // vsnprintf, etc.
  27. #include <stddef.h> // offsetof, etc.
  28. #include <wchar.h> // swprintf
  29. #include <Chstring.h>
  30. #include <ProvExce.h>
  31. #include <wbemcli.h>
  32. #include <wbemutil.h>
  33. #include <wbemtime.h>
  34. #include <wmiutils.h>
  35. #include "umi.h"
  36. #include <flexarry.h>
  37. // OLE DB headers
  38. #include "oledb.h"
  39. #include "oledberr.h"
  40. // Data conversion library header
  41. #include "msdadc.h"
  42. #include "datamap.h"
  43. // MSDASQL Guids (for conversion library guid)
  44. #include "msdaguid.h"
  45. #include "resource.h"
  46. #include "urlparser.h"
  47. #include "util.h"
  48. // General headers
  49. #include "baseobj.h"
  50. #include "wmiglobal.h"
  51. #include "utilprop.h"
  52. //#include "rc.h"
  53. // GUIDs
  54. #include "guids.h"
  55. #include "critsec.h"
  56. #include <autobloc.h>
  57. // CDataSource object and contained interface objects
  58. #include "cwbemwrap.h"
  59. /////////////////////////////////////////////////////////////////////////////////////////////
  60. #include "oahelp.inl"
  61. #include "wmioledbmap.h"
  62. #include "datasrc.h"
  63. #include "dataconvert.h"
  64. #include "tranoptions.h"
  65. // CDBSession object and contained interface objects
  66. #include "dbsess.h"
  67. // CRowset object and contained interface objects
  68. #include "Rowset.h"
  69. #include "row.h"
  70. #include "Binder.h"
  71. #include "autobloc.h"
  72. #include "schema.h"
  73. #include "command.h"
  74. #include "errinf.h"
  75. #define WMIOLEDB L"WMIOLEDB"
  76. class CGlobals
  77. {
  78. static BOOL m_bInitialized;
  79. public:
  80. CGlobals();
  81. ~CGlobals();
  82. HRESULT Init();
  83. };
  84. #ifndef DECLARE_GLOBALS
  85. extern IMalloc * g_pIMalloc; // OLE2 task memory allocator
  86. extern HINSTANCE g_hInstance; // Instance Handle
  87. extern IDataConvert * g_pIDataConvert; // IDataConvert pointer
  88. extern CCriticalSection m_CsGlobalError;
  89. extern CError * g_pCError;
  90. extern IClassFactory* g_pErrClassFact;
  91. extern BOOL g_bIsAnsiOS;
  92. extern IClassFactory * g_pIWbemPathParser;
  93. extern CGlobals g_cgGlobals;
  94. extern IClassFactory* g_pIWbemCtxClassFac;
  95. #else
  96. IMalloc * g_pIMalloc = NULL; // OLE2 task memory allocator
  97. HINSTANCE g_hInstance; // Instance Handle
  98. IDataConvert * g_pIDataConvert = NULL; // IDataConvert pointer
  99. CCriticalSection m_CsGlobalError(FALSE);
  100. CError * g_pCError = NULL;
  101. IClassFactory* g_pErrClassFact = NULL;
  102. BOOL g_bIsAnsiOS = FALSE;
  103. IClassFactory * g_pIWbemPathParser = FALSE; // class factory pointer for Parser object
  104. IClassFactory* g_pIWbemCtxClassFac = NULL;
  105. CGlobals g_cgGlobals;
  106. #endif
  107. #define ROWSET ((CRowset*)(m_pObj))
  108. #define BASEROW ((CBaseRowObj*)(m_pObj))
  109. #define DATASOURCE ((CDataSource*)(m_pObj))
  110. #define BINDER ((CBinder*)(m_pObj))
  111. #define COMMAND ((CCommand*)(m_pObj))
  112. #endif