wac_downloadManager_factory.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #include "wac_downloadManager_factory.h"
  2. static const char serviceName[] = "WAC Downloads";
  3. static const char testString[] = "Downloads Component";
  4. // {B000EE81-199F-48C2-BDCB-F7E3C31A2A13}
  5. static const GUID api_downloads_GUID = { 0xb000ee81, 0x199f, 0x48c2, { 0xbd, 0xcb, 0xf7, 0xe3, 0x1a, 0x12, 0x2a, 0x13 } };
  6. FOURCC wa::Components::WAC_DownloadManagerFactory::GetServiceType()
  7. {
  8. return WaSvc::UNIQUE;
  9. }
  10. const char *wa::Components::WAC_DownloadManagerFactory::GetServiceName()
  11. {
  12. return serviceName;
  13. }
  14. GUID wa::Components::WAC_DownloadManagerFactory::GetGUID()
  15. {
  16. return api_downloads_GUID;
  17. }
  18. const char *wa::Components::WAC_DownloadManagerFactory::GetTestString()
  19. {
  20. return testString;
  21. }
  22. void *wa::Components::WAC_DownloadManagerFactory::GetInterface( int global_lock )
  23. {
  24. return nullptr;
  25. }
  26. int wa::Components::WAC_DownloadManagerFactory::ReleaseInterface( void *ifc )
  27. {
  28. return 1;
  29. }
  30. int wa::Components::WAC_DownloadManagerFactory::SupportNonLockingInterface()
  31. {
  32. return 1;
  33. }
  34. int wa::Components::WAC_DownloadManagerFactory::ServiceNotify( int msg, int param1, int param2 )
  35. {
  36. return 1;
  37. }
  38. HRESULT wa::Components::WAC_DownloadManagerFactory::Register( api_service *p_service )
  39. {
  40. if ( p_service == NULL )
  41. return E_INVALIDARG;
  42. p_service->service_register( this );
  43. return S_OK;
  44. }
  45. HRESULT wa::Components::WAC_DownloadManagerFactory::Unregister( api_service *p_service )
  46. {
  47. if ( p_service == NULL )
  48. return E_INVALIDARG;
  49. p_service->service_deregister( this );
  50. return S_OK;
  51. }
  52. #ifdef CBCLASS
  53. #undef CBCLASS
  54. #endif
  55. #define CBCLASS wa::Components::WAC_DownloadManagerFactory
  56. START_DISPATCH;
  57. CB( WASERVICEFACTORY_GETSERVICETYPE, GetServiceType )
  58. CB( WASERVICEFACTORY_GETSERVICENAME, GetServiceName )
  59. CB( WASERVICEFACTORY_GETGUID, GetGUID )
  60. CB( WASERVICEFACTORY_GETINTERFACE, GetInterface )
  61. CB( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface )
  62. CB( WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface )
  63. CB( WASERVICEFACTORY_GETTESTSTRING, GetTestString )
  64. CB( WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify )
  65. END_DISPATCH;