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.

72 lines
1.4 KiB

  1. /*++
  2. Copyright (C) 1999- Microsoft Corporation
  3. Module Name:
  4. ptputil.h
  5. Abstract:
  6. This module declares PTP data manipulating utility functions
  7. Author:
  8. William Hsieh (williamh) created
  9. Revision History:
  10. --*/
  11. #ifndef PTPUTIL__H_
  12. #define PTPUTIL__H_
  13. //
  14. // Time conversion functions
  15. //
  16. HRESULT PtpTime2SystemTime(CBstr *pptpTime, SYSTEMTIME *pSystemTime);
  17. HRESULT SystemTime2PtpTime(SYSTEMTIME *pSystemTime, CBstr *pptpTime, BOOL bTwoDigitsForMilliseconds);
  18. //
  19. // Functions that dump a PTP structure to the log file
  20. //
  21. VOID DumpCommand(PTP_COMMAND *pCommand, DWORD NumParams);
  22. VOID DumpResponse(PTP_RESPONSE *pResponse);
  23. VOID DumpEvent(PTP_EVENT *pEvent);
  24. VOID DumpGuid(GUID *pGuid);
  25. //
  26. // Macro for getting size of array
  27. //
  28. #ifndef ARRAYSIZE
  29. #define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
  30. #endif
  31. //
  32. // Class for reading registry entries
  33. //
  34. class CPTPRegistry
  35. {
  36. public:
  37. CPTPRegistry() :
  38. m_hKey(NULL)
  39. {
  40. }
  41. ~CPTPRegistry()
  42. {
  43. if (m_hKey)
  44. RegCloseKey(m_hKey);
  45. }
  46. HRESULT Open(HKEY hkAncestor, LPCTSTR KeyName, REGSAM Access = KEY_READ);
  47. HRESULT GetValueStr(LPCTSTR ValueName, TCHAR *string, DWORD *pcbStringBytes);
  48. HRESULT GetValueDword(LPCTSTR ValueName, DWORD *pValue);
  49. HRESULT GetValueCodes(LPCTSTR ValueName, CArray16 *pCodeArray);
  50. private:
  51. HKEY m_hKey;
  52. };
  53. #endif // PTPUTIL__H_