summaryrefslogtreecommitdiffstats
path: root/source/core/slang-shared-library.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-shared-library.cpp')
-rw-r--r--source/core/slang-shared-library.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/core/slang-shared-library.cpp b/source/core/slang-shared-library.cpp
index 17b881540..844bea8d9 100644
--- a/source/core/slang-shared-library.cpp
+++ b/source/core/slang-shared-library.cpp
@@ -76,9 +76,21 @@ TemporarySharedLibrary::~TemporarySharedLibrary()
/* !!!!!!!!!!!!!!!!!!!!!!!!!! DefaultSharedLibrary !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
-ISlangUnknown* DefaultSharedLibrary::getInterface(const Guid& guid)
+SLANG_NO_THROW SlangResult SLANG_MCALL DefaultSharedLibrary::queryInterface(SlangUUID const& uuid, void** outObject)
{
- return (guid == ISlangUnknown::getTypeGuid() || guid == ISlangSharedLibrary::getTypeGuid()) ? static_cast<ISlangSharedLibrary*>(this) : nullptr;
+ if (uuid == DefaultSharedLibrary::getTypeGuid())
+ {
+ *outObject = this;
+ return SLANG_OK;
+ }
+
+ if (uuid == ISlangUnknown::getTypeGuid() || uuid == ISlangSharedLibrary::getTypeGuid())
+ {
+ addReference();
+ *outObject = static_cast<ISlangSharedLibrary*>(this);
+ return SLANG_OK;
+ }
+ return SLANG_E_NO_INTERFACE;
}
DefaultSharedLibrary::~DefaultSharedLibrary()