diff --git a/dlls/rpcrt4/Makefile.in b/dlls/rpcrt4/Makefile.in index 301feeafa3..d167fb952d 100644 --- a/dlls/rpcrt4/Makefile.in +++ b/dlls/rpcrt4/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ cproxy.c \ cpsf.c \ cstub.c \ + ndr_marshall.c \ ndr_midl.c \ ndr_ole.c \ ndr_stubless.c \ diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c new file mode 100644 index 0000000000..12d5511889 --- /dev/null +++ b/dlls/rpcrt4/ndr_marshall.c @@ -0,0 +1,74 @@ +/* + * NDR data marshalling + * + * Copyright 2002 Greg Turner + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * TODO: + * - figure out whether we *really* got this right + * - check for errors and throw exceptions + */ + +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winreg.h" + +#include "wine/obj_base.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +/*********************************************************************** + * NdrConformantStringMarshall [RPCRT4.@] + */ +unsigned char *WINAPI NdrConformantStringMarshall(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pszMessage, + PFORMAT_STRING pFormat) +{ + FIXME("stub\n"); + return NULL; +} + +/*********************************************************************** + * NdrConformantStringBufferSize [RPCRT4.@] + */ +void WINAPI NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +{ + FIXME("stub\n"); +} + +/************************************************************************ + * NdrConformantStringMemorySize [RPCRT4.@] + */ +unsigned long WINAPI NdrConformantStringMemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat ) +{ + FIXME("stub\n"); + return 0; +} + +/************************************************************************ + * NdrConformantStringUnmarshall [RPCRT4.@] + */ +unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, + PFORMAT_STRING pFormat, unsigned char fMustAlloc ) +{ + FIXME("stub\n"); + return 0; +} diff --git a/dlls/rpcrt4/ndr_midl.c b/dlls/rpcrt4/ndr_midl.c index 05eb3b6870..5fa2aa2231 100644 --- a/dlls/rpcrt4/ndr_midl.c +++ b/dlls/rpcrt4/ndr_midl.c @@ -177,16 +177,6 @@ void WINAPI NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE FIXME("stub\n"); } -/*********************************************************************** - * NdrConformantStringMarshall [RPCRT4.@] - */ -unsigned char *WINAPI NdrConformantStringMarshall(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pszMessage, - PFORMAT_STRING pFormat) -{ - FIXME("stub\n"); - return NULL; -} - /*********************************************************************** * NdrGetBuffer [RPCRT4.@] */ diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index ffed0310a9..640c3786b4 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -297,10 +297,10 @@ init RPCRT4_LibMain @ stub NdrConformantArrayMarshall @ stub NdrConformantArrayMemorySize @ stub NdrConformantArrayUnmarshall -@ stub NdrConformantStringBufferSize +@ stdcall NdrConformantStringBufferSize(ptr ptr ptr) NdrConformantStringBufferSize @ stdcall NdrConformantStringMarshall(ptr ptr ptr) NdrConformantStringMarshall -@ stub NdrConformantStringMemorySize -@ stub NdrConformantStringUnmarshall +@ stdcall NdrConformantStringMemorySize(ptr ptr) NdrConformantStringMemorySize +@ stdcall NdrConformantStringUnmarshall(ptr ptr ptr long) NdrConformantStringUnmarshall @ stub NdrConformantStructBufferSize @ stub NdrConformantStructFree @ stub NdrConformantStructMarshall diff --git a/include/rpcndr.h b/include/rpcndr.h index 9e1f9dc3f3..d7d4dc8ad2 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -240,7 +240,7 @@ RPCRTAPI void RPC_ENTRY NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar ); /* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */ -#define TYPE_MARSHAL(type) \ +#define SIMPLE_TYPE_MARSHAL(type) \ RPCRTAPI unsigned char* RPC_ENTRY \ Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \ RPCRTAPI unsigned char* RPC_ENTRY \ @@ -248,7 +248,10 @@ RPCRTAPI unsigned char* RPC_ENTRY \ RPCRTAPI void RPC_ENTRY \ Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \ RPCRTAPI unsigned long RPC_ENTRY \ - Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat ); \ + Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat ); + +#define TYPE_MARSHAL(type) \ + SIMPLE_TYPE_MARSHAL(type) \ RPCRTAPI void RPC_ENTRY \ Ndr##type##Free( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); @@ -269,7 +272,11 @@ TYPE_MARSHAL(XmitOrRepAs) TYPE_MARSHAL(UserMarshal) TYPE_MARSHAL(InterfacePointer) +SIMPLE_TYPE_MARSHAL(ConformantString) +SIMPLE_TYPE_MARSHAL(NonConformantString) + #undef TYPE_MARSHAL +#undef SIMPLE_TYPE_MARSHAL RPCRTAPI void RPC_ENTRY NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, long NumberParams ); @@ -299,9 +306,6 @@ RPCRTAPI void RPC_ENTRY RPCRTAPI void RPC_ENTRY NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, int unknown ); -RPCRTAPI unsigned char* RPC_ENTRY - NdrConformantStringMarshall( MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pszMessage, - PFORMAT_STRING pFormat); RPCRTAPI unsigned char* RPC_ENTRY NdrGetBuffer( MIDL_STUB_MESSAGE *stubmsg, unsigned long buflen, RPC_BINDING_HANDLE handle ); RPCRTAPI void RPC_ENTRY