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.

147 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000
  6. //
  7. // File: wbemmisc.cpp
  8. //
  9. // Abstract: Misc routines useful for interfacing with WBEM
  10. //
  11. //--------------------------------------------------------------------------
  12. extern HANDLE CdmMutex;
  13. #define EnterCdmCritSection() WaitForSingleObject(CdmMutex, INFINITE)
  14. #define LeaveCdmCritSection() ReleaseMutex(CdmMutex);
  15. HRESULT WmiGetQualifier(
  16. IN IWbemQualifierSet *pIWbemQualifierSet,
  17. IN PWCHAR QualifierName,
  18. IN VARTYPE Type,
  19. OUT VARIANT *Value
  20. );
  21. HRESULT WmiGetProperty(
  22. IN IWbemClassObject *pIWbemClassObject,
  23. IN PWCHAR PropertyName,
  24. IN CIMTYPE ExpectedCimType,
  25. OUT VARIANT *Value
  26. );
  27. HRESULT WmiSetProperty(
  28. IN IWbemClassObject *pIWbemClassObject,
  29. IN PWCHAR PropertyName,
  30. IN VARIANT *Value
  31. );
  32. PVOID WmipAlloc(
  33. ULONG Size
  34. );
  35. void WmipFree(
  36. PVOID Ptr
  37. );
  38. PWCHAR AddSlashesToStringW(
  39. PWCHAR SlashedNamespace,
  40. PWCHAR Namespace
  41. );
  42. HRESULT WmiConnectToWbem(
  43. PWCHAR Namespace,
  44. IWbemServices **ppIWbemServices
  45. );
  46. typedef struct
  47. {
  48. PWCHAR Name;
  49. VARTYPE VarType;
  50. VARIANT Value;
  51. } QUALIFIER_VALUE, *PQUALIFIER_VALUE;
  52. HRESULT GetClassQualifierList(
  53. IWbemServices *pServices,
  54. PWCHAR ClassName,
  55. ULONG QualifierValuesCount,
  56. PQUALIFIER_VALUE QualifierValues
  57. );
  58. HRESULT WmiSetPropertyList(
  59. IN IWbemClassObject *pIWbemClassObject,
  60. IN ULONG PropertyCount,
  61. IN PWCHAR *PropertyNames,
  62. IN VARIANT *Values
  63. );
  64. HRESULT WmiGetPropertyByName(
  65. IN IWbemServices *pServices,
  66. IN PWCHAR ClassName,
  67. IN PWCHAR PropertyName,
  68. IN CIMTYPE ExpectedCimType,
  69. OUT VARIANT *Value
  70. );
  71. HRESULT CreateInst(
  72. IWbemServices * pNamespace,
  73. IWbemClassObject ** pNewInst,
  74. WCHAR * pwcClassName,
  75. IWbemContext *pCtx
  76. );
  77. BSTR GetCurrentDateTime(
  78. void
  79. );
  80. HRESULT WmiDumpClassObject(
  81. IWbemClassObject *pClass,
  82. PWCHAR ClassName
  83. );
  84. HRESULT WmiGetQualifierListByName(
  85. IN IWbemServices *pServices,
  86. IN PWCHAR ClassName,
  87. PWCHAR PropertyName,
  88. IN ULONG QualifierCount,
  89. IN PWCHAR *QualifierNames,
  90. IN VARTYPE *Types,
  91. OUT VARIANT *Values
  92. );
  93. PWCHAR AddSlashesToStringExW(
  94. PWCHAR SlashedNamespace,
  95. PWCHAR Namespace
  96. );
  97. HRESULT WmiGetArraySize(
  98. IN SAFEARRAY *Array,
  99. OUT LONG *LBound,
  100. OUT LONG *UBound,
  101. OUT LONG *NumberElements
  102. );
  103. HRESULT LookupValueMap(
  104. IWbemServices *pServices,
  105. PWCHAR ClassName,
  106. PWCHAR PropertyName,
  107. ULONG Value,
  108. BSTR *MappedValue
  109. );
  110. void FreeTheBSTRArray(
  111. BSTR *Array,
  112. ULONG Size
  113. );
  114. HRESULT GetMethodInParamInstance(
  115. IN IWbemServices *pServices,
  116. IN PWCHAR ClassName,
  117. IN BSTR MethodName,
  118. OUT IWbemClassObject **ppInParamInstance
  119. );