Skip to content

Commit 391f03b

Browse files
[SimpleCOMRPC] Adjust the plugin after changes to IShell::ICOMLink::INotification (#936)
* Change the Revoked and Dangling functionality * Fix a warning --------- Co-authored-by: MFransen69 <39826971+MFransen69@users.noreply.github.com>
1 parent 81b1e41 commit 391f03b

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

examples/SimpleCOMRPC/Client/SimpleCOMRPCClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ int main(int argc, char* argv[])
244244
printf("We do not have a clock interface, so we can not get the time\n");
245245
}
246246
else {
247-
printf("The Ticker is at: %llu\n", clock->Now());
247+
printf("The Ticker is at: %lu\n", clock->Now());
248248
}
249249
break;
250250
case 'T':

examples/SimpleCOMRPC/PluginServer/SimpleCOMRPCPluginServer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ namespace Plugin {
9999
return (_parent == nullptr ? 0 : result.Ticks());
100100
}
101101

102-
void SimpleCOMRPCPluginServer::OnRevoke(const Exchange::IWallClock::ICallback* remote) {
102+
void SimpleCOMRPCPluginServer::OnInterfaceDangling(const Exchange::IWallClock::ICallback* remote)
103+
{
103104
// Looks like we need to stop the callback from being called, it is a dead object now anyway :-)
104-
TRACE(Trace::Information, (_T("Revoking a callback, it will not fire anymore")));
105+
TRACE(Trace::Information, (_T("Callback is dangling, disarming it so it will not fire anymore")));
105106
_notifier.Disarm(remote);
106107
}
107108

examples/SimpleCOMRPC/PluginServer/SimpleCOMRPCPluginServer.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,7 @@ namespace Plugin {
8383

8484
void Dangling(const Core::IUnknown* remote, const uint32_t interfaceId) override
8585
{
86-
//not interested in this notification
87-
TRACE(Trace::Information, (_T("Cleanup an interface: %d [%X] on object: [%s]"), interfaceId, interfaceId, typeid(*remote).name()));
88-
}
89-
void Revoked(const Core::IUnknown* remote, const uint32_t interfaceId) override
90-
{
91-
TRACE(Trace::Information, (_T("Revoking an interface: %d [%X] on object: [%s]"), interfaceId, interfaceId, typeid(*remote).name()));
86+
TRACE(Trace::Information, (_T("Dangling interface: %d [%X] on object: [%s]"), interfaceId, interfaceId, typeid(*remote).name()));
9287

9388
// Something happened to the other side
9489
ASSERT(interfaceId != Exchange::ID_WALLCLOCK);
@@ -98,7 +93,7 @@ namespace Plugin {
9893

9994
ASSERT(result != nullptr);
10095

101-
_parent.OnRevoke(result);
96+
_parent.OnInterfaceDangling(result);
10297

10398
// Do not forget to release the QI from a few lines above :-)
10499
result->Release();
@@ -304,7 +299,7 @@ POP_WARNING()
304299
virtual string Information() const;
305300

306301
private:
307-
void OnRevoke(const Exchange::IWallClock::ICallback* remote);
302+
void OnInterfaceDangling(const Exchange::IWallClock::ICallback* remote);
308303

309304
private:
310305
WallClockNotifier _notifier;

0 commit comments

Comments
 (0)