summaryrefslogtreecommitdiff
path: root/Source/7zip/Common/MyCom.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/7zip/Common/MyCom.h')
-rwxr-xr-xSource/7zip/Common/MyCom.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/Source/7zip/Common/MyCom.h b/Source/7zip/Common/MyCom.h
index 1b97dfd..119aaff 100755
--- a/Source/7zip/Common/MyCom.h
+++ b/Source/7zip/Common/MyCom.h
@@ -1,4 +1,19 @@
-// MyCom.h
+/*
+ * MyCom.h
+ *
+ * This file is a part of LZMA compression module for NSIS.
+ *
+ * Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
+ * Modifications Copyright (C) 2003-2006 Amir Szekely <kichik@netvision.net.il>
+ *
+ * Licensed under the Common Public License version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * Licence details can be found in the file COPYING.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ */
#ifndef __MYCOM_H
#define __MYCOM_H
@@ -50,7 +65,7 @@ public:
_p = NULL;
return pt;
}
- #ifdef WIN32
+ #ifdef _WIN32
HRESULT CoCreateInstance(REFCLSID rclsid, REFIID iid, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
{
return ::CoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, (void**)&_p);
@@ -148,8 +163,10 @@ public:
#define MY_QUERYINTERFACE_BEGIN STDMETHOD(QueryInterface) \
(REFGUID iid, void **outObject) {
+
#define MY_QUERYINTERFACE_ENTRY(i) if (iid == IID_ ## i) \
{ *outObject = (void *)(i *)this; AddRef(); return S_OK; }
+
#define MY_QUERYINTERFACE_END return E_NOINTERFACE; }
#define MY_ADDREF_RELEASE \
@@ -164,7 +181,9 @@ STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \
MY_ADDREF_RELEASE
-#define MY_UNKNOWN_IMP MY_UNKNOWN_IMP_SPEC(;)
+#define MY_UNKNOWN_IMP STDMETHOD(QueryInterface)(REFGUID, void **) { \
+ MY_QUERYINTERFACE_END \
+ MY_ADDREF_RELEASE
#define MY_UNKNOWN_IMP1(i) MY_UNKNOWN_IMP_SPEC( \
MY_QUERYINTERFACE_ENTRY(i) \
@@ -174,11 +193,13 @@ STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \
MY_QUERYINTERFACE_ENTRY(i1) \
MY_QUERYINTERFACE_ENTRY(i2) \
)
+
#define MY_UNKNOWN_IMP3(i1, i2, i3) MY_UNKNOWN_IMP_SPEC( \
MY_QUERYINTERFACE_ENTRY(i1) \
MY_QUERYINTERFACE_ENTRY(i2) \
MY_QUERYINTERFACE_ENTRY(i3) \
)
+
#define MY_UNKNOWN_IMP4(i1, i2, i3, i4) MY_UNKNOWN_IMP_SPEC( \
MY_QUERYINTERFACE_ENTRY(i1) \
MY_QUERYINTERFACE_ENTRY(i2) \