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.

98 lines
2.8 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. #define NOTRACE
  26. #include <fwcommon.h> // This must be the first include.
  27. #include <provider.h>
  28. #include <atlbase.h>
  29. #include "dbgtrace.h"
  30. #include "traceids.h"
  31. #include "smartptr.h"
  32. //
  33. // Namespaces that we'll be working with
  34. //
  35. #define PCH_NAMESPACE L"root\\pchealth"
  36. #define CIM_NAMESPACE L"root\\cimv2"
  37. // #include <winsock2.h>
  38. //
  39. // Global Variables
  40. //
  41. extern CComPtr<IWbemServices> g_pWbemServices;
  42. //
  43. // Utility functions
  44. //
  45. HRESULT ExecWQLQuery(IEnumWbemClassObject **ppEnumInst, BSTR bstrQuery);
  46. HRESULT GetWbemServices(IWbemServices **ppServices);
  47. HRESULT CopyProperty(IWbemClassObject * pFrom, LPCWSTR szFrom, CInstance * pTo, LPCWSTR szTo);
  48. HRESULT GetCIMDataFile(BSTR bstrFile, IWbemClassObject ** ppFileObject, BOOL fHasDoubleSlashes = FALSE);
  49. BOOL getCompletePath(CComBSTR bstrFileName, CComBSTR &bstrFileWithPathName);
  50. int DelimitedStringToArray(LPWSTR strDelimitedString, LPTSTR strDelimiter, LPTSTR apstrArray[], int iMaxArraySize);
  51. int DelimitedStringToArray(LPTSTR strDelimitedString, LPTSTR strDelimiter, LPTSTR apstrArray[], int iMaxArraySize);
  52. //-----------------------------------------------------------------------------
  53. // This class is useful for retrieving information about a specific file. It
  54. // uses the version resource code from Dr. Watson. To use it, create an
  55. // instance of the class, and use the QueryFile method to query information
  56. // about a specific file. Then use the Get* access functions to get the
  57. // values describing the information.
  58. //-----------------------------------------------------------------------------
  59. struct FILEVERSION;
  60. class CFileVersionInfo
  61. {
  62. public:
  63. CFileVersionInfo();
  64. ~CFileVersionInfo();
  65. HRESULT QueryFile(LPCSTR szFile, BOOL fHasDoubleBackslashes = FALSE);
  66. HRESULT QueryFile(LPCWSTR szFile, BOOL fHasDoubleBackslashes = FALSE);
  67. LPCTSTR GetVersion();
  68. LPCTSTR GetDescription();
  69. LPCTSTR GetCompany();
  70. LPCTSTR GetProduct();
  71. private:
  72. FILEVERSION * m_pfv;
  73. };
  74. #endif // _pchdef_h_