1
0

setupLog.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPLOG_HEADER
  2. #define NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPLOG_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include <map>
  8. class ifc_omservice;
  9. class SetupLog
  10. {
  11. public:
  12. typedef enum
  13. {
  14. opUnknown = 0,
  15. opServiceAdded = 1,
  16. opServiceRemoved = 2,
  17. };
  18. protected:
  19. SetupLog();
  20. ~SetupLog();
  21. public:
  22. static SetupLog *Open();
  23. static HRESULT Erase();
  24. public:
  25. ULONG AddRef();
  26. ULONG Release();
  27. HRESULT LogServiceById(UINT serviceUid, UINT operation);
  28. HRESULT LogService(ifc_omservice *service, UINT operation);
  29. HRESULT Save();
  30. HRESULT Send(HANDLE completeEvent);
  31. BOOL IsOperationSupported(UINT operation);
  32. protected:
  33. typedef std::map<UINT, UINT> ServiceMap;
  34. friend static size_t SetupLog_GetMaxServiceIdCount(SetupLog::ServiceMap *serviceMap);
  35. friend static HRESULT SetupLog_FormatServiceId(SetupLog::ServiceMap *serviceMap, INT operation, LPSTR pszBuffer, size_t cchBufferMax);
  36. protected:
  37. ULONG ref;
  38. ServiceMap serviceMap;
  39. };
  40. #endif //NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPLOG_HEADER