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.

80 lines
2.0 KiB

  1. /********************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. pchealth.H
  5. Abstract:
  6. Main header file for all PCHealth WMI providers
  7. Contains all defines and includes used elsewhere
  8. Revision History:
  9. Ghim-Sim Chua (gschua) 04/27/99
  10. - Created
  11. Ghim-Sim Chua (gschua) 05/02/99
  12. - Added GetWbemServices & CopyProperty
  13. Kalyani Narlanka (kalyanin) 05/10/99
  14. - Added #define INCL_WINSOCK_API_TYPEDEFS
  15. - Included <winsock2.>
  16. ********************************************************************/
  17. #define INCL_WINSOCK_API_TYPEDEFS 1
  18. #include <winsock2.h>
  19. #include <sys/stat.h>
  20. #ifndef _pchdef_h_
  21. #define _pchdef_h_
  22. #ifdef _WIN32_WINNT
  23. #undef _WIN32_WINNT
  24. #endif
  25. #include <fwcommon.h> // This must be the first include.
  26. #include <provider.h>
  27. #include <atlbase.h>
  28. #include "dbgtrace.h"
  29. #include "traceids.h"
  30. #include "smartptr.h"
  31. // Namespaces that we'll be working with
  32. #define PCH_NAMESPACE L"root\\pchealth"
  33. #define CIM_NAMESPACE L"root\\cimv2"
  34. // #include <winsock2.h>
  35. // Global Variables
  36. extern CComPtr<IWbemServices> g_pWbemServices;
  37. // Utility functions
  38. HRESULT ExecWQLQuery(IEnumWbemClassObject **ppEnumInst, BSTR bstrQuery);
  39. HRESULT GetWbemServices(IWbemServices **ppServices);
  40. HRESULT CopyProperty(IWbemClassObject * pFrom, LPCWSTR szFrom, CInstance * pTo, LPCWSTR szTo);
  41. HRESULT GetCIMDataFile(BSTR bstrFile, IWbemClassObject ** ppFileObject, BOOL fHasDoubleSlashes = FALSE);
  42. HRESULT GetCIMObj(BSTR bstrPath, IWbemClassObject **ppObj, long lFlags);
  43. BOOL getCompletePath(CComBSTR bstrFileName, CComBSTR &bstrFileWithPathName);
  44. // memory alloc inlines
  45. inline LPVOID MyAlloc(DWORD cb)
  46. {
  47. return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
  48. }
  49. inline LPVOID MyReAlloc(LPVOID pv, DWORD cb)
  50. {
  51. return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pv, cb);
  52. }
  53. inline BOOL MyFree(LPVOID pv)
  54. {
  55. return HeapFree(GetProcessHeap(), 0, pv);
  56. }
  57. #endif // _pchdef_h_