Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
The point is to make necessary types available to rpcss idls and code, combase and ole32.
dlls/ole32/dcom.idl | 151 +-------------------------------- include/Makefile.in | 1 + include/wine/orpc.idl | 189 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 191 insertions(+), 150 deletions(-) create mode 100644 include/wine/orpc.idl
diff --git a/dlls/ole32/dcom.idl b/dlls/ole32/dcom.idl index c3d090a9cb6..e00aba5834c 100644 --- a/dlls/ole32/dcom.idl +++ b/dlls/ole32/dcom.idl @@ -22,7 +22,7 @@ #pragma makedep proxy #pragma makedep register
-import "unknwn.idl"; +#include "wine/orpc.idl"
[ threading(both), @@ -30,155 +30,6 @@ import "unknwn.idl"; ] coclass PSFactoryBuffer { interface IFactoryBuffer; }
-[ - uuid(99fcfe60-5260-101b-bbcb-00aa0021347a), - pointer_default(unique) -] -interface ObjectRpcBaseTypes -{ - typedef unsigned hyper ID; - typedef ID MID; - typedef ID OXID; - typedef ID OID; - typedef ID SETID; - typedef GUID IPID; - typedef GUID CID; - typedef REFGUID REFIPID; - - const unsigned short COM_MINOR_VERSION_1 = 1; - const unsigned short COM_MINOR_VERSION_2 = 2; - - const unsigned short COM_MAJOR_VERSION = 5; - const unsigned short COM_MINOR_VERSION = 3; - - typedef struct tagCOMVERSION { - unsigned short MajorVersion; - unsigned short MinorVersion; - } COMVERSION; - - const unsigned long ORPCF_NULL = 0; - const unsigned long ORPCF_LOCAL = 1; - const unsigned long ORPCF_RESERVED1 = 2; - const unsigned long ORPCF_RESERVED2 = 4; - const unsigned long ORPCF_RESERVED3 = 8; - const unsigned long ORPCF_RESERVED4 = 16; - - typedef struct tagORPC_EXTENT { - GUID id; - unsigned long size; - [size_is((size+7)&~7)] byte data[]; - } ORPC_EXTENT; - - typedef struct tagORPC_EXTENT_ARRAY { - unsigned long size; - unsigned long reserved; - [size_is((size+1)&~1,), unique] ORPC_EXTENT **extent; - } ORPC_EXTENT_ARRAY; - - typedef struct tagORPCTHIS { - COMVERSION version; - unsigned long flags; - unsigned long reserved1; - CID cid; - [unique] ORPC_EXTENT_ARRAY *extensions; - } ORPCTHIS; - - typedef struct tagORPCTHAT { - unsigned long flags; - [unique] ORPC_EXTENT_ARRAY *extensions; - } ORPCTHAT; - - const unsigned short NCADG_IP_UDP = 0x08; - const unsigned short NCACN_IP_TCP = 0x07; - const unsigned short NCADG_IPX = 0x0E; - const unsigned short NCACN_SPX = 0x0C; - const unsigned short NCACN_NB_NB = 0x12; - const unsigned short NCACN_NB_IPX = 0x0D; - const unsigned short NCACN_DNET_NSP = 0x04; - const unsigned short NCACN_HTTP = 0x1F; - - typedef struct tagSTRINGBINDING { - unsigned short wTowerId; - [string] WCHAR aNetworkAddr[]; - } STRINGBINDING; - - const unsigned short COM_C_AUTHZ_NONE = 0xffff; - - typedef struct tagSECURITYBINDING { - unsigned short wAuthnSvc; - unsigned short wAuthzSvc; - [string] WCHAR aPrincName[]; - } SECURITYBINDING; - - typedef struct tagDUALSTRINGARRAY { - unsigned short wNumEntries; - unsigned short wSecurityOffset; - [size_is(wNumEntries)] unsigned short aStringArray[]; - } DUALSTRINGARRAY; - - typedef struct tagOXID_INFO { - DWORD dwTid; - DWORD dwPid; - IPID ipidRemUnknown; - DWORD dwAuthnHint; - DUALSTRINGARRAY *psa; - } OXID_INFO; - - const unsigned long OBJREF_SIGNATURE = 0x574f454d; /* "MEOW" */ - const unsigned long OBJREF_STANDARD = 0x1; - const unsigned long OBJREF_HANDLER = 0x2; - const unsigned long OBJREF_CUSTOM = 0x4; - const unsigned long SORF_OXRES1 = 0x1; - const unsigned long SORF_OXRES2 = 0x20; - const unsigned long SORF_OXRES3 = 0x40; - const unsigned long SORF_OXRES4 = 0x80; - const unsigned long SORF_OXRES5 = 0x100; - const unsigned long SORF_OXRES6 = 0x200; - const unsigned long SORF_OXRES7 = 0x400; - const unsigned long SORF_OXRES8 = 0x800; - const unsigned long SORF_NULL = 0x0; - const unsigned long SORF_NOPING = 0x1000; - - typedef struct tagSTDOBJREF { - unsigned long flags; - unsigned long cPublicRefs; - OXID oxid; - OID oid; - IPID ipid; - } STDOBJREF; - - typedef struct tagOBJREF { - unsigned long signature; - unsigned long flags; - GUID iid; - [switch_is(flags)] union { - [case(OBJREF_STANDARD)] struct OR_STANDARD { - STDOBJREF std; - DUALSTRINGARRAY saResAddr; - } u_standard; - [case(OBJREF_HANDLER)] struct OR_HANDLER { - STDOBJREF std; - CLSID clsid; - DUALSTRINGARRAY saResAddr; - } u_handler; - [case(OBJREF_CUSTOM)] struct OR_CUSTOM { - CLSID clsid; - unsigned long cbExtension; - ULONG size; - [size_is(size), ref] byte *pData; - } u_custom; - } u_objref; - } OBJREF; - - typedef struct tagMInterfacePointer { - ULONG ulCntData; - [size_is(ulCntData)] BYTE abData[]; - } MInterfacePointer; - - typedef [unique] MInterfacePointer *PMInterfacePointer; - -} /* interface ObjectRpcBaseTypes */ - [ object, uuid(00000131-0000-0000-C000-000000000046) diff --git a/include/Makefile.in b/include/Makefile.in index 23a7d736dd5..49b174ed319 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -740,6 +740,7 @@ SOURCES = \ wine/fil_data.idl \ wine/itss.idl \ wine/library.h \ + wine/orpc.idl \ wine/svcctl.idl \ wine/winedxgi.idl \ winerror.h \ diff --git a/include/wine/orpc.idl b/include/wine/orpc.idl new file mode 100644 index 00000000000..c72a43ff2fe --- /dev/null +++ b/include/wine/orpc.idl @@ -0,0 +1,189 @@ +/* + * Copyright 2003 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "unknwn.idl"; + +[ + uuid(99fcfe60-5260-101b-bbcb-00aa0021347a), + pointer_default(unique) +] +interface ObjectRpcBaseTypes +{ + typedef unsigned hyper ID; + typedef ID MID; + typedef ID OXID; + typedef ID OID; + typedef ID SETID; + typedef GUID IPID; + typedef GUID CID; + typedef REFGUID REFIPID; + + const unsigned short COM_MINOR_VERSION_1 = 1; + const unsigned short COM_MINOR_VERSION_2 = 2; + + const unsigned short COM_MAJOR_VERSION = 5; + const unsigned short COM_MINOR_VERSION = 3; + + typedef struct tagCOMVERSION + { + unsigned short MajorVersion; + unsigned short MinorVersion; + } COMVERSION; + + const unsigned long ORPCF_NULL = 0; + const unsigned long ORPCF_LOCAL = 1; + const unsigned long ORPCF_RESERVED1 = 2; + const unsigned long ORPCF_RESERVED2 = 4; + const unsigned long ORPCF_RESERVED3 = 8; + const unsigned long ORPCF_RESERVED4 = 16; + + typedef struct tagORPC_EXTENT + { + GUID id; + unsigned long size; + [size_is((size + 7) & ~7)] byte data[]; + } ORPC_EXTENT; + + typedef struct tagORPC_EXTENT_ARRAY + { + unsigned long size; + unsigned long reserved; + [size_is((size + 1) & ~1,), unique] ORPC_EXTENT **extent; + } ORPC_EXTENT_ARRAY; + + typedef struct tagORPCTHIS + { + COMVERSION version; + unsigned long flags; + unsigned long reserved1; + CID cid; + [unique] ORPC_EXTENT_ARRAY *extensions; + } ORPCTHIS; + + typedef struct tagORPCTHAT + { + unsigned long flags; + [unique] ORPC_EXTENT_ARRAY *extensions; + } ORPCTHAT; + + const unsigned short NCADG_IP_UDP = 0x08; + const unsigned short NCACN_IP_TCP = 0x07; + const unsigned short NCADG_IPX = 0x0E; + const unsigned short NCACN_SPX = 0x0C; + const unsigned short NCACN_NB_NB = 0x12; + const unsigned short NCACN_NB_IPX = 0x0D; + const unsigned short NCACN_DNET_NSP = 0x04; + const unsigned short NCACN_HTTP = 0x1F; + + typedef struct tagSTRINGBINDING + { + unsigned short wTowerId; + [string] WCHAR aNetworkAddr[]; + } STRINGBINDING; + + const unsigned short COM_C_AUTHZ_NONE = 0xffff; + + typedef struct tagSECURITYBINDING + { + unsigned short wAuthnSvc; + unsigned short wAuthzSvc; + [string] WCHAR aPrincName[]; + } SECURITYBINDING; + + typedef struct tagDUALSTRINGARRAY + { + unsigned short wNumEntries; + unsigned short wSecurityOffset; + [size_is(wNumEntries)] unsigned short aStringArray[]; + } DUALSTRINGARRAY; + + typedef struct tagOXID_INFO + { + DWORD dwTid; + DWORD dwPid; + IPID ipidRemUnknown; + DWORD dwAuthnHint; + DUALSTRINGARRAY *psa; + } OXID_INFO; + + const unsigned long OBJREF_SIGNATURE = 0x574f454d; /* "MEOW" */ + const unsigned long OBJREF_STANDARD = 0x1; + const unsigned long OBJREF_HANDLER = 0x2; + const unsigned long OBJREF_CUSTOM = 0x4; + const unsigned long SORF_OXRES1 = 0x1; + const unsigned long SORF_OXRES2 = 0x20; + const unsigned long SORF_OXRES3 = 0x40; + const unsigned long SORF_OXRES4 = 0x80; + const unsigned long SORF_OXRES5 = 0x100; + const unsigned long SORF_OXRES6 = 0x200; + const unsigned long SORF_OXRES7 = 0x400; + const unsigned long SORF_OXRES8 = 0x800; + const unsigned long SORF_NULL = 0x0; + const unsigned long SORF_NOPING = 0x1000; + + typedef struct tagSTDOBJREF + { + unsigned long flags; + unsigned long cPublicRefs; + OXID oxid; + OID oid; + IPID ipid; + } STDOBJREF; + + typedef struct tagOBJREF + { + unsigned long signature; + unsigned long flags; + GUID iid; + [switch_is(flags)] + union + { + [case(OBJREF_STANDARD)] + struct OR_STANDARD + { + STDOBJREF std; + DUALSTRINGARRAY saResAddr; + } u_standard; + + [case(OBJREF_HANDLER)] + struct OR_HANDLER + { + STDOBJREF std; + CLSID clsid; + DUALSTRINGARRAY saResAddr; + } u_handler; + + [case(OBJREF_CUSTOM)] + struct OR_CUSTOM + { + CLSID clsid; + unsigned long cbExtension; + ULONG size; + [size_is(size), ref] byte *pData; + } u_custom; + } u_objref; + } OBJREF; + + typedef struct tagMInterfacePointer + { + ULONG ulCntData; + [size_is(ulCntData)] BYTE abData[]; + } MInterfacePointer; + + typedef [unique] MInterfacePointer *PMInterfacePointer; +}
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.spec | 2 +- dlls/combase/marshal.c | 32 ++++++++++++++++++++++++ dlls/ole32/marshal.c | 52 --------------------------------------- dlls/ole32/ole32.spec | 2 +- 4 files changed, 34 insertions(+), 54 deletions(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 3214f54550c..8bcac10cdc8 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -112,7 +112,7 @@ @ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr) @ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) @ stdcall CoGetMalloc(long ptr) -@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) ole32.CoGetMarshalSizeMax +@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) @ stub CoGetModuleType @ stdcall CoGetObjectContext(ptr ptr) @ stdcall CoGetPSClsid(ptr ptr) ole32.CoGetPSClsid diff --git a/dlls/combase/marshal.c b/dlls/combase/marshal.c index 2b0c0058125..3c577a9bff1 100644 --- a/dlls/combase/marshal.c +++ b/dlls/combase/marshal.c @@ -24,6 +24,7 @@
#include "wine/debug.h" #include "wine/heap.h" +#include "wine/orpc.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
@@ -379,3 +380,34 @@ HRESULT WINAPI CoCreateFreeThreadedMarshaler(IUnknown *outer, IUnknown **marshal
return S_OK; } + +/*********************************************************************** + * CoGetMarshalSizeMax (combase.@) + */ +HRESULT WINAPI CoGetMarshalSizeMax(ULONG *size, REFIID riid, IUnknown *unk, + DWORD dest_context, void *pvDestContext, DWORD mshlFlags) +{ + BOOL std_marshal = FALSE; + IMarshal *marshal; + HRESULT hr; + + if (!unk) + return E_POINTER; + + hr = IUnknown_QueryInterface(unk, &IID_IMarshal, (void **)&marshal); + if (hr != S_OK) + { + std_marshal = TRUE; + hr = CoGetStandardMarshal(riid, unk, dest_context, pvDestContext, mshlFlags, &marshal); + } + if (hr != S_OK) + return hr; + + hr = IMarshal_GetMarshalSizeMax(marshal, riid, unk, dest_context, pvDestContext, mshlFlags, size); + if (!std_marshal) + /* add on the size of the whole OBJREF structure like native does */ + *size += sizeof(OBJREF); + + IMarshal_Release(marshal); + return hr; +} diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index cf1e55babed..ea8432e2ee6 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1777,58 +1777,6 @@ static HRESULT get_unmarshaler_from_stream(IStream *stream, IMarshal **marshal, return hr; }
-/*********************************************************************** - * CoGetMarshalSizeMax [OLE32.@] - * - * Gets the maximum amount of data that will be needed by a marshal. - * - * PARAMS - * pulSize [O] Address where maximum marshal size will be stored. - * riid [I] Identifier of the interface to marshal. - * pUnk [I] Pointer to the object to marshal. - * dwDestContext [I] Destination. Used to enable or disable optimizations. - * pvDestContext [I] Reserved. Must be NULL. - * mshlFlags [I] Flags that affect the marshaling. See CoMarshalInterface(). - * - * RETURNS - * Success: S_OK. - * Failure: HRESULT code. - * - * SEE ALSO - * CoMarshalInterface(). - */ -HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk, - DWORD dwDestContext, void *pvDestContext, - DWORD mshlFlags) -{ - HRESULT hr; - LPMARSHAL pMarshal; - BOOL std_marshal = FALSE; - - if(!pUnk) - return E_POINTER; - - hr = IUnknown_QueryInterface(pUnk, &IID_IMarshal, (void**)&pMarshal); - if (hr != S_OK) - { - std_marshal = TRUE; - hr = CoGetStandardMarshal(riid, pUnk, dwDestContext, pvDestContext, - mshlFlags, &pMarshal); - } - if (hr != S_OK) - return hr; - - hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext, - pvDestContext, mshlFlags, pulSize); - if (!std_marshal) - /* add on the size of the whole OBJREF structure like native does */ - *pulSize += sizeof(OBJREF); - - IMarshal_Release(pMarshal); - return hr; -} - - static void dump_MSHLFLAGS(MSHLFLAGS flags) { if (flags & MSHLFLAGS_TABLESTRONG) diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index a19264127f9..772599b4cff 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -39,7 +39,7 @@ @ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr) combase.CoGetInstanceFromIStorage @ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) combase.CoGetInterfaceAndReleaseStream @ stdcall CoGetMalloc(long ptr) combase.CoGetMalloc -@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) +@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) combase.CoGetMarshalSizeMax @ stdcall CoGetObject(wstr ptr ptr ptr) @ stdcall CoGetObjectContext(ptr ptr) combase.CoGetObjectContext @ stdcall CoGetPSClsid(ptr ptr)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=77120
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
ole32: clipboard.c:1529: Test failed: gle 5 clipboard.c:1531: Test failed: gle 1418 clipboard.c:1533: Test failed: gle 1418 clipboard.c:1541: Test failed: got 800401d0 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00406970).
Report validation errors: ole32:clipboard crashed (c0000005)
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.spec | 2 +- dlls/combase/marshal.c | 95 ++++++++++++++++++++++++ dlls/ole32/marshal.c | 149 -------------------------------------- dlls/ole32/ole32.spec | 2 +- 4 files changed, 97 insertions(+), 151 deletions(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 8bcac10cdc8..be5ed85a8e3 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -131,7 +131,7 @@ @ stdcall CoLockObjectExternal(ptr long long) ole32.CoLockObjectExternal @ stdcall CoMarshalHresult(ptr long) @ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr) -@ stdcall CoMarshalInterface(ptr ptr ptr long ptr long) ole32.CoMarshalInterface +@ stdcall CoMarshalInterface(ptr ptr ptr long ptr long) @ stub CoPopServiceDomain @ stub CoPushServiceDomain @ stub CoQueryAuthenticationServices diff --git a/dlls/combase/marshal.c b/dlls/combase/marshal.c index 3c577a9bff1..9a88be72368 100644 --- a/dlls/combase/marshal.c +++ b/dlls/combase/marshal.c @@ -411,3 +411,98 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG *size, REFIID riid, IUnknown *unk, IMarshal_Release(marshal); return hr; } + +static void dump_mshflags(MSHLFLAGS flags) +{ + if (flags & MSHLFLAGS_TABLESTRONG) + TRACE(" MSHLFLAGS_TABLESTRONG"); + if (flags & MSHLFLAGS_TABLEWEAK) + TRACE(" MSHLFLAGS_TABLEWEAK"); + if (!(flags & (MSHLFLAGS_TABLESTRONG|MSHLFLAGS_TABLEWEAK))) + TRACE(" MSHLFLAGS_NORMAL"); + if (flags & MSHLFLAGS_NOPING) + TRACE(" MSHLFLAGS_NOPING"); +} + +/*********************************************************************** + * CoMarshalInterface (combase.@) + */ +HRESULT WINAPI CoMarshalInterface(IStream *stream, REFIID riid, IUnknown *unk, + DWORD dest_context, void *pvDestContext, DWORD mshlFlags) +{ + CLSID marshaler_clsid; + IMarshal *marshal; + HRESULT hr; + + TRACE("%p, %s, %p, %x, %p, ", stream, debugstr_guid(riid), unk, dest_context, pvDestContext); + dump_mshflags(mshlFlags); + TRACE("\n"); + + if (!unk || !stream) + return E_INVALIDARG; + + hr = IUnknown_QueryInterface(unk, &IID_IMarshal, (void **)&marshal); + if (hr != S_OK) + hr = CoGetStandardMarshal(riid, unk, dest_context, pvDestContext, mshlFlags, &marshal); + if (hr != S_OK) + { + ERR("Failed to get marshaller, %#x\n", hr); + return hr; + } + + hr = IMarshal_GetUnmarshalClass(marshal, riid, unk, dest_context, pvDestContext, mshlFlags, + &marshaler_clsid); + if (hr != S_OK) + { + ERR("IMarshal::GetUnmarshalClass failed, %#x\n", hr); + goto cleanup; + } + + /* FIXME: implement handler marshaling too */ + if (IsEqualCLSID(&marshaler_clsid, &CLSID_StdMarshal)) + { + TRACE("Using standard marshaling\n"); + } + else + { + OBJREF objref; + + TRACE("Using custom marshaling\n"); + objref.signature = OBJREF_SIGNATURE; + objref.iid = *riid; + objref.flags = OBJREF_CUSTOM; + objref.u_objref.u_custom.clsid = marshaler_clsid; + objref.u_objref.u_custom.cbExtension = 0; + objref.u_objref.u_custom.size = 0; + hr = IMarshal_GetMarshalSizeMax(marshal, riid, unk, dest_context, pvDestContext, mshlFlags, + &objref.u_objref.u_custom.size); + if (hr != S_OK) + { + ERR("Failed to get max size of marshal data, error %#x\n", hr); + goto cleanup; + } + /* write constant sized common header and OR_CUSTOM data into stream */ + hr = IStream_Write(stream, &objref, FIELD_OFFSET(OBJREF, u_objref.u_custom.pData), NULL); + if (hr != S_OK) + { + ERR("Failed to write OR_CUSTOM header to stream with %#x\n", hr); + goto cleanup; + } + } + + TRACE("Calling IMarshal::MarshalInterface\n"); + + hr = IMarshal_MarshalInterface(marshal, stream, riid, unk, dest_context, pvDestContext, mshlFlags); + if (hr != S_OK) + { + ERR("Failed to marshal the interface %s, hr %#x\n", debugstr_guid(riid), hr); + goto cleanup; + } + +cleanup: + IMarshal_Release(marshal); + + TRACE("completed with hr %#x\n", hr); + + return hr; +} diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index ea8432e2ee6..343d1c834f7 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1689,26 +1689,6 @@ HRESULT WINAPI CoGetStandardMarshal(REFIID riid, IUnknown *pUnk, return StdMarshalImpl_Construct(&IID_IMarshal, dwDestContext, pvDestContext, (void**)ppMarshal); }
-/*********************************************************************** - * get_marshaler [internal] - * - * Retrieves an IMarshal interface for an object. - */ -static HRESULT get_marshaler(REFIID riid, IUnknown *pUnk, DWORD dwDestContext, - void *pvDestContext, DWORD mshlFlags, - LPMARSHAL *pMarshal) -{ - HRESULT hr; - - if (!pUnk) - return E_POINTER; - hr = IUnknown_QueryInterface(pUnk, &IID_IMarshal, (LPVOID*)pMarshal); - if (hr != S_OK) - hr = CoGetStandardMarshal(riid, pUnk, dwDestContext, pvDestContext, - mshlFlags, pMarshal); - return hr; -} - /*********************************************************************** * get_unmarshaler_from_stream [internal] * @@ -1777,135 +1757,6 @@ static HRESULT get_unmarshaler_from_stream(IStream *stream, IMarshal **marshal, return hr; }
-static void dump_MSHLFLAGS(MSHLFLAGS flags) -{ - if (flags & MSHLFLAGS_TABLESTRONG) - TRACE(" MSHLFLAGS_TABLESTRONG"); - if (flags & MSHLFLAGS_TABLEWEAK) - TRACE(" MSHLFLAGS_TABLEWEAK"); - if (!(flags & (MSHLFLAGS_TABLESTRONG|MSHLFLAGS_TABLEWEAK))) - TRACE(" MSHLFLAGS_NORMAL"); - if (flags & MSHLFLAGS_NOPING) - TRACE(" MSHLFLAGS_NOPING"); -} - -/*********************************************************************** - * CoMarshalInterface [OLE32.@] - * - * Marshals an interface into a stream so that the object can then be - * unmarshaled from another COM apartment and used remotely. - * - * PARAMS - * pStream [I] Stream the object will be marshaled into. - * riid [I] Identifier of the interface to marshal. - * pUnk [I] Pointer to the object to marshal. - * dwDestContext [I] Destination. Used to enable or disable optimizations. - * pvDestContext [I] Reserved. Must be NULL. - * mshlFlags [I] Flags that affect the marshaling. See notes. - * - * RETURNS - * Success: S_OK. - * Failure: HRESULT code. - * - * NOTES - * - * The mshlFlags parameter can take one or more of the following flags: - *| MSHLFLAGS_NORMAL - Unmarshal once, releases stub on last proxy release. - *| MSHLFLAGS_TABLESTRONG - Unmarshal many, release when CoReleaseMarshalData() called. - *| MSHLFLAGS_TABLEWEAK - Unmarshal many, releases stub on last proxy release. - *| MSHLFLAGS_NOPING - No automatic garbage collection (and so reduces network traffic). - * - * If a marshaled object is not unmarshaled, then CoReleaseMarshalData() must - * be called in order to release the resources used in the marshaling. - * - * SEE ALSO - * CoUnmarshalInterface(), CoReleaseMarshalData(). - */ -HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, - DWORD dwDestContext, void *pvDestContext, - DWORD mshlFlags) -{ - HRESULT hr; - CLSID marshaler_clsid; - LPMARSHAL pMarshal; - - TRACE("(%p, %s, %p, %x, %p, ", pStream, debugstr_guid(riid), pUnk, - dwDestContext, pvDestContext); - dump_MSHLFLAGS(mshlFlags); - TRACE(")\n"); - - if (!pUnk || !pStream) - return E_INVALIDARG; - - /* get the marshaler for the specified interface */ - hr = get_marshaler(riid, pUnk, dwDestContext, pvDestContext, mshlFlags, &pMarshal); - if (hr != S_OK) - { - ERR("Failed to get marshaller, 0x%08x\n", hr); - return hr; - } - - hr = IMarshal_GetUnmarshalClass(pMarshal, riid, pUnk, dwDestContext, - pvDestContext, mshlFlags, &marshaler_clsid); - if (hr != S_OK) - { - ERR("IMarshal::GetUnmarshalClass failed, 0x%08x\n", hr); - goto cleanup; - } - - /* FIXME: implement handler marshaling too */ - if (IsEqualCLSID(&marshaler_clsid, &CLSID_StdMarshal)) - { - TRACE("Using standard marshaling\n"); - } - else - { - OBJREF objref; - - TRACE("Using custom marshaling\n"); - objref.signature = OBJREF_SIGNATURE; - objref.iid = *riid; - objref.flags = OBJREF_CUSTOM; - objref.u_objref.u_custom.clsid = marshaler_clsid; - objref.u_objref.u_custom.cbExtension = 0; - objref.u_objref.u_custom.size = 0; - hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext, - pvDestContext, mshlFlags, - &objref.u_objref.u_custom.size); - if (hr != S_OK) - { - ERR("Failed to get max size of marshal data, error 0x%08x\n", hr); - goto cleanup; - } - /* write constant sized common header and OR_CUSTOM data into stream */ - hr = IStream_Write(pStream, &objref, - FIELD_OFFSET(OBJREF, u_objref.u_custom.pData), NULL); - if (hr != S_OK) - { - ERR("Failed to write OR_CUSTOM header to stream with 0x%08x\n", hr); - goto cleanup; - } - } - - TRACE("Calling IMarshal::MarshalInterface\n"); - /* call helper object to do the actual marshaling */ - hr = IMarshal_MarshalInterface(pMarshal, pStream, riid, pUnk, dwDestContext, - pvDestContext, mshlFlags); - - if (hr != S_OK) - { - ERR("Failed to marshal the interface %s, %x\n", debugstr_guid(riid), hr); - goto cleanup; - } - -cleanup: - IMarshal_Release(pMarshal); - - TRACE("completed with hr 0x%08x\n", hr); - - return hr; -} - /*********************************************************************** * CoUnmarshalInterface [OLE32.@] * diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 772599b4cff..7ab90e7b7a7 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -59,7 +59,7 @@ @ stdcall CoLockObjectExternal(ptr long long) @ stdcall CoMarshalHresult(ptr long) combase.CoMarshalHresult @ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr) combase.CoMarshalInterThreadInterfaceInStream -@ stdcall CoMarshalInterface(ptr ptr ptr long ptr long) +@ stdcall CoMarshalInterface(ptr ptr ptr long ptr long) combase.CoMarshalInterface @ stub CoQueryAuthenticationServices @ stdcall CoQueryClientBlanket(ptr ptr ptr ptr ptr ptr ptr) combase.CoQueryClientBlanket @ stdcall CoQueryProxyBlanket(ptr ptr ptr ptr ptr ptr ptr ptr) combase.CoQueryProxyBlanket
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.c | 13 +++++++++++++ dlls/combase/combase.spec | 2 +- dlls/ole32/compobj.c | 15 --------------- dlls/ole32/ole32.spec | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 5752d90d5cc..8d8d83005bc 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -785,6 +785,19 @@ HRESULT WINAPI CoRevertToSelf(void) return hr; }
+/*********************************************************************** + * CoInitializeSecurity (combase.@) + */ +HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR sd, LONG cAuthSvc, + SOLE_AUTHENTICATION_SERVICE *asAuthSvc, void *reserved1, DWORD authn_level, + DWORD imp_level, void *reserved2, DWORD capabilities, void *reserved3) +{ + FIXME("%p, %d, %p, %p, %d, %d, %p, %d, %p stub\n", sd, cAuthSvc, asAuthSvc, reserved1, authn_level, + imp_level, reserved2, capabilities, reserved3); + + return S_OK; +} + /*********************************************************************** * CoGetObjectContext (combase.@) */ diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index be5ed85a8e3..0f34dc6918e 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -124,7 +124,7 @@ @ stdcall CoImpersonateClient() @ stdcall CoIncrementMTAUsage(ptr) ole32.CoIncrementMTAUsage @ stdcall CoInitializeEx(ptr long) ole32.CoInitializeEx -@ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) ole32.CoInitializeSecurity +@ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) @ stdcall CoInitializeWOW(long long) ole32.CoInitializeWOW @ stub CoInvalidateRemoteMachineBindings @ stdcall CoIsHandlerConnected(ptr) ole32.CoIsHandlerConnected diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index f983b07f20b..350508ac9a3 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -3352,21 +3352,6 @@ BOOL WINAPI IsEqualGUID( return !memcmp(rguid1,rguid2,sizeof(GUID)); }
-/*********************************************************************** - * CoInitializeSecurity [OLE32.@] - */ -HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, - SOLE_AUTHENTICATION_SERVICE* asAuthSvc, - void* pReserved1, DWORD dwAuthnLevel, - DWORD dwImpLevel, void* pReserved2, - DWORD dwCapabilities, void* pReserved3) -{ - FIXME("(%p,%d,%p,%p,%d,%d,%p,%d,%p) - stub!\n", pSecDesc, cAuthSvc, - asAuthSvc, pReserved1, dwAuthnLevel, dwImpLevel, pReserved2, - dwCapabilities, pReserved3); - return S_OK; -} - /*********************************************************************** * CoSuspendClassObjects [OLE32.@] * diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 7ab90e7b7a7..7b2c5836611 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -51,7 +51,7 @@ @ stdcall CoIncrementMTAUsage(ptr) @ stdcall CoInitialize(ptr) @ stdcall CoInitializeEx(ptr long) -@ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) +@ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) combase.CoInitializeSecurity @ stdcall CoInitializeWOW(long long) @ stdcall CoIsHandlerConnected(ptr) @ stdcall CoIsOle1Class (ptr)
Signed-off-by: Huw Davies huw@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=77119
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
ole32: clipboard.c:1239: Test failed: got 800401d0 clipboard.c:1250: Test failed: got 800401d0 clipboard.c:1256: Test failed: got 800401d0 clipboard.c:1257: Test failed: GetData not called clipboard.c:1263: Test failed: 1 1 clipboard.c:1269: Test failed: 1
=== debiant (64 bit WoW report) ===
ole32: clipboard.c:1757: Test failed: got 800401d0 clipboard.c:1760: Test failed: called 5 clipboard.c:1761: Test failed: called 1 clipboard.c:1767: Test failed: got 800401d0 clipboard.c:1770: Test failed: called 5 clipboard.c:1771: Test failed: called 1 clipboard.c:1777: Test failed: got 800401d0 clipboard.c:1780: Test failed: called 5 clipboard.c:1781: Test failed: called 1 clipboard.c:1789: Test failed: got 800401d0 clipboard.c:1792: Test failed: called 5 clipboard.c:1793: Test failed: called 1 clipboard.c:1799: Test failed: got 800401d0 clipboard.c:1802: Test failed: called 5 clipboard.c:1803: Test failed: called 1 clipboard.c:1809: Test failed: got 800401d0 clipboard.c:1812: Test failed: called 5 clipboard.c:1813: Test failed: called 1