aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/windows/msofficecomm/WeakReference.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/native/windows/msofficecomm/WeakReference.cxx')
-rw-r--r--src/native/windows/msofficecomm/WeakReference.cxx47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/native/windows/msofficecomm/WeakReference.cxx b/src/native/windows/msofficecomm/WeakReference.cxx
new file mode 100644
index 0000000..a858917
--- /dev/null
+++ b/src/native/windows/msofficecomm/WeakReference.cxx
@@ -0,0 +1,47 @@
+/*
+ * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+#include "WeakReference.h"
+
+STDMETHODIMP WeakReference::QueryInterface(REFIID iid, PVOID *obj)
+{
+ HRESULT hr;
+
+ if (!obj)
+ hr = E_POINTER;
+ else if (IID_IWeakReferenceSource == iid)
+ {
+ /*
+ * While a weak reference to a weak reference should technically be
+ * possible, such functionality does not seem necessary at the time of
+ * this writing.
+ */
+ *obj = NULL;
+ hr = E_NOINTERFACE;
+ }
+ else
+ hr = UnknownImpl::QueryInterface(iid, obj);
+ return hr;
+}
+
+STDMETHODIMP WeakReference::Resolve(REFIID iid, PVOID *obj)
+{
+ HRESULT hr;
+
+ if (obj)
+ {
+ if (_iUnknown)
+ hr = _iUnknown->QueryInterface(iid, obj);
+ else
+ {
+ *obj = NULL;
+ hr = E_FAIL;
+ }
+ }
+ else
+ hr = E_POINTER;
+ return hr;
+}