1
0

ifc_omstoragehelper.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef NULLSOFT_WINAMP_OMSTORAGE_HELPER_INTERFACE_HEADER
  2. #define NULLSOFT_WINAMP_OMSTORAGE_HELPER_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/dispatch.h>
  7. // {47243D54-37F3-4493-8643-BE75205E6CBF}
  8. static const GUID IFC_OmStorageHelper =
  9. { 0x47243d54, 0x37f3, 0x4493, { 0x86, 0x43, 0xbe, 0x75, 0x20, 0x5e, 0x6c, 0xbf } };
  10. class ifc_omservice;
  11. class ifc_omstoragehandler;
  12. class ifc_omstoragehandlerenum;
  13. class __declspec(novtable) ifc_omstoragehelper : public Dispatchable
  14. {
  15. public:
  16. typedef void (CALLBACK *HandlerProc)(ifc_omservice * /*service*/, const wchar_t * /*pszKey*/, const wchar_t * /*pszValue*/);
  17. typedef struct __TemplateRecord
  18. {
  19. LPCWSTR key;
  20. HandlerProc handler;
  21. } TemplateRecord;
  22. protected:
  23. ifc_omstoragehelper() {}
  24. ~ifc_omstoragehelper() {}
  25. public:
  26. HRESULT CreateHandler(const wchar_t *key, HandlerProc proc, ifc_omstoragehandler **handler);
  27. HRESULT CreateEnumerator(const TemplateRecord *recordList, size_t recordCount, ifc_omstoragehandlerenum **enumerator);
  28. public:
  29. DISPATCH_CODES
  30. {
  31. API_CREATEHANDLER = 10,
  32. API_CREATEENUMERATOR = 20,
  33. };
  34. };
  35. inline HRESULT ifc_omstoragehelper::CreateHandler(const wchar_t *key, HandlerProc proc, ifc_omstoragehandler **handler)
  36. {
  37. return _call(API_CREATEHANDLER, (HRESULT)E_NOTIMPL, key, proc, handler);
  38. }
  39. inline HRESULT ifc_omstoragehelper::CreateEnumerator(const TemplateRecord *recordList, size_t recordCount, ifc_omstoragehandlerenum **enumerator)
  40. {
  41. return _call(API_CREATEENUMERATOR, (HRESULT)E_NOTIMPL, recordList, recordCount, enumerator);
  42. }
  43. #endif //NULLSOFT_WINAMP_OMSTORAGE_HELPER_INTERFACE_HEADER