Skip to content

Commit 530b850

Browse files
committed
[Bridgelink] adjust for QueryInterfaceChanges
1 parent 86e608f commit 530b850

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

BridgeLink/BridgeLink.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,28 +761,34 @@ namespace Plugin {
761761
}
762762
void Dropped(const ICallback*) override {
763763
}
764-
void* QueryInterface(const uint32_t interfaceNumber) override {
764+
void* QueryInterface(const uint32_t interfaceNumber, const bool asIUnknown = false) override {
765765
void* result = nullptr;
766766
if (interfaceNumber == Core::IUnknown::ID) {
767767
AddRef();
768768
result = static_cast<void*>(static_cast<Core::IUnknown*>(this));
769769
}
770770
else if (interfaceNumber == PluginHost::IShell::ID) {
771771
AddRef();
772-
result = static_cast<void*>(static_cast<PluginHost::IShell*>(this));
772+
if(asIUnknown == false)
773+
result = static_cast<void*>(static_cast<PluginHost::IShell*>(this));
774+
else
775+
result = static_cast<void*>(static_cast<Thunder::Core::IUnknown*>(this));
773776
}
774777
else if (interfaceNumber == PluginHost::IDispatcher::ID) {
775778
_adminLock.Lock();
776779
if (_dispatcher != nullptr) {
777780
AddRef();
778-
result = static_cast<void*>(static_cast<PluginHost::IDispatcher*>(this));
781+
if(asIUnknown == false)
782+
result = static_cast<void*>(static_cast<PluginHost::IDispatcher*>(this));
783+
else
784+
result = static_cast<void*>(static_cast<Thunder::Core::IUnknown*>(this));
779785
}
780786
_adminLock.Unlock();
781787
}
782788
else {
783789
PluginHost::IShell* source = Source();
784790
if (source != nullptr) {
785-
result = source->QueryInterface(interfaceNumber);
791+
result = source->QueryInterface(interfaceNumber, asIUnknown);
786792
source->Release();
787793
}
788794
}

0 commit comments

Comments
 (0)