mirror of
https://github.com/reactos/reactos.git
synced 2024-07-07 21:25:05 +00:00
- Winesync to Wine-20080118.
svn path=/trunk/; revision=31874
This commit is contained in:
parent
faa2ab3874
commit
f1b7277633
|
@ -1273,7 +1273,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData(
|
||||||
* Return the clipboard data in the storage medium structure
|
* Return the clipboard data in the storage medium structure
|
||||||
*/
|
*/
|
||||||
pmedium->tymed = (hData == 0) ? TYMED_NULL : TYMED_HGLOBAL;
|
pmedium->tymed = (hData == 0) ? TYMED_NULL : TYMED_HGLOBAL;
|
||||||
pmedium->u.hGlobal = (HGLOBAL)hData;
|
pmedium->u.hGlobal = hData;
|
||||||
pmedium->pUnkForRelease = NULL;
|
pmedium->pUnkForRelease = NULL;
|
||||||
|
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
|
|
|
@ -104,7 +104,7 @@ StdGlobalInterfaceTable_FindEntry(IGlobalInterfaceTable* iface, DWORD cookie)
|
||||||
StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface;
|
StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface;
|
||||||
StdGITEntry* e;
|
StdGITEntry* e;
|
||||||
|
|
||||||
TRACE("iface=%p, cookie=0x%x\n", iface, (UINT)cookie);
|
TRACE("iface=%p, cookie=0x%x\n", iface, cookie);
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY(e, &self->list, StdGITEntry, entry) {
|
LIST_FOR_EACH_ENTRY(e, &self->list, StdGITEntry, entry) {
|
||||||
if (e->cookie == cookie)
|
if (e->cookie == cookie)
|
||||||
|
@ -227,7 +227,7 @@ StdGlobalInterfaceTable_RevokeInterfaceFromGlobal(
|
||||||
StdGITEntry* entry;
|
StdGITEntry* entry;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("iface=%p, dwCookie=0x%x\n", iface, (UINT)dwCookie);
|
TRACE("iface=%p, dwCookie=0x%x\n", iface, dwCookie);
|
||||||
|
|
||||||
EnterCriticalSection(&git_section);
|
EnterCriticalSection(&git_section);
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ DWORD CDECL IMalloc16_fnGetSize(IMalloc16* iface,SEGPTR pv)
|
||||||
* IMalloc16_DidAlloc [COMPOBJ.507]
|
* IMalloc16_DidAlloc [COMPOBJ.507]
|
||||||
*/
|
*/
|
||||||
INT16 CDECL IMalloc16_fnDidAlloc(IMalloc16* iface,LPVOID pv) {
|
INT16 CDECL IMalloc16_fnDidAlloc(IMalloc16* iface,LPVOID pv) {
|
||||||
IMalloc16 *This = (IMalloc16 *)iface;
|
IMalloc16 *This = iface;
|
||||||
TRACE("(%p)->DidAlloc(%p)\n",This,pv);
|
TRACE("(%p)->DidAlloc(%p)\n",This,pv);
|
||||||
return (INT16)-1;
|
return (INT16)-1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1400,7 +1400,7 @@ static LRESULT CALLBACK OLEMenu_CallWndProc(INT code, WPARAM wParam, LPARAM lPar
|
||||||
* If the window has an OLEMenu property we may need to dispatch
|
* If the window has an OLEMenu property we may need to dispatch
|
||||||
* the menu message to its active objects window instead. */
|
* the menu message to its active objects window instead. */
|
||||||
|
|
||||||
hOleMenu = (HOLEMENU)GetPropA( pMsg->hwnd, "PROP_OLEMenuDescriptor" );
|
hOleMenu = GetPropA( pMsg->hwnd, "PROP_OLEMenuDescriptor" );
|
||||||
if ( !hOleMenu )
|
if ( !hOleMenu )
|
||||||
goto NEXTHOOK;
|
goto NEXTHOOK;
|
||||||
|
|
||||||
|
@ -1505,7 +1505,7 @@ static LRESULT CALLBACK OLEMenu_GetMsgProc(INT code, WPARAM wParam, LPARAM lPara
|
||||||
* If the window has an OLEMenu property we may need to dispatch
|
* If the window has an OLEMenu property we may need to dispatch
|
||||||
* the menu message to its active objects window instead. */
|
* the menu message to its active objects window instead. */
|
||||||
|
|
||||||
hOleMenu = (HOLEMENU)GetPropA( pMsg->hwnd, "PROP_OLEMenuDescriptor" );
|
hOleMenu = GetPropA( pMsg->hwnd, "PROP_OLEMenuDescriptor" );
|
||||||
if ( !hOleMenu )
|
if ( !hOleMenu )
|
||||||
goto NEXTHOOK;
|
goto NEXTHOOK;
|
||||||
|
|
||||||
|
|
|
@ -1026,8 +1026,13 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetDestCtx(LPRPCCHANNELBUFFER iface
|
||||||
|
|
||||||
static HRESULT WINAPI ServerRpcChannelBuffer_GetDestCtx(LPRPCCHANNELBUFFER iface, DWORD* pdwDestContext, void** ppvDestContext)
|
static HRESULT WINAPI ServerRpcChannelBuffer_GetDestCtx(LPRPCCHANNELBUFFER iface, DWORD* pdwDestContext, void** ppvDestContext)
|
||||||
{
|
{
|
||||||
FIXME("(%p,%p), stub!\n", pdwDestContext, ppvDestContext);
|
WARN("(%p,%p), stub!\n", pdwDestContext, ppvDestContext);
|
||||||
return E_FAIL;
|
|
||||||
|
/* FIXME: implement this by storing the dwDestContext and pvDestContext
|
||||||
|
* values passed into IMarshal_MarshalInterface and returning them here */
|
||||||
|
*pdwDestContext = MSHCTX_DIFFERENTMACHINE;
|
||||||
|
*ppvDestContext = NULL;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI RpcChannelBuffer_IsConnected(LPRPCCHANNELBUFFER iface)
|
static HRESULT WINAPI RpcChannelBuffer_IsConnected(LPRPCCHANNELBUFFER iface)
|
||||||
|
|
|
@ -200,7 +200,7 @@ static HRESULT WINAPI IPropertyStorage_fnQueryInterface(
|
||||||
IsEqualGUID(&IID_IPropertyStorage, riid))
|
IsEqualGUID(&IID_IPropertyStorage, riid))
|
||||||
{
|
{
|
||||||
IPropertyStorage_AddRef(iface);
|
IPropertyStorage_AddRef(iface);
|
||||||
*ppvObject = (IPropertyStorage*)iface;
|
*ppvObject = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ static PROPVARIANT *PropertyStorage_FindPropertyByName(
|
||||||
if (This->codePage == CP_UNICODE)
|
if (This->codePage == CP_UNICODE)
|
||||||
{
|
{
|
||||||
if (dictionary_find(This->name_to_propid, name, (void **)&propid))
|
if (dictionary_find(This->name_to_propid, name, (void **)&propid))
|
||||||
ret = PropertyStorage_FindProperty(This, (PROPID)propid);
|
ret = PropertyStorage_FindProperty(This, propid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -275,7 +275,7 @@ static PROPVARIANT *PropertyStorage_FindPropertyByName(
|
||||||
{
|
{
|
||||||
if (dictionary_find(This->name_to_propid, ansiName,
|
if (dictionary_find(This->name_to_propid, ansiName,
|
||||||
(void **)&propid))
|
(void **)&propid))
|
||||||
ret = PropertyStorage_FindProperty(This, (PROPID)propid);
|
ret = PropertyStorage_FindProperty(This, propid);
|
||||||
CoTaskMemFree(ansiName);
|
CoTaskMemFree(ansiName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -528,7 +528,7 @@ static HRESULT PropertyStorage_StoreNameWithId(PropertyStorage_impl *This,
|
||||||
|
|
||||||
assert(srcName);
|
assert(srcName);
|
||||||
|
|
||||||
hr = PropertyStorage_StringCopy((LPCSTR)srcName, cp, &name, This->codePage);
|
hr = PropertyStorage_StringCopy(srcName, cp, &name, This->codePage);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
if (This->codePage == CP_UNICODE)
|
if (This->codePage == CP_UNICODE)
|
||||||
|
@ -1059,7 +1059,7 @@ static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This,
|
||||||
TRACE("Read char 0x%x ('%c')\n", prop->u.cVal, prop->u.cVal);
|
TRACE("Read char 0x%x ('%c')\n", prop->u.cVal, prop->u.cVal);
|
||||||
break;
|
break;
|
||||||
case VT_UI1:
|
case VT_UI1:
|
||||||
prop->u.bVal = *(const UCHAR *)data;
|
prop->u.bVal = *data;
|
||||||
TRACE("Read byte 0x%x\n", prop->u.bVal);
|
TRACE("Read byte 0x%x\n", prop->u.bVal);
|
||||||
break;
|
break;
|
||||||
case VT_I2:
|
case VT_I2:
|
||||||
|
|
|
@ -1300,14 +1300,7 @@ static HRESULT WINAPI StorageImpl_CreateStorage(
|
||||||
/*
|
/*
|
||||||
* Open it to get a pointer to return.
|
* Open it to get a pointer to return.
|
||||||
*/
|
*/
|
||||||
hr = IStorage_OpenStorage(
|
hr = IStorage_OpenStorage(iface, pwcsName, 0, grfMode, 0, 0, ppstg);
|
||||||
iface,
|
|
||||||
(const OLECHAR*)pwcsName,
|
|
||||||
0,
|
|
||||||
grfMode,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
ppstg);
|
|
||||||
|
|
||||||
if( (hr != S_OK) || (*ppstg == NULL))
|
if( (hr != S_OK) || (*ppstg == NULL))
|
||||||
{
|
{
|
||||||
|
@ -2004,9 +1997,7 @@ static HRESULT deleteStorageProperty(
|
||||||
hr = IEnumSTATSTG_Next(elements, 1, ¤tElement, NULL);
|
hr = IEnumSTATSTG_Next(elements, 1, ¤tElement, NULL);
|
||||||
if (hr==S_OK)
|
if (hr==S_OK)
|
||||||
{
|
{
|
||||||
destroyHr = StorageImpl_DestroyElement(
|
destroyHr = StorageImpl_DestroyElement(childStorage, currentElement.pwcsName);
|
||||||
(IStorage*)childStorage,
|
|
||||||
(OLECHAR*)currentElement.pwcsName);
|
|
||||||
|
|
||||||
CoTaskMemFree(currentElement.pwcsName);
|
CoTaskMemFree(currentElement.pwcsName);
|
||||||
}
|
}
|
||||||
|
@ -4053,8 +4044,7 @@ static ULONG IEnumSTATSTGImpl_FindProperty(
|
||||||
currentProperty);
|
currentProperty);
|
||||||
|
|
||||||
if ( propertyNameCmp(
|
if ( propertyNameCmp(
|
||||||
(const OLECHAR*)currentProperty->name,
|
(const OLECHAR*)currentProperty->name, lpszPropName) == 0)
|
||||||
(const OLECHAR*)lpszPropName) == 0)
|
|
||||||
return currentSearchNode;
|
return currentSearchNode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -410,6 +410,7 @@ void WINAPI NdrProxyFreeBuffer(void *This,
|
||||||
PMIDL_STUB_MESSAGE pStubMsg)
|
PMIDL_STUB_MESSAGE pStubMsg)
|
||||||
{
|
{
|
||||||
TRACE("(%p,%p)\n", This, pStubMsg);
|
TRACE("(%p,%p)\n", This, pStubMsg);
|
||||||
|
|
||||||
if (pStubMsg->fBufferValid)
|
if (pStubMsg->fBufferValid)
|
||||||
{
|
{
|
||||||
IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer,
|
IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer,
|
||||||
|
|
|
@ -51,7 +51,7 @@ void WINAPI NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE
|
||||||
pRpcMessage, pStubMsg, pStubDesc, ProcNum);
|
pRpcMessage, pStubMsg, pStubDesc, ProcNum);
|
||||||
|
|
||||||
pRpcMessage->Handle = NULL;
|
pRpcMessage->Handle = NULL;
|
||||||
pRpcMessage->ProcNum = ProcNum;
|
pRpcMessage->ProcNum = ProcNum | RPC_FLAGS_VALID_BIT;
|
||||||
pRpcMessage->RpcInterfaceInformation = pStubDesc->RpcInterfaceInformation;
|
pRpcMessage->RpcInterfaceInformation = pStubDesc->RpcInterfaceInformation;
|
||||||
pRpcMessage->RpcFlags = 0;
|
pRpcMessage->RpcFlags = 0;
|
||||||
pRpcMessage->ReservedForRuntime = NULL;
|
pRpcMessage->ReservedForRuntime = NULL;
|
||||||
|
@ -216,10 +216,29 @@ RPC_STATUS RPC_ENTRY NdrMapCommAndFaultStatus( PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
ULONG *pFaultStatus,
|
ULONG *pFaultStatus,
|
||||||
RPC_STATUS Status )
|
RPC_STATUS Status )
|
||||||
{
|
{
|
||||||
FIXME("(%p, %p, %p, %ld): stub\n", pStubMsg, pCommStatus, pFaultStatus, Status);
|
TRACE("(%p, %p, %p, %ld)\n", pStubMsg, pCommStatus, pFaultStatus, Status);
|
||||||
|
|
||||||
*pCommStatus = 0;
|
switch (Status)
|
||||||
|
{
|
||||||
|
case ERROR_INVALID_HANDLE:
|
||||||
|
case RPC_S_INVALID_BINDING:
|
||||||
|
case RPC_S_UNKNOWN_IF:
|
||||||
|
case RPC_S_SERVER_UNAVAILABLE:
|
||||||
|
case RPC_S_SERVER_TOO_BUSY:
|
||||||
|
case RPC_S_CALL_FAILED_DNE:
|
||||||
|
case RPC_S_PROTOCOL_ERROR:
|
||||||
|
case RPC_S_UNSUPPORTED_TRANS_SYN:
|
||||||
|
case RPC_S_UNSUPPORTED_TYPE:
|
||||||
|
case RPC_S_PROCNUM_OUT_OF_RANGE:
|
||||||
|
case EPT_S_NOT_REGISTERED:
|
||||||
|
case RPC_S_COMM_FAILURE:
|
||||||
|
*pCommStatus = Status;
|
||||||
*pFaultStatus = 0;
|
*pFaultStatus = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*pCommStatus = 0;
|
||||||
|
*pFaultStatus = Status;
|
||||||
|
}
|
||||||
|
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,8 @@ void WINAPI NDRSContextMarshall(NDR_SCONTEXT SContext,
|
||||||
NDR_RUNDOWN userRunDownIn)
|
NDR_RUNDOWN userRunDownIn)
|
||||||
{
|
{
|
||||||
TRACE("(%p %p %p)\n", SContext, pBuff, userRunDownIn);
|
TRACE("(%p %p %p)\n", SContext, pBuff, userRunDownIn);
|
||||||
NDRSContextMarshall2(I_RpcGetCurrentCallHandle(), SContext, pBuff, userRunDownIn, NULL, 0);
|
NDRSContextMarshall2(I_RpcGetCurrentCallHandle(), SContext, pBuff,
|
||||||
|
userRunDownIn, NULL, RPC_CONTEXT_HANDLE_DEFAULT_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -230,7 +231,8 @@ void WINAPI NDRSContextMarshallEx(RPC_BINDING_HANDLE hBinding,
|
||||||
NDR_RUNDOWN userRunDownIn)
|
NDR_RUNDOWN userRunDownIn)
|
||||||
{
|
{
|
||||||
TRACE("(%p %p %p %p)\n", hBinding, SContext, pBuff, userRunDownIn);
|
TRACE("(%p %p %p %p)\n", hBinding, SContext, pBuff, userRunDownIn);
|
||||||
NDRSContextMarshall2(hBinding, SContext, pBuff, userRunDownIn, NULL, 0);
|
NDRSContextMarshall2(hBinding, SContext, pBuff, userRunDownIn, NULL,
|
||||||
|
RPC_CONTEXT_HANDLE_DEFAULT_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -252,6 +254,9 @@ void WINAPI NDRSContextMarshall2(RPC_BINDING_HANDLE hBinding,
|
||||||
if (!binding->server || !binding->Assoc)
|
if (!binding->server || !binding->Assoc)
|
||||||
RpcRaiseException(ERROR_INVALID_HANDLE);
|
RpcRaiseException(ERROR_INVALID_HANDLE);
|
||||||
|
|
||||||
|
if (Flags & RPC_CONTEXT_HANDLE_FLAGS)
|
||||||
|
FIXME("unimplemented flags: 0x%x\n", Flags & RPC_CONTEXT_HANDLE_FLAGS);
|
||||||
|
|
||||||
if (SContext->userContext)
|
if (SContext->userContext)
|
||||||
{
|
{
|
||||||
status = RpcServerAssoc_UpdateContextHandle(binding->Assoc, SContext, CtxGuard, userRunDownIn);
|
status = RpcServerAssoc_UpdateContextHandle(binding->Assoc, SContext, CtxGuard, userRunDownIn);
|
||||||
|
@ -287,7 +292,9 @@ NDR_SCONTEXT WINAPI NDRSContextUnmarshall(void *pBuff,
|
||||||
ULONG DataRepresentation)
|
ULONG DataRepresentation)
|
||||||
{
|
{
|
||||||
TRACE("(%p %08x)\n", pBuff, DataRepresentation);
|
TRACE("(%p %08x)\n", pBuff, DataRepresentation);
|
||||||
return NDRSContextUnmarshall2(I_RpcGetCurrentCallHandle(), pBuff, DataRepresentation, NULL, 0);
|
return NDRSContextUnmarshall2(I_RpcGetCurrentCallHandle(), pBuff,
|
||||||
|
DataRepresentation, NULL,
|
||||||
|
RPC_CONTEXT_HANDLE_DEFAULT_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -298,7 +305,8 @@ NDR_SCONTEXT WINAPI NDRSContextUnmarshallEx(RPC_BINDING_HANDLE hBinding,
|
||||||
ULONG DataRepresentation)
|
ULONG DataRepresentation)
|
||||||
{
|
{
|
||||||
TRACE("(%p %p %08x)\n", hBinding, pBuff, DataRepresentation);
|
TRACE("(%p %p %08x)\n", hBinding, pBuff, DataRepresentation);
|
||||||
return NDRSContextUnmarshall2(hBinding, pBuff, DataRepresentation, NULL, 0);
|
return NDRSContextUnmarshall2(hBinding, pBuff, DataRepresentation, NULL,
|
||||||
|
RPC_CONTEXT_HANDLE_DEFAULT_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -320,6 +328,9 @@ NDR_SCONTEXT WINAPI NDRSContextUnmarshall2(RPC_BINDING_HANDLE hBinding,
|
||||||
if (!binding->server || !binding->Assoc)
|
if (!binding->server || !binding->Assoc)
|
||||||
RpcRaiseException(ERROR_INVALID_HANDLE);
|
RpcRaiseException(ERROR_INVALID_HANDLE);
|
||||||
|
|
||||||
|
if (Flags & RPC_CONTEXT_HANDLE_FLAGS)
|
||||||
|
FIXME("unimplemented flags: 0x%x\n", Flags & RPC_CONTEXT_HANDLE_FLAGS);
|
||||||
|
|
||||||
if (!pBuff || (!context_ndr->attributes &&
|
if (!pBuff || (!context_ndr->attributes &&
|
||||||
UuidIsNil((UUID *)&context_ndr->uuid, &status)))
|
UuidIsNil((UUID *)&context_ndr->uuid, &status)))
|
||||||
status = RpcServerAssoc_AllocateContextHandle(binding->Assoc, CtxGuard,
|
status = RpcServerAssoc_AllocateContextHandle(binding->Assoc, CtxGuard,
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
* - Non-conformant strings
|
|
||||||
* - String structs
|
* - String structs
|
||||||
* - Byte count pointers
|
* - Byte count pointers
|
||||||
* - transmit_as/represent as
|
* - transmit_as/represent as
|
||||||
|
@ -1528,8 +1527,7 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
* BufferStart and BufferEnd won't be reset when allocating memory for
|
* BufferStart and BufferEnd won't be reset when allocating memory for
|
||||||
* sending the response. we don't have to check for the new buffer here as
|
* sending the response. we don't have to check for the new buffer here as
|
||||||
* it won't be used a type memory, only for buffer memory */
|
* it won't be used a type memory, only for buffer memory */
|
||||||
if (Pointer >= (unsigned char *)pStubMsg->BufferStart &&
|
if (Pointer >= pStubMsg->BufferStart && Pointer < pStubMsg->BufferEnd)
|
||||||
Pointer < (unsigned char *)pStubMsg->BufferEnd)
|
|
||||||
goto notfree;
|
goto notfree;
|
||||||
|
|
||||||
if (attr & RPC_FC_P_ONSTACK) {
|
if (attr & RPC_FC_P_ONSTACK) {
|
||||||
|
@ -3538,6 +3536,7 @@ ULONG WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
SavedMemorySize = pStubMsg->MemorySize;
|
SavedMemorySize = pStubMsg->MemorySize;
|
||||||
|
|
||||||
esize = ComplexStructSize(pStubMsg, pFormat);
|
esize = ComplexStructSize(pStubMsg, pFormat);
|
||||||
|
|
||||||
MemorySize = safe_multiply(pStubMsg->MaxCount, esize);
|
MemorySize = safe_multiply(pStubMsg->MaxCount, esize);
|
||||||
|
|
||||||
count = pStubMsg->ActualCount;
|
count = pStubMsg->ActualCount;
|
||||||
|
@ -4980,7 +4979,7 @@ static ULONG get_discriminant(unsigned char fc, const unsigned char *pMemory)
|
||||||
case RPC_FC_CHAR:
|
case RPC_FC_CHAR:
|
||||||
case RPC_FC_SMALL:
|
case RPC_FC_SMALL:
|
||||||
case RPC_FC_USMALL:
|
case RPC_FC_USMALL:
|
||||||
return *(const UCHAR *)pMemory;
|
return *pMemory;
|
||||||
case RPC_FC_WCHAR:
|
case RPC_FC_WCHAR:
|
||||||
case RPC_FC_SHORT:
|
case RPC_FC_SHORT:
|
||||||
case RPC_FC_USHORT:
|
case RPC_FC_USHORT:
|
||||||
|
@ -5800,12 +5799,12 @@ unsigned char *WINAPI NdrRangeUnmarshall(
|
||||||
case RPC_FC_CHAR:
|
case RPC_FC_CHAR:
|
||||||
case RPC_FC_SMALL:
|
case RPC_FC_SMALL:
|
||||||
RANGE_UNMARSHALL(UCHAR, "%d");
|
RANGE_UNMARSHALL(UCHAR, "%d");
|
||||||
TRACE("value: 0x%02x\n", **(UCHAR **)ppMemory);
|
TRACE("value: 0x%02x\n", **ppMemory);
|
||||||
break;
|
break;
|
||||||
case RPC_FC_BYTE:
|
case RPC_FC_BYTE:
|
||||||
case RPC_FC_USMALL:
|
case RPC_FC_USMALL:
|
||||||
RANGE_UNMARSHALL(CHAR, "%u");
|
RANGE_UNMARSHALL(CHAR, "%u");
|
||||||
TRACE("value: 0x%02x\n", **(UCHAR **)ppMemory);
|
TRACE("value: 0x%02x\n", **ppMemory);
|
||||||
break;
|
break;
|
||||||
case RPC_FC_WCHAR: /* FIXME: valid? */
|
case RPC_FC_WCHAR: /* FIXME: valid? */
|
||||||
case RPC_FC_USHORT:
|
case RPC_FC_USHORT:
|
||||||
|
@ -5913,7 +5912,7 @@ static unsigned char *WINAPI NdrBaseTypeMarshall(
|
||||||
case RPC_FC_SMALL:
|
case RPC_FC_SMALL:
|
||||||
case RPC_FC_USMALL:
|
case RPC_FC_USMALL:
|
||||||
safe_copy_to_buffer(pStubMsg, pMemory, sizeof(UCHAR));
|
safe_copy_to_buffer(pStubMsg, pMemory, sizeof(UCHAR));
|
||||||
TRACE("value: 0x%02x\n", *(UCHAR *)pMemory);
|
TRACE("value: 0x%02x\n", *pMemory);
|
||||||
break;
|
break;
|
||||||
case RPC_FC_WCHAR:
|
case RPC_FC_WCHAR:
|
||||||
case RPC_FC_SHORT:
|
case RPC_FC_SHORT:
|
||||||
|
@ -5998,7 +5997,7 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
|
||||||
case RPC_FC_SMALL:
|
case RPC_FC_SMALL:
|
||||||
case RPC_FC_USMALL:
|
case RPC_FC_USMALL:
|
||||||
BASE_TYPE_UNMARSHALL(UCHAR);
|
BASE_TYPE_UNMARSHALL(UCHAR);
|
||||||
TRACE("value: 0x%02x\n", **(UCHAR **)ppMemory);
|
TRACE("value: 0x%02x\n", **ppMemory);
|
||||||
break;
|
break;
|
||||||
case RPC_FC_WCHAR:
|
case RPC_FC_WCHAR:
|
||||||
case RPC_FC_SHORT:
|
case RPC_FC_SHORT:
|
||||||
|
@ -6208,6 +6207,7 @@ static unsigned char *WINAPI NdrContextHandleMarshall(
|
||||||
ERR("invalid format type %x\n", *pFormat);
|
ERR("invalid format type %x\n", *pFormat);
|
||||||
RpcRaiseException(RPC_S_INTERNAL_ERROR);
|
RpcRaiseException(RPC_S_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
|
TRACE("flags: 0x%02x\n", pFormat[1]);
|
||||||
|
|
||||||
if (pFormat[1] & 0x80)
|
if (pFormat[1] & 0x80)
|
||||||
NdrClientContextMarshall(pStubMsg, *(NDR_CCONTEXT **)pMemory, FALSE);
|
NdrClientContextMarshall(pStubMsg, *(NDR_CCONTEXT **)pMemory, FALSE);
|
||||||
|
@ -6226,12 +6226,18 @@ static unsigned char *WINAPI NdrContextHandleUnmarshall(
|
||||||
PFORMAT_STRING pFormat,
|
PFORMAT_STRING pFormat,
|
||||||
unsigned char fMustAlloc)
|
unsigned char fMustAlloc)
|
||||||
{
|
{
|
||||||
|
TRACE("pStubMsg %p, ppMemory %p, pFormat %p, fMustAlloc %s\n", pStubMsg,
|
||||||
|
ppMemory, pFormat, fMustAlloc ? "TRUE": "FALSE");
|
||||||
|
|
||||||
if (*pFormat != RPC_FC_BIND_CONTEXT)
|
if (*pFormat != RPC_FC_BIND_CONTEXT)
|
||||||
{
|
{
|
||||||
ERR("invalid format type %x\n", *pFormat);
|
ERR("invalid format type %x\n", *pFormat);
|
||||||
RpcRaiseException(RPC_S_INTERNAL_ERROR);
|
RpcRaiseException(RPC_S_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
|
TRACE("flags: 0x%02x\n", pFormat[1]);
|
||||||
|
|
||||||
|
/* [out]-only or [ret] param */
|
||||||
|
if ((pFormat[1] & 0x60) == 0x20)
|
||||||
**(NDR_CCONTEXT **)ppMemory = NULL;
|
**(NDR_CCONTEXT **)ppMemory = NULL;
|
||||||
NdrClientContextUnmarshall(pStubMsg, *(NDR_CCONTEXT **)ppMemory, pStubMsg->RpcMsg->Handle);
|
NdrClientContextUnmarshall(pStubMsg, *(NDR_CCONTEXT **)ppMemory, pStubMsg->RpcMsg->Handle);
|
||||||
|
|
||||||
|
@ -6301,7 +6307,8 @@ void WINAPI NdrServerContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
}
|
}
|
||||||
|
|
||||||
NDRSContextMarshall2(pStubMsg->RpcMsg->Handle, ContextHandle,
|
NDRSContextMarshall2(pStubMsg->RpcMsg->Handle, ContextHandle,
|
||||||
pStubMsg->Buffer, RundownRoutine, NULL, 0);
|
pStubMsg->Buffer, RundownRoutine, NULL,
|
||||||
|
RPC_CONTEXT_HANDLE_DEFAULT_FLAGS);
|
||||||
pStubMsg->Buffer += cbNDRContext;
|
pStubMsg->Buffer += cbNDRContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6323,7 +6330,7 @@ NDR_SCONTEXT WINAPI NdrServerContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg)
|
||||||
ContextHandle = NDRSContextUnmarshall2(pStubMsg->RpcMsg->Handle,
|
ContextHandle = NDRSContextUnmarshall2(pStubMsg->RpcMsg->Handle,
|
||||||
pStubMsg->Buffer,
|
pStubMsg->Buffer,
|
||||||
pStubMsg->RpcMsg->DataRepresentation,
|
pStubMsg->RpcMsg->DataRepresentation,
|
||||||
NULL, 0);
|
NULL, RPC_CONTEXT_HANDLE_DEFAULT_FLAGS);
|
||||||
pStubMsg->Buffer += cbNDRContext;
|
pStubMsg->Buffer += cbNDRContext;
|
||||||
|
|
||||||
return ContextHandle;
|
return ContextHandle;
|
||||||
|
@ -6339,9 +6346,24 @@ void WINAPI NdrContextHandleSize(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg,
|
NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
PFORMAT_STRING pFormat)
|
PFORMAT_STRING pFormat)
|
||||||
{
|
{
|
||||||
|
RPC_SYNTAX_IDENTIFIER *if_id = NULL;
|
||||||
|
ULONG flags = RPC_CONTEXT_HANDLE_DEFAULT_FLAGS;
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", pStubMsg, pFormat);
|
TRACE("(%p, %p)\n", pStubMsg, pFormat);
|
||||||
|
|
||||||
|
if (pFormat[1] & NDR_CONTEXT_HANDLE_SERIALIZE)
|
||||||
|
flags |= RPC_CONTEXT_HANDLE_SERIALIZE;
|
||||||
|
if (pFormat[1] & NDR_CONTEXT_HANDLE_NO_SERIALIZE)
|
||||||
|
flags |= RPC_CONTEXT_HANDLE_DONT_SERIALIZE;
|
||||||
|
if (pFormat[1] & NDR_STRICT_CONTEXT_HANDLE)
|
||||||
|
{
|
||||||
|
RPC_SERVER_INTERFACE *sif = pStubMsg->StubDesc->RpcInterfaceInformation;
|
||||||
|
if_id = &sif->InterfaceId;
|
||||||
|
}
|
||||||
|
|
||||||
return NDRSContextUnmarshall2(pStubMsg->RpcMsg->Handle, NULL,
|
return NDRSContextUnmarshall2(pStubMsg->RpcMsg->Handle, NULL,
|
||||||
pStubMsg->RpcMsg->DataRepresentation, NULL, 0);
|
pStubMsg->RpcMsg->DataRepresentation, if_id,
|
||||||
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
|
@ -6349,6 +6371,9 @@ void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
NDR_RUNDOWN RundownRoutine,
|
NDR_RUNDOWN RundownRoutine,
|
||||||
PFORMAT_STRING pFormat)
|
PFORMAT_STRING pFormat)
|
||||||
{
|
{
|
||||||
|
RPC_SYNTAX_IDENTIFIER *if_id = NULL;
|
||||||
|
ULONG flags = RPC_CONTEXT_HANDLE_DEFAULT_FLAGS;
|
||||||
|
|
||||||
TRACE("(%p, %p, %p, %p)\n", pStubMsg, ContextHandle, RundownRoutine, pFormat);
|
TRACE("(%p, %p, %p, %p)\n", pStubMsg, ContextHandle, RundownRoutine, pFormat);
|
||||||
|
|
||||||
ALIGN_POINTER(pStubMsg->Buffer, 4);
|
ALIGN_POINTER(pStubMsg->Buffer, 4);
|
||||||
|
@ -6360,9 +6385,18 @@ void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: do something with pFormat */
|
if (pFormat[1] & NDR_CONTEXT_HANDLE_SERIALIZE)
|
||||||
|
flags |= RPC_CONTEXT_HANDLE_SERIALIZE;
|
||||||
|
if (pFormat[1] & NDR_CONTEXT_HANDLE_NO_SERIALIZE)
|
||||||
|
flags |= RPC_CONTEXT_HANDLE_DONT_SERIALIZE;
|
||||||
|
if (pFormat[1] & NDR_STRICT_CONTEXT_HANDLE)
|
||||||
|
{
|
||||||
|
RPC_SERVER_INTERFACE *sif = pStubMsg->StubDesc->RpcInterfaceInformation;
|
||||||
|
if_id = &sif->InterfaceId;
|
||||||
|
}
|
||||||
|
|
||||||
NDRSContextMarshall2(pStubMsg->RpcMsg->Handle, ContextHandle,
|
NDRSContextMarshall2(pStubMsg->RpcMsg->Handle, ContextHandle,
|
||||||
pStubMsg->Buffer, RundownRoutine, NULL, 0);
|
pStubMsg->Buffer, RundownRoutine, if_id, flags);
|
||||||
pStubMsg->Buffer += cbNDRContext;
|
pStubMsg->Buffer += cbNDRContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6370,6 +6404,8 @@ NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
PFORMAT_STRING pFormat)
|
PFORMAT_STRING pFormat)
|
||||||
{
|
{
|
||||||
NDR_SCONTEXT ContextHandle;
|
NDR_SCONTEXT ContextHandle;
|
||||||
|
RPC_SYNTAX_IDENTIFIER *if_id = NULL;
|
||||||
|
ULONG flags = RPC_CONTEXT_HANDLE_DEFAULT_FLAGS;
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", pStubMsg, pFormat);
|
TRACE("(%p, %p)\n", pStubMsg, pFormat);
|
||||||
|
|
||||||
|
@ -6382,12 +6418,74 @@ NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: do something with pFormat */
|
if (pFormat[1] & NDR_CONTEXT_HANDLE_SERIALIZE)
|
||||||
|
flags |= RPC_CONTEXT_HANDLE_SERIALIZE;
|
||||||
|
if (pFormat[1] & NDR_CONTEXT_HANDLE_NO_SERIALIZE)
|
||||||
|
flags |= RPC_CONTEXT_HANDLE_DONT_SERIALIZE;
|
||||||
|
if (pFormat[1] & NDR_STRICT_CONTEXT_HANDLE)
|
||||||
|
{
|
||||||
|
RPC_SERVER_INTERFACE *sif = pStubMsg->StubDesc->RpcInterfaceInformation;
|
||||||
|
if_id = &sif->InterfaceId;
|
||||||
|
}
|
||||||
|
|
||||||
ContextHandle = NDRSContextUnmarshall2(pStubMsg->RpcMsg->Handle,
|
ContextHandle = NDRSContextUnmarshall2(pStubMsg->RpcMsg->Handle,
|
||||||
pStubMsg->Buffer,
|
pStubMsg->Buffer,
|
||||||
pStubMsg->RpcMsg->DataRepresentation,
|
pStubMsg->RpcMsg->DataRepresentation,
|
||||||
NULL, 0);
|
if_id, flags);
|
||||||
pStubMsg->Buffer += cbNDRContext;
|
pStubMsg->Buffer += cbNDRContext;
|
||||||
|
|
||||||
return ContextHandle;
|
return ContextHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* NdrCorrelationInitialize [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Initializes correlation validity checking.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pStubMsg [I] MIDL_STUB_MESSAGE used during unmarshalling.
|
||||||
|
* pMemory [I] Pointer to memory to use as a cache.
|
||||||
|
* CacheSize [I] Size of the memory pointed to by pMemory.
|
||||||
|
* Flags [I] Reserved. Set to zero.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Nothing.
|
||||||
|
*/
|
||||||
|
void WINAPI NdrCorrelationInitialize(PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG Flags)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %p, %d, 0x%x): stub\n", pStubMsg, pMemory, CacheSize, Flags);
|
||||||
|
pStubMsg->fHasNewCorrDesc = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* NdrCorrelationPass [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Performs correlation validity checking.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pStubMsg [I] MIDL_STUB_MESSAGE used during unmarshalling.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Nothing.
|
||||||
|
*/
|
||||||
|
void WINAPI NdrCorrelationPass(PMIDL_STUB_MESSAGE pStubMsg)
|
||||||
|
{
|
||||||
|
FIXME("(%p): stub\n", pStubMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* NdrCorrelationFree [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Frees any resources used while unmarshalling parameters that need
|
||||||
|
* correlation validity checking.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pStubMsg [I] MIDL_STUB_MESSAGE used during unmarshalling.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Nothing.
|
||||||
|
*/
|
||||||
|
void WINAPI NdrCorrelationFree(PMIDL_STUB_MESSAGE pStubMsg)
|
||||||
|
{
|
||||||
|
FIXME("(%p): stub\n", pStubMsg);
|
||||||
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ static ULONG WINAPI RpcStream_Release(LPSTREAM iface)
|
||||||
RpcStreamImpl *This = (RpcStreamImpl *)iface;
|
RpcStreamImpl *This = (RpcStreamImpl *)iface;
|
||||||
if (!--(This->RefCount)) {
|
if (!--(This->RefCount)) {
|
||||||
TRACE("size=%d\n", *This->size);
|
TRACE("size=%d\n", *This->size);
|
||||||
This->pMsg->Buffer = (unsigned char*)This->data + *This->size;
|
This->pMsg->Buffer = This->data + *This->size;
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
#include "objbase.h"
|
#include "objbase.h"
|
||||||
#include "rpc.h"
|
#include "rpc.h"
|
||||||
#include "rpcproxy.h"
|
#include "rpcproxy.h"
|
||||||
#include "ndrtypes.h"
|
|
||||||
|
|
||||||
|
#include "wine/exception.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "wine/rpcfc.h"
|
#include "wine/rpcfc.h"
|
||||||
|
|
||||||
|
@ -115,11 +115,12 @@ static inline unsigned long call_memory_sizer(PMIDL_STUB_MESSAGE pStubMsg, PFORM
|
||||||
}
|
}
|
||||||
|
|
||||||
#define STUBLESS_UNMARSHAL 1
|
#define STUBLESS_UNMARSHAL 1
|
||||||
#define STUBLESS_CALLSERVER 2
|
#define STUBLESS_INITOUT 2
|
||||||
#define STUBLESS_CALCSIZE 3
|
#define STUBLESS_CALLSERVER 3
|
||||||
#define STUBLESS_GETBUFFER 4
|
#define STUBLESS_CALCSIZE 4
|
||||||
#define STUBLESS_MARSHAL 5
|
#define STUBLESS_GETBUFFER 5
|
||||||
#define STUBLESS_FREE 6
|
#define STUBLESS_MARSHAL 6
|
||||||
|
#define STUBLESS_FREE 7
|
||||||
|
|
||||||
void WINAPI NdrRpcSmSetClientToOsf(PMIDL_STUB_MESSAGE pMessage)
|
void WINAPI NdrRpcSmSetClientToOsf(PMIDL_STUB_MESSAGE pMessage)
|
||||||
{
|
{
|
||||||
|
@ -563,6 +564,8 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
|
||||||
/* the pointer to the object when in OLE mode */
|
/* the pointer to the object when in OLE mode */
|
||||||
void * This = NULL;
|
void * This = NULL;
|
||||||
PFORMAT_STRING pHandleFormat;
|
PFORMAT_STRING pHandleFormat;
|
||||||
|
/* correlation cache */
|
||||||
|
unsigned long NdrCorrCache[256];
|
||||||
|
|
||||||
TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat);
|
TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat);
|
||||||
|
|
||||||
|
@ -664,10 +667,65 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
|
||||||
if (ext_flags.HasNewCorrDesc)
|
if (ext_flags.HasNewCorrDesc)
|
||||||
{
|
{
|
||||||
/* initialize extra correlation package */
|
/* initialize extra correlation package */
|
||||||
FIXME("new correlation description not implemented\n");
|
NdrCorrelationInitialize(&stubMsg, NdrCorrCache, sizeof(NdrCorrCache), 0);
|
||||||
stubMsg.fHasNewCorrDesc = TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* order of phases:
|
||||||
|
* 1. PROXY_CALCSIZE - calculate the buffer size
|
||||||
|
* 2. PROXY_GETBUFFER - allocate the buffer
|
||||||
|
* 3. PROXY_MARHSAL - marshal [in] params into the buffer
|
||||||
|
* 4. PROXY_SENDRECEIVE - send/receive buffer
|
||||||
|
* 5. PROXY_UNMARHSAL - unmarshal [out] params from buffer
|
||||||
|
*/
|
||||||
|
if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)
|
||||||
|
{
|
||||||
|
__TRY
|
||||||
|
{
|
||||||
|
for (phase = PROXY_CALCSIZE; phase <= PROXY_UNMARSHAL; phase++)
|
||||||
|
{
|
||||||
|
TRACE("phase = %d\n", phase);
|
||||||
|
switch (phase)
|
||||||
|
{
|
||||||
|
case PROXY_GETBUFFER:
|
||||||
|
/* allocate the buffer */
|
||||||
|
NdrProxyGetBuffer(This, &stubMsg);
|
||||||
|
break;
|
||||||
|
case PROXY_SENDRECEIVE:
|
||||||
|
/* send the [in] params and receive the [out] and [retval]
|
||||||
|
* params */
|
||||||
|
NdrProxySendReceive(This, &stubMsg);
|
||||||
|
|
||||||
|
/* convert strings, floating point values and endianess into our
|
||||||
|
* preferred format */
|
||||||
|
if ((rpcMsg.DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)
|
||||||
|
NdrConvert(&stubMsg, pFormat);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PROXY_CALCSIZE:
|
||||||
|
case PROXY_MARSHAL:
|
||||||
|
case PROXY_UNMARSHAL:
|
||||||
|
if (bV2Format)
|
||||||
|
client_do_args(&stubMsg, pFormat, phase, number_of_params,
|
||||||
|
(unsigned char *)&RetVal);
|
||||||
|
else
|
||||||
|
client_do_args_old_format(&stubMsg, pFormat, phase, stack_size,
|
||||||
|
(unsigned char *)&RetVal,
|
||||||
|
(pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ERR("shouldn't reach here. phase %d\n", phase);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__EXCEPT(NULL)
|
||||||
|
{
|
||||||
|
RetVal = NdrProxyErrorHandler(GetExceptionCode());
|
||||||
|
}
|
||||||
|
__ENDTRY
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* order of phases:
|
/* order of phases:
|
||||||
* 1. PROXY_CALCSIZE - calculate the buffer size
|
* 1. PROXY_CALCSIZE - calculate the buffer size
|
||||||
* 2. PROXY_GETBUFFER - allocate the buffer
|
* 2. PROXY_GETBUFFER - allocate the buffer
|
||||||
|
@ -682,9 +740,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
|
||||||
{
|
{
|
||||||
case PROXY_GETBUFFER:
|
case PROXY_GETBUFFER:
|
||||||
/* allocate the buffer */
|
/* allocate the buffer */
|
||||||
if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)
|
if (Oif_flags.HasPipes)
|
||||||
NdrProxyGetBuffer(This, &stubMsg);
|
|
||||||
else if (Oif_flags.HasPipes)
|
|
||||||
/* NdrGetPipeBuffer(...) */
|
/* NdrGetPipeBuffer(...) */
|
||||||
FIXME("pipes not supported yet\n");
|
FIXME("pipes not supported yet\n");
|
||||||
else
|
else
|
||||||
|
@ -702,9 +758,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
|
||||||
case PROXY_SENDRECEIVE:
|
case PROXY_SENDRECEIVE:
|
||||||
/* send the [in] params and receive the [out] and [retval]
|
/* send the [in] params and receive the [out] and [retval]
|
||||||
* params */
|
* params */
|
||||||
if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)
|
if (Oif_flags.HasPipes)
|
||||||
NdrProxySendReceive(This, &stubMsg);
|
|
||||||
else if (Oif_flags.HasPipes)
|
|
||||||
/* NdrPipesSendReceive(...) */
|
/* NdrPipesSendReceive(...) */
|
||||||
FIXME("pipes not supported yet\n");
|
FIXME("pipes not supported yet\n");
|
||||||
else
|
else
|
||||||
|
@ -741,11 +795,12 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ext_flags.HasNewCorrDesc)
|
if (ext_flags.HasNewCorrDesc)
|
||||||
{
|
{
|
||||||
/* free extra correlation package */
|
/* free extra correlation package */
|
||||||
/* NdrCorrelationFree(&stubMsg); */
|
NdrCorrelationFree(&stubMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Oif_flags.HasPipes)
|
if (Oif_flags.HasPipes)
|
||||||
|
@ -855,6 +910,7 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
|
||||||
pFormat = ComputeVariance(pStubMsg, NULL, pFormat, pStubMsg->MaxCount);
|
pFormat = ComputeVariance(pStubMsg, NULL, pFormat, pStubMsg->MaxCount);
|
||||||
size = ComplexStructSize(pStubMsg, pFormat);
|
size = ComplexStructSize(pStubMsg, pFormat);
|
||||||
size *= pStubMsg->MaxCount;
|
size *= pStubMsg->MaxCount;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
FIXME("Unhandled type %02x\n", *pFormat);
|
FIXME("Unhandled type %02x\n", *pFormat);
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
@ -886,7 +942,7 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
unsigned char *pArg;
|
unsigned char *pArg;
|
||||||
|
|
||||||
current_stack_offset = pParam->stack_offset;
|
current_stack_offset = pParam->stack_offset;
|
||||||
pArg = (unsigned char *)(args+current_stack_offset);
|
pArg = args + current_stack_offset;
|
||||||
|
|
||||||
TRACE("param[%d]: new format\n", i);
|
TRACE("param[%d]: new format\n", i);
|
||||||
TRACE("\tparam_attributes:"); dump_RPC_FC_PROC_PF(pParam->param_attributes); TRACE("\n");
|
TRACE("\tparam_attributes:"); dump_RPC_FC_PROC_PF(pParam->param_attributes); TRACE("\n");
|
||||||
|
@ -900,6 +956,10 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
|
|
||||||
TRACE("\tbase type: 0x%02x\n", *pTypeFormat);
|
TRACE("\tbase type: 0x%02x\n", *pTypeFormat);
|
||||||
|
|
||||||
|
/* make a note of the address of the return value parameter for later */
|
||||||
|
if (pParam->param_attributes.IsReturn)
|
||||||
|
retval_ptr = (LONG_PTR *)pArg;
|
||||||
|
|
||||||
switch (phase)
|
switch (phase)
|
||||||
{
|
{
|
||||||
case STUBLESS_MARSHAL:
|
case STUBLESS_MARSHAL:
|
||||||
|
@ -915,6 +975,8 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
if (pParam->param_attributes.ServerAllocSize)
|
if (pParam->param_attributes.ServerAllocSize)
|
||||||
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
|
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
|
||||||
break;
|
break;
|
||||||
|
case STUBLESS_INITOUT:
|
||||||
|
break;
|
||||||
case STUBLESS_UNMARSHAL:
|
case STUBLESS_UNMARSHAL:
|
||||||
if (pParam->param_attributes.ServerAllocSize)
|
if (pParam->param_attributes.ServerAllocSize)
|
||||||
*(void **)pArg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
*(void **)pArg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
|
@ -927,11 +989,6 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
else
|
else
|
||||||
call_unmarshaller(pStubMsg, &pArg, pTypeFormat, 0);
|
call_unmarshaller(pStubMsg, &pArg, pTypeFormat, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make a note of the address of the return value parameter for later */
|
|
||||||
if (pParam->param_attributes.IsReturn)
|
|
||||||
retval_ptr = (LONG_PTR *)pArg;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case STUBLESS_CALCSIZE:
|
case STUBLESS_CALCSIZE:
|
||||||
if (pParam->param_attributes.IsOut || pParam->param_attributes.IsReturn)
|
if (pParam->param_attributes.IsOut || pParam->param_attributes.IsReturn)
|
||||||
|
@ -988,7 +1045,21 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
|
|
||||||
if (pParam->param_attributes.ServerAllocSize)
|
if (pParam->param_attributes.ServerAllocSize)
|
||||||
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
|
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
|
||||||
/* FIXME: call call_freer here for IN types with MustFree set */
|
break;
|
||||||
|
case STUBLESS_INITOUT:
|
||||||
|
if (!pParam->param_attributes.IsIn &&
|
||||||
|
pParam->param_attributes.IsOut &&
|
||||||
|
!pParam->param_attributes.ServerAllocSize &&
|
||||||
|
!pParam->param_attributes.IsByValue)
|
||||||
|
{
|
||||||
|
DWORD size = calc_arg_size(pStubMsg, pTypeFormat);
|
||||||
|
|
||||||
|
if(size)
|
||||||
|
{
|
||||||
|
*(void **)pArg = NdrAllocate(pStubMsg, size);
|
||||||
|
memset(*(void **)pArg, 0, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case STUBLESS_UNMARSHAL:
|
case STUBLESS_UNMARSHAL:
|
||||||
if (pParam->param_attributes.ServerAllocSize)
|
if (pParam->param_attributes.ServerAllocSize)
|
||||||
|
@ -1002,18 +1073,6 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
else
|
else
|
||||||
call_unmarshaller(pStubMsg, (unsigned char **)pArg, pTypeFormat, 0);
|
call_unmarshaller(pStubMsg, (unsigned char **)pArg, pTypeFormat, 0);
|
||||||
}
|
}
|
||||||
else if (pParam->param_attributes.IsOut &&
|
|
||||||
!pParam->param_attributes.ServerAllocSize &&
|
|
||||||
!pParam->param_attributes.IsByValue)
|
|
||||||
{
|
|
||||||
DWORD size = calc_arg_size(pStubMsg, pTypeFormat);
|
|
||||||
|
|
||||||
if(size)
|
|
||||||
{
|
|
||||||
*(void **)pArg = NdrAllocate(pStubMsg, size);
|
|
||||||
memset(*(void **)pArg, 0, size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case STUBLESS_CALCSIZE:
|
case STUBLESS_CALCSIZE:
|
||||||
if (pParam->param_attributes.IsOut || pParam->param_attributes.IsReturn)
|
if (pParam->param_attributes.IsOut || pParam->param_attributes.IsReturn)
|
||||||
|
@ -1058,7 +1117,7 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
* if present, so adjust this */
|
* if present, so adjust this */
|
||||||
unsigned short current_stack_offset_adjusted = current_stack_offset +
|
unsigned short current_stack_offset_adjusted = current_stack_offset +
|
||||||
(object ? sizeof(void *) : 0);
|
(object ? sizeof(void *) : 0);
|
||||||
unsigned char *pArg = (unsigned char *)(args+current_stack_offset_adjusted);
|
unsigned char *pArg = args + current_stack_offset_adjusted;
|
||||||
|
|
||||||
/* no more parameters; exit loop */
|
/* no more parameters; exit loop */
|
||||||
if (current_stack_offset_adjusted >= stack_size)
|
if (current_stack_offset_adjusted >= stack_size)
|
||||||
|
@ -1076,6 +1135,9 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
|
|
||||||
TRACE("\tbase type 0x%02x\n", *pTypeFormat);
|
TRACE("\tbase type 0x%02x\n", *pTypeFormat);
|
||||||
|
|
||||||
|
if (pParam->param_direction == RPC_FC_RETURN_PARAM_BASETYPE)
|
||||||
|
retval_ptr = (LONG_PTR *)pArg;
|
||||||
|
|
||||||
switch (phase)
|
switch (phase)
|
||||||
{
|
{
|
||||||
case STUBLESS_MARSHAL:
|
case STUBLESS_MARSHAL:
|
||||||
|
@ -1089,8 +1151,6 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
case STUBLESS_UNMARSHAL:
|
case STUBLESS_UNMARSHAL:
|
||||||
if (pParam->param_direction == RPC_FC_IN_PARAM_BASETYPE)
|
if (pParam->param_direction == RPC_FC_IN_PARAM_BASETYPE)
|
||||||
call_unmarshaller(pStubMsg, &pArg, pTypeFormat, 0);
|
call_unmarshaller(pStubMsg, &pArg, pTypeFormat, 0);
|
||||||
else if (pParam->param_direction == RPC_FC_RETURN_PARAM_BASETYPE)
|
|
||||||
retval_ptr = (LONG_PTR *)pArg;
|
|
||||||
break;
|
break;
|
||||||
case STUBLESS_CALCSIZE:
|
case STUBLESS_CALCSIZE:
|
||||||
if (pParam->param_direction == RPC_FC_RETURN_PARAM_BASETYPE)
|
if (pParam->param_direction == RPC_FC_RETURN_PARAM_BASETYPE)
|
||||||
|
@ -1113,6 +1173,9 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
|
|
||||||
TRACE("\tcomplex type 0x%02x\n", *pTypeFormat);
|
TRACE("\tcomplex type 0x%02x\n", *pTypeFormat);
|
||||||
|
|
||||||
|
if (pParam->param_direction == RPC_FC_RETURN_PARAM)
|
||||||
|
retval_ptr = (LONG_PTR *)pArg;
|
||||||
|
|
||||||
switch (phase)
|
switch (phase)
|
||||||
{
|
{
|
||||||
case STUBLESS_MARSHAL:
|
case STUBLESS_MARSHAL:
|
||||||
|
@ -1128,13 +1191,8 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
else if (pParam->param_direction == RPC_FC_OUT_PARAM)
|
else if (pParam->param_direction == RPC_FC_OUT_PARAM)
|
||||||
pStubMsg->pfnFree(*(void **)pArg);
|
pStubMsg->pfnFree(*(void **)pArg);
|
||||||
break;
|
break;
|
||||||
case STUBLESS_UNMARSHAL:
|
case STUBLESS_INITOUT:
|
||||||
if (pParam->param_direction == RPC_FC_IN_OUT_PARAM ||
|
if (pParam->param_direction == RPC_FC_OUT_PARAM)
|
||||||
pParam->param_direction == RPC_FC_IN_PARAM)
|
|
||||||
call_unmarshaller(pStubMsg, (unsigned char **)pArg, pTypeFormat, 0);
|
|
||||||
else if (pParam->param_direction == RPC_FC_RETURN_PARAM)
|
|
||||||
retval_ptr = (LONG_PTR *)pArg;
|
|
||||||
else if (pParam->param_direction == RPC_FC_OUT_PARAM)
|
|
||||||
{
|
{
|
||||||
DWORD size = calc_arg_size(pStubMsg, pTypeFormat);
|
DWORD size = calc_arg_size(pStubMsg, pTypeFormat);
|
||||||
|
|
||||||
|
@ -1145,6 +1203,11 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case STUBLESS_UNMARSHAL:
|
||||||
|
if (pParam->param_direction == RPC_FC_IN_OUT_PARAM ||
|
||||||
|
pParam->param_direction == RPC_FC_IN_PARAM)
|
||||||
|
call_unmarshaller(pStubMsg, (unsigned char **)pArg, pTypeFormat, 0);
|
||||||
|
break;
|
||||||
case STUBLESS_CALCSIZE:
|
case STUBLESS_CALCSIZE:
|
||||||
if (pParam->param_direction == RPC_FC_OUT_PARAM ||
|
if (pParam->param_direction == RPC_FC_OUT_PARAM ||
|
||||||
pParam->param_direction == RPC_FC_IN_OUT_PARAM ||
|
pParam->param_direction == RPC_FC_IN_OUT_PARAM ||
|
||||||
|
@ -1406,9 +1469,10 @@ LONG WINAPI NdrStubCall2(
|
||||||
stubMsg.Buffer = stubMsg.BufferStart;
|
stubMsg.Buffer = stubMsg.BufferStart;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STUBLESS_MARSHAL:
|
|
||||||
case STUBLESS_UNMARSHAL:
|
case STUBLESS_UNMARSHAL:
|
||||||
|
case STUBLESS_INITOUT:
|
||||||
case STUBLESS_CALCSIZE:
|
case STUBLESS_CALCSIZE:
|
||||||
|
case STUBLESS_MARSHAL:
|
||||||
case STUBLESS_FREE:
|
case STUBLESS_FREE:
|
||||||
if (bV2Format)
|
if (bV2Format)
|
||||||
retval_ptr = stub_do_args(&stubMsg, &pFormat[parameter_start_offset],
|
retval_ptr = stub_do_args(&stubMsg, &pFormat[parameter_start_offset],
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndrtypes.h"
|
||||||
|
|
||||||
/* there can't be any alignment with the structures in this file */
|
/* there can't be any alignment with the structures in this file */
|
||||||
#include "pshpack1.h"
|
#include "pshpack1.h"
|
||||||
|
|
||||||
|
|
|
@ -332,7 +332,7 @@ static RPC_STATUS RpcAssoc_BindConnection(const RpcAssoc *assoc, RpcConnection *
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
I_RpcFreeBuffer(&msg);
|
I_RpcFree(msg.Buffer);
|
||||||
RPCRT4_FreeHeader(response_hdr);
|
RPCRT4_FreeHeader(response_hdr);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
148
reactos/dll/win32/rpcrt4/rpc_async.c
Normal file
148
reactos/dll/win32/rpcrt4/rpc_async.c
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
/*
|
||||||
|
* Asynchronous Call Support Functions
|
||||||
|
*
|
||||||
|
* Copyright 2007 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include "rpc.h"
|
||||||
|
#include "rpcndr.h"
|
||||||
|
#include "rpcasync.h"
|
||||||
|
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "rpc_binding.h"
|
||||||
|
#include "rpc_message.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(rpc);
|
||||||
|
|
||||||
|
#define RPC_ASYNC_SIGNATURE 0x43595341
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RpcAsyncInitializeHandle [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Initialises an asynchronous state so it can be used in other asynchronous
|
||||||
|
* functions and for use in asynchronous calls.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pAsync [I] Asynchronous state to initialise.
|
||||||
|
* Size [I] Size of the memory pointed to by pAsync.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPC_S_OK.
|
||||||
|
* Failure: Any error code.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI RpcAsyncInitializeHandle(PRPC_ASYNC_STATE pAsync, unsigned int Size)
|
||||||
|
{
|
||||||
|
TRACE("(%p, %d)\n", pAsync, Size);
|
||||||
|
|
||||||
|
if (Size != sizeof(*pAsync))
|
||||||
|
{
|
||||||
|
ERR("invalid Size %d\n", Size);
|
||||||
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
pAsync->Size = sizeof(*pAsync);
|
||||||
|
pAsync->Signature = RPC_ASYNC_SIGNATURE;
|
||||||
|
pAsync->Lock = 0;
|
||||||
|
pAsync->Flags = 0;
|
||||||
|
pAsync->StubInfo = NULL;
|
||||||
|
pAsync->RuntimeInfo = NULL;
|
||||||
|
memset(&pAsync->Reserved, 0, sizeof(*pAsync) - FIELD_OFFSET(RPC_ASYNC_STATE, Reserved));
|
||||||
|
|
||||||
|
return RPC_S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RpcAsyncGetCallStatus [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Retrieves the current status of the asynchronous call taking place.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pAsync [I] Asynchronous state to initialise.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* RPC_S_OK - The call was successfully completed.
|
||||||
|
* RPC_S_INVALID_ASYNC_HANDLE - The asynchronous structure is not valid.
|
||||||
|
* RPC_S_ASYNC_CALL_PENDING - The call is still in progress and has not been completed.
|
||||||
|
* Any other error code - The call failed.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI RpcAsyncGetCallStatus(PRPC_ASYNC_STATE pAsync)
|
||||||
|
{
|
||||||
|
FIXME("(%p): stub\n", pAsync);
|
||||||
|
return RPC_S_INVALID_ASYNC_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RpcAsyncCompleteCall [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Completes a client or server asynchronous call.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pAsync [I] Asynchronous state to initialise.
|
||||||
|
* Reply [I] The return value of the asynchronous function.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPC_S_OK.
|
||||||
|
* Failure: Any error code.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI RpcAsyncCompleteCall(PRPC_ASYNC_STATE pAsync, void *Reply)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %p): stub\n", pAsync, Reply);
|
||||||
|
return RPC_S_INVALID_ASYNC_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RpcAsyncAbortCall [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Aborts the asynchronous server call taking place.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pAsync [I] Asynchronous server state to abort.
|
||||||
|
* ExceptionCode [I] Exception code to return to the client in a fault packet.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPC_S_OK.
|
||||||
|
* Failure: Any error code.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI RpcAsyncAbortCall(PRPC_ASYNC_STATE pAsync, ULONG ExceptionCode)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %d/0x%x): stub\n", pAsync, ExceptionCode, ExceptionCode);
|
||||||
|
return RPC_S_INVALID_ASYNC_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RpcAsyncCancelCall [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Cancels the asynchronous client call taking place.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pAsync [I] Asynchronous client state to abort.
|
||||||
|
* fAbortCall [I] If TRUE, then send a cancel to the server, otherwise
|
||||||
|
* just wait for the call to complete.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPC_S_OK.
|
||||||
|
* Failure: Any error code.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI RpcAsyncCancelCall(PRPC_ASYNC_STATE pAsync, BOOL fAbortCall)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %s): stub\n", pAsync, fAbortCall ? "TRUE" : "FALSE");
|
||||||
|
return RPC_S_INVALID_ASYNC_HANDLE;
|
||||||
|
}
|
|
@ -754,8 +754,12 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
|
||||||
|
|
||||||
TRACE("buffer length = %u\n", pMsg->BufferLength);
|
TRACE("buffer length = %u\n", pMsg->BufferLength);
|
||||||
|
|
||||||
status = I_RpcGetBuffer(pMsg);
|
pMsg->Buffer = I_RpcAllocate(pMsg->BufferLength);
|
||||||
if (status != RPC_S_OK) goto fail;
|
if (!pMsg->Buffer)
|
||||||
|
{
|
||||||
|
status = ERROR_OUTOFMEMORY;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
first_flag = RPC_FLG_FIRST;
|
first_flag = RPC_FLG_FIRST;
|
||||||
auth_length = common_hdr.auth_len;
|
auth_length = common_hdr.auth_len;
|
||||||
|
@ -842,7 +846,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
|
||||||
*Header, hdr_length,
|
*Header, hdr_length,
|
||||||
(unsigned char *)pMsg->Buffer + buffer_length, data_length,
|
(unsigned char *)pMsg->Buffer + buffer_length, data_length,
|
||||||
(RpcAuthVerifier *)auth_data,
|
(RpcAuthVerifier *)auth_data,
|
||||||
(unsigned char *)auth_data + sizeof(RpcAuthVerifier),
|
auth_data + sizeof(RpcAuthVerifier),
|
||||||
header_auth_len - sizeof(RpcAuthVerifier));
|
header_auth_len - sizeof(RpcAuthVerifier));
|
||||||
if (status != RPC_S_OK) goto fail;
|
if (status != RPC_S_OK) goto fail;
|
||||||
}
|
}
|
||||||
|
@ -890,6 +894,54 @@ fail:
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* I_RpcNegotiateTransferSyntax [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Negotiates the transfer syntax used by a client connection by connecting
|
||||||
|
* to the server.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pMsg [I] RPC Message structure.
|
||||||
|
* pAsync [I] Asynchronous state to set.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPC_S_OK.
|
||||||
|
* Failure: Any error code.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI I_RpcNegotiateTransferSyntax(PRPC_MESSAGE pMsg)
|
||||||
|
{
|
||||||
|
RpcBinding* bind = (RpcBinding*)pMsg->Handle;
|
||||||
|
RpcConnection* conn;
|
||||||
|
RPC_STATUS status = RPC_S_OK;
|
||||||
|
|
||||||
|
TRACE("(%p)\n", pMsg);
|
||||||
|
|
||||||
|
if (!bind || bind->server)
|
||||||
|
return RPC_S_INVALID_BINDING;
|
||||||
|
|
||||||
|
/* if we already have a connection, we don't need to negotiate again */
|
||||||
|
if (!pMsg->ReservedForRuntime)
|
||||||
|
{
|
||||||
|
RPC_CLIENT_INTERFACE *cif = pMsg->RpcInterfaceInformation;
|
||||||
|
if (!cif) return RPC_S_INTERFACE_NOT_FOUND;
|
||||||
|
|
||||||
|
if (!bind->Endpoint || !bind->Endpoint[0])
|
||||||
|
{
|
||||||
|
TRACE("automatically resolving partially bound binding\n");
|
||||||
|
status = RpcEpResolveBinding(bind, cif);
|
||||||
|
if (status != RPC_S_OK) return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = RPCRT4_OpenBinding(bind, &conn, &cif->TransferSyntax,
|
||||||
|
&cif->InterfaceId);
|
||||||
|
|
||||||
|
if (status == RPC_S_OK)
|
||||||
|
pMsg->ReservedForRuntime = conn;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* I_RpcGetBuffer [RPCRT4.@]
|
* I_RpcGetBuffer [RPCRT4.@]
|
||||||
*
|
*
|
||||||
|
@ -916,11 +968,30 @@ fail:
|
||||||
*/
|
*/
|
||||||
RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg)
|
RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg)
|
||||||
{
|
{
|
||||||
TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength);
|
RPC_STATUS status;
|
||||||
pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->BufferLength);
|
RpcBinding* bind = (RpcBinding*)pMsg->Handle;
|
||||||
|
|
||||||
|
TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength);
|
||||||
|
|
||||||
|
if (!bind)
|
||||||
|
return RPC_S_INVALID_BINDING;
|
||||||
|
|
||||||
|
pMsg->Buffer = I_RpcAllocate(pMsg->BufferLength);
|
||||||
TRACE("Buffer=%p\n", pMsg->Buffer);
|
TRACE("Buffer=%p\n", pMsg->Buffer);
|
||||||
return pMsg->Buffer ? RPC_S_OK : ERROR_OUTOFMEMORY;
|
|
||||||
|
if (!pMsg->Buffer)
|
||||||
|
return ERROR_OUTOFMEMORY;
|
||||||
|
|
||||||
|
if (!bind->server)
|
||||||
|
{
|
||||||
|
status = I_RpcNegotiateTransferSyntax(pMsg);
|
||||||
|
if (status != RPC_S_OK)
|
||||||
|
I_RpcFree(pMsg->Buffer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
status = RPC_S_OK;
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -952,8 +1023,19 @@ static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg)
|
||||||
*/
|
*/
|
||||||
RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg)
|
RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg)
|
||||||
{
|
{
|
||||||
|
RpcBinding* bind = (RpcBinding*)pMsg->Handle;
|
||||||
|
|
||||||
TRACE("(%p) Buffer=%p\n", pMsg, pMsg->Buffer);
|
TRACE("(%p) Buffer=%p\n", pMsg, pMsg->Buffer);
|
||||||
HeapFree(GetProcessHeap(), 0, pMsg->Buffer);
|
|
||||||
|
if (!bind) return RPC_S_INVALID_BINDING;
|
||||||
|
|
||||||
|
if (pMsg->ReservedForRuntime)
|
||||||
|
{
|
||||||
|
RpcConnection *conn = pMsg->ReservedForRuntime;
|
||||||
|
RPCRT4_CloseBinding(bind, conn);
|
||||||
|
pMsg->ReservedForRuntime = NULL;
|
||||||
|
}
|
||||||
|
I_RpcFree(pMsg->Buffer);
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -978,43 +1060,26 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
|
||||||
{
|
{
|
||||||
RpcBinding* bind = (RpcBinding*)pMsg->Handle;
|
RpcBinding* bind = (RpcBinding*)pMsg->Handle;
|
||||||
RpcConnection* conn;
|
RpcConnection* conn;
|
||||||
RPC_CLIENT_INTERFACE* cif = NULL;
|
|
||||||
RPC_STATUS status;
|
RPC_STATUS status;
|
||||||
RpcPktHdr *hdr;
|
RpcPktHdr *hdr;
|
||||||
|
|
||||||
TRACE("(%p)\n", pMsg);
|
TRACE("(%p)\n", pMsg);
|
||||||
if (!bind || bind->server) return RPC_S_INVALID_BINDING;
|
if (!bind || bind->server || !pMsg->ReservedForRuntime) return RPC_S_INVALID_BINDING;
|
||||||
|
|
||||||
cif = pMsg->RpcInterfaceInformation;
|
conn = pMsg->ReservedForRuntime;
|
||||||
if (!cif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */
|
|
||||||
|
|
||||||
if (!bind->Endpoint || !bind->Endpoint[0])
|
|
||||||
{
|
|
||||||
TRACE("automatically resolving partially bound binding\n");
|
|
||||||
status = RpcEpResolveBinding(bind, cif);
|
|
||||||
if (status != RPC_S_OK) return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = RPCRT4_OpenBinding(bind, &conn, &cif->TransferSyntax,
|
|
||||||
&cif->InterfaceId);
|
|
||||||
if (status != RPC_S_OK) return status;
|
|
||||||
|
|
||||||
hdr = RPCRT4_BuildRequestHeader(pMsg->DataRepresentation,
|
hdr = RPCRT4_BuildRequestHeader(pMsg->DataRepresentation,
|
||||||
pMsg->BufferLength, pMsg->ProcNum,
|
pMsg->BufferLength,
|
||||||
|
pMsg->ProcNum & ~RPC_FLAGS_VALID_BIT,
|
||||||
&bind->ObjectUuid);
|
&bind->ObjectUuid);
|
||||||
if (!hdr)
|
if (!hdr)
|
||||||
{
|
|
||||||
RPCRT4_CloseBinding(bind, conn);
|
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
}
|
|
||||||
hdr->common.call_id = conn->NextCallId++;
|
hdr->common.call_id = conn->NextCallId++;
|
||||||
|
|
||||||
status = RPCRT4_Send(conn, hdr, pMsg->Buffer, pMsg->BufferLength);
|
status = RPCRT4_Send(conn, hdr, pMsg->Buffer, pMsg->BufferLength);
|
||||||
|
|
||||||
RPCRT4_FreeHeader(hdr);
|
RPCRT4_FreeHeader(hdr);
|
||||||
|
|
||||||
/* save the connection, so the response can be read from it */
|
|
||||||
pMsg->ReservedForRuntime = conn;
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1042,41 +1107,14 @@ static inline BOOL is_hard_error(RPC_STATUS status)
|
||||||
RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
|
RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
|
||||||
{
|
{
|
||||||
RpcBinding* bind = (RpcBinding*)pMsg->Handle;
|
RpcBinding* bind = (RpcBinding*)pMsg->Handle;
|
||||||
RpcConnection* conn;
|
|
||||||
RPC_CLIENT_INTERFACE* cif = NULL;
|
|
||||||
RPC_SERVER_INTERFACE* sif = NULL;
|
|
||||||
RPC_STATUS status;
|
RPC_STATUS status;
|
||||||
RpcPktHdr *hdr = NULL;
|
RpcPktHdr *hdr = NULL;
|
||||||
|
RpcConnection *conn;
|
||||||
|
|
||||||
TRACE("(%p)\n", pMsg);
|
TRACE("(%p)\n", pMsg);
|
||||||
if (!bind) return RPC_S_INVALID_BINDING;
|
if (!bind || bind->server || !pMsg->ReservedForRuntime) return RPC_S_INVALID_BINDING;
|
||||||
|
|
||||||
if (pMsg->ReservedForRuntime) {
|
|
||||||
conn = pMsg->ReservedForRuntime;
|
conn = pMsg->ReservedForRuntime;
|
||||||
pMsg->ReservedForRuntime = NULL;
|
|
||||||
} else {
|
|
||||||
if (bind->server) {
|
|
||||||
sif = pMsg->RpcInterfaceInformation;
|
|
||||||
if (!sif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */
|
|
||||||
status = RPCRT4_OpenBinding(bind, &conn, &sif->TransferSyntax,
|
|
||||||
&sif->InterfaceId);
|
|
||||||
} else {
|
|
||||||
cif = pMsg->RpcInterfaceInformation;
|
|
||||||
if (!cif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */
|
|
||||||
|
|
||||||
if (!bind->Endpoint || !bind->Endpoint[0])
|
|
||||||
{
|
|
||||||
TRACE("automatically resolving partially bound binding\n");
|
|
||||||
status = RpcEpResolveBinding(bind, cif);
|
|
||||||
if (status != RPC_S_OK) return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = RPCRT4_OpenBinding(bind, &conn, &cif->TransferSyntax,
|
|
||||||
&cif->InterfaceId);
|
|
||||||
}
|
|
||||||
if (status != RPC_S_OK) return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = RPCRT4_Receive(conn, &hdr, pMsg);
|
status = RPCRT4_Receive(conn, &hdr, pMsg);
|
||||||
if (status != RPC_S_OK) {
|
if (status != RPC_S_OK) {
|
||||||
WARN("receive failed with error %lx\n", status);
|
WARN("receive failed with error %lx\n", status);
|
||||||
|
@ -1085,16 +1123,6 @@ RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
|
||||||
|
|
||||||
switch (hdr->common.ptype) {
|
switch (hdr->common.ptype) {
|
||||||
case PKT_RESPONSE:
|
case PKT_RESPONSE:
|
||||||
if (bind->server) {
|
|
||||||
status = RPC_S_PROTOCOL_ERROR;
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case PKT_REQUEST:
|
|
||||||
if (!bind->server) {
|
|
||||||
status = RPC_S_PROTOCOL_ERROR;
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PKT_FAULT:
|
case PKT_FAULT:
|
||||||
ERR ("we got fault packet with status 0x%lx\n", hdr->fault.status);
|
ERR ("we got fault packet with status 0x%lx\n", hdr->fault.status);
|
||||||
|
@ -1109,13 +1137,13 @@ RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
RPCRT4_CloseBinding(bind, conn);
|
|
||||||
RPCRT4_FreeHeader(hdr);
|
RPCRT4_FreeHeader(hdr);
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
RPCRT4_FreeHeader(hdr);
|
RPCRT4_FreeHeader(hdr);
|
||||||
RPCRT4_DestroyConnection(conn);
|
RPCRT4_DestroyConnection(conn);
|
||||||
|
pMsg->ReservedForRuntime = NULL;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1140,16 +1168,55 @@ fail:
|
||||||
RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg)
|
RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg)
|
||||||
{
|
{
|
||||||
RPC_STATUS status;
|
RPC_STATUS status;
|
||||||
RPC_MESSAGE original_message;
|
void *original_buffer;
|
||||||
|
|
||||||
TRACE("(%p)\n", pMsg);
|
TRACE("(%p)\n", pMsg);
|
||||||
|
|
||||||
original_message = *pMsg;
|
original_buffer = pMsg->Buffer;
|
||||||
status = I_RpcSend(pMsg);
|
status = I_RpcSend(pMsg);
|
||||||
if (status == RPC_S_OK)
|
if (status == RPC_S_OK)
|
||||||
status = I_RpcReceive(pMsg);
|
status = I_RpcReceive(pMsg);
|
||||||
/* free the buffer replaced by a new buffer in I_RpcReceive */
|
/* free the buffer replaced by a new buffer in I_RpcReceive */
|
||||||
if (status == RPC_S_OK)
|
if (status == RPC_S_OK)
|
||||||
I_RpcFreeBuffer(&original_message);
|
I_RpcFree(original_buffer);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* I_RpcAsyncSetHandle [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Sets the asynchronous state of the handle contained in the RPC message
|
||||||
|
* structure.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pMsg [I] RPC Message structure.
|
||||||
|
* pAsync [I] Asynchronous state to set.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPC_S_OK.
|
||||||
|
* Failure: Any error code.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI I_RpcAsyncSetHandle(PRPC_MESSAGE pMsg, PRPC_ASYNC_STATE pAsync)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %p): stub\n", pMsg, pAsync);
|
||||||
|
return RPC_S_INVALID_BINDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* I_RpcAsyncAbortCall [RPCRT4.@]
|
||||||
|
*
|
||||||
|
* Aborts an asynchronous call.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* pAsync [I] Asynchronous state.
|
||||||
|
* ExceptionCode [I] Exception code.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPC_S_OK.
|
||||||
|
* Failure: Any error code.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI I_RpcAsyncAbortCall(PRPC_ASYNC_STATE pAsync, ULONG ExceptionCode)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %d): stub\n", pAsync, ExceptionCode);
|
||||||
|
return RPC_S_INVALID_ASYNC_HANDLE;
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright 2001 Ove Kåven, TransGaming Technologies
|
* Copyright 2001 Ove Kåven, TransGaming Technologies
|
||||||
* Copyright 2004 Filip Navara
|
* Copyright 2004 Filip Navara
|
||||||
|
* Copyright 2006-2008 Robert Shearman (for CodeWeavers)
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -17,9 +18,6 @@
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*
|
|
||||||
* TODO:
|
|
||||||
* - a whole lot
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -163,25 +161,14 @@ static WINE_EXCEPTION_FILTER(rpc_filter)
|
||||||
return EXCEPTION_EXECUTE_HANDLER;
|
return EXCEPTION_EXECUTE_HANDLER;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSAGE* msg)
|
static RPC_STATUS process_bind_packet(RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg)
|
||||||
{
|
{
|
||||||
RpcServerInterface* sif;
|
|
||||||
RPC_DISPATCH_FUNCTION func;
|
|
||||||
UUID *object_uuid;
|
|
||||||
RpcPktHdr *response = NULL;
|
|
||||||
void *buf = msg->Buffer;
|
|
||||||
RPC_STATUS status;
|
RPC_STATUS status;
|
||||||
BOOL exception;
|
RpcServerInterface* sif;
|
||||||
NDR_SCONTEXT context_handle;
|
RpcPktHdr *response = NULL;
|
||||||
|
|
||||||
msg->Handle = (RPC_BINDING_HANDLE)conn->server_binding;
|
|
||||||
|
|
||||||
switch (hdr->common.ptype) {
|
|
||||||
case PKT_BIND:
|
|
||||||
TRACE("got bind packet\n");
|
|
||||||
|
|
||||||
/* FIXME: do more checks! */
|
/* FIXME: do more checks! */
|
||||||
if (hdr->bind.max_tsize < RPC_MIN_PACKET_SIZE ||
|
if (hdr->max_tsize < RPC_MIN_PACKET_SIZE ||
|
||||||
!UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status) ||
|
!UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status) ||
|
||||||
conn->server_binding) {
|
conn->server_binding) {
|
||||||
TRACE("packet size less than min size, or active interface syntax guid non-null\n");
|
TRACE("packet size less than min size, or active interface syntax guid non-null\n");
|
||||||
|
@ -192,9 +179,9 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
RpcServerAssoc_GetAssociation(rpcrt4_conn_get_name(conn),
|
RpcServerAssoc_GetAssociation(rpcrt4_conn_get_name(conn),
|
||||||
conn->NetworkAddr, conn->Endpoint,
|
conn->NetworkAddr, conn->Endpoint,
|
||||||
conn->NetworkOptions,
|
conn->NetworkOptions,
|
||||||
hdr->bind.assoc_gid,
|
hdr->assoc_gid,
|
||||||
&conn->server_binding->Assoc) == RPC_S_OK)
|
&conn->server_binding->Assoc) == RPC_S_OK)
|
||||||
sif = RPCRT4_find_interface(NULL, &hdr->bind.abstract, FALSE);
|
sif = RPCRT4_find_interface(NULL, &hdr->abstract, FALSE);
|
||||||
else
|
else
|
||||||
sif = NULL;
|
sif = NULL;
|
||||||
}
|
}
|
||||||
|
@ -205,7 +192,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
RPC_VER_MAJOR, RPC_VER_MINOR);
|
RPC_VER_MAJOR, RPC_VER_MINOR);
|
||||||
} else {
|
} else {
|
||||||
TRACE("accepting bind request on connection %p for %s\n", conn,
|
TRACE("accepting bind request on connection %p for %s\n", conn,
|
||||||
debugstr_guid(&hdr->bind.abstract.SyntaxGUID));
|
debugstr_guid(&hdr->abstract.SyntaxGUID));
|
||||||
|
|
||||||
/* accept. */
|
/* accept. */
|
||||||
response = RPCRT4_BuildBindAckHeader(NDR_LOCAL_DATA_REPRESENTATION,
|
response = RPCRT4_BuildBindAckHeader(NDR_LOCAL_DATA_REPRESENTATION,
|
||||||
|
@ -217,21 +204,31 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
&sif->If->TransferSyntax);
|
&sif->If->TransferSyntax);
|
||||||
|
|
||||||
/* save the interface for later use */
|
/* save the interface for later use */
|
||||||
conn->ActiveInterface = hdr->bind.abstract;
|
conn->ActiveInterface = hdr->abstract;
|
||||||
conn->MaxTransmissionSize = hdr->bind.max_tsize;
|
conn->MaxTransmissionSize = hdr->max_tsize;
|
||||||
|
|
||||||
RPCRT4_release_server_interface(sif);
|
RPCRT4_release_server_interface(sif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response)
|
||||||
status = RPCRT4_Send(conn, response, NULL, 0);
|
status = RPCRT4_Send(conn, response, NULL, 0);
|
||||||
|
else
|
||||||
|
status = ERROR_OUTOFMEMORY;
|
||||||
RPCRT4_FreeHeader(response);
|
RPCRT4_FreeHeader(response);
|
||||||
if (status != RPC_S_OK)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
break;
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
case PKT_REQUEST:
|
static RPC_STATUS process_request_packet(RpcConnection *conn, RpcPktRequestHdr *hdr, RPC_MESSAGE *msg)
|
||||||
TRACE("got request packet\n");
|
{
|
||||||
|
RPC_STATUS status;
|
||||||
|
RpcPktHdr *response = NULL;
|
||||||
|
RpcServerInterface* sif;
|
||||||
|
RPC_DISPATCH_FUNCTION func;
|
||||||
|
BOOL exception;
|
||||||
|
UUID *object_uuid;
|
||||||
|
NDR_SCONTEXT context_handle;
|
||||||
|
void *buf = msg->Buffer;
|
||||||
|
|
||||||
/* fail if the connection isn't bound with an interface */
|
/* fail if the connection isn't bound with an interface */
|
||||||
if (UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status)) {
|
if (UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status)) {
|
||||||
|
@ -241,11 +238,11 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
|
|
||||||
RPCRT4_Send(conn, response, NULL, 0);
|
RPCRT4_Send(conn, response, NULL, 0);
|
||||||
RPCRT4_FreeHeader(response);
|
RPCRT4_FreeHeader(response);
|
||||||
break;
|
return RPC_S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hdr->common.flags & RPC_FLG_OBJECT_UUID) {
|
if (hdr->common.flags & RPC_FLG_OBJECT_UUID) {
|
||||||
object_uuid = (UUID*)(&hdr->request + 1);
|
object_uuid = (UUID*)(hdr + 1);
|
||||||
} else {
|
} else {
|
||||||
object_uuid = NULL;
|
object_uuid = NULL;
|
||||||
}
|
}
|
||||||
|
@ -258,7 +255,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
|
|
||||||
RPCRT4_Send(conn, response, NULL, 0);
|
RPCRT4_Send(conn, response, NULL, 0);
|
||||||
RPCRT4_FreeHeader(response);
|
RPCRT4_FreeHeader(response);
|
||||||
break;
|
return RPC_S_OK;
|
||||||
}
|
}
|
||||||
msg->RpcInterfaceInformation = sif->If;
|
msg->RpcInterfaceInformation = sif->If;
|
||||||
/* copy the endpoint vector from sif to msg so that midl-generated code will use it */
|
/* copy the endpoint vector from sif to msg so that midl-generated code will use it */
|
||||||
|
@ -268,7 +265,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find dispatch function */
|
/* find dispatch function */
|
||||||
msg->ProcNum = hdr->request.opnum;
|
msg->ProcNum = hdr->opnum;
|
||||||
if (sif->Flags & RPC_IF_OLE) {
|
if (sif->Flags & RPC_IF_OLE) {
|
||||||
/* native ole32 always gives us a dispatch table with a single entry
|
/* native ole32 always gives us a dispatch table with a single entry
|
||||||
* (I assume that's a wrapper for IRpcStubBuffer::Invoke) */
|
* (I assume that's a wrapper for IRpcStubBuffer::Invoke) */
|
||||||
|
@ -327,6 +324,30 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
msg->RpcInterfaceInformation = NULL;
|
msg->RpcInterfaceInformation = NULL;
|
||||||
RPCRT4_release_server_interface(sif);
|
RPCRT4_release_server_interface(sif);
|
||||||
|
|
||||||
|
if (msg->Buffer == buf) buf = NULL;
|
||||||
|
TRACE("freeing Buffer=%p\n", buf);
|
||||||
|
I_RpcFree(buf);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSAGE* msg)
|
||||||
|
{
|
||||||
|
RPC_STATUS status;
|
||||||
|
|
||||||
|
msg->Handle = (RPC_BINDING_HANDLE)conn->server_binding;
|
||||||
|
|
||||||
|
switch (hdr->common.ptype) {
|
||||||
|
case PKT_BIND:
|
||||||
|
TRACE("got bind packet\n");
|
||||||
|
|
||||||
|
status = process_bind_packet(conn, &hdr->bind, msg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PKT_REQUEST:
|
||||||
|
TRACE("got request packet\n");
|
||||||
|
|
||||||
|
status = process_request_packet(conn, &hdr->request, msg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -334,14 +355,8 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fail:
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
if (msg->Buffer == buf) msg->Buffer = NULL;
|
|
||||||
TRACE("freeing Buffer=%p\n", buf);
|
|
||||||
HeapFree(GetProcessHeap(), 0, buf);
|
|
||||||
msg->Handle = 0;
|
|
||||||
I_RpcFreeBuffer(msg);
|
I_RpcFreeBuffer(msg);
|
||||||
msg->Buffer = NULL;
|
|
||||||
RPCRT4_FreeHeader(hdr);
|
RPCRT4_FreeHeader(hdr);
|
||||||
HeapFree(GetProcessHeap(), 0, msg);
|
HeapFree(GetProcessHeap(), 0, msg);
|
||||||
}
|
}
|
||||||
|
@ -388,6 +403,7 @@ static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
|
||||||
HeapFree(GetProcessHeap(), 0, packet);
|
HeapFree(GetProcessHeap(), 0, packet);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = NULL;
|
msg = NULL;
|
||||||
}
|
}
|
||||||
RPCRT4_DestroyConnection(conn);
|
RPCRT4_DestroyConnection(conn);
|
||||||
|
|
|
@ -446,8 +446,8 @@ static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data,
|
||||||
|
|
||||||
TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint);
|
TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint);
|
||||||
|
|
||||||
networkaddr_size = strlen(networkaddr) + 1;
|
networkaddr_size = networkaddr ? strlen(networkaddr) + 1 : 1;
|
||||||
endpoint_size = strlen(endpoint) + 1;
|
endpoint_size = endpoint ? strlen(endpoint) + 1 : 1;
|
||||||
size = sizeof(*smb_floor) + endpoint_size + sizeof(*nb_floor) + networkaddr_size;
|
size = sizeof(*smb_floor) + endpoint_size + sizeof(*nb_floor) + networkaddr_size;
|
||||||
|
|
||||||
if (!tower_data)
|
if (!tower_data)
|
||||||
|
@ -461,7 +461,10 @@ static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data,
|
||||||
smb_floor->protid = EPM_PROTOCOL_SMB;
|
smb_floor->protid = EPM_PROTOCOL_SMB;
|
||||||
smb_floor->count_rhs = endpoint_size;
|
smb_floor->count_rhs = endpoint_size;
|
||||||
|
|
||||||
|
if (endpoint)
|
||||||
memcpy(tower_data, endpoint, endpoint_size);
|
memcpy(tower_data, endpoint, endpoint_size);
|
||||||
|
else
|
||||||
|
tower_data[0] = 0;
|
||||||
tower_data += endpoint_size;
|
tower_data += endpoint_size;
|
||||||
|
|
||||||
nb_floor = (twr_empty_floor_t *)tower_data;
|
nb_floor = (twr_empty_floor_t *)tower_data;
|
||||||
|
@ -472,7 +475,10 @@ static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data,
|
||||||
nb_floor->protid = EPM_PROTOCOL_NETBIOS;
|
nb_floor->protid = EPM_PROTOCOL_NETBIOS;
|
||||||
nb_floor->count_rhs = networkaddr_size;
|
nb_floor->count_rhs = networkaddr_size;
|
||||||
|
|
||||||
|
if (networkaddr)
|
||||||
memcpy(tower_data, networkaddr, networkaddr_size);
|
memcpy(tower_data, networkaddr, networkaddr_size);
|
||||||
|
else
|
||||||
|
tower_data[0] = 0;
|
||||||
tower_data += networkaddr_size;
|
tower_data += networkaddr_size;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
|
@ -1025,7 +1031,7 @@ static int rpcrt4_conn_tcp_write(RpcConnection *Connection,
|
||||||
int bytes_written = 0;
|
int bytes_written = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int r = write(tcpc->sock, (const char *)buffer + bytes_written, count - bytes_written);
|
int r = send(tcpc->sock, (const char *)buffer + bytes_written, count - bytes_written, 0);
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
bytes_written += r;
|
bytes_written += r;
|
||||||
else if (errno != EAGAIN)
|
else if (errno != EAGAIN)
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
<file>ndr_ole.c</file>
|
<file>ndr_ole.c</file>
|
||||||
<file>ndr_stubless.c</file>
|
<file>ndr_stubless.c</file>
|
||||||
<file>rpc_assoc.c</file>
|
<file>rpc_assoc.c</file>
|
||||||
|
<file>rpc_async.c</file>
|
||||||
<file>rpc_binding.c</file>
|
<file>rpc_binding.c</file>
|
||||||
<file>rpc_epmap.c</file>
|
<file>rpc_epmap.c</file>
|
||||||
<file>rpc_message.c</file>
|
<file>rpc_message.c</file>
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
@ stdcall IUnknown_AddRef_Proxy(ptr)
|
@ stdcall IUnknown_AddRef_Proxy(ptr)
|
||||||
@ stdcall IUnknown_QueryInterface_Proxy(ptr ptr ptr)
|
@ stdcall IUnknown_QueryInterface_Proxy(ptr ptr ptr)
|
||||||
@ stdcall IUnknown_Release_Proxy(ptr)
|
@ stdcall IUnknown_Release_Proxy(ptr)
|
||||||
@ stub I_RpcAbortAsyncCall
|
@ stdcall I_RpcAbortAsyncCall(ptr long) I_RpcAsyncAbortCall
|
||||||
@ stdcall I_RpcAllocate(long)
|
@ stdcall I_RpcAllocate(long)
|
||||||
@ stub I_RpcAsyncAbortCall
|
@ stdcall I_RpcAsyncAbortCall(ptr long)
|
||||||
@ stub I_RpcAsyncSendReceive # NT4
|
@ stub I_RpcAsyncSendReceive # NT4
|
||||||
@ stub I_RpcAsyncSetHandle
|
@ stdcall I_RpcAsyncSetHandle(ptr ptr)
|
||||||
@ stub I_RpcBCacheAllocate
|
@ stub I_RpcBCacheAllocate
|
||||||
@ stub I_RpcBCacheFree
|
@ stub I_RpcBCacheFree
|
||||||
@ stub I_RpcBindingCopy
|
@ stub I_RpcBindingCopy
|
||||||
|
@ -201,9 +201,9 @@
|
||||||
@ stdcall NdrContextHandleSize(ptr ptr ptr)
|
@ stdcall NdrContextHandleSize(ptr ptr ptr)
|
||||||
@ stdcall NdrConvert2(ptr ptr long)
|
@ stdcall NdrConvert2(ptr ptr long)
|
||||||
@ stdcall NdrConvert(ptr ptr)
|
@ stdcall NdrConvert(ptr ptr)
|
||||||
@ stub NdrCorrelationFree
|
@ stdcall NdrCorrelationFree(ptr)
|
||||||
@ stub NdrCorrelationInitialize
|
@ stdcall NdrCorrelationInitialize(ptr ptr long long)
|
||||||
@ stub NdrCorrelationPass
|
@ stdcall NdrCorrelationPass(ptr)
|
||||||
@ stub NdrDcomAsyncClientCall
|
@ stub NdrDcomAsyncClientCall
|
||||||
@ stub NdrDcomAsyncStubCall
|
@ stub NdrDcomAsyncStubCall
|
||||||
@ stdcall NdrDllCanUnloadNow(ptr)
|
@ stdcall NdrDllCanUnloadNow(ptr)
|
||||||
|
@ -362,12 +362,12 @@
|
||||||
@ stub NdrpSetRpcSsDefaults
|
@ stub NdrpSetRpcSsDefaults
|
||||||
@ stub NdrpVarVtOfTypeDesc # wxp
|
@ stub NdrpVarVtOfTypeDesc # wxp
|
||||||
@ stub PerformRpcInitialization
|
@ stub PerformRpcInitialization
|
||||||
@ stub RpcAbortAsyncCall
|
@ stdcall RpcAbortAsyncCall(ptr long) RpcAsyncAbortCall
|
||||||
@ stub RpcAsyncAbortCall
|
@ stdcall RpcAsyncAbortCall(ptr long)
|
||||||
@ stub RpcAsyncCancelCall
|
@ stdcall RpcAsyncCancelCall(ptr long)
|
||||||
@ stub RpcAsyncCompleteCall
|
@ stdcall RpcAsyncCompleteCall(ptr ptr)
|
||||||
@ stub RpcAsyncGetCallStatus
|
@ stdcall RpcAsyncGetCallStatus(ptr)
|
||||||
@ stub RpcAsyncInitializeHandle
|
@ stdcall RpcAsyncInitializeHandle(ptr long)
|
||||||
@ stub RpcAsyncRegisterInfo
|
@ stub RpcAsyncRegisterInfo
|
||||||
@ stdcall RpcBindingCopy(ptr ptr)
|
@ stdcall RpcBindingCopy(ptr ptr)
|
||||||
@ stdcall RpcBindingFree(ptr)
|
@ stdcall RpcBindingFree(ptr)
|
||||||
|
@ -394,12 +394,12 @@
|
||||||
@ stdcall RpcBindingToStringBindingA(ptr ptr)
|
@ stdcall RpcBindingToStringBindingA(ptr ptr)
|
||||||
@ stdcall RpcBindingToStringBindingW(ptr ptr)
|
@ stdcall RpcBindingToStringBindingW(ptr ptr)
|
||||||
@ stdcall RpcBindingVectorFree(ptr)
|
@ stdcall RpcBindingVectorFree(ptr)
|
||||||
@ stub RpcCancelAsyncCall
|
@ stdcall RpcCancelAsyncCall(ptr long) RpcAsyncCancelCall
|
||||||
@ stdcall RpcCancelThread(ptr)
|
@ stdcall RpcCancelThread(ptr)
|
||||||
@ stub RpcCancelThreadEx
|
@ stub RpcCancelThreadEx
|
||||||
@ stub RpcCertGeneratePrincipalNameA
|
@ stub RpcCertGeneratePrincipalNameA
|
||||||
@ stub RpcCertGeneratePrincipalNameW
|
@ stub RpcCertGeneratePrincipalNameW
|
||||||
@ stub RpcCompleteAsyncCall
|
@ stdcall RpcCompleteAsyncCall(ptr ptr) RpcAsyncCompleteCall
|
||||||
@ stdcall RpcEpRegisterA(ptr ptr ptr str)
|
@ stdcall RpcEpRegisterA(ptr ptr ptr str)
|
||||||
@ stub RpcEpRegisterNoReplaceA
|
@ stub RpcEpRegisterNoReplaceA
|
||||||
@ stub RpcEpRegisterNoReplaceW
|
@ stub RpcEpRegisterNoReplaceW
|
||||||
|
@ -416,11 +416,11 @@
|
||||||
@ stub RpcErrorSaveErrorInfo # wxp
|
@ stub RpcErrorSaveErrorInfo # wxp
|
||||||
@ stdcall RpcErrorStartEnumeration(ptr)
|
@ stdcall RpcErrorStartEnumeration(ptr)
|
||||||
@ stub RpcFreeAuthorizationContext # wxp
|
@ stub RpcFreeAuthorizationContext # wxp
|
||||||
@ stub RpcGetAsyncCallStatus
|
@ stdcall RpcGetAsyncCallStatus(ptr) RpcAsyncGetCallStatus
|
||||||
@ stub RpcIfIdVectorFree
|
@ stub RpcIfIdVectorFree
|
||||||
@ stub RpcIfInqId
|
@ stub RpcIfInqId
|
||||||
@ stdcall RpcImpersonateClient(ptr)
|
@ stdcall RpcImpersonateClient(ptr)
|
||||||
@ stub RpcInitializeAsyncHandle
|
@ stdcall RpcInitializeAsyncHandle(ptr long) RpcAsyncInitializeHandle
|
||||||
@ stub RpcMgmtBindingInqParameter # win9x
|
@ stub RpcMgmtBindingInqParameter # win9x
|
||||||
@ stub RpcMgmtBindingSetParameter # win9x
|
@ stub RpcMgmtBindingSetParameter # win9x
|
||||||
@ stdcall RpcMgmtEnableIdleCleanup()
|
@ stdcall RpcMgmtEnableIdleCleanup()
|
||||||
|
|
|
@ -19,74 +19,13 @@
|
||||||
*
|
*
|
||||||
* WINE RPC TODO's (and a few TODONT's)
|
* WINE RPC TODO's (and a few TODONT's)
|
||||||
*
|
*
|
||||||
* - Ove's decreasingly incomplete widl is an IDL compiler for wine. For widl
|
|
||||||
* to be wine's only IDL compiler, a fair bit of work remains to be done.
|
|
||||||
* until then we have used some midl-generated stuff. (What?)
|
|
||||||
* widl currently doesn't generate stub/proxy files required by wine's (O)RPC
|
|
||||||
* capabilities -- nor does it make those lovely format strings :(
|
|
||||||
* The MS MIDL compiler does some really esoteric stuff. Of course Ove has
|
|
||||||
* started with the less esoteric stuff. There are also lots of nice
|
|
||||||
* comments in there if you want to flex your bison and help build this monster.
|
|
||||||
*
|
|
||||||
* - RPC has a quite featureful error handling mechanism; basically none of this is
|
|
||||||
* implemented right now. We also have deficiencies on the compiler side, where
|
|
||||||
* wine's __TRY / __EXCEPT / __FINALLY macros are not even used for RpcTryExcept & co,
|
|
||||||
* due to syntactic differences! (we can fix it with widl by using __TRY)
|
|
||||||
*
|
|
||||||
* - There are several different memory allocation schemes for MSRPC.
|
|
||||||
* I don't even understand what they all are yet, much less have them
|
|
||||||
* properly implemented. Surely we are supposed to be doing something with
|
|
||||||
* the user-provided allocation/deallocation functions, but so far,
|
|
||||||
* I don't think we are doing this...
|
|
||||||
*
|
|
||||||
* - MSRPC provides impersonation capabilities which currently are not possible
|
|
||||||
* to implement in wine. At the very least we should implement the authorization
|
|
||||||
* API's & gracefully ignore the irrelevant stuff (to an extent we already do).
|
|
||||||
*
|
|
||||||
* - Some transports are not yet implemented. The existing transport implementations
|
|
||||||
* are incomplete and may be bug-infested.
|
|
||||||
*
|
|
||||||
* - The various transports that we do support ought to be supported in a more
|
|
||||||
* object-oriented manner, as in DCE's RPC implementation, instead of cluttering
|
|
||||||
* up the code with conditionals like we do now.
|
|
||||||
*
|
|
||||||
* - Data marshalling: So far, only the beginnings of a full implementation
|
|
||||||
* exist in wine. NDR protocol itself is documented, but the MS API's to
|
|
||||||
* convert data-types in memory into NDR are not. This is challenging work,
|
|
||||||
* and has supposedly been "at the top of Greg's queue" for several months now.
|
|
||||||
*
|
|
||||||
* - ORPC is RPC for OLE; once we have a working RPC framework, we can
|
|
||||||
* use it to implement out-of-process OLE client/server communications.
|
|
||||||
* ATM there is maybe a disconnect between the marshalling in the OLE DLLs
|
|
||||||
* and the marshalling going on here [TODO: well, is there or not?]
|
|
||||||
*
|
|
||||||
* - In-source API Documentation, at least for those functions which we have
|
|
||||||
* implemented, but preferably for everything we can document, would be nice,
|
|
||||||
* since some of this stuff is quite obscure.
|
|
||||||
*
|
|
||||||
* - Name services... [TODO: what about them]
|
|
||||||
*
|
|
||||||
* - Protocol Towers: Totally unimplemented.... I think.
|
|
||||||
*
|
|
||||||
* - Context Handle Rundown: whatever that is.
|
|
||||||
*
|
|
||||||
* - Nested RPC's: Totally unimplemented.
|
|
||||||
*
|
|
||||||
* - Statistics: we are supposed to be keeping various counters. we aren't.
|
* - Statistics: we are supposed to be keeping various counters. we aren't.
|
||||||
*
|
*
|
||||||
* - Async RPC: Unimplemented.
|
* - Async RPC: Unimplemented.
|
||||||
*
|
*
|
||||||
* - XML/http RPC: Somewhere there's an XML fiend that wants to do this! Betcha
|
|
||||||
* we could use these as a transport for RPC's across computers without a
|
|
||||||
* permissions and/or licensing crisis.
|
|
||||||
*
|
|
||||||
* - The NT "ports" API, aka LPC. Greg claims this is on his radar. Might (or
|
* - The NT "ports" API, aka LPC. Greg claims this is on his radar. Might (or
|
||||||
* might not) enable users to get some kind of meaningful result out of
|
* might not) enable users to get some kind of meaningful result out of
|
||||||
* NT-based native rpcrt4's. Commonly-used transport for self-to-self RPC's.
|
* NT-based native rpcrt4's. Commonly-used transport for self-to-self RPC's.
|
||||||
*
|
|
||||||
* - ...? More stuff I haven't thought of. If you think of more RPC todo's
|
|
||||||
* drop me an e-mail <gmturner007@ameritech.net> or send a patch to the
|
|
||||||
* wine-patches mailing list.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -96,6 +35,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "ntstatus.h"
|
||||||
|
#define WIN32_NO_STATUS
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
|
@ -871,11 +812,128 @@ void WINAPI I_RpcFree(void *Object)
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* I_RpcMapWin32Status (rpcrt4.@)
|
* I_RpcMapWin32Status (rpcrt4.@)
|
||||||
|
*
|
||||||
|
* Maps Win32 RPC error codes to NT statuses.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* status [I] Win32 RPC error code.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Appropriate translation into an NT status code.
|
||||||
*/
|
*/
|
||||||
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
|
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
|
||||||
{
|
{
|
||||||
FIXME("(%ld): stub\n", status);
|
TRACE("(%ld)\n", status);
|
||||||
return 0;
|
switch (status)
|
||||||
|
{
|
||||||
|
case ERROR_ACCESS_DENIED: return STATUS_ACCESS_DENIED;
|
||||||
|
case ERROR_INVALID_HANDLE: return RPC_NT_SS_CONTEXT_MISMATCH;
|
||||||
|
case ERROR_OUTOFMEMORY: return STATUS_NO_MEMORY;
|
||||||
|
case ERROR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER;
|
||||||
|
case ERROR_INSUFFICIENT_BUFFER: return STATUS_BUFFER_TOO_SMALL;
|
||||||
|
case ERROR_MAX_THRDS_REACHED: return STATUS_NO_MEMORY;
|
||||||
|
case ERROR_NOACCESS: return STATUS_ACCESS_VIOLATION;
|
||||||
|
case ERROR_NOT_ENOUGH_SERVER_MEMORY: return STATUS_INSUFF_SERVER_RESOURCES;
|
||||||
|
case ERROR_WRONG_PASSWORD: return STATUS_WRONG_PASSWORD;
|
||||||
|
case ERROR_INVALID_LOGON_HOURS: return STATUS_INVALID_LOGON_HOURS;
|
||||||
|
case ERROR_PASSWORD_EXPIRED: return STATUS_PASSWORD_EXPIRED;
|
||||||
|
case ERROR_ACCOUNT_DISABLED: return STATUS_ACCOUNT_DISABLED;
|
||||||
|
case ERROR_INVALID_SECURITY_DESCR: return STATUS_INVALID_SECURITY_DESCR;
|
||||||
|
case RPC_S_INVALID_STRING_BINDING: return RPC_NT_INVALID_STRING_BINDING;
|
||||||
|
case RPC_S_WRONG_KIND_OF_BINDING: return RPC_NT_WRONG_KIND_OF_BINDING;
|
||||||
|
case RPC_S_INVALID_BINDING: return RPC_NT_INVALID_BINDING;
|
||||||
|
case RPC_S_PROTSEQ_NOT_SUPPORTED: return RPC_NT_PROTSEQ_NOT_SUPPORTED;
|
||||||
|
case RPC_S_INVALID_RPC_PROTSEQ: return RPC_NT_INVALID_RPC_PROTSEQ;
|
||||||
|
case RPC_S_INVALID_STRING_UUID: return RPC_NT_INVALID_STRING_UUID;
|
||||||
|
case RPC_S_INVALID_ENDPOINT_FORMAT: return RPC_NT_INVALID_ENDPOINT_FORMAT;
|
||||||
|
case RPC_S_INVALID_NET_ADDR: return RPC_NT_INVALID_NET_ADDR;
|
||||||
|
case RPC_S_NO_ENDPOINT_FOUND: return RPC_NT_NO_ENDPOINT_FOUND;
|
||||||
|
case RPC_S_INVALID_TIMEOUT: return RPC_NT_INVALID_TIMEOUT;
|
||||||
|
case RPC_S_OBJECT_NOT_FOUND: return RPC_NT_OBJECT_NOT_FOUND;
|
||||||
|
case RPC_S_ALREADY_REGISTERED: return RPC_NT_ALREADY_REGISTERED;
|
||||||
|
case RPC_S_TYPE_ALREADY_REGISTERED: return RPC_NT_TYPE_ALREADY_REGISTERED;
|
||||||
|
case RPC_S_ALREADY_LISTENING: return RPC_NT_ALREADY_LISTENING;
|
||||||
|
case RPC_S_NO_PROTSEQS_REGISTERED: return RPC_NT_NO_PROTSEQS_REGISTERED;
|
||||||
|
case RPC_S_NOT_LISTENING: return RPC_NT_NOT_LISTENING;
|
||||||
|
case RPC_S_UNKNOWN_MGR_TYPE: return RPC_NT_UNKNOWN_MGR_TYPE;
|
||||||
|
case RPC_S_UNKNOWN_IF: return RPC_NT_UNKNOWN_IF;
|
||||||
|
case RPC_S_NO_BINDINGS: return RPC_NT_NO_BINDINGS;
|
||||||
|
case RPC_S_NO_PROTSEQS: return RPC_NT_NO_PROTSEQS;
|
||||||
|
case RPC_S_CANT_CREATE_ENDPOINT: return RPC_NT_CANT_CREATE_ENDPOINT;
|
||||||
|
case RPC_S_OUT_OF_RESOURCES: return RPC_NT_OUT_OF_RESOURCES;
|
||||||
|
case RPC_S_SERVER_UNAVAILABLE: return RPC_NT_SERVER_UNAVAILABLE;
|
||||||
|
case RPC_S_SERVER_TOO_BUSY: return RPC_NT_SERVER_TOO_BUSY;
|
||||||
|
case RPC_S_INVALID_NETWORK_OPTIONS: return RPC_NT_INVALID_NETWORK_OPTIONS;
|
||||||
|
case RPC_S_NO_CALL_ACTIVE: return RPC_NT_NO_CALL_ACTIVE;
|
||||||
|
case RPC_S_CALL_FAILED: return RPC_NT_CALL_FAILED;
|
||||||
|
case RPC_S_CALL_FAILED_DNE: return RPC_NT_CALL_FAILED_DNE;
|
||||||
|
case RPC_S_PROTOCOL_ERROR: return RPC_NT_PROTOCOL_ERROR;
|
||||||
|
case RPC_S_UNSUPPORTED_TRANS_SYN: return RPC_NT_UNSUPPORTED_TRANS_SYN;
|
||||||
|
case RPC_S_UNSUPPORTED_TYPE: return RPC_NT_UNSUPPORTED_TYPE;
|
||||||
|
case RPC_S_INVALID_TAG: return RPC_NT_INVALID_TAG;
|
||||||
|
case RPC_S_INVALID_BOUND: return RPC_NT_INVALID_BOUND;
|
||||||
|
case RPC_S_NO_ENTRY_NAME: return RPC_NT_NO_ENTRY_NAME;
|
||||||
|
case RPC_S_INVALID_NAME_SYNTAX: return RPC_NT_INVALID_NAME_SYNTAX;
|
||||||
|
case RPC_S_UNSUPPORTED_NAME_SYNTAX: return RPC_NT_UNSUPPORTED_NAME_SYNTAX;
|
||||||
|
case RPC_S_UUID_NO_ADDRESS: return RPC_NT_UUID_NO_ADDRESS;
|
||||||
|
case RPC_S_DUPLICATE_ENDPOINT: return RPC_NT_DUPLICATE_ENDPOINT;
|
||||||
|
case RPC_S_UNKNOWN_AUTHN_TYPE: return RPC_NT_UNKNOWN_AUTHN_TYPE;
|
||||||
|
case RPC_S_MAX_CALLS_TOO_SMALL: return RPC_NT_MAX_CALLS_TOO_SMALL;
|
||||||
|
case RPC_S_STRING_TOO_LONG: return RPC_NT_STRING_TOO_LONG;
|
||||||
|
case RPC_S_PROTSEQ_NOT_FOUND: return RPC_NT_PROTSEQ_NOT_FOUND;
|
||||||
|
case RPC_S_PROCNUM_OUT_OF_RANGE: return RPC_NT_PROCNUM_OUT_OF_RANGE;
|
||||||
|
case RPC_S_BINDING_HAS_NO_AUTH: return RPC_NT_BINDING_HAS_NO_AUTH;
|
||||||
|
case RPC_S_UNKNOWN_AUTHN_SERVICE: return RPC_NT_UNKNOWN_AUTHN_SERVICE;
|
||||||
|
case RPC_S_UNKNOWN_AUTHN_LEVEL: return RPC_NT_UNKNOWN_AUTHN_LEVEL;
|
||||||
|
case RPC_S_INVALID_AUTH_IDENTITY: return RPC_NT_INVALID_AUTH_IDENTITY;
|
||||||
|
case RPC_S_UNKNOWN_AUTHZ_SERVICE: return RPC_NT_UNKNOWN_AUTHZ_SERVICE;
|
||||||
|
case EPT_S_INVALID_ENTRY: return EPT_NT_INVALID_ENTRY;
|
||||||
|
case EPT_S_CANT_PERFORM_OP: return EPT_NT_CANT_PERFORM_OP;
|
||||||
|
case EPT_S_NOT_REGISTERED: return EPT_NT_NOT_REGISTERED;
|
||||||
|
case EPT_S_CANT_CREATE: return EPT_NT_CANT_CREATE;
|
||||||
|
case RPC_S_NOTHING_TO_EXPORT: return RPC_NT_NOTHING_TO_EXPORT;
|
||||||
|
case RPC_S_INCOMPLETE_NAME: return RPC_NT_INCOMPLETE_NAME;
|
||||||
|
case RPC_S_INVALID_VERS_OPTION: return RPC_NT_INVALID_VERS_OPTION;
|
||||||
|
case RPC_S_NO_MORE_MEMBERS: return RPC_NT_NO_MORE_MEMBERS;
|
||||||
|
case RPC_S_NOT_ALL_OBJS_UNEXPORTED: return RPC_NT_NOT_ALL_OBJS_UNEXPORTED;
|
||||||
|
case RPC_S_INTERFACE_NOT_FOUND: return RPC_NT_INTERFACE_NOT_FOUND;
|
||||||
|
case RPC_S_ENTRY_ALREADY_EXISTS: return RPC_NT_ENTRY_ALREADY_EXISTS;
|
||||||
|
case RPC_S_ENTRY_NOT_FOUND: return RPC_NT_ENTRY_NOT_FOUND;
|
||||||
|
case RPC_S_NAME_SERVICE_UNAVAILABLE: return RPC_NT_NAME_SERVICE_UNAVAILABLE;
|
||||||
|
case RPC_S_INVALID_NAF_ID: return RPC_NT_INVALID_NAF_ID;
|
||||||
|
case RPC_S_CANNOT_SUPPORT: return RPC_NT_CANNOT_SUPPORT;
|
||||||
|
case RPC_S_NO_CONTEXT_AVAILABLE: return RPC_NT_NO_CONTEXT_AVAILABLE;
|
||||||
|
case RPC_S_INTERNAL_ERROR: return RPC_NT_INTERNAL_ERROR;
|
||||||
|
case RPC_S_ZERO_DIVIDE: return RPC_NT_ZERO_DIVIDE;
|
||||||
|
case RPC_S_ADDRESS_ERROR: return RPC_NT_ADDRESS_ERROR;
|
||||||
|
case RPC_S_FP_DIV_ZERO: return RPC_NT_FP_DIV_ZERO;
|
||||||
|
case RPC_S_FP_UNDERFLOW: return RPC_NT_FP_UNDERFLOW;
|
||||||
|
case RPC_S_FP_OVERFLOW: return RPC_NT_FP_OVERFLOW;
|
||||||
|
case RPC_S_CALL_IN_PROGRESS: return RPC_NT_CALL_IN_PROGRESS;
|
||||||
|
case RPC_S_NO_MORE_BINDINGS: return RPC_NT_NO_MORE_BINDINGS;
|
||||||
|
case RPC_S_CALL_CANCELLED: return RPC_NT_CALL_CANCELLED;
|
||||||
|
case RPC_S_INVALID_OBJECT: return RPC_NT_INVALID_OBJECT;
|
||||||
|
case RPC_S_INVALID_ASYNC_HANDLE: return RPC_NT_INVALID_ASYNC_HANDLE;
|
||||||
|
case RPC_S_INVALID_ASYNC_CALL: return RPC_NT_INVALID_ASYNC_CALL;
|
||||||
|
case RPC_S_GROUP_MEMBER_NOT_FOUND: return RPC_NT_GROUP_MEMBER_NOT_FOUND;
|
||||||
|
case RPC_X_NO_MORE_ENTRIES: return RPC_NT_NO_MORE_ENTRIES;
|
||||||
|
case RPC_X_SS_CHAR_TRANS_OPEN_FAIL: return RPC_NT_SS_CHAR_TRANS_OPEN_FAIL;
|
||||||
|
case RPC_X_SS_CHAR_TRANS_SHORT_FILE: return RPC_NT_SS_CHAR_TRANS_SHORT_FILE;
|
||||||
|
case RPC_X_SS_IN_NULL_CONTEXT: return RPC_NT_SS_IN_NULL_CONTEXT;
|
||||||
|
case RPC_X_SS_CONTEXT_DAMAGED: return RPC_NT_SS_CONTEXT_DAMAGED;
|
||||||
|
case RPC_X_SS_HANDLES_MISMATCH: return RPC_NT_SS_HANDLES_MISMATCH;
|
||||||
|
case RPC_X_SS_CANNOT_GET_CALL_HANDLE: return RPC_NT_SS_CANNOT_GET_CALL_HANDLE;
|
||||||
|
case RPC_X_NULL_REF_POINTER: return RPC_NT_NULL_REF_POINTER;
|
||||||
|
case RPC_X_ENUM_VALUE_OUT_OF_RANGE: return RPC_NT_ENUM_VALUE_OUT_OF_RANGE;
|
||||||
|
case RPC_X_BYTE_COUNT_TOO_SMALL: return RPC_NT_BYTE_COUNT_TOO_SMALL;
|
||||||
|
case RPC_X_BAD_STUB_DATA: return RPC_NT_BAD_STUB_DATA;
|
||||||
|
case RPC_X_PIPE_CLOSED: return RPC_NT_PIPE_CLOSED;
|
||||||
|
case RPC_X_PIPE_DISCIPLINE_ERROR: return RPC_NT_PIPE_DISCIPLINE_ERROR;
|
||||||
|
case RPC_X_PIPE_EMPTY: return RPC_NT_PIPE_EMPTY;
|
||||||
|
case ERROR_PASSWORD_MUST_CHANGE: return STATUS_PASSWORD_MUST_CHANGE;
|
||||||
|
case ERROR_ACCOUNT_LOCKED_OUT: return STATUS_ACCOUNT_LOCKED_OUT;
|
||||||
|
default: return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
--- rpc_server.c Tue Jan 01 13:09:34 2008
|
Index: rpc_server.c
|
||||||
+++ rpc_server.c Fri Jan 11 15:58:57 2008
|
===================================================================
|
||||||
|
--- rpc_server.c (working copy)
|
||||||
|
+++ rpc_server.c (working copy)
|
||||||
@@ -1017,22 +1017,30 @@
|
@@ -1017,22 +1017,30 @@
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* RpcMgmtServerWaitListen (RPCRT4.@)
|
* RpcMgmtServerWaitListen (RPCRT4.@)
|
||||||
|
@ -33,8 +35,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
--- rpc_transport.c Sun Jan 06 19:27:38 2008
|
Index: rpc_transport.c
|
||||||
+++ rpc_transport.c Fri Jan 11 15:59:32 2008
|
===================================================================
|
||||||
|
--- rpc_transport.c (working copy)
|
||||||
|
+++ rpc_transport.c (working copy)
|
||||||
@@ -54,10 +54,13 @@
|
@@ -54,10 +54,13 @@
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_POLL_H
|
#ifdef HAVE_SYS_POLL_H
|
||||||
|
|
Loading…
Reference in a new issue