1
0

ifc_omstorageasync.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef NULLSOFT_WINAMP_OMSTORAGE_ASYNC_INTERFACE_HEADER
  2. #define NULLSOFT_WINAMP_OMSTORAGE_ASYNC_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/dispatch.h>
  7. // {5D6C5C55-E744-4936-A31D-B9D8C0F4EF86}
  8. static const GUID IFC_OmStorageAsync =
  9. { 0x5d6c5c55, 0xe744, 0x4936, { 0xa3, 0x1d, 0xb9, 0xd8, 0xc0, 0xf4, 0xef, 0x86 } };
  10. class __declspec(novtable) ifc_omstorageasync : public Dispatchable
  11. {
  12. public:
  13. typedef void (CALLBACK *AsyncCallback)(ifc_omstorageasync *result);
  14. typedef enum
  15. {
  16. stateReady = 0,
  17. stateInitializing = 1,
  18. stateConnecting = 2,
  19. stateReceiving = 3,
  20. stateCompleted = 4,
  21. stateAborting = 5,
  22. } States;
  23. protected:
  24. ifc_omstorageasync() {}
  25. ~ifc_omstorageasync() {}
  26. public:
  27. HRESULT GetState(unsigned int *state);
  28. HRESULT GetWaitHandle(HANDLE *handle);
  29. HRESULT GetData(void **data);
  30. public:
  31. DISPATCH_CODES
  32. {
  33. API_GETSTATE = 10,
  34. API_GETWAITHANDLE = 20,
  35. API_GETDATA = 30,
  36. };
  37. };
  38. inline HRESULT ifc_omstorageasync::GetWaitHandle(HANDLE *handle)
  39. {
  40. return _call(API_GETWAITHANDLE, (HRESULT)E_NOTIMPL, handle);
  41. }
  42. inline HRESULT ifc_omstorageasync::GetData(void **data)
  43. {
  44. return _call(API_GETDATA, (HRESULT)E_NOTIMPL, data);
  45. }
  46. inline HRESULT ifc_omstorageasync::GetState(unsigned int *state)
  47. {
  48. return _call(API_GETSTATE, (HRESULT)E_NOTIMPL, state);
  49. }
  50. #endif //NULLSOFT_WINAMP_OMSTORAGE_ASYNC_INTERFACE_HEADER