Sync to Wine-0_9_10:

Robert Shearman <rob@codeweavers.com>
- ndrtypes.h added into reactos/include
- too many changes to paste here. Look at the url below, checking all changes done after Wine-0_9_5 tag (including Wine-0_9_10 as the last one)
- http://cvs.winehq.com/cvsweb/wine/dlls/rpcrt4/?cvsroot=home/wine

svn path=/trunk/; revision=21362
This commit is contained in:
Aleksey Bragin 2006-03-20 21:52:24 +00:00
parent 1e8013cf73
commit 43a02bfa45
14 changed files with 1807 additions and 241 deletions

View file

@ -104,7 +104,7 @@ static HRESULT WINAPI ObjectStubless(DWORD index)
unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST;
TRACE("(%p)->(%ld)([%d bytes]) ret=%08lx\n", iface, index, bytes, *(DWORD*)(args+bytes)); TRACE("(%p)->(%ld)([%d bytes]) ret=%08lx\n", iface, index, bytes, *(DWORD*)(args+bytes));
return RPCRT4_NdrClientCall2(This->stubless->pStubDesc, fs, args); return NdrClientCall2(This->stubless->pStubDesc, fs, args);
} }
#else /* __i386__ */ #else /* __i386__ */
@ -119,20 +119,21 @@ struct StublessThunk { int dummy; };
HRESULT WINAPI StdProxy_Construct(REFIID riid, HRESULT WINAPI StdProxy_Construct(REFIID riid,
LPUNKNOWN pUnkOuter, LPUNKNOWN pUnkOuter,
PCInterfaceName name, const ProxyFileInfo *ProxyInfo,
CInterfaceProxyVtbl *vtbl, int Index,
CInterfaceStubVtbl *svtbl,
LPPSFACTORYBUFFER pPSFactory, LPPSFACTORYBUFFER pPSFactory,
LPRPCPROXYBUFFER *ppProxy, LPRPCPROXYBUFFER *ppProxy,
LPVOID *ppvObj) LPVOID *ppvObj)
{ {
StdProxyImpl *This; StdProxyImpl *This;
const MIDL_STUBLESS_PROXY_INFO *stubless = NULL; const MIDL_STUBLESS_PROXY_INFO *stubless = NULL;
PCInterfaceName name = ProxyInfo->pNamesArray[Index];
CInterfaceProxyVtbl *vtbl = ProxyInfo->pProxyVtblList[Index];
TRACE("(%p,%p,%p,%p,%p) %s\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj, name); TRACE("(%p,%p,%p,%p,%p) %s\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj, name);
/* I can't find any other way to detect stubless proxies than this hack */ /* TableVersion = 2 means it is the stubless version of CInterfaceProxyVtbl */
if (!IsEqualGUID(vtbl->header.piid, riid)) { if (ProxyInfo->TableVersion > 1) {
stubless = *(const void **)vtbl; stubless = *(const void **)vtbl;
vtbl = (CInterfaceProxyVtbl *)((const void **)vtbl + 1); vtbl = (CInterfaceProxyVtbl *)((const void **)vtbl + 1);
TRACE("stubless=%p\n", stubless); TRACE("stubless=%p\n", stubless);
@ -150,11 +151,12 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid,
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
if (stubless) { if (stubless) {
unsigned i, count = svtbl->header.DispatchTableCount; CInterfaceStubVtbl *svtbl = ProxyInfo->pStubVtblList[Index];
unsigned long i, count = svtbl->header.DispatchTableCount;
/* Maybe the original vtbl is just modified directly to point at /* Maybe the original vtbl is just modified directly to point at
* ObjectStublessClientXXX thunks in real Windows, but I don't like it * ObjectStublessClientXXX thunks in real Windows, but I don't like it
*/ */
TRACE("stubless thunks: count=%d\n", count); TRACE("stubless thunks: count=%ld\n", count);
This->thunks = HeapAlloc(GetProcessHeap(),0,sizeof(struct StublessThunk)*count); This->thunks = HeapAlloc(GetProcessHeap(),0,sizeof(struct StublessThunk)*count);
This->PVtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPVOID)*count); This->PVtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPVOID)*count);
for (i=0; i<count; i++) { for (i=0; i<count; i++) {
@ -162,7 +164,7 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid,
if (vtbl->Vtbl[i] == (LPVOID)-1) { if (vtbl->Vtbl[i] == (LPVOID)-1) {
PFORMAT_STRING fs = stubless->ProcFormatString + stubless->FormatStringOffset[i]; PFORMAT_STRING fs = stubless->ProcFormatString + stubless->FormatStringOffset[i];
unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST;
TRACE("method %d: stacksize=%d\n", i, bytes); TRACE("method %ld: stacksize=%d\n", i, bytes);
FILL_STUBLESS(thunk, i, bytes) FILL_STUBLESS(thunk, i, bytes)
This->PVtbl[i] = thunk; This->PVtbl[i] = thunk;
} }
@ -186,7 +188,11 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid,
This->pChannel = NULL; This->pChannel = NULL;
*ppProxy = (LPRPCPROXYBUFFER)&This->lpVtbl; *ppProxy = (LPRPCPROXYBUFFER)&This->lpVtbl;
*ppvObj = &This->PVtbl; *ppvObj = &This->PVtbl;
IUnknown_AddRef((IUnknown *)*ppvObj); /* if there is no outer unknown then the caller will control the lifetime
* of the proxy object through the proxy buffer, so no need to increment the
* ref count of the proxy object */
if (pUnkOuter)
IUnknown_AddRef((IUnknown *)*ppvObj);
IPSFactoryBuffer_AddRef(pPSFactory); IPSFactoryBuffer_AddRef(pPSFactory);
return S_OK; return S_OK;

View file

@ -95,9 +95,7 @@ static HRESULT WINAPI CStdPSFactory_CreateProxy(LPPSFACTORYBUFFER iface,
debugstr_guid(riid),ppProxy,ppv); debugstr_guid(riid),ppProxy,ppv);
if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index)) if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index))
return E_NOINTERFACE; return E_NOINTERFACE;
return StdProxy_Construct(riid, pUnkOuter, ProxyInfo->pNamesArray[Index], return StdProxy_Construct(riid, pUnkOuter, ProxyInfo, Index, iface, ppProxy, ppv);
ProxyInfo->pProxyVtblList[Index],
ProxyInfo->pStubVtblList[Index], iface, ppProxy, ppv);
} }
static HRESULT WINAPI CStdPSFactory_CreateStub(LPPSFACTORYBUFFER iface, static HRESULT WINAPI CStdPSFactory_CreateStub(LPPSFACTORYBUFFER iface,
@ -139,9 +137,24 @@ HRESULT WINAPI NdrDllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv,
*ppv = NULL; *ppv = NULL;
if (!pPSFactoryBuffer->lpVtbl) { if (!pPSFactoryBuffer->lpVtbl) {
const ProxyFileInfo **pProxyFileList2;
pPSFactoryBuffer->lpVtbl = &CStdPSFactory_Vtbl; pPSFactoryBuffer->lpVtbl = &CStdPSFactory_Vtbl;
pPSFactoryBuffer->RefCount = 0; pPSFactoryBuffer->RefCount = 0;
pPSFactoryBuffer->pProxyFileList = pProxyFileList; pPSFactoryBuffer->pProxyFileList = pProxyFileList;
for (pProxyFileList2 = pProxyFileList; *pProxyFileList2; pProxyFileList2++) {
int i;
for (i = 0; i < (*pProxyFileList2)->TableSize; i++) {
/* FIXME: i think that different vtables should be copied for
* async interfaces */
void * const *pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Vtbl;
void **pRpcStubVtbl = (void **)&(*pProxyFileList2)->pStubVtblList[i]->Vtbl;
int j;
for (j = 0; j < sizeof(IRpcStubBufferVtbl)/sizeof(void *); j++)
if (!pRpcStubVtbl[j])
pRpcStubVtbl[j] = pSrcRpcStubVtbl[j];
}
}
} }
if (IsEqualGUID(rclsid, pclsid)) if (IsEqualGUID(rclsid, pclsid))
return IPSFactoryBuffer_QueryInterface((LPPSFACTORYBUFFER)pPSFactoryBuffer, iid, ppv); return IPSFactoryBuffer_QueryInterface((LPPSFACTORYBUFFER)pPSFactoryBuffer, iid, ppv);

View file

@ -23,9 +23,8 @@
HRESULT WINAPI StdProxy_Construct(REFIID riid, HRESULT WINAPI StdProxy_Construct(REFIID riid,
LPUNKNOWN pUnkOuter, LPUNKNOWN pUnkOuter,
PCInterfaceName name, const ProxyFileInfo *ProxyInfo,
CInterfaceProxyVtbl *vtbl, int Index,
CInterfaceStubVtbl *svtbl,
LPPSFACTORYBUFFER pPSFactory, LPPSFACTORYBUFFER pPSFactory,
LPRPCPROXYBUFFER *ppProxy, LPRPCPROXYBUFFER *ppProxy,
LPVOID *ppvObj); LPVOID *ppvObj);
@ -43,4 +42,6 @@ HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid,
const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface); const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface);
const IRpcStubBufferVtbl CStdStubBuffer_Vtbl;
#endif /* __WINE_CPSF_H */ #endif /* __WINE_CPSF_H */

View file

@ -144,7 +144,10 @@ HRESULT WINAPI CStdStubBuffer_Invoke(LPRPCSTUBBUFFER iface,
DWORD dwPhase = STUB_UNMARSHAL; DWORD dwPhase = STUB_UNMARSHAL;
TRACE("(%p)->Invoke(%p,%p)\n",This,pMsg,pChannel); TRACE("(%p)->Invoke(%p,%p)\n",This,pMsg,pChannel);
STUB_HEADER(This).pDispatchTable[pMsg->iMethod](iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase); if (STUB_HEADER(This).pDispatchTable)
STUB_HEADER(This).pDispatchTable[pMsg->iMethod](iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase);
else /* pure interpreted */
NdrStubCall2(iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase);
return S_OK; return S_OK;
} }
@ -178,6 +181,20 @@ void WINAPI CStdStubBuffer_DebugServerRelease(LPRPCSTUBBUFFER iface,
TRACE("(%p)->DebugServerRelease(%p)\n",This,pv); TRACE("(%p)->DebugServerRelease(%p)\n",This,pv);
} }
const IRpcStubBufferVtbl CStdStubBuffer_Vtbl =
{
CStdStubBuffer_QueryInterface,
CStdStubBuffer_AddRef,
NULL,
CStdStubBuffer_Connect,
CStdStubBuffer_Disconnect,
CStdStubBuffer_Invoke,
CStdStubBuffer_IsIIDSupported,
CStdStubBuffer_CountRefs,
CStdStubBuffer_DebugServerQueryInterface,
CStdStubBuffer_DebugServerRelease
};
const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface) const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface)
{ {
CStdStubBuffer *This = (CStdStubBuffer *)iface; CStdStubBuffer *This = (CStdStubBuffer *)iface;

View file

@ -26,6 +26,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <limits.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -300,20 +301,43 @@ static void WINAPI NdrFree(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *Pointer)
pStubMsg->pfnFree(Pointer); pStubMsg->pfnFree(Pointer);
} }
static inline BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
{
return (*(const ULONG *)pFormat != -1);
}
PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
{ {
pStubMsg->MaxCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer); pStubMsg->MaxCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
pStubMsg->Buffer += 4; pStubMsg->Buffer += 4;
TRACE("unmarshalled conformance is %ld\n", pStubMsg->MaxCount); TRACE("unmarshalled conformance is %ld\n", pStubMsg->MaxCount);
return pFormat+4; if (pStubMsg->fHasNewCorrDesc)
return pFormat+6;
else
return pFormat+4;
} }
static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
{ {
if (!IsConformanceOrVariancePresent(pFormat))
{
pStubMsg->Offset = 0;
pStubMsg->ActualCount = pStubMsg->MaxCount;
goto done;
}
pStubMsg->Offset = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
pStubMsg->Buffer += 4;
TRACE("offset is %ld\n", pStubMsg->Offset);
pStubMsg->ActualCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer); pStubMsg->ActualCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
pStubMsg->Buffer += 4; pStubMsg->Buffer += 4;
TRACE("unmarshalled variance is %ld\n", pStubMsg->ActualCount); TRACE("variance is %ld\n", pStubMsg->ActualCount);
return pFormat+4;
done:
if (pStubMsg->fHasNewCorrDesc)
return pFormat+6;
else
return pFormat+4;
} }
PFORMAT_STRING ComputeConformanceOrVariance( PFORMAT_STRING ComputeConformanceOrVariance(
@ -325,8 +349,7 @@ PFORMAT_STRING ComputeConformanceOrVariance(
LPVOID ptr = NULL; LPVOID ptr = NULL;
DWORD data = 0; DWORD data = 0;
/* FIXME: is this correct? */ if (!IsConformanceOrVariancePresent(pFormat)) {
if (pFormat[0] == 0xff) {
/* null descriptor */ /* null descriptor */
*pCount = def; *pCount = def;
goto finish_conf; goto finish_conf;
@ -428,7 +451,10 @@ done_conf_grab:
finish_conf: finish_conf:
TRACE("resulting conformance is %ld\n", *pCount); TRACE("resulting conformance is %ld\n", *pCount);
return pFormat+4; if (pStubMsg->fHasNewCorrDesc)
return pFormat+6;
else
return pFormat+4;
} }
@ -1773,7 +1799,10 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
if (fMustAlloc || !*ppMemory) if (fMustAlloc || !*ppMemory)
{
*ppMemory = NdrAllocate(pStubMsg, size); *ppMemory = NdrAllocate(pStubMsg, size);
memset(*ppMemory, 0, size);
}
pFormat += 4; pFormat += 4;
if (*(const WORD*)pFormat) conf_array = pFormat + *(const WORD*)pFormat; if (*(const WORD*)pFormat) conf_array = pFormat + *(const WORD*)pFormat;
@ -2026,7 +2055,6 @@ unsigned char* WINAPI NdrConformantVaryingArrayUnmarshall( PMIDL_STUB_MESSAGE pS
PFORMAT_STRING pFormat, PFORMAT_STRING pFormat,
unsigned char fMustAlloc ) unsigned char fMustAlloc )
{ {
DWORD offset;
DWORD esize = *(const WORD*)(pFormat+2); DWORD esize = *(const WORD*)(pFormat+2);
TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
@ -2038,13 +2066,11 @@ unsigned char* WINAPI NdrConformantVaryingArrayUnmarshall( PMIDL_STUB_MESSAGE pS
return NULL; return NULL;
} }
pFormat = ReadConformance(pStubMsg, pFormat); pFormat = ReadConformance(pStubMsg, pFormat);
offset = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
pStubMsg->Buffer += 4;
pFormat = ReadVariance(pStubMsg, pFormat); pFormat = ReadVariance(pStubMsg, pFormat);
if (!*ppMemory || fMustAlloc) if (!*ppMemory || fMustAlloc)
*ppMemory = NdrAllocate(pStubMsg, pStubMsg->MaxCount * esize); *ppMemory = NdrAllocate(pStubMsg, pStubMsg->MaxCount * esize);
memcpy(*ppMemory + offset, pStubMsg->Buffer, pStubMsg->ActualCount * esize); memcpy(*ppMemory + pStubMsg->Offset, pStubMsg->Buffer, pStubMsg->ActualCount * esize);
pStubMsg->Buffer += pStubMsg->ActualCount * esize; pStubMsg->Buffer += pStubMsg->ActualCount * esize;
EmbeddedPointerUnmarshall(pStubMsg, ppMemory, pFormat, fMustAlloc); EmbeddedPointerUnmarshall(pStubMsg, ppMemory, pFormat, fMustAlloc);
@ -2111,24 +2137,39 @@ unsigned char * WINAPI NdrComplexArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg,
unsigned char *pMemory, unsigned char *pMemory,
PFORMAT_STRING pFormat) PFORMAT_STRING pFormat)
{ {
DWORD size = 0, count, def; ULONG count, def;
BOOL variance_present;
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
if (pFormat[0] != RPC_FC_BOGUS_ARRAY)
{
ERR("invalid format type %x\n", pFormat[0]);
RpcRaiseException(RPC_S_INTERNAL_ERROR);
return NULL;
}
def = *(const WORD*)&pFormat[2]; def = *(const WORD*)&pFormat[2];
pFormat += 4; pFormat += 4;
pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def); pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def);
size = pStubMsg->MaxCount; TRACE("conformance = %ld\n", pStubMsg->MaxCount);
TRACE("conformance=%ld\n", size);
if (*(const DWORD*)pFormat != 0xffffffff) variance_present = IsConformanceOrVariancePresent(pFormat);
FIXME("compute variance\n"); pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount);
pFormat += 4; TRACE("variance = %ld\n", pStubMsg->ActualCount);
NDR_LOCAL_UINT32_WRITE(pStubMsg->Buffer, size); NDR_LOCAL_UINT32_WRITE(pStubMsg->Buffer, pStubMsg->MaxCount);
pStubMsg->Buffer += 4; pStubMsg->Buffer += 4;
if (variance_present)
{
NDR_LOCAL_UINT32_WRITE(pStubMsg->Buffer, pStubMsg->Offset);
pStubMsg->Buffer += 4;
NDR_LOCAL_UINT32_WRITE(pStubMsg->Buffer, pStubMsg->ActualCount);
pStubMsg->Buffer += 4;
}
for (count=0; count<size; count++) for (count = 0; count < pStubMsg->ActualCount; count++)
pMemory = ComplexMarshall(pStubMsg, pMemory, pFormat, NULL); pMemory = ComplexMarshall(pStubMsg, pMemory, pFormat, NULL);
STD_OVERFLOW_CHECK(pStubMsg); STD_OVERFLOW_CHECK(pStubMsg);
@ -2144,25 +2185,33 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
PFORMAT_STRING pFormat, PFORMAT_STRING pFormat,
unsigned char fMustAlloc) unsigned char fMustAlloc)
{ {
DWORD size = 0, count, esize; ULONG count, esize;
unsigned char *pMemory; unsigned char *pMemory;
TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
if (pFormat[0] != RPC_FC_BOGUS_ARRAY)
{
ERR("invalid format type %x\n", pFormat[0]);
RpcRaiseException(RPC_S_INTERNAL_ERROR);
return NULL;
}
pFormat += 4; pFormat += 4;
pFormat = ReadConformance(pStubMsg, pFormat); pFormat = ReadConformance(pStubMsg, pFormat);
size = pStubMsg->MaxCount; pFormat = ReadVariance(pStubMsg, pFormat);
TRACE("conformance=%ld\n", size);
pFormat += 4;
esize = ComplexStructSize(pStubMsg, pFormat); esize = ComplexStructSize(pStubMsg, pFormat);
if (fMustAlloc || !*ppMemory) if (fMustAlloc || !*ppMemory)
*ppMemory = NdrAllocate(pStubMsg, size*esize); {
*ppMemory = NdrAllocate(pStubMsg, pStubMsg->MaxCount * esize);
memset(*ppMemory, 0, pStubMsg->MaxCount * esize);
}
pMemory = *ppMemory; pMemory = *ppMemory;
for (count=0; count<size; count++) for (count = 0; count < pStubMsg->ActualCount; count++)
pMemory = ComplexUnmarshall(pStubMsg, pMemory, pFormat, NULL, fMustAlloc); pMemory = ComplexUnmarshall(pStubMsg, pMemory, pFormat, NULL, fMustAlloc);
return NULL; return NULL;
@ -2175,21 +2224,33 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned char *pMemory, unsigned char *pMemory,
PFORMAT_STRING pFormat) PFORMAT_STRING pFormat)
{ {
DWORD size = 0, count, def; ULONG count, def;
BOOL variance_present;
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
if (pFormat[0] != RPC_FC_BOGUS_ARRAY)
{
ERR("invalid format type %x\n", pFormat[0]);
RpcRaiseException(RPC_S_INTERNAL_ERROR);
return;
}
def = *(const WORD*)&pFormat[2]; def = *(const WORD*)&pFormat[2];
pFormat += 4; pFormat += 4;
pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def); pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def);
size = pStubMsg->MaxCount; TRACE("conformance = %ld\n", pStubMsg->MaxCount);
TRACE("conformance=%ld\n", size); pStubMsg->BufferLength += sizeof(ULONG);
if (*(const DWORD*)pFormat != 0xffffffff) variance_present = IsConformanceOrVariancePresent(pFormat);
FIXME("compute variance\n"); pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount);
pFormat += 4; TRACE("variance = %ld\n", pStubMsg->ActualCount);
for (count=0; count<size; count++) if (variance_present)
pStubMsg->BufferLength += 2*sizeof(ULONG);
for (count=0; count < pStubMsg->ActualCount; count++)
pMemory = ComplexBufferSize(pStubMsg, pMemory, pFormat, NULL); pMemory = ComplexBufferSize(pStubMsg, pMemory, pFormat, NULL);
} }
@ -2202,6 +2263,13 @@ unsigned long WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
DWORD size = 0; DWORD size = 0;
FIXME("(%p,%p): stub\n", pStubMsg, pFormat); FIXME("(%p,%p): stub\n", pStubMsg, pFormat);
if (pFormat[0] != RPC_FC_BOGUS_ARRAY)
{
ERR("invalid format type %x\n", pFormat[0]);
RpcRaiseException(RPC_S_INTERNAL_ERROR);
return 0;
}
pFormat += 4; pFormat += 4;
pFormat = ReadConformance(pStubMsg, pFormat); pFormat = ReadConformance(pStubMsg, pFormat);
@ -2220,21 +2288,27 @@ void WINAPI NdrComplexArrayFree(PMIDL_STUB_MESSAGE pStubMsg,
unsigned char *pMemory, unsigned char *pMemory,
PFORMAT_STRING pFormat) PFORMAT_STRING pFormat)
{ {
DWORD size = 0, count, def; ULONG count, def;
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
if (pFormat[0] != RPC_FC_BOGUS_ARRAY)
{
ERR("invalid format type %x\n", pFormat[0]);
RpcRaiseException(RPC_S_INTERNAL_ERROR);
return;
}
def = *(const WORD*)&pFormat[2]; def = *(const WORD*)&pFormat[2];
pFormat += 4; pFormat += 4;
pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def); pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def);
size = pStubMsg->MaxCount; TRACE("conformance = %ld\n", pStubMsg->MaxCount);
TRACE("conformance=%ld\n", size);
if (*(const DWORD*)pFormat != 0xffffffff) pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount);
FIXME("compute variance\n"); TRACE("variance = %ld\n", pStubMsg->ActualCount);
pFormat += 4;
for (count=0; count<size; count++) for (count=0; count < pStubMsg->ActualCount; count++)
pMemory = ComplexFree(pStubMsg, pMemory, pFormat, NULL); pMemory = ComplexFree(pStubMsg, pMemory, pFormat, NULL);
} }
@ -2934,6 +3008,7 @@ static unsigned char *WINAPI NdrBaseTypeMarshall(
case RPC_FC_LONG: case RPC_FC_LONG:
case RPC_FC_ULONG: case RPC_FC_ULONG:
case RPC_FC_ERROR_STATUS_T: case RPC_FC_ERROR_STATUS_T:
case RPC_FC_ENUM32:
ALIGN_POINTER(pStubMsg->Buffer, sizeof(ULONG) - 1); ALIGN_POINTER(pStubMsg->Buffer, sizeof(ULONG) - 1);
*(ULONG *)pStubMsg->Buffer = *(ULONG *)pMemory; *(ULONG *)pStubMsg->Buffer = *(ULONG *)pMemory;
pStubMsg->Buffer += sizeof(ULONG); pStubMsg->Buffer += sizeof(ULONG);
@ -2956,7 +3031,14 @@ static unsigned char *WINAPI NdrBaseTypeMarshall(
TRACE("value: %s\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory)); TRACE("value: %s\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory));
break; break;
case RPC_FC_ENUM16: case RPC_FC_ENUM16:
case RPC_FC_ENUM32: /* only 16-bits on the wire, so do a sanity check */
if (*(UINT *)pMemory > USHRT_MAX)
RpcRaiseException(RPC_X_ENUM_VALUE_OUT_OF_RANGE);
ALIGN_POINTER(pStubMsg->Buffer, sizeof(USHORT) - 1);
*(USHORT *)pStubMsg->Buffer = *(UINT *)pMemory;
pStubMsg->Buffer += sizeof(USHORT);
TRACE("value: 0x%04x\n", *(UINT *)pMemory);
break;
default: default:
FIXME("Unhandled base type: 0x%02x\n", *pFormat); FIXME("Unhandled base type: 0x%02x\n", *pFormat);
} }
@ -3004,6 +3086,7 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
case RPC_FC_LONG: case RPC_FC_LONG:
case RPC_FC_ULONG: case RPC_FC_ULONG:
case RPC_FC_ERROR_STATUS_T: case RPC_FC_ERROR_STATUS_T:
case RPC_FC_ENUM32:
ALIGN_POINTER(pStubMsg->Buffer, sizeof(ULONG) - 1); ALIGN_POINTER(pStubMsg->Buffer, sizeof(ULONG) - 1);
**(ULONG **)ppMemory = *(ULONG *)pStubMsg->Buffer; **(ULONG **)ppMemory = *(ULONG *)pStubMsg->Buffer;
pStubMsg->Buffer += sizeof(ULONG); pStubMsg->Buffer += sizeof(ULONG);
@ -3028,7 +3111,12 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
TRACE("value: %s\n", wine_dbgstr_longlong(**(ULONGLONG **)ppMemory)); TRACE("value: %s\n", wine_dbgstr_longlong(**(ULONGLONG **)ppMemory));
break; break;
case RPC_FC_ENUM16: case RPC_FC_ENUM16:
case RPC_FC_ENUM32: ALIGN_POINTER(pStubMsg->Buffer, sizeof(USHORT) - 1);
/* 16-bits on the wire, but int in memory */
**(UINT **)ppMemory = *(USHORT *)pStubMsg->Buffer;
pStubMsg->Buffer += sizeof(USHORT);
TRACE("value: 0x%08x\n", **(UINT **)ppMemory);
break;
default: default:
FIXME("Unhandled base type: 0x%02x\n", *pFormat); FIXME("Unhandled base type: 0x%02x\n", *pFormat);
} }
@ -3059,11 +3147,13 @@ static void WINAPI NdrBaseTypeBufferSize(
case RPC_FC_WCHAR: case RPC_FC_WCHAR:
case RPC_FC_SHORT: case RPC_FC_SHORT:
case RPC_FC_USHORT: case RPC_FC_USHORT:
case RPC_FC_ENUM16:
ALIGN_LENGTH(pStubMsg->BufferLength, sizeof(USHORT) - 1); ALIGN_LENGTH(pStubMsg->BufferLength, sizeof(USHORT) - 1);
pStubMsg->BufferLength += sizeof(USHORT); pStubMsg->BufferLength += sizeof(USHORT);
break; break;
case RPC_FC_LONG: case RPC_FC_LONG:
case RPC_FC_ULONG: case RPC_FC_ULONG:
case RPC_FC_ENUM32:
ALIGN_LENGTH(pStubMsg->BufferLength, sizeof(ULONG) - 1); ALIGN_LENGTH(pStubMsg->BufferLength, sizeof(ULONG) - 1);
pStubMsg->BufferLength += sizeof(ULONG); pStubMsg->BufferLength += sizeof(ULONG);
break; break;
@ -3083,8 +3173,6 @@ static void WINAPI NdrBaseTypeBufferSize(
ALIGN_LENGTH(pStubMsg->BufferLength, sizeof(error_status_t) - 1); ALIGN_LENGTH(pStubMsg->BufferLength, sizeof(error_status_t) - 1);
pStubMsg->BufferLength += sizeof(error_status_t); pStubMsg->BufferLength += sizeof(error_status_t);
break; break;
case RPC_FC_ENUM16:
case RPC_FC_ENUM32:
default: default:
FIXME("Unhandled base type: 0x%02x\n", *pFormat); FIXME("Unhandled base type: 0x%02x\n", *pFormat);
} }
@ -3121,6 +3209,7 @@ static unsigned long WINAPI NdrBaseTypeMemorySize(
return sizeof(error_status_t); return sizeof(error_status_t);
case RPC_FC_ENUM16: case RPC_FC_ENUM16:
case RPC_FC_ENUM32: case RPC_FC_ENUM32:
return sizeof(INT);
default: default:
FIXME("Unhandled base type: 0x%02x\n", *pFormat); FIXME("Unhandled base type: 0x%02x\n", *pFormat);
return 0; return 0;

View file

@ -269,6 +269,8 @@ void WINAPI NdrFreeBuffer(MIDL_STUB_MESSAGE *pStubMsg)
*/ */
unsigned char *WINAPI NdrSendReceive( MIDL_STUB_MESSAGE *stubmsg, unsigned char *buffer ) unsigned char *WINAPI NdrSendReceive( MIDL_STUB_MESSAGE *stubmsg, unsigned char *buffer )
{ {
RPC_STATUS status;
TRACE("(stubmsg == ^%p, buffer == ^%p)\n", stubmsg, buffer); TRACE("(stubmsg == ^%p, buffer == ^%p)\n", stubmsg, buffer);
/* FIXME: how to handle errors? (raise exception?) */ /* FIXME: how to handle errors? (raise exception?) */
@ -281,10 +283,9 @@ unsigned char *WINAPI NdrSendReceive( MIDL_STUB_MESSAGE *stubmsg, unsigned char
return NULL; return NULL;
} }
if (I_RpcSendReceive(stubmsg->RpcMsg) != RPC_S_OK) { status = I_RpcSendReceive(stubmsg->RpcMsg);
WARN("I_RpcSendReceive did not return success.\n"); if (status != RPC_S_OK)
/* FIXME: raise exception? */ RpcRaiseException(status);
}
stubmsg->BufferLength = stubmsg->RpcMsg->BufferLength; stubmsg->BufferLength = stubmsg->RpcMsg->BufferLength;
stubmsg->BufferStart = stubmsg->RpcMsg->Buffer; stubmsg->BufferStart = stubmsg->RpcMsg->Buffer;

View file

@ -30,11 +30,6 @@
struct IPSFactoryBuffer; struct IPSFactoryBuffer;
LONG_PTR RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
PFORMAT_STRING pFormat, va_list args );
HRESULT RPCRT4_GetPSFactory(REFIID riid, struct IPSFactoryBuffer **ppPS);
#define ComputeConformance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->MaxCount) #define ComputeConformance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->MaxCount)
#define ComputeVariance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->ActualCount) #define ComputeVariance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->ActualCount)
PFORMAT_STRING ComputeConformanceOrVariance( PFORMAT_STRING ComputeConformanceOrVariance(

View file

@ -257,14 +257,16 @@ unsigned char * WINAPI NdrInterfacePointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
if (pStubMsg->Buffer + sizeof(DWORD) < (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength) { if (pStubMsg->Buffer + sizeof(DWORD) < (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength) {
stream = RpcStream_Create(pStubMsg, TRUE); stream = RpcStream_Create(pStubMsg, TRUE);
if (stream) { if (stream) {
hr = COM_MarshalInterface(stream, riid, (LPUNKNOWN)pMemory, if (pMemory)
pStubMsg->dwDestContext, pStubMsg->pvDestContext, hr = COM_MarshalInterface(stream, riid, (LPUNKNOWN)pMemory,
MSHLFLAGS_NORMAL); pStubMsg->dwDestContext, pStubMsg->pvDestContext,
MSHLFLAGS_NORMAL);
else
hr = S_OK;
IStream_Release(stream); IStream_Release(stream);
if (FAILED(hr)) { if (FAILED(hr))
IUnknown_Release((LPUNKNOWN)pMemory);
RpcRaiseException(hr); RpcRaiseException(hr);
}
} }
} }
return NULL; return NULL;
@ -355,17 +357,3 @@ void WINAPI NdrOleFree(void *NodeToFree)
if (!LoadCOM()) return; if (!LoadCOM()) return;
COM_MemFree(NodeToFree); COM_MemFree(NodeToFree);
} }
/* internal */
HRESULT RPCRT4_GetPSFactory(REFIID riid, LPPSFACTORYBUFFER *pPS)
{
HRESULT hr;
CLSID clsid;
if (!LoadCOM()) return RPC_E_UNEXPECTED;
hr = COM_GetPSClsid(riid, &clsid);
if (FAILED(hr)) return hr;
hr = COM_GetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL,
&IID_IPSFactoryBuffer, (LPVOID *)pPS);
return hr;
}

File diff suppressed because it is too large Load diff

View file

@ -254,15 +254,13 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header,
hdr_size = Header->common.frag_len; hdr_size = Header->common.frag_len;
Header->common.flags |= RPC_FLG_FIRST; Header->common.flags |= RPC_FLG_FIRST;
Header->common.flags &= ~RPC_FLG_LAST; Header->common.flags &= ~RPC_FLG_LAST;
while (!(Header->common.flags & RPC_FLG_LAST)) { while (!(Header->common.flags & RPC_FLG_LAST)) {
/* decide if we need to split the packet into fragments */ /* decide if we need to split the packet into fragments */
if ((BufferLength + hdr_size) <= Connection->MaxTransmissionSize) { if ((BufferLength + hdr_size) <= Connection->MaxTransmissionSize) {
Header->common.flags |= RPC_FLG_LAST; Header->common.flags |= RPC_FLG_LAST;
Header->common.frag_len = BufferLength + hdr_size; Header->common.frag_len = BufferLength + hdr_size;
} else { } else {
Header->common.frag_len = Connection->MaxTransmissionSize; Header->common.frag_len = Connection->MaxTransmissionSize;
buffer_pos += Header->common.frag_len - hdr_size;
BufferLength -= Header->common.frag_len - hdr_size;
} }
/* transmit packet header */ /* transmit packet header */
@ -293,6 +291,8 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header,
return GetLastError(); return GetLastError();
} }
buffer_pos += Header->common.frag_len - hdr_size;
BufferLength -= Header->common.frag_len - hdr_size;
Header->common.flags &= ~RPC_FLG_FIRST; Header->common.flags &= ~RPC_FLG_FIRST;
} }

View file

@ -303,7 +303,7 @@
@ stub NdrRpcSsDisableAllocate @ stub NdrRpcSsDisableAllocate
@ stub NdrRpcSsEnableAllocate @ stub NdrRpcSsEnableAllocate
@ stdcall NdrSendReceive(ptr ptr) @ stdcall NdrSendReceive(ptr ptr)
@ stub NdrServerCall2 @ stdcall NdrServerCall2(ptr)
@ stub NdrServerCall @ stub NdrServerCall
@ stdcall NdrServerContextMarshall(ptr ptr long) @ stdcall NdrServerContextMarshall(ptr ptr long)
@ stdcall NdrServerContextNewMarshall(ptr ptr ptr ptr) # wxp @ stdcall NdrServerContextNewMarshall(ptr ptr ptr ptr) # wxp
@ -323,7 +323,7 @@
@ stdcall NdrSimpleStructUnmarshall(ptr ptr ptr long) @ stdcall NdrSimpleStructUnmarshall(ptr ptr ptr long)
@ stdcall NdrSimpleTypeMarshall(ptr ptr long) @ stdcall NdrSimpleTypeMarshall(ptr ptr long)
@ stdcall NdrSimpleTypeUnmarshall(ptr ptr long) @ stdcall NdrSimpleTypeUnmarshall(ptr ptr long)
@ stub NdrStubCall2 @ stdcall NdrStubCall2(ptr ptr ptr ptr)
@ stub NdrStubCall @ stub NdrStubCall
@ stdcall NdrStubForwardingFunction(ptr ptr ptr ptr) @ stdcall NdrStubForwardingFunction(ptr ptr ptr ptr)
@ stdcall NdrStubGetBuffer(ptr ptr ptr) @ stdcall NdrStubGetBuffer(ptr ptr ptr)

View file

@ -0,0 +1,57 @@
/*
* NDR Types
*
* Copyright 2006 Robert Shearman (for CodeWeavers)
*
* 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
*/
#ifndef __NDRTYPES_H__
#define __NDRTYPES_H__
typedef struct
{
unsigned short MustSize : 1; /* 0x0001 - client interpreter MUST size this
* parameter, other parameters may be skipped, using the value in
* NDR_PROC_PARTIAL_OIF_HEADER::constant_client_buffer_size instead. */
unsigned short MustFree : 1; /* 0x0002 - server interpreter MUST size this
* parameter, other parameters may be skipped, using the value in
* NDR_PROC_PARTIAL_OIF_HEADER::constant_server_buffer_size instead. */
unsigned short IsPipe : 1; /* 0x0004 - The parameter is a pipe handle. See
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/pipes.asp
* for more information on pipes. */
unsigned short IsIn : 1; /* 0x0008 - The parameter is an input */
unsigned short IsOut : 1; /* 0x0010 - The parameter is an output */
unsigned short IsReturn : 1; /* 0x0020 - The parameter is to be returned */
unsigned short IsBasetype : 1; /* 0x0040 - The parameter is simple and has the
* format defined by NDR_PARAM_OIF_BASETYPE rather than by
* NDR_PARAM_OIF_OTHER. */
unsigned short IsByValue : 1; /* 0x0080 - Set for compound types being sent by
* value. Can be of type: structure, union, transmit_as, represent_as,
* wire_marshal and SAFEARRAY. */
unsigned short IsSimpleRef : 1; /* 0x0100 - parameter that is a reference
* pointer to anything other than another pointer, and which has no
* allocate attributes. */
unsigned short IsDontCallFreeInst : 1; /* 0x0200 - Used for some represent_as types
* for when the free instance routine should not be called. */
unsigned short SaveForAsyncFinish : 1; /* 0x0400 - Unknown */
unsigned short Unused : 2;
unsigned short ServerAllocSize : 3; /* 0xe000 - If non-zero
* specifies the size of the object in numbers of 8byte blocks needed.
* It will be stored on the server's stack rather than using an allocate
* call. */
} PARAM_ATTRIBUTES;
#endif

View file

@ -164,67 +164,73 @@ typedef struct _NDR_ASYNC_MESSAGE *PNDR_ASYNC_MESSAGE;
typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO; typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO;
#pragma pack(push,4) #pragma pack(push,4)
typedef struct _MIDL_STUB_MESSAGE { typedef struct _MIDL_STUB_MESSAGE
PRPC_MESSAGE RpcMsg; {
unsigned char *Buffer; PRPC_MESSAGE RpcMsg;
unsigned char *BufferStart; unsigned char *Buffer;
unsigned char *BufferEnd; unsigned char *BufferStart;
unsigned char *BufferMark; unsigned char *BufferEnd;
unsigned long BufferLength; unsigned char *BufferMark;
unsigned long MemorySize; unsigned long BufferLength;
unsigned char *Memory; unsigned long MemorySize;
int IsClient; unsigned char *Memory;
int ReuseBuffer; int IsClient;
unsigned char *AllocAllNodesMemory; int ReuseBuffer;
unsigned char *AllocAllNodesMemoryEnd; struct NDR_ALLOC_ALL_NODES_CONTEXT *pAllocAllNodesContext;
int IgnoreEmbeddedPointers; struct NDR_POINTER_QUEUE_STATE *pPointerQueueState;
unsigned char *PointerBufferMark; int IgnoreEmbeddedPointers;
unsigned char fBufferValid; unsigned char *PointerBufferMark;
unsigned char uFlags; unsigned char fBufferValid;
unsigned long MaxCount; unsigned char uFlags;
unsigned long Offset; unsigned short UniquePtrCount;
unsigned long ActualCount; ULONG_PTR MaxCount;
void*(__RPC_API *pfnAllocate)(unsigned int); unsigned long Offset;
void(__RPC_API *pfnFree)(void*); unsigned long ActualCount;
unsigned char *StackTop; void * (__RPC_API *pfnAllocate)(size_t);
unsigned char *pPresentedType; void (__RPC_API *pfnFree)(void *);
unsigned char *pTransmitType; unsigned char *StackTop;
handle_t SavedHandle; unsigned char *pPresentedType;
const struct _MIDL_STUB_DESC *StubDesc; unsigned char *pTransmitType;
struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables; handle_t SavedHandle;
unsigned long FullPtrRefId; const struct _MIDL_STUB_DESC *StubDesc;
int fCheckBounds; struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
int fInDontFree :1; unsigned long FullPtrRefId;
int fDontCallFreeInst :1; unsigned long PointerLength;
int fInOnlyParam :1; int fInDontFree:1;
int fHasReturn :1; int fDontCallFreeInst:1;
unsigned long dwDestContext; int fInOnlyParam:1;
void*pvDestContext; int fHasReturn:1;
NDR_SCONTEXT *SavedContextHandles; int fHasExtensions:1;
long ParamNumber; int fHasNewCorrDesc:1;
struct IRpcChannelBuffer *pRpcChannelBuffer; int fUnused:10;
PARRAY_INFO pArrayInfo; int fUnused2:16;
unsigned long *SizePtrCountArray; unsigned long dwDestContext;
unsigned long *SizePtrOffsetArray; void *pvDestContext;
unsigned long *SizePtrLengthArray; NDR_SCONTEXT *SavedContextHandles;
void*pArgQueue; long ParamNumber;
unsigned long dwStubPhase; struct IRpcChannelBuffer *pRpcChannelBuffer;
void *LowStackMark; PARRAY_INFO pArrayInfo;
PNDR_ASYNC_MESSAGE pAsyncMsg; unsigned long *SizePtrCountArray;
PNDR_CORRELATION_INFO pCorrInfo; unsigned long *SizePtrOffsetArray;
unsigned char *pCorrMemory; unsigned long *SizePtrLengthArray;
void *pMemoryList; void *pArgQueue;
CS_STUB_INFO *pCSInfo; unsigned long dwStubPhase;
unsigned char *ConformanceMark; void *LowStackMark;
unsigned char *VarianceMark; PNDR_ASYNC_MESSAGE pAsyncMsg;
INT_PTR Unused; PNDR_CORRELATION_INFO pCorrInfo;
struct _NDR_PROC_CONTEXT *pContext; unsigned char *pCorrMemory;
INT_PTR Reserved51_1; void *pMemoryList;
INT_PTR Reserved51_2; CS_STUB_INFO *pCSInfo;
INT_PTR Reserved51_3; unsigned char *ConformanceMark;
INT_PTR Reserved51_4; unsigned char *VarianceMark;
INT_PTR Reserved51_5; INT_PTR Unused;
} MIDL_STUB_MESSAGE,*PMIDL_STUB_MESSAGE; struct _NDR_PROC_CONTEXT *pContext;
INT_PTR Reserved51_1;
INT_PTR Reserved51_2;
INT_PTR Reserved51_3;
INT_PTR Reserved51_4;
INT_PTR Reserved51_5;
} MIDL_STUB_MESSAGE, *PMIDL_STUB_MESSAGE;
#pragma pack(pop) #pragma pack(pop)
typedef void*(__RPC_API *GENERIC_BINDING_ROUTINE)(void*); typedef void*(__RPC_API *GENERIC_BINDING_ROUTINE)(void*);
typedef void (__RPC_API *GENERIC_UNBIND_ROUTINE)(void*,unsigned char*); typedef void (__RPC_API *GENERIC_UNBIND_ROUTINE)(void*,unsigned char*);

View file

@ -1,23 +1,44 @@
#ifndef _RPCNTERR_H /*
#define _RPCNTERR_H * Copyright (C) 2001 Peter Hunnisett
#if __GNUC__ >=3 *
#pragma GCC system_header * This library is free software; you can redistribute it and/or
#endif * 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
*/
#define RPC_S_OK ERROR_SUCCESS #ifndef __RPCNTERR_H__
#define RPC_S_INVALID_ARG ERROR_INVALID_PARAMETER #define __RPCNTERR_H__
#define RPC_S_OUT_OF_MEMORY ERROR_OUTOFMEMORY
#define RPC_S_OUT_OF_THREADS ERROR_MAX_THRDS_REACHED #define RPC_S_OK ERROR_SUCCESS
#define RPC_S_INVALID_LEVEL ERROR_INVALID_PARAMETER #define RPC_S_INVALID_ARG ERROR_INVALID_PARAMETER
#define RPC_S_BUFFER_TOO_SMALL ERROR_INSUFFICIENT_BUFFER #define RPC_S_OUT_OF_MEMORY ERROR_OUTOFMEMORY
#define RPC_S_INVALID_SECURITY_DESC ERROR_INVALID_SECURITY_DESCR #define RPC_S_OUT_OF_THREADS ERROR_MAX_THRDS_REACHED
#define RPC_S_ACCESS_DENIED ERROR_ACCESS_DENIED #define RPC_S_INVALID_LEVEL ERROR_INVALID_PARAMETER
#define RPC_S_SERVER_OUT_OF_MEMORY ERROR_NOT_ENOUGH_SERVER_MEMORY #define RPC_S_BUFFER_TOO_SMALL ERROR_INSUFFICIENT_BUFFER
#define RPC_X_NO_MEMORY RPC_S_OUT_OF_MEMORY #define RPC_S_INVALID_SECURITY_DESC ERROR_INVALID_SECURITY_DESCR
#define RPC_X_INVALID_BOUND RPC_S_INVALID_BOUND #define RPC_S_ACCESS_DENIED ERROR_ACCESS_DENIED
#define RPC_X_INVALID_TAG RPC_S_INVALID_TAG #define RPC_S_SERVER_OUT_OF_MEMORY ERROR_NOT_ENOUGH_SERVER_MEMORY
#define RPC_X_ENUM_VALUE_TOO_LARGE RPC_X_ENUM_VALUE_OUT_OF_RANGE #define RPC_S_ASYNC_CALL_PENDING ERROR_IO_PENDING
#define RPC_X_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE #define RPC_S_UNKNOWN_PRINCIPAL ERROR_NONE_MAPPED
#define RPC_X_INVALID_BUFFER ERROR_INVALID_USER_BUFFER #define RPC_S_TIMEOUT ERROR_TIMEOUT
#define RPC_X_INVALID_PIPE_OPERATION RPC_X_WRONG_PIPE_ORDER
#endif #define RPC_X_NO_MEMORY RPC_S_OUT_OF_MEMORY
#define RPC_X_INVALID_BOUND RPC_S_INVALID_BOUND
#define RPC_X_INVALID_TAG RPC_S_INVALID_TAG
#define RPC_X_ENUM_VALUE_TOO_LARGE RPC_X_ENUM_VALUE_OUT_OF_RANGE
#define RPC_X_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE
#define RPC_X_INVALID_BUFFER ERROR_INVALID_USER_BUFFER
#define RPC_X_PIPE_APP_MEMORY ERROR_OUTOFMEMORY
#define RPC_X_INVALID_PIPE_OPERATION RPC_X_WRONG_PIPE_ORDER
#endif /* __RPCNTERR_H__ */