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.

117 lines
3.6 KiB

  1. ////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Microsoft WMI OLE DB Provider
  4. // (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // WMIGLOBAL.H global definations header file
  7. //
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WMIOLEDBGLOBAL_H
  10. #define _WMIOLEDBGLOBAL_H
  11. #define WMIOLEDB_CLASS_PROPERTY 0x200L
  12. #define WMIOLEDB_PROPERTY_QUALIFIER 0x201L
  13. #define WMIOLEDB_CLASS_QUALIFIER 0x202L
  14. #define DBTYPE_WMI_QUALIFIERSET DBTYPE_IUNKNOWN
  15. #ifndef MAX
  16. # define MIN(a,b) ( (a) < (b) ? (a) : (b) )
  17. # define MAX(a,b) ( (a) > (b) ? (a) : (b) )
  18. #endif
  19. #ifndef NUMELEM
  20. # define NUMELEM(x) (sizeof(x)/sizeof(*x))
  21. #endif
  22. #define MAX_HEAP_SIZE 128000
  23. //#define MAX_TOTAL_ROWBUFF_SIZE (10*1024*1024) // Max for all row buffers.
  24. #define MAX_TOTAL_ROWBUFF_SIZE (10*64*1024) // Max for all row buffers.
  25. #define MAX_IBUFFER_SIZE 2000000
  26. #define MAX_BIND_LEN (MAX_IBUFFER_SIZE/10)
  27. #define STAT_ENDOFCURSOR 0x00000100 // for forward-only means fully materialized
  28. #define PROPERTYQUALIFIER 1
  29. #define CLASSQUALIFIER 2
  30. #define INSTANCEQUALIFIER 3
  31. #define COLUMNSROWSET 4
  32. #define SCHEMA_ROWSET 5
  33. #define COMMAND_ROWSET 6
  34. #define METHOD_ROWSET 7
  35. #define NAMESPACE L"NAMESPACE"
  36. #define PROVIDER_TYPES L"PROVIDER_TYPES"
  37. #define CATALOGS L"CATALOGS"
  38. #define COLUMNS L"COLUMNS"
  39. #define FOREIGN_KEYS L"FOREIGN_KEYS"
  40. #define TABLES L"TABLES"
  41. #define PRIMARY_KEYS L"PRIMARY_KEYS"
  42. #define TABLESINFO L"TABLES_INFO"
  43. #define PROCEDURES L"PROCEDURES"
  44. #define PROCEDURE_PARAMETERS L"PROCEDURE_PARAMETERS"
  45. #define OPENCOLLECTION L"*"
  46. #define UMIURLPREFIX L"UMI:"
  47. #define WMIURLPREFIX L"WINMGMTS:"
  48. #define DEFAULTQUERYLANG L"WQL"
  49. //-----------------------------------------------------------------------------
  50. // Memory alignment
  51. //-----------------------------------------------------------------------------
  52. //++
  53. // Useful rounding macros.
  54. // Rounding amount is always a power of two.
  55. //--
  56. #define ROUND_DOWN( Size, Amount ) ((ULONG_PTR)(Size) & ~((Amount) - 1))
  57. #define ROUND_UP( Size, Amount ) (((ULONG_PTR)(Size) + ((Amount) - 1)) & ~((Amount) - 1))
  58. //++
  59. // These macros are for aligment of ColumnData within the internal row buffer.
  60. // COLUMN_ALIGN takes a ptr where you think data ought to go,
  61. // and rounds up to the next appropriate address boundary.
  62. //
  63. // Rule of thumb is "natural" boundary, i.e. 4-byte member should be
  64. // aligned on address that is multiple of 4.
  65. //
  66. // Most everything should be aligned to 32-bit boundary.
  67. // But doubles should be aligned to 64-bit boundary, so let's play it safe.
  68. // Also have __int64.
  69. //--
  70. #if defined(_M_MRX000)
  71. # define COLUMN_ALIGNVAL 8
  72. #elif defined(_M_ALPHA)
  73. # define COLUMN_ALIGNVAL 8
  74. #else
  75. # define COLUMN_ALIGNVAL 8 // venerable 80x86
  76. #endif
  77. #define SEPARATOR L"/"
  78. extern LONG g_cObj; // # of outstanding objects
  79. extern LONG g_cLock; // # of explicit locks set
  80. extern DWORD g_cAttachedProcesses; // # of attached processes
  81. extern DWORD g_dwPageSize; // System page size
  82. extern IMalloc * g_pIMalloc; // OLE2 task memory allocator
  83. extern HINSTANCE g_hInstance; // Instance Handle
  84. extern IDataConvert * g_pIDataConvert; // IDataConvert pointer
  85. // Accessor Structure
  86. typedef struct tagACCESSOR
  87. {
  88. DBACCESSORFLAGS dwAccessorFlags;
  89. LONG cRef;
  90. DBCOUNTITEM cBindings;
  91. DBBINDING rgBindings[1];
  92. } ACCESSOR, *PACCESSOR;
  93. #endif