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.

115 lines
2.9 KiB

  1. #include "qmgrlib.h"
  2. #include <objbase.h>
  3. #include "qmgr.h"
  4. UpdateNotificationPointer(
  5. IBackgroundCopyGroup * This,
  6. REFCLSID clsid
  7. )
  8. {
  9. IBackgroundCopyCallback1 * callback = NULL;
  10. try
  11. {
  12. THROW_HRESULT( CoCreateInstance( clsid,
  13. NULL, // no aggregation
  14. CLSCTX_INPROC,
  15. _uuidof(IBackgroundCopyCallback1),
  16. (LPVOID *) &callback
  17. ));
  18. THROW_HRESULT( This->SetNotificationPointer( _uuidof(IBackgroundCopyCallback1), callback ));
  19. callback->Release();
  20. return S_OK;
  21. }
  22. catch( ComError err )
  23. {
  24. SafeRelease( callback );
  25. return err.Error() ;
  26. }
  27. }
  28. HRESULT
  29. IBackgroundCopyGroup_SetProp_Proxy(
  30. IBackgroundCopyGroup * This,
  31. GROUPPROP propID,
  32. VARIANT *pvarVal
  33. )
  34. /*
  35. This is the client-side proxy function that maps from SetProp (a local function)
  36. to InternalSetProp (a remoted function).
  37. */
  38. {
  39. switch (propID)
  40. {
  41. case GROUPPROP_NOTIFYCLSID:
  42. {
  43. INT flags;
  44. CLSID clsid;
  45. VARIANT vFlags;
  46. RETURN_HRESULT( IBackgroundCopyGroup_InternalSetProp_Proxy( This, propID, pvarVal ));
  47. RETURN_HRESULT( This->GetProp( GROUPPROP_NOTIFYFLAGS, &vFlags ));
  48. RETURN_HRESULT( CLSIDFromString( pvarVal->bstrVal, &clsid ));
  49. flags = vFlags.intVal;
  50. if (clsid != GUID_NULL &&
  51. 0 == (flags & QM_NOTIFY_DISABLE_NOTIFY))
  52. {
  53. RETURN_HRESULT( UpdateNotificationPointer( This, clsid ));
  54. }
  55. return S_OK;
  56. }
  57. case GROUPPROP_NOTIFYFLAGS:
  58. {
  59. INT flags;
  60. CLSID clsid;
  61. VARIANT vClsid;
  62. RETURN_HRESULT( IBackgroundCopyGroup_InternalSetProp_Proxy( This, propID, pvarVal ));
  63. RETURN_HRESULT( This->GetProp( GROUPPROP_NOTIFYCLSID, &vClsid ));
  64. RETURN_HRESULT( CLSIDFromString( vClsid.bstrVal, &clsid ));
  65. flags = pvarVal->intVal;
  66. if (clsid != GUID_NULL &&
  67. 0 == (flags & QM_NOTIFY_DISABLE_NOTIFY))
  68. {
  69. RETURN_HRESULT( UpdateNotificationPointer( This, clsid ));
  70. }
  71. return S_OK;
  72. }
  73. default:
  74. return IBackgroundCopyGroup_InternalSetProp_Proxy( This, propID, pvarVal );
  75. }
  76. ASSERT( 0 );
  77. }
  78. HRESULT
  79. IBackgroundCopyGroup_SetProp_Stub(
  80. IBackgroundCopyGroup * This,
  81. GROUPPROP propID,
  82. VARIANT *pvarVal
  83. )
  84. /*
  85. This is the server-side stub function that maps from InternalSetProp (a remote function)
  86. to SetProp (a local function).
  87. */
  88. {
  89. return This->SetProp( propID, pvarVal );
  90. }