https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e64b0329877c602f04cad…
commit e64b0329877c602f04cad77e5d88528574b03378
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Jun 4 03:37:18 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Mon Jun 4 03:37:18 2018 +0100
[ITSS] Sync with Wine Staging 3.9. CORE-14656
---
dll/win32/itss/itss.c | 29 ++++++++++++------
dll/win32/itss/protocol.c | 76 +++++++++++++++++++++++++++++++++--------------
media/doc/README.WINE | 2 +-
3 files changed, 75 insertions(+), 32 deletions(-)
diff --git a/dll/win32/itss/itss.c b/dll/win32/itss/itss.c
index f47a0e96e7..1d236a5960 100644
--- a/dll/win32/itss/itss.c
+++ b/dll/win32/itss/itss.c
@@ -105,20 +105,31 @@ static ULONG WINAPI ITSSCF_Release(LPCLASSFACTORY iface)
}
-static HRESULT WINAPI ITSSCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter,
- REFIID riid, LPVOID *ppobj)
+static HRESULT WINAPI ITSSCF_CreateInstance(IClassFactory *iface, IUnknown *outer,
+ REFIID riid, void **ppv)
{
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
+ IUnknown *unk;
HRESULT hres;
- LPUNKNOWN punk;
- TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
+ TRACE("(%p)->(%p %s %p)\n", This, outer, debugstr_guid(riid), ppv);
- *ppobj = NULL;
- hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk);
- if (SUCCEEDED(hres)) {
- hres = IUnknown_QueryInterface(punk, riid, ppobj);
- IUnknown_Release(punk);
+ if(outer && !IsEqualGUID(riid, &IID_IUnknown)) {
+ *ppv = NULL;
+ return CLASS_E_NOAGGREGATION;
+ }
+
+ hres = This->pfnCreateInstance(outer, (void**)&unk);
+ if(FAILED(hres)) {
+ *ppv = NULL;
+ return hres;
+ }
+
+ if(!IsEqualGUID(riid, &IID_IUnknown)) {
+ hres = IUnknown_QueryInterface(unk, riid, ppv);
+ IUnknown_Release(unk);
+ }else {
+ *ppv = unk;
}
return hres;
}
diff --git a/dll/win32/itss/protocol.c b/dll/win32/itss/protocol.c
index 1463518c2c..1cdb365002 100644
--- a/dll/win32/itss/protocol.c
+++ b/dll/win32/itss/protocol.c
@@ -36,16 +36,23 @@
WINE_DEFAULT_DEBUG_CHANNEL(itss);
typedef struct {
+ IUnknown IUnknown_inner;
IInternetProtocol IInternetProtocol_iface;
IInternetProtocolInfo IInternetProtocolInfo_iface;
LONG ref;
+ IUnknown *outer;
ULONG offset;
struct chmFile *chm_file;
struct chmUnitInfo chm_object;
} ITSProtocol;
+static inline ITSProtocol *impl_from_IUnknown(IUnknown *iface)
+{
+ return CONTAINING_RECORD(iface, ITSProtocol, IUnknown_inner);
+}
+
static inline ITSProtocol *impl_from_IInternetProtocol(IInternetProtocol *iface)
{
return CONTAINING_RECORD(iface, ITSProtocol, IInternetProtocol_iface);
@@ -65,14 +72,13 @@ static void release_chm(ITSProtocol *This)
This->offset = 0;
}
-static HRESULT WINAPI ITSProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid,
void **ppv)
+static HRESULT WINAPI ITSProtocol_QueryInterface(IUnknown *iface, REFIID riid, void
**ppv)
{
- ITSProtocol *This = impl_from_IInternetProtocol(iface);
+ ITSProtocol *This = impl_from_IUnknown(iface);
- *ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
- *ppv = &This->IInternetProtocol_iface;
+ *ppv = &This->IUnknown_inner;
}else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
*ppv = &This->IInternetProtocol_iface;
@@ -82,28 +88,27 @@ static HRESULT WINAPI ITSProtocol_QueryInterface(IInternetProtocol
*iface, REFII
}else if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
TRACE("(%p)->(IID_IInternetProtocolInfo %p)\n", This, ppv);
*ppv = &This->IInternetProtocolInfo_iface;
+ }else {
+ *ppv = NULL;
+ WARN("not supported interface %s\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
}
- if(*ppv) {
- IInternetProtocol_AddRef(iface);
- return S_OK;
- }
-
- WARN("not supported interface %s\n", debugstr_guid(riid));
- return E_NOINTERFACE;
+ IUnknown_AddRef((IUnknown*)*ppv);
+ return S_OK;
}
-static ULONG WINAPI ITSProtocol_AddRef(IInternetProtocol *iface)
+static ULONG WINAPI ITSProtocol_AddRef(IUnknown *iface)
{
- ITSProtocol *This = impl_from_IInternetProtocol(iface);
+ ITSProtocol *This = impl_from_IUnknown(iface);
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
}
-static ULONG WINAPI ITSProtocol_Release(IInternetProtocol *iface)
+static ULONG WINAPI ITSProtocol_Release(IUnknown *iface)
{
- ITSProtocol *This = impl_from_IInternetProtocol(iface);
+ ITSProtocol *This = impl_from_IUnknown(iface);
LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
@@ -118,6 +123,30 @@ static ULONG WINAPI ITSProtocol_Release(IInternetProtocol *iface)
return ref;
}
+static const IUnknownVtbl ITSProtocolUnkVtbl = {
+ ITSProtocol_QueryInterface,
+ ITSProtocol_AddRef,
+ ITSProtocol_Release
+};
+
+static HRESULT WINAPI ITSInternetProtocol_QueryInterface(IInternetProtocol *iface, REFIID
riid, void **ppv)
+{
+ ITSProtocol *This = impl_from_IInternetProtocol(iface);
+ return IUnknown_QueryInterface(This->outer, riid, ppv);
+}
+
+static ULONG WINAPI ITSInternetProtocol_AddRef(IInternetProtocol *iface)
+{
+ ITSProtocol *This = impl_from_IInternetProtocol(iface);
+ return IUnknown_AddRef(This->outer);
+}
+
+static ULONG WINAPI ITSInternetProtocol_Release(IInternetProtocol *iface)
+{
+ ITSProtocol *This = impl_from_IInternetProtocol(iface);
+ return IUnknown_Release(This->outer);
+}
+
static LPCWSTR skip_schema(LPCWSTR url)
{
static const WCHAR its_schema[] = {'i','t','s',':'};
@@ -387,9 +416,9 @@ static HRESULT WINAPI ITSProtocol_UnlockRequest(IInternetProtocol
*iface)
}
static const IInternetProtocolVtbl ITSProtocolVtbl = {
- ITSProtocol_QueryInterface,
- ITSProtocol_AddRef,
- ITSProtocol_Release,
+ ITSInternetProtocol_QueryInterface,
+ ITSInternetProtocol_AddRef,
+ ITSInternetProtocol_Release,
ITSProtocol_Start,
ITSProtocol_Continue,
ITSProtocol_Abort,
@@ -520,21 +549,24 @@ static const IInternetProtocolInfoVtbl ITSProtocolInfoVtbl = {
ITSProtocolInfo_QueryInfo
};
-HRESULT ITSProtocol_create(IUnknown *pUnkOuter, LPVOID *ppobj)
+HRESULT ITSProtocol_create(IUnknown *outer, void **ppv)
{
ITSProtocol *ret;
- TRACE("(%p %p)\n", pUnkOuter, ppobj);
+ TRACE("(%p %p)\n", outer, ppv);
ITSS_LockModule();
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ITSProtocol));
+ if(!ret)
+ return E_OUTOFMEMORY;
+ ret->IUnknown_inner.lpVtbl = &ITSProtocolUnkVtbl;
ret->IInternetProtocol_iface.lpVtbl = &ITSProtocolVtbl;
ret->IInternetProtocolInfo_iface.lpVtbl = &ITSProtocolInfoVtbl;
ret->ref = 1;
+ ret->outer = outer ? outer : &ret->IUnknown_inner;
- *ppobj = &ret->IInternetProtocol_iface;
-
+ *ppv = &ret->IUnknown_inner;
return S_OK;
}
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 5e05bad95f..037d88371c 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -84,7 +84,7 @@ reactos/dll/win32/initpki # Synced to WineStaging-3.3
reactos/dll/win32/inseng # Synced to WineStaging-3.3
reactos/dll/win32/iphlpapi # Out of sync
reactos/dll/win32/itircl # Synced to WineStaging-3.3
-reactos/dll/win32/itss # Synced to WineStaging-3.3
+reactos/dll/win32/itss # Synced to WineStaging-3.9
reactos/dll/win32/jscript # Synced to WineStaging-3.3
reactos/dll/win32/jsproxy # Synced to WineStaging-3.3
reactos/dll/win32/loadperf # Synced to WineStaging-3.3