1
0

enumAsync.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef NULLSOFT_WINAMP_OMSTORAGE_ASYNC_ENUMERATOR_WRAPPER_HEADER
  2. #define NULLSOFT_WINAMP_OMSTORAGE_ASYNC_ENUMERATOR_WRAPPER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "./ifc_omstorageasync.h"
  8. class ifc_omservicehost;
  9. class ifc_omserviceenum;
  10. class ifc_omservice;
  11. class OmServiceList;
  12. class EnumAsyncWrapper : public ifc_omstorageasync
  13. {
  14. protected:
  15. EnumAsyncWrapper(ifc_omserviceenum *enumerator);
  16. ~EnumAsyncWrapper();
  17. public:
  18. static HRESULT CreateInstance(ifc_omserviceenum *enumerator, EnumAsyncWrapper **instance);
  19. public:
  20. /* Dispatchable */
  21. size_t AddRef();
  22. size_t Release();
  23. int QueryInterface(GUID interface_guid, void **object);
  24. /* ifc_omstorageasync */
  25. HRESULT GetState(UINT *state);
  26. HRESULT GetWaitHandle(HANDLE *handle);
  27. HRESULT GetData(void **data);
  28. public:
  29. HRESULT SetData(void *data);
  30. HRESULT SetCallback(AsyncCallback callback);
  31. HRESULT GetCallback(AsyncCallback *callback);
  32. HRESULT RequestAbort(BOOL fDrop);
  33. HRESULT BeginEnumerate();
  34. HRESULT Enumerate();
  35. HRESULT GetResultCode();
  36. HRESULT GetServiceList(ifc_omserviceenum **list);
  37. protected:
  38. size_t ref;
  39. ifc_omserviceenum *enumerator;
  40. AsyncCallback userCallback;
  41. void *userData;
  42. HANDLE completed;
  43. UINT state;
  44. HRESULT resultCode;
  45. CRITICAL_SECTION lock;
  46. OmServiceList *serviceList;
  47. protected:
  48. RECVS_DISPATCH;
  49. };
  50. #endif //NULLSOFT_WINAMP_OMSTORAGE_ASYNC_ENUMERATOR_WRAPPER_HEADER