Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/Makefile.in | 4 +- dlls/combase/combase.spec | 8 +- dlls/combase/usrmarshal.c | 231 ++++++++++++++++++++++++++++++++++++++ dlls/ole32/Makefile.in | 2 +- dlls/ole32/ole32.spec | 8 +- dlls/ole32/usrmarshal.c | 181 +---------------------------- 6 files changed, 249 insertions(+), 185 deletions(-) create mode 100644 dlls/combase/usrmarshal.c
diff --git a/dlls/combase/Makefile.in b/dlls/combase/Makefile.in index 0f3c9f86322..eedcbd8e1c2 100644 --- a/dlls/combase/Makefile.in +++ b/dlls/combase/Makefile.in @@ -1,8 +1,10 @@ MODULE = combase.dll +IMPORTLIB = combase IMPORTS = advapi32 ole32 uuid
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ roapi.c \ - string.c + string.c \ + usrmarshal.c diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 36005929da2..b5ca117717c 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -281,11 +281,13 @@ @ stdcall StringFromGUID2(ptr ptr long) ole32.StringFromGUID2 @ stdcall StringFromIID(ptr ptr) ole32.StringFromIID @ stub UpdateDCOMSettings -@ stdcall WdtpInterfacePointer_UserMarshal(ptr long ptr ptr ptr) ole32.WdtpInterfacePointer_UserMarshal +@ stdcall WdtpInterfacePointer_UserFree(ptr) +@ stub WdtpInterfacePointer_UserFree64 +@ stdcall WdtpInterfacePointer_UserMarshal(ptr long ptr ptr ptr) @ stub WdtpInterfacePointer_UserMarshal64 -@ stdcall WdtpInterfacePointer_UserSize(ptr long long ptr ptr) ole32.WdtpInterfacePointer_UserSize +@ stdcall WdtpInterfacePointer_UserSize(ptr long long ptr ptr) @ stub WdtpInterfacePointer_UserSize64 -@ stdcall WdtpInterfacePointer_UserUnmarshal(ptr ptr ptr ptr) ole32.WdtpInterfacePointer_UserUnmarshal +@ stdcall WdtpInterfacePointer_UserUnmarshal(ptr ptr ptr ptr) @ stub WdtpInterfacePointer_UserUnmarshal64 @ stdcall WindowsCompareStringOrdinal(ptr ptr ptr) @ stdcall WindowsConcatString(ptr ptr ptr) diff --git a/dlls/combase/usrmarshal.c b/dlls/combase/usrmarshal.c new file mode 100644 index 00000000000..3fc7c2743a0 --- /dev/null +++ b/dlls/combase/usrmarshal.c @@ -0,0 +1,231 @@ +/* + * Marshaling Routines + * + * Copyright 2005 Robert Shearman + * Copyright 2009 Huw Davies + * + * 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 + */ + +#define COBJMACROS +#define NONAMELESSUNION + +#include "ole2.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +#define ALIGNED_LENGTH(_Len, _Align) (((_Len)+(_Align))&~(_Align)) +#define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align)) +#define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align) +#define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align) + +static const char* debugstr_user_flags(ULONG *pFlags) +{ + char buf[12]; + const char* loword; + switch (LOWORD(*pFlags)) + { + case MSHCTX_LOCAL: + loword = "MSHCTX_LOCAL"; + break; + case MSHCTX_NOSHAREDMEM: + loword = "MSHCTX_NOSHAREDMEM"; + break; + case MSHCTX_DIFFERENTMACHINE: + loword = "MSHCTX_DIFFERENTMACHINE"; + break; + case MSHCTX_INPROC: + loword = "MSHCTX_INPROC"; + break; + default: + sprintf(buf, "%d", LOWORD(*pFlags)); + loword=buf; + } + + if (HIWORD(*pFlags) == NDR_LOCAL_DATA_REPRESENTATION) + return wine_dbg_sprintf("MAKELONG(%s, NDR_LOCAL_DATA_REPRESENTATION)", loword); + else + return wine_dbg_sprintf("MAKELONG(%s, 0x%04x)", loword, HIWORD(*pFlags)); +} + +/****************************************************************************** + * WdtpInterfacePointer_UserSize (combase.@) + * + * Calculates the buffer size required to marshal an interface pointer. + * + * PARAMS + * pFlags [I] Flags. See notes. + * RealFlags [I] The MSHCTX to use when marshaling the interface. + * punk [I] Interface pointer to size. + * StartingSize [I] Starting size of the buffer. This value is added on to + * the buffer size required for the clip format. + * riid [I] ID of interface to size. + * + * RETURNS + * The buffer size required to marshal an interface pointer plus the starting size. + * + * NOTES + * Even though the function is documented to take a pointer to a ULONG in + * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which + * the first parameter is a ULONG. + */ +ULONG __RPC_USER WdtpInterfacePointer_UserSize(ULONG *pFlags, ULONG RealFlags, ULONG StartingSize, IUnknown *punk, REFIID riid) +{ + DWORD marshal_size = 0; + HRESULT hr; + + TRACE("%s, %#x, %u, %p, %s.\n", debugstr_user_flags(pFlags), RealFlags, StartingSize, punk, debugstr_guid(riid)); + + hr = CoGetMarshalSizeMax(&marshal_size, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL); + if (FAILED(hr)) return StartingSize; + + ALIGN_LENGTH(StartingSize, 3); + StartingSize += 2 * sizeof(DWORD); + return StartingSize + marshal_size; +} + +/****************************************************************************** + * WdtpInterfacePointer_UserMarshal (combase.@) + * + * Marshals an interface pointer into a buffer. + * + * PARAMS + * pFlags [I] Flags. See notes. + * RealFlags [I] The MSHCTX to use when marshaling the interface. + * pBuffer [I] Buffer to marshal the clip format into. + * punk [I] Interface pointer to marshal. + * riid [I] ID of interface to marshal. + * + * RETURNS + * The end of the marshaled data in the buffer. + * + * NOTES + * Even though the function is documented to take a pointer to a ULONG in + * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which + * the first parameter is a ULONG. + */ +unsigned char * WINAPI WdtpInterfacePointer_UserMarshal(ULONG *pFlags, ULONG RealFlags, unsigned char *pBuffer, IUnknown *punk, REFIID riid) +{ + HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, 0); + IStream *stm; + DWORD size; + void *ptr; + + TRACE("%s, %#x, %p, &%p, %s.\n", debugstr_user_flags(pFlags), RealFlags, pBuffer, punk, debugstr_guid(riid)); + + if (!h) return NULL; + if (CreateStreamOnHGlobal(h, TRUE, &stm) != S_OK) + { + GlobalFree(h); + return NULL; + } + + if (CoMarshalInterface(stm, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL) != S_OK) + { + IStream_Release(stm); + return pBuffer; + } + + ALIGN_POINTER(pBuffer, 3); + size = GlobalSize(h); + + *(DWORD *)pBuffer = size; + pBuffer += sizeof(DWORD); + *(DWORD *)pBuffer = size; + pBuffer += sizeof(DWORD); + + ptr = GlobalLock(h); + memcpy(pBuffer, ptr, size); + GlobalUnlock(h); + + IStream_Release(stm); + return pBuffer + size; +} + +/****************************************************************************** + * WdtpInterfacePointer_UserUnmarshal (combase.@) + * + * Unmarshals an interface pointer from a buffer. + * + * PARAMS + * pFlags [I] Flags. See notes. + * pBuffer [I] Buffer to marshal the clip format from. + * ppunk [I/O] Address that receives the unmarshaled interface pointer. + * riid [I] ID of interface to unmarshal. + * + * RETURNS + * The end of the marshaled data in the buffer. + * + * NOTES + * Even though the function is documented to take a pointer to an ULONG in + * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which + * the first parameter is an ULONG. + */ +unsigned char * WINAPI WdtpInterfacePointer_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, IUnknown **ppunk, REFIID riid) +{ + HRESULT hr; + HGLOBAL h; + IStream *stm; + DWORD size; + void *ptr; + IUnknown *orig; + + TRACE("%s, %p, %p, %s.\n", debugstr_user_flags(pFlags), pBuffer, ppunk, debugstr_guid(riid)); + + ALIGN_POINTER(pBuffer, 3); + + size = *(DWORD *)pBuffer; + pBuffer += sizeof(DWORD); + if (size != *(DWORD *)pBuffer) + RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL); + + pBuffer += sizeof(DWORD); + + /* FIXME: sanity check on size */ + + h = GlobalAlloc(GMEM_MOVEABLE, size); + if (!h) RaiseException(RPC_X_NO_MEMORY, 0, 0, NULL); + + if (CreateStreamOnHGlobal(h, TRUE, &stm) != S_OK) + { + GlobalFree(h); + RaiseException(RPC_X_NO_MEMORY, 0, 0, NULL); + } + + ptr = GlobalLock(h); + memcpy(ptr, pBuffer, size); + GlobalUnlock(h); + + orig = *ppunk; + hr = CoUnmarshalInterface(stm, riid, (void**)ppunk); + IStream_Release(stm); + + if (hr != S_OK) RaiseException(hr, 0, 0, NULL); + + if (orig) IUnknown_Release(orig); + + return pBuffer + size; +} + +/****************************************************************************** + * WdtpInterfacePointer_UserFree (combase.@) + */ +void WINAPI WdtpInterfacePointer_UserFree(IUnknown *punk) +{ + TRACE("%p.\n", punk); + if (punk) IUnknown_Release(punk); +} diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in index 310f6fc1199..4738407d7fd 100644 --- a/dlls/ole32/Makefile.in +++ b/dlls/ole32/Makefile.in @@ -1,6 +1,6 @@ MODULE = ole32.dll IMPORTLIB = ole32 -IMPORTS = uuid advapi32 user32 gdi32 rpcrt4 +IMPORTS = uuid advapi32 user32 gdi32 combase rpcrt4 DELAYIMPORTS = oleaut32 EXTRADEFS = -D_OLE32_
diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 2c4428edf0f..e8466c20491 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -287,10 +287,10 @@ @ stub UtConvertDvtd32toDvtd16 @ stub UtGetDvtd16Info @ stub UtGetDvtd32Info -@ stdcall WdtpInterfacePointer_UserFree(ptr) -@ stdcall WdtpInterfacePointer_UserMarshal(ptr long ptr ptr ptr) -@ stdcall WdtpInterfacePointer_UserSize(ptr long long ptr ptr) -@ stdcall WdtpInterfacePointer_UserUnmarshal(ptr ptr ptr ptr) +@ stdcall WdtpInterfacePointer_UserFree(ptr) combase.WdtpInterfacePointer_UserFree +@ stdcall WdtpInterfacePointer_UserMarshal(ptr long ptr ptr ptr) combase.WdtpInterfacePointer_UserMarshal +@ stdcall WdtpInterfacePointer_UserSize(ptr long long ptr ptr) combase.WdtpInterfacePointer_UserSize +@ stdcall WdtpInterfacePointer_UserUnmarshal(ptr ptr ptr ptr) combase.WdtpInterfacePointer_UserUnmarshal @ stdcall WriteClassStg(ptr ptr) @ stdcall WriteClassStm(ptr ptr) @ stdcall WriteFmtUserTypeStg(ptr long ptr) diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c index ba318c66b62..cf07ae3cccf 100644 --- a/dlls/ole32/usrmarshal.c +++ b/dlls/ole32/usrmarshal.c @@ -48,6 +48,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); ( (DWORD)'U' | ( (DWORD)'s' << 8 ) | \ ( (DWORD)'e' << 16 ) | ( (DWORD)'r' << 24 ) )
+ULONG __RPC_USER WdtpInterfacePointer_UserSize(ULONG *pFlags, ULONG RealFlags, ULONG StartingSize, IUnknown *punk, REFIID riid); +unsigned char * WINAPI WdtpInterfacePointer_UserMarshal(ULONG *pFlags, ULONG RealFlags, unsigned char *pBuffer, + IUnknown *punk, REFIID riid); +unsigned char * WINAPI WdtpInterfacePointer_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, IUnknown **ppunk, REFIID riid); + static const char* debugstr_user_flags(ULONG *pFlags) { char buf[12]; @@ -1491,182 +1496,6 @@ void __RPC_USER HMETAFILEPICT_UserFree(ULONG *pFlags, HMETAFILEPICT *phMfp) } }
-/****************************************************************************** - * WdtpInterfacePointer_UserSize [OLE32.@] - * - * Calculates the buffer size required to marshal an interface pointer. - * - * PARAMS - * pFlags [I] Flags. See notes. - * RealFlags [I] The MSHCTX to use when marshaling the interface. - * punk [I] Interface pointer to size. - * StartingSize [I] Starting size of the buffer. This value is added on to - * the buffer size required for the clip format. - * riid [I] ID of interface to size. - * - * RETURNS - * The buffer size required to marshal an interface pointer plus the starting size. - * - * NOTES - * Even though the function is documented to take a pointer to a ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is a ULONG. - */ -ULONG __RPC_USER WdtpInterfacePointer_UserSize(ULONG *pFlags, ULONG RealFlags, ULONG StartingSize, IUnknown *punk, REFIID riid) -{ - DWORD marshal_size = 0; - HRESULT hr; - - TRACE("(%s, 0%x, %d, %p, %s)\n", debugstr_user_flags(pFlags), RealFlags, StartingSize, punk, debugstr_guid(riid)); - - hr = CoGetMarshalSizeMax(&marshal_size, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL); - if(FAILED(hr)) return StartingSize; - - ALIGN_LENGTH(StartingSize, 3); - StartingSize += 2 * sizeof(DWORD); - return StartingSize + marshal_size; -} - -/****************************************************************************** - * WdtpInterfacePointer_UserMarshal [OLE32.@] - * - * Marshals an interface pointer into a buffer. - * - * PARAMS - * pFlags [I] Flags. See notes. - * RealFlags [I] The MSHCTX to use when marshaling the interface. - * pBuffer [I] Buffer to marshal the clip format into. - * punk [I] Interface pointer to marshal. - * riid [I] ID of interface to marshal. - * - * RETURNS - * The end of the marshaled data in the buffer. - * - * NOTES - * Even though the function is documented to take a pointer to a ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is a ULONG. - */ -unsigned char * WINAPI WdtpInterfacePointer_UserMarshal(ULONG *pFlags, ULONG RealFlags, unsigned char *pBuffer, IUnknown *punk, REFIID riid) -{ - HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, 0); - IStream *stm; - DWORD size; - void *ptr; - - TRACE("(%s, 0x%x, %p, &%p, %s)\n", debugstr_user_flags(pFlags), RealFlags, pBuffer, punk, debugstr_guid(riid)); - - if(!h) return NULL; - if(CreateStreamOnHGlobal(h, TRUE, &stm) != S_OK) - { - GlobalFree(h); - return NULL; - } - - if(CoMarshalInterface(stm, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL) != S_OK) - { - IStream_Release(stm); - return pBuffer; - } - - ALIGN_POINTER(pBuffer, 3); - size = GlobalSize(h); - - *(DWORD *)pBuffer = size; - pBuffer += sizeof(DWORD); - *(DWORD *)pBuffer = size; - pBuffer += sizeof(DWORD); - - ptr = GlobalLock(h); - memcpy(pBuffer, ptr, size); - GlobalUnlock(h); - - IStream_Release(stm); - return pBuffer + size; -} - -/****************************************************************************** - * WdtpInterfacePointer_UserUnmarshal [OLE32.@] - * - * Unmarshals an interface pointer from a buffer. - * - * PARAMS - * pFlags [I] Flags. See notes. - * pBuffer [I] Buffer to marshal the clip format from. - * ppunk [I/O] Address that receives the unmarshaled interface pointer. - * riid [I] ID of interface to unmarshal. - * - * RETURNS - * The end of the marshaled data in the buffer. - * - * NOTES - * Even though the function is documented to take a pointer to an ULONG in - * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which - * the first parameter is an ULONG. - */ -unsigned char * WINAPI WdtpInterfacePointer_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, IUnknown **ppunk, REFIID riid) -{ - HRESULT hr; - HGLOBAL h; - IStream *stm; - DWORD size; - void *ptr; - IUnknown *orig; - - TRACE("(%s, %p, %p, %s)\n", debugstr_user_flags(pFlags), pBuffer, ppunk, debugstr_guid(riid)); - - ALIGN_POINTER(pBuffer, 3); - - size = *(DWORD *)pBuffer; - pBuffer += sizeof(DWORD); - if(size != *(DWORD *)pBuffer) - RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL); - - pBuffer += sizeof(DWORD); - - /* FIXME: sanity check on size */ - - h = GlobalAlloc(GMEM_MOVEABLE, size); - if(!h) RaiseException(RPC_X_NO_MEMORY, 0, 0, NULL); - - if(CreateStreamOnHGlobal(h, TRUE, &stm) != S_OK) - { - GlobalFree(h); - RaiseException(RPC_X_NO_MEMORY, 0, 0, NULL); - } - - ptr = GlobalLock(h); - memcpy(ptr, pBuffer, size); - GlobalUnlock(h); - - orig = *ppunk; - hr = CoUnmarshalInterface(stm, riid, (void**)ppunk); - IStream_Release(stm); - - if(hr != S_OK) RaiseException(hr, 0, 0, NULL); - - if(orig) IUnknown_Release(orig); - - return pBuffer + size; -} - -/****************************************************************************** - * WdtpInterfacePointer_UserFree [OLE32.@] - * - * Releases an unmarshaled interface pointer. - * - * PARAMS - * punk [I] Interface pointer to release. - * - * RETURNS - * Nothing. - */ -void WINAPI WdtpInterfacePointer_UserFree(IUnknown *punk) -{ - TRACE("(%p)\n", punk); - if(punk) IUnknown_Release(punk); -} - /****************************************************************************** * STGMEDIUM_UserSize [OLE32.@] *
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.spec | 4 +++ dlls/combase/usrmarshal.c | 74 +++++++++++++++++++++++++++++++++++++++ dlls/ole32/ole32.spec | 8 ++--- dlls/ole32/usrmarshal.c | 1 - 4 files changed, 82 insertions(+), 5 deletions(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index b5ca117717c..480f29d1d2b 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -189,6 +189,10 @@ @ stub HSTRING_UserSize64 @ stub HSTRING_UserUnmarshal @ stub HSTRING_UserUnmarshal64 +@ stdcall HWND_UserFree(ptr ptr) +@ stdcall HWND_UserMarshal(ptr ptr ptr) +@ stdcall HWND_UserSize(ptr long ptr) +@ stdcall HWND_UserUnmarshal(ptr ptr ptr) @ stub HkOleRegisterObject @ stdcall IIDFromString(wstr ptr) ole32.IIDFromString @ stub InternalAppInvokeExceptionFilter diff --git a/dlls/combase/usrmarshal.c b/dlls/combase/usrmarshal.c index 3fc7c2743a0..91f389916fe 100644 --- a/dlls/combase/usrmarshal.c +++ b/dlls/combase/usrmarshal.c @@ -62,6 +62,80 @@ static const char* debugstr_user_flags(ULONG *pFlags) return wine_dbg_sprintf("MAKELONG(%s, 0x%04x)", loword, HIWORD(*pFlags)); }
+static ULONG handle_UserSize(ULONG *pFlags, ULONG StartingSize, HANDLE *handle) +{ + if (LOWORD(*pFlags) == MSHCTX_DIFFERENTMACHINE) + { + ERR("can't remote a local handle\n"); + RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL); + return StartingSize; + } + + ALIGN_LENGTH(StartingSize, 3); + return StartingSize + sizeof(RemotableHandle); +} + +static unsigned char * handle_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HANDLE *handle) +{ + RemotableHandle *remhandle; + if (LOWORD(*pFlags) == MSHCTX_DIFFERENTMACHINE) + { + ERR("can't remote a local handle\n"); + RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL); + return pBuffer; + } + + ALIGN_POINTER(pBuffer, 3); + remhandle = (RemotableHandle *)pBuffer; + remhandle->fContext = WDT_INPROC_CALL; + remhandle->u.hInproc = (LONG_PTR)*handle; + return pBuffer + sizeof(RemotableHandle); +} + +static unsigned char * handle_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HANDLE *handle) +{ + RemotableHandle *remhandle; + + ALIGN_POINTER(pBuffer, 3); + remhandle = (RemotableHandle *)pBuffer; + if (remhandle->fContext != WDT_INPROC_CALL) + RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL); + *handle = (HANDLE)(LONG_PTR)remhandle->u.hInproc; + return pBuffer + sizeof(RemotableHandle); +} + +static void handle_UserFree(ULONG *pFlags, HANDLE *handle) +{ + /* nothing to do */ +} + +#define IMPL_WIREM_HANDLE(type) \ + ULONG __RPC_USER type##_UserSize(ULONG *pFlags, ULONG StartingSize, type *handle) \ + { \ + TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, handle); \ + return handle_UserSize(pFlags, StartingSize, (HANDLE *)handle); \ + } \ + \ + unsigned char * __RPC_USER type##_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, type *handle) \ + { \ + TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags), pBuffer, *handle); \ + return handle_UserMarshal(pFlags, pBuffer, (HANDLE *)handle); \ + } \ + \ + unsigned char * __RPC_USER type##_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, type *handle) \ + { \ + TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, handle); \ + return handle_UserUnmarshal(pFlags, pBuffer, (HANDLE *)handle); \ + } \ + \ + void __RPC_USER type##_UserFree(ULONG *pFlags, type *handle) \ + { \ + TRACE("(%s, &%p\n", debugstr_user_flags(pFlags), *handle); \ + handle_UserFree(pFlags, (HANDLE *)handle); \ + } + +IMPL_WIREM_HANDLE(HWND) + /****************************************************************************** * WdtpInterfacePointer_UserSize (combase.@) * diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index e8466c20491..f41f010fdd0 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -167,10 +167,10 @@ @ stdcall HPALETTE_UserMarshal(ptr ptr ptr) @ stdcall HPALETTE_UserSize(ptr long ptr) @ stdcall HPALETTE_UserUnmarshal(ptr ptr ptr) -@ stdcall HWND_UserFree(ptr ptr) -@ stdcall HWND_UserMarshal(ptr ptr ptr) -@ stdcall HWND_UserSize(ptr long ptr) -@ stdcall HWND_UserUnmarshal(ptr ptr ptr) +@ stdcall HWND_UserFree(ptr ptr) combase.HWND_UserFree +@ stdcall HWND_UserMarshal(ptr ptr ptr) combase.HWND_UserMarshal +@ stdcall HWND_UserSize(ptr long ptr) combase.HWND_UserSize +@ stdcall HWND_UserUnmarshal(ptr ptr ptr) combase.HWND_UserUnmarshal @ stdcall IIDFromString(wstr ptr) @ stub I_RemoteMain @ stdcall IsAccelerator(long long ptr ptr) diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c index cf07ae3cccf..add6ba759eb 100644 --- a/dlls/ole32/usrmarshal.c +++ b/dlls/ole32/usrmarshal.c @@ -356,7 +356,6 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle)
IMPL_WIREM_HANDLE(HACCEL) IMPL_WIREM_HANDLE(HMENU) -IMPL_WIREM_HANDLE(HWND) IMPL_WIREM_HANDLE(HDC) IMPL_WIREM_HANDLE(HICON) IMPL_WIREM_HANDLE(HBRUSH)
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=76219
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
ole32: clipboard.c:1159: Test failed: got 800401d0 clipboard.c:1175: Test failed: got 800401d0 clipboard.c:1182: Test failed: data objects match clipboard.c:1185: Test failed: Failed to clear clipboard, hr 0x800401d0. clipboard.c:1190: Test failed: data objects match clipboard.c:1191: Test failed: data objects match clipboard.c:1201: Test failed: got 800401d0 clipboard.c:1213: Test failed: got 800401d0 clipboard.c:1214: Test failed: GetData not called clipboard.c:1217: Test failed: 1 1 clipboard.c:1223: Test failed: got 800401d0 clipboard.c:1224: Test failed: GetData not called clipboard.c:1228: Test failed: 1 clipboard.c:1239: Test failed: got 800401d0 clipboard.c:1250: 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 (32 bit WoW report) ===
ole32: clipboard.c:1051: Test failed: OleIsCurrentClipboard returned 0 clipboard.c:1119: Test failed: 1 WM_DRAWCLIPBOARD received
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.spec | 4 ++++ dlls/combase/usrmarshal.c | 1 + dlls/ole32/ole32.spec | 8 ++++---- dlls/ole32/usrmarshal.c | 1 - 4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 480f29d1d2b..6c6441b307e 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -181,6 +181,10 @@ @ stdcall GetHGlobalFromStream(ptr ptr) ole32.GetHGlobalFromStream @ stub GetHookInterface @ stdcall GetRestrictedErrorInfo(ptr) +@ stdcall HDC_UserFree(ptr ptr) +@ stdcall HDC_UserMarshal(ptr ptr ptr) +@ stdcall HDC_UserSize(ptr long ptr) +@ stdcall HDC_UserUnmarshal(ptr ptr ptr) @ stub HSTRING_UserFree @ stub HSTRING_UserFree64 @ stub HSTRING_UserMarshal diff --git a/dlls/combase/usrmarshal.c b/dlls/combase/usrmarshal.c index 91f389916fe..632c06a5b2b 100644 --- a/dlls/combase/usrmarshal.c +++ b/dlls/combase/usrmarshal.c @@ -134,6 +134,7 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle) handle_UserFree(pFlags, (HANDLE *)handle); \ }
+IMPL_WIREM_HANDLE(HDC) IMPL_WIREM_HANDLE(HWND)
/****************************************************************************** diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index f41f010fdd0..31be1c3e13c 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -135,10 +135,10 @@ @ stdcall HBRUSH_UserMarshal(ptr ptr ptr) @ stdcall HBRUSH_UserSize(ptr long ptr) @ stdcall HBRUSH_UserUnmarshal(ptr ptr ptr) -@ stdcall HDC_UserFree(ptr ptr) -@ stdcall HDC_UserMarshal(ptr ptr ptr) -@ stdcall HDC_UserSize(ptr long ptr) -@ stdcall HDC_UserUnmarshal(ptr ptr ptr) +@ stdcall HDC_UserFree(ptr ptr) combase.HDC_UserFree +@ stdcall HDC_UserMarshal(ptr ptr ptr) combase.HDC_UserMarshal +@ stdcall HDC_UserSize(ptr long ptr) combase.HDC_UserSize +@ stdcall HDC_UserUnmarshal(ptr ptr ptr) combase.HDC_UserUnmarshal @ stdcall HENHMETAFILE_UserFree(ptr ptr) @ stdcall HENHMETAFILE_UserMarshal(ptr ptr ptr) @ stdcall HENHMETAFILE_UserSize(ptr long ptr) diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c index add6ba759eb..826c9b7cf73 100644 --- a/dlls/ole32/usrmarshal.c +++ b/dlls/ole32/usrmarshal.c @@ -356,7 +356,6 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle)
IMPL_WIREM_HANDLE(HACCEL) IMPL_WIREM_HANDLE(HMENU) -IMPL_WIREM_HANDLE(HDC) IMPL_WIREM_HANDLE(HICON) IMPL_WIREM_HANDLE(HBRUSH)
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=76220
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:1544: Test failed: got 00000000 clipboard.c:1585: Test failed: tymed 1 clipboard.c:1588: Test failed: got 00000001 clipboard.c:1589: Test failed: cf 0001 clipboard.c:1593: Test failed: tymed 1 clipboard.c:1596: Test failed: got 00000001 clipboard.c:1597: Test failed: cf 0001 clipboard.c:1601: Test failed: tymed 1 clipboard.c:1604: Test failed: got 00000001 clipboard.c:1605: Test failed: cf 0001 clipboard.c:1609: Test failed: tymed 1 clipboard.c:1612: Test failed: got 00000001 clipboard.c:1614: Test failed: cf 0001 clipboard.c:1621: Test failed: got 00000001 clipboard.c:1623: Test failed: cf 0001 clipboard.c:1627: Test failed: tymed 1 clipboard.c:1630: Test failed: got 00000001 clipboard.c:1631: Test failed: cf 0001 clipboard.c:1635: Test failed: tymed 1 clipboard.c:1638: Test failed: got 00000001 clipboard.c:1639: Test failed: cf 0001 clipboard.c:1643: Test failed: tymed 1 clipboard.c:1658: Test failed: got 80040069 clipboard.c:1659: Test failed: got 0
=== debiant (64 bit WoW report) ===
ole32: clipboard.c:1159: Test failed: got 800401d0 clipboard.c:1175: Test failed: got 800401d0 clipboard.c:1182: Test failed: data objects match clipboard.c:1185: Test failed: Failed to clear clipboard, hr 0x800401d0. clipboard.c:1190: Test failed: data objects match clipboard.c:1191: Test failed: data objects match clipboard.c:1201: Test failed: got 800401d0 clipboard.c:1213: Test failed: got 800401d0 clipboard.c:1214: Test failed: GetData not called clipboard.c:1217: Test failed: 1 1 clipboard.c:1223: Test failed: got 800401d0 clipboard.c:1224: Test failed: GetData not called clipboard.c:1228: Test failed: 1 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:1266: Test failed: Failed to clear clipboard, hr 0x800401d0. clipboard.c:1269: Test failed: 1 clipboard.c:1281: Test failed: Failed to clear clipboard, hr 0x800401d0. clipboard.c:1283: Test failed: 1 1 clipboard.c:1287: Test failed: 1
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.spec | 4 ++++ dlls/combase/usrmarshal.c | 1 + dlls/ole32/ole32.spec | 8 ++++---- dlls/ole32/usrmarshal.c | 1 - 4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 6c6441b307e..9d4888d0051 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -185,6 +185,10 @@ @ stdcall HDC_UserMarshal(ptr ptr ptr) @ stdcall HDC_UserSize(ptr long ptr) @ stdcall HDC_UserUnmarshal(ptr ptr ptr) +@ stdcall HMENU_UserFree(ptr ptr) +@ stdcall HMENU_UserMarshal(ptr ptr ptr) +@ stdcall HMENU_UserSize(ptr long ptr) +@ stdcall HMENU_UserUnmarshal(ptr ptr ptr) @ stub HSTRING_UserFree @ stub HSTRING_UserFree64 @ stub HSTRING_UserMarshal diff --git a/dlls/combase/usrmarshal.c b/dlls/combase/usrmarshal.c index 632c06a5b2b..6934e588a24 100644 --- a/dlls/combase/usrmarshal.c +++ b/dlls/combase/usrmarshal.c @@ -135,6 +135,7 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle) }
IMPL_WIREM_HANDLE(HDC) +IMPL_WIREM_HANDLE(HMENU) IMPL_WIREM_HANDLE(HWND)
/****************************************************************************** diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 31be1c3e13c..b0489cb0cef 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -151,10 +151,10 @@ @ stdcall HICON_UserMarshal(ptr ptr ptr) @ stdcall HICON_UserSize(ptr long ptr) @ stdcall HICON_UserUnmarshal(ptr ptr ptr) -@ stdcall HMENU_UserFree(ptr ptr) -@ stdcall HMENU_UserMarshal(ptr ptr ptr) -@ stdcall HMENU_UserSize(ptr long ptr) -@ stdcall HMENU_UserUnmarshal(ptr ptr ptr) +@ stdcall HMENU_UserFree(ptr ptr) combase.HMENU_UserFree +@ stdcall HMENU_UserMarshal(ptr ptr ptr) combase.HMENU_UserMarshal +@ stdcall HMENU_UserSize(ptr long ptr) combase.HMENU_UserSize +@ stdcall HMENU_UserUnmarshal(ptr ptr ptr) combase.HMENU_UserUnmarshal @ stdcall HMETAFILEPICT_UserFree(ptr ptr) @ stdcall HMETAFILEPICT_UserMarshal(ptr ptr ptr) @ stdcall HMETAFILEPICT_UserSize(ptr long ptr) diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c index 826c9b7cf73..86793a89965 100644 --- a/dlls/ole32/usrmarshal.c +++ b/dlls/ole32/usrmarshal.c @@ -355,7 +355,6 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle) }
IMPL_WIREM_HANDLE(HACCEL) -IMPL_WIREM_HANDLE(HMENU) IMPL_WIREM_HANDLE(HICON) IMPL_WIREM_HANDLE(HBRUSH)
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=76221
Your paranoid android.
=== debiant (64 bit WoW report) ===
ole32: clipboard.c:1651: Test failed: got 800401d0 clipboard.c:1653: Test failed: got 0 clipboard.c:1658: Test failed: got 800401d0 clipboard.c:1659: Test failed: got 0 clipboard.c:1665: Test failed: gle 5 clipboard.c:1667: Test failed: gle 1418 clipboard.c:1669: Test failed: gle 1418
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.spec | 4 ++++ dlls/combase/usrmarshal.c | 1 + dlls/ole32/ole32.spec | 8 ++++---- dlls/ole32/usrmarshal.c | 1 - 4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 9d4888d0051..c2342cc9f88 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -185,6 +185,10 @@ @ stdcall HDC_UserMarshal(ptr ptr ptr) @ stdcall HDC_UserSize(ptr long ptr) @ stdcall HDC_UserUnmarshal(ptr ptr ptr) +@ stdcall HICON_UserFree(ptr ptr) +@ stdcall HICON_UserMarshal(ptr ptr ptr) +@ stdcall HICON_UserSize(ptr long ptr) +@ stdcall HICON_UserUnmarshal(ptr ptr ptr) @ stdcall HMENU_UserFree(ptr ptr) @ stdcall HMENU_UserMarshal(ptr ptr ptr) @ stdcall HMENU_UserSize(ptr long ptr) diff --git a/dlls/combase/usrmarshal.c b/dlls/combase/usrmarshal.c index 6934e588a24..08328cc673f 100644 --- a/dlls/combase/usrmarshal.c +++ b/dlls/combase/usrmarshal.c @@ -135,6 +135,7 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle) }
IMPL_WIREM_HANDLE(HDC) +IMPL_WIREM_HANDLE(HICON) IMPL_WIREM_HANDLE(HMENU) IMPL_WIREM_HANDLE(HWND)
diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index b0489cb0cef..03697c3e8de 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -147,10 +147,10 @@ @ stdcall HGLOBAL_UserMarshal(ptr ptr ptr) @ stdcall HGLOBAL_UserSize(ptr long ptr) @ stdcall HGLOBAL_UserUnmarshal(ptr ptr ptr) -@ stdcall HICON_UserFree(ptr ptr) -@ stdcall HICON_UserMarshal(ptr ptr ptr) -@ stdcall HICON_UserSize(ptr long ptr) -@ stdcall HICON_UserUnmarshal(ptr ptr ptr) +@ stdcall HICON_UserFree(ptr ptr) combase.HICON_UserFree +@ stdcall HICON_UserMarshal(ptr ptr ptr) combase.HICON_UserMarshal +@ stdcall HICON_UserSize(ptr long ptr) combase.HICON_UserSize +@ stdcall HICON_UserUnmarshal(ptr ptr ptr) combase.HICON_UserUnmarshal @ stdcall HMENU_UserFree(ptr ptr) combase.HMENU_UserFree @ stdcall HMENU_UserMarshal(ptr ptr ptr) combase.HMENU_UserMarshal @ stdcall HMENU_UserSize(ptr long ptr) combase.HMENU_UserSize diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c index 86793a89965..6898517568b 100644 --- a/dlls/ole32/usrmarshal.c +++ b/dlls/ole32/usrmarshal.c @@ -355,7 +355,6 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle) }
IMPL_WIREM_HANDLE(HACCEL) -IMPL_WIREM_HANDLE(HICON) IMPL_WIREM_HANDLE(HBRUSH)
/******************************************************************************
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=76222
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
ole32: clipboard.c:1373: Test failed: got 800401d0 clipboard.c:1374: Test failed: got 0 clipboard.c:1379: Test failed: got 800401d0 clipboard.c:1380: Test failed: got 0 clipboard.c:1387: Test failed: got 800401d0 clipboard.c:1388: Test failed: got 0 clipboard.c:1398: Test failed: got 800401d0 clipboard.c:1399: Test failed: got 0
=== debiant (32 bit WoW report) ===
ole32: clipboard.c:1051: Test failed: OleIsCurrentClipboard returned 0 clipboard.c:1119: Test failed: 1 WM_DRAWCLIPBOARD received
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=76218
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
ole32: clipboard.c:1185: Test failed: Failed to clear clipboard, hr 0x800401d0. clipboard.c:1191: Test failed: data objects match
=== debiant (64 bit WoW 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:1544: Test failed: got 00000000 clipboard.c:1585: Test failed: tymed 1 clipboard.c:1588: Test failed: got 00000001 clipboard.c:1589: Test failed: cf 0001 clipboard.c:1593: Test failed: tymed 1 clipboard.c:1596: Test failed: got 00000001 clipboard.c:1597: Test failed: cf 0001 clipboard.c:1601: Test failed: tymed 1 clipboard.c:1604: Test failed: got 00000001 clipboard.c:1605: Test failed: cf 0001 clipboard.c:1609: Test failed: tymed 1 clipboard.c:1612: Test failed: got 00000001 clipboard.c:1614: Test failed: cf 0001 clipboard.c:1621: Test failed: got 00000001 clipboard.c:1623: Test failed: cf 0001 clipboard.c:1627: Test failed: tymed 1 clipboard.c:1630: Test failed: got 00000001 clipboard.c:1631: Test failed: cf 0001 clipboard.c:1635: Test failed: tymed 1 clipboard.c:1638: Test failed: got 00000001 clipboard.c:1639: Test failed: cf 0001 clipboard.c:1643: Test failed: tymed 1 clipboard.c:1658: Test failed: got 80040069 clipboard.c:1659: Test failed: got 0
Clipboard tests are not very stable, it didn't start with this patch.