combase: Move HACCEL marshalling functions.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-08-04 17:02:37 +03:00 committed by Alexandre Julliard
parent f6f9dd81a7
commit 4ae64d59de
4 changed files with 9 additions and 78 deletions

View File

@ -185,6 +185,10 @@
@ stdcall GetHGlobalFromStream(ptr ptr) ole32.GetHGlobalFromStream
@ stub GetHookInterface
@ stdcall GetRestrictedErrorInfo(ptr)
@ stdcall HACCEL_UserFree(ptr ptr)
@ stdcall HACCEL_UserMarshal(ptr ptr ptr)
@ stdcall HACCEL_UserSize(ptr long ptr)
@ stdcall HACCEL_UserUnmarshal(ptr ptr ptr)
@ stdcall HBITMAP_UserFree(ptr ptr)
@ stdcall HBITMAP_UserMarshal(ptr ptr ptr)
@ stdcall HBITMAP_UserSize(ptr long ptr)

View File

@ -134,6 +134,7 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *handle)
handle_UserFree(pFlags, (HANDLE *)handle); \
}
IMPL_WIREM_HANDLE(HACCEL)
IMPL_WIREM_HANDLE(HBRUSH)
IMPL_WIREM_HANDLE(HDC)
IMPL_WIREM_HANDLE(HICON)

View File

@ -123,10 +123,10 @@
@ stdcall GetHGlobalFromStream(ptr ptr)
@ stub GetHookInterface
@ stdcall GetRunningObjectTable(long ptr)
@ stdcall HACCEL_UserFree(ptr ptr)
@ stdcall HACCEL_UserMarshal(ptr ptr ptr)
@ stdcall HACCEL_UserSize(ptr long ptr)
@ stdcall HACCEL_UserUnmarshal(ptr ptr ptr)
@ stdcall HACCEL_UserFree(ptr ptr) combase.HACCEL_UserFree
@ stdcall HACCEL_UserMarshal(ptr ptr ptr) combase.HACCEL_UserMarshal
@ stdcall HACCEL_UserSize(ptr long ptr) combase.HACCEL_UserSize
@ stdcall HACCEL_UserUnmarshal(ptr ptr ptr) combase.HACCEL_UserUnmarshal
@ stdcall HBITMAP_UserFree(ptr ptr) combase.HBITMAP_UserFree
@ stdcall HBITMAP_UserMarshal(ptr ptr ptr) combase.HBITMAP_UserMarshal
@ stdcall HBITMAP_UserSize(ptr long ptr) combase.HBITMAP_UserSize

View File

@ -82,80 +82,6 @@ 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(HACCEL)
/******************************************************************************
* HMETAFILE_UserSize [OLE32.@]
*