mirror of
https://github.com/reactos/reactos.git
synced 2024-10-31 11:56:26 +00:00
4f0b8d3db0
svn path=/branches/ntvdm/; revision=59241
222 lines
7.1 KiB
Diff
222 lines
7.1 KiB
Diff
Index: epm_towers.h
|
|
===================================================================
|
|
--- epm_towers.h (working copy)
|
|
+++ epm_towers.h (working copy)
|
|
@@ -19,7 +19,7 @@
|
|
*
|
|
*/
|
|
|
|
-#include "epm.h"
|
|
+#include "epm_c.h"
|
|
|
|
#define EPM_PROTOCOL_DNET_NSP 0x04
|
|
#define EPM_PROTOCOL_OSI_TP4 0x05
|
|
Index: ndr_marshall.c
|
|
===================================================================
|
|
--- ndr_marshall.c (working copy)
|
|
+++ ndr_marshall.c (working copy)
|
|
@@ -1210,7 +1210,7 @@
|
|
unsigned char *bufptr = bufbase + *(const SHORT*)&info[2];
|
|
unsigned char *saved_memory = pStubMsg->Memory;
|
|
|
|
- pStubMsg->Memory = pMemory;
|
|
+ pStubMsg->Memory = membase;
|
|
PointerMarshall(pStubMsg, bufptr, *(unsigned char**)memptr, info+4);
|
|
pStubMsg->Memory = saved_memory;
|
|
}
|
|
@@ -1362,7 +1362,7 @@
|
|
unsigned char *memptr = membase + *(const SHORT*)&info[0];
|
|
unsigned char *saved_memory = pStubMsg->Memory;
|
|
|
|
- pStubMsg->Memory = pMemory;
|
|
+ pStubMsg->Memory = membase;
|
|
PointerBufferSize(pStubMsg, *(unsigned char**)memptr, info+4);
|
|
pStubMsg->Memory = saved_memory;
|
|
}
|
|
@@ -6159,6 +6159,7 @@ static LONG unmarshall_discriminant(PMID
|
|
case RPC_FC_WCHAR:
|
|
case RPC_FC_SHORT:
|
|
case RPC_FC_USHORT:
|
|
+ case RPC_FC_ENUM16:
|
|
{
|
|
USHORT d;
|
|
align_pointer(&pStubMsg->Buffer, sizeof(USHORT));
|
|
Index: ndr_stubless.c
|
|
===================================================================
|
|
--- ndr_stubless.c (working copy)
|
|
+++ ndr_stubless.c (working copy)
|
|
@@ -981,11 +981,12 @@ __declspec(naked) LONG_PTR __cdecl call_
|
|
__asm
|
|
{
|
|
push ebp
|
|
+ mov ebp, esp
|
|
push edi ; Save registers
|
|
push esi
|
|
- mov ebp, esp
|
|
mov eax, [ebp+16] ; Get stack size
|
|
sub esp, eax ; Make room in stack for arguments
|
|
+ and esp, 0xFFFFFFF0
|
|
mov edi, esp
|
|
mov ecx, eax
|
|
mov esi, [ebp+12]
|
|
Index: rpc_epmap.c
|
|
===================================================================
|
|
--- rpc_epmap.c (working copy)
|
|
+++ rpc_epmap.c (working copy)
|
|
@@ -32,7 +32,7 @@
|
|
#include "wine/exception.h"
|
|
|
|
#include "rpc_binding.h"
|
|
-#include "epm.h"
|
|
+#include "epm_c.h"
|
|
#include "epm_towers.h"
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
|
@@ -162,7 +162,7 @@ static RPC_STATUS get_epm_handle_server(
|
|
|
|
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *__eptr)
|
|
{
|
|
- switch (GetExceptionCode())
|
|
+ switch (__eptr->ExceptionRecord->ExceptionCode)
|
|
{
|
|
case EXCEPTION_ACCESS_VIOLATION:
|
|
case EXCEPTION_ILLEGAL_INSTRUCTION:
|
|
Index: rpc_server.c
|
|
===================================================================
|
|
--- rpc_server.c (working copy)
|
|
+++ rpc_server.c (working copy)
|
|
@@ -1071,8 +1071,6 @@ void RPCRT4_destroy_all_protseqs(void)
|
|
EnterCriticalSection(&server_cs);
|
|
LIST_FOR_EACH_ENTRY_SAFE(cps, cursor2, &protseqs, RpcServerProtseq, entry)
|
|
{
|
|
- if (listen_count != 0)
|
|
- RPCRT4_sync_with_server_thread(cps);
|
|
destroy_serverprotoseq(cps);
|
|
}
|
|
LeaveCriticalSection(&server_cs);
|
|
Index: rpc_transport.c
|
|
===================================================================
|
|
--- rpc_transport.c (working copy)
|
|
+++ rpc_transport.c (working copy)
|
|
@@ -224,6 +224,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe(
|
|
if (err == ERROR_PIPE_BUSY) {
|
|
TRACE("connection failed, error=%x\n", err);
|
|
return RPC_S_SERVER_TOO_BUSY;
|
|
+ } else if (err == ERROR_BAD_NETPATH) {
|
|
+ TRACE("connection failed, error=%x\n", err);
|
|
+ return RPC_S_SERVER_UNAVAILABLE;
|
|
}
|
|
if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) {
|
|
err = GetLastError();
|
|
@@ -305,18 +308,32 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc
|
|
static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
|
|
{
|
|
RpcConnection_np *npc = (RpcConnection_np *) Connection;
|
|
- static const char prefix[] = "\\\\.";
|
|
+ static const char prefix[] = "\\\\";
|
|
+ static const char local[] =".";
|
|
RPC_STATUS r;
|
|
LPSTR pname;
|
|
+ INT size;
|
|
|
|
/* already connected? */
|
|
if (npc->pipe)
|
|
return RPC_S_OK;
|
|
|
|
/* protseq=ncacn_np: named pipes */
|
|
- pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1);
|
|
- strcat(strcpy(pname, prefix), Connection->Endpoint);
|
|
- r = rpcrt4_conn_open_pipe(Connection, pname, FALSE);
|
|
+ size = strlen(prefix);
|
|
+ if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
|
|
+ size += strlen(local);
|
|
+ else
|
|
+ size += strlen(Connection->NetworkAddr);
|
|
+ size += strlen(Connection->Endpoint) + 1;
|
|
+
|
|
+ pname = I_RpcAllocate(size);
|
|
+ strcpy(pname, prefix);
|
|
+ if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
|
|
+ strcat(pname, local);
|
|
+ else
|
|
+ strcat(pname, Connection->NetworkAddr);
|
|
+ strcat(pname, Connection->Endpoint);
|
|
+ r = rpcrt4_conn_open_pipe(Connection, pname, TRUE);
|
|
I_RpcFree(pname);
|
|
|
|
return r;
|
|
@@ -412,11 +429,17 @@ static int rpcrt4_conn_np_read(RpcConnec
|
|
char *buf = buffer;
|
|
BOOL ret = TRUE;
|
|
unsigned int bytes_left = count;
|
|
+ OVERLAPPED ovl;
|
|
+
|
|
+ ZeroMemory(&ovl, sizeof(ovl));
|
|
+ ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
|
|
|
|
while (bytes_left)
|
|
{
|
|
DWORD bytes_read;
|
|
- ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, NULL);
|
|
+ ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, &ovl);
|
|
+ if (!ret && GetLastError() == ERROR_IO_PENDING)
|
|
+ ret = GetOverlappedResult(npc->pipe, &ovl, &bytes_read, TRUE);
|
|
if (!ret && GetLastError() == ERROR_MORE_DATA)
|
|
ret = TRUE;
|
|
if (!ret || !bytes_read)
|
|
@@ -424,6 +447,7 @@ static int rpcrt4_conn_np_read(RpcConnec
|
|
bytes_left -= bytes_read;
|
|
buf += bytes_read;
|
|
}
|
|
+ CloseHandle(ovl.hEvent);
|
|
return ret ? count : -1;
|
|
}
|
|
|
|
@@ -434,16 +458,23 @@ static int rpcrt4_conn_np_write(RpcConne
|
|
const char *buf = buffer;
|
|
BOOL ret = TRUE;
|
|
unsigned int bytes_left = count;
|
|
+ OVERLAPPED ovl;
|
|
+
|
|
+ ZeroMemory(&ovl, sizeof(ovl));
|
|
+ ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
|
|
|
|
while (bytes_left)
|
|
{
|
|
DWORD bytes_written;
|
|
- ret = WriteFile(npc->pipe, buf, bytes_left, &bytes_written, NULL);
|
|
+ ret = WriteFile(npc->pipe, buf, bytes_left, &bytes_written, &ovl);
|
|
+ if (!ret && GetLastError() == ERROR_IO_PENDING)
|
|
+ ret = GetOverlappedResult(npc->pipe, &ovl, &bytes_written, TRUE);
|
|
if (!ret || !bytes_written)
|
|
break;
|
|
bytes_left -= bytes_written;
|
|
buf += bytes_written;
|
|
}
|
|
+ CloseHandle(ovl.hEvent);
|
|
return ret ? count : -1;
|
|
}
|
|
|
|
Index: rpcrt4.spec
|
|
===================================================================
|
|
--- rpcrt4.spec (working copy)
|
|
+++ rpcrt4.spec (working copy)
|
|
@@ -53,7 +53,7 @@
|
|
@ stub I_RpcIfInqTransferSyntaxes
|
|
@ stub I_RpcLogEvent
|
|
@ stdcall I_RpcMapWin32Status(long)
|
|
-@ stub I_RpcNegotiateTransferSyntax # wxp
|
|
+@ stdcall I_RpcNegotiateTransferSyntax(ptr)
|
|
@ stub I_RpcNsBindingSetEntryName
|
|
@ stub I_RpcNsBindingSetEntryNameA
|
|
@ stub I_RpcNsBindingSetEntryNameW
|
|
@@ -266,7 +266,7 @@
|
|
@ stdcall NdrRangeUnmarshall(ptr ptr ptr long)
|
|
@ stub NdrRpcSmClientAllocate
|
|
@ stub NdrRpcSmClientFree
|
|
-@ stub NdrRpcSmSetClientToOsf
|
|
+@ stdcall NdrRpcSmSetClientToOsf(ptr)
|
|
@ stub NdrRpcSsDefaultAllocate
|
|
@ stub NdrRpcSsDefaultFree
|
|
@ stub NdrRpcSsDisableAllocate
|