Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.0 KiB

  1. #include "privcpp.h"
  2. CPackage_IRunnableObject::CPackage_IRunnableObject(CPackage *pPackage) :
  3. _pPackage(pPackage)
  4. {
  5. ASSERT(_cRef == 0);
  6. }
  7. CPackage_IRunnableObject::~CPackage_IRunnableObject()
  8. {
  9. DebugMsg(DM_TRACE,"CPackage_IRunnableObject destroyed with ref count %d",_cRef);
  10. }
  11. //////////////////////////////////
  12. //
  13. // IUnknown Methods...
  14. //
  15. HRESULT CPackage_IRunnableObject::QueryInterface(REFIID iid, void ** ppv)
  16. {
  17. return _pPackage->QueryInterface(iid,ppv);
  18. }
  19. ULONG CPackage_IRunnableObject::AddRef(void)
  20. {
  21. _cRef++; // interface ref count for debugging
  22. return _pPackage->AddRef();
  23. }
  24. ULONG CPackage_IRunnableObject::Release(void)
  25. {
  26. _cRef--; // interface ref count for debugging
  27. return _pPackage->Release();
  28. }
  29. //////////////////////////////////
  30. //
  31. // IRunnable Object Methods...
  32. //
  33. // NOTE: To answer your question, yes, this is kind of a pointless interface,
  34. // but some apps feel better when it's around. Basically we just tell what
  35. // they want to hear (ie. return S_OK).
  36. //
  37. HRESULT CPackage_IRunnableObject::GetRunningClass(LPCLSID pclsid)
  38. {
  39. DebugMsg(DM_TRACE, "pack ro - GetRunningClass() called.");
  40. if (pclsid == NULL)
  41. return E_INVALIDARG;
  42. *pclsid = CLSID_CPackage;
  43. return S_OK;
  44. }
  45. HRESULT CPackage_IRunnableObject::Run(LPBC lpbc)
  46. {
  47. // we're an inproc-server, so telling us to run is kind of pointless
  48. DebugMsg(DM_TRACE, "pack ro - Run() called.");
  49. return S_OK;
  50. }
  51. BOOL CPackage_IRunnableObject::IsRunning()
  52. {
  53. DebugMsg(DM_TRACE, "pack ro - IsRunning() called.");
  54. // we're an inproc-server, so this is kind of pointless
  55. return TRUE;
  56. }
  57. HRESULT CPackage_IRunnableObject::LockRunning(BOOL, BOOL)
  58. {
  59. DebugMsg(DM_TRACE, "pack ro - LockRunning() called.");
  60. // again, we're an inproc-server, so this is also pointless
  61. return S_OK;
  62. }
  63. HRESULT CPackage_IRunnableObject::SetContainedObject(BOOL)
  64. {
  65. DebugMsg(DM_TRACE, "pack ro - SetContainedObject() called.");
  66. // again, we don't really care about this
  67. return S_OK;
  68. }