reactos/dll/win32/rpcrt4/rpcrt4_ros.diff

236 lines
7.5 KiB
Diff

diff -pudN e:\wine\dlls\rpcrt4/cproxy.c e:\reactos\dll\win32\rpcrt4/cproxy.c
--- e:\wine\dlls\rpcrt4/cproxy.c 2016-11-16 17:29:34 +0100
+++ e:\reactos\dll\win32\rpcrt4/cproxy.c 2015-08-27 22:03:34 +0100
@@ -150,6 +150,30 @@ static inline void init_thunk( struct th
thunk->call_stubless = call_stubless_func;
}
+#elif defined(__arm__)
+
+extern void call_stubless_func(void);
+__ASM_GLOBAL_FUNC(call_stubless_func,
+ "DCD 0xDEFC\n\t" // _assertfail
+ "" );
+
+#include "pshpack1.h"
+struct thunk
+{
+ DWORD assertfail;
+};
+#include "poppack.h"
+
+static const struct thunk thunk_template =
+{
+ { 0xDEFC } /* _assertfail */
+};
+
+static inline void init_thunk( struct thunk *thunk, unsigned int index )
+{
+ *thunk = thunk_template;
+}
+
#else /* __i386__ */
#warning You must implement stubless proxies for your CPU
diff -pudN e:\wine\dlls\rpcrt4/cstub.c e:\reactos\dll\win32\rpcrt4/cstub.c
--- e:\wine\dlls\rpcrt4/cstub.c 2016-11-16 17:29:34 +0100
+++ e:\reactos\dll\win32\rpcrt4/cstub.c 2016-05-20 23:26:31 +0100
@@ -156,6 +156,13 @@ typedef struct
static const BYTE opcodes[16] = { 0x48, 0x8b, 0x49, 0x20, 0x48, 0x8b, 0x01,
0xff, 0xa0, 0, 0, 0, 0, 0x48, 0x8d, 0x36 };
+#elif defined(__arm__)
+typedef struct
+{
+ DWORD offset;
+} vtbl_method_t;
+static const BYTE opcodes[1];
+
#else
#warning You must implement delegated proxies/stubs for your CPU
diff -pudN e:\wine\dlls\rpcrt4/rpc_epmap.c e:\reactos\dll\win32\rpcrt4/rpc_epmap.c
--- e:\wine\dlls\rpcrt4/rpc_epmap.c 2016-11-16 17:29:34 +0100
+++ e:\reactos\dll\win32\rpcrt4/rpc_epmap.c 2016-11-17 12:09:06 +0100
@@ -171,7 +173,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:
diff -pudN e:\wine\dlls\rpcrt4/rpc_transport.c e:\reactos\dll\win32\rpcrt4/rpc_transport.c
--- e:\wine\dlls\rpcrt4/rpc_transport.c 2018-07-28 18:12:19 +0000
+++ e:\reactos\dll\win32\rpcrt4/rpc_transport.c 2018-07-28 18:28:54 +0000
@@ -25,6 +25,9 @@
#include "ntstatus.h"
#define WIN32_NO_STATUS
+#ifdef __REACTOS__
+#define NONAMELESSUNION
+#endif
#include "ws2tcpip.h"
#include <stdarg.h>
@@ -32,12 +35,14 @@
#include <string.h>
#include <assert.h>
+
+
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winerror.h"
#include "wininet.h"
-#include "winternl.h"
+#include "wine/winternl.h"
#include "winioctl.h"
#include "wine/unicode.h"
@@ -54,10 +59,26 @@
#define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000)
+#undef ARRAYSIZE
#define ARRAYSIZE(a) (sizeof((a)) / sizeof((a)[0]))
WINE_DEFAULT_DEBUG_CHANNEL(rpc);
+#ifdef __REACTOS__ /* FIXME: Inspect */
+BOOL WINAPI CancelIoEx(HANDLE handle, LPOVERLAPPED lpOverlapped)
+{
+ IO_STATUS_BLOCK io_status;
+
+ NtCancelIoFile(handle, &io_status);
+ if (io_status.u.Status)
+ {
+ SetLastError( RtlNtStatusToDosError( io_status.u.Status ) );
+ return FALSE;
+ }
+ return TRUE;
+}
+#endif
+
static RpcConnection *rpcrt4_spawn_connection(RpcConnection *old_connection);
/**** ncacn_np support ****/
@@ -237,14 +258,24 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc
return r;
}
-static char *ncacn_pipe_name(const char *endpoint)
+static char *ncacn_pipe_name(const char *server, const char *endpoint)
{
- static const char prefix[] = "\\\\.";
+ static const char prefix[] = "\\\\";
+ static const char local[] = ".";
+ char ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
char *pipe_name;
+ DWORD bufLen = ARRAYSIZE(ComputerName);
+
+ GetComputerNameA(ComputerName, &bufLen);
+
+ if (server == NULL || *server == 0 || stricmp(ComputerName, server) == 0)
+ server = local;
/* protseq=ncacn_np: named pipes */
- pipe_name = I_RpcAllocate(sizeof(prefix) + strlen(endpoint));
- strcat(strcpy(pipe_name, prefix), endpoint);
+ pipe_name = I_RpcAllocate(sizeof(prefix) + strlen(server) + strlen(endpoint));
+ strcpy(pipe_name, prefix);
+ strcat(pipe_name, server);
+ strcat(pipe_name, endpoint);
return pipe_name;
}
@@ -258,7 +289,7 @@ static RPC_STATUS rpcrt4_ncacn_np_open(R
if (npc->pipe)
return RPC_S_OK;
- pname = ncacn_pipe_name(Connection->Endpoint);
+ pname = ncacn_pipe_name(Connection->NetworkAddr, Connection->Endpoint);
r = rpcrt4_conn_open_pipe(Connection, pname, FALSE);
I_RpcFree(pname);
@@ -286,7 +317,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_n
if (r != RPC_S_OK)
return r;
- ((RpcConnection_np*)Connection)->listen_pipe = ncacn_pipe_name(Connection->Endpoint);
+ ((RpcConnection_np*)Connection)->listen_pipe = ncacn_pipe_name(NULL, Connection->Endpoint);
r = rpcrt4_conn_create_pipe(Connection);
EnterCriticalSection(&protseq->cs);
@@ -337,7 +368,7 @@ static RPC_STATUS rpcrt4_ncacn_np_is_ser
char *pipe_name;
RPC_STATUS status;
- pipe_name = ncacn_pipe_name(endpoint);
+ pipe_name = ncacn_pipe_name(NULL, endpoint);
status = is_pipe_listening(pipe_name);
I_RpcFree(pipe_name);
return status;
@@ -395,10 +426,14 @@ static int rpcrt4_conn_np_read(RpcConnec
if (connection->read_closed)
{
IO_STATUS_BLOCK io_status;
+#ifdef __REACTOS__ /* FIXME: We should also cancel I/O for other threads */
+ NtCancelIoFile(connection->pipe, &io_status);
+#else
NtCancelIoFileEx(connection->pipe, &connection->io_status, &io_status);
+#endif
}
WaitForSingleObject(event, INFINITE);
- status = connection->io_status.Status;
+ status = connection->io_status.u.Status;
}
release_np_event(connection, event);
return status && status != STATUS_BUFFER_OVERFLOW ? -1 : connection->io_status.Information;
@@ -419,7 +454,7 @@ static int rpcrt4_conn_np_write(RpcConne
if (status == STATUS_PENDING)
{
WaitForSingleObject(event, INFINITE);
- status = io_status.Status;
+ status = io_status.u.Status;
}
release_np_event(connection, event);
if (status)
@@ -457,7 +492,11 @@ static void rpcrt4_conn_np_close_read(Rp
IO_STATUS_BLOCK io_status;
connection->read_closed = TRUE;
+#ifdef __REACTOS__ /* FIXME: We should also cancel I/O for other threads */
+ NtCancelIoFile(connection->pipe, &io_status);
+#else
NtCancelIoFileEx(connection->pipe, &connection->io_status, &io_status);
+#endif
}
static void rpcrt4_conn_np_cancel_call(RpcConnection *conn)
@@ -675,7 +714,7 @@ static void *rpcrt4_protseq_np_get_wait_
{
case STATUS_SUCCESS:
case STATUS_PIPE_CONNECTED:
- conn->io_status.Status = status;
+ conn->io_status.u.Status = status;
SetEvent(event);
break;
case STATUS_PENDING:
@@ -756,10 +795,10 @@ static int rpcrt4_protseq_np_wait_for_ne
{
release_np_event(conn, conn->listen_event);
conn->listen_event = NULL;
- if (conn->io_status.Status == STATUS_SUCCESS || conn->io_status.Status == STATUS_PIPE_CONNECTED)
+ if (conn->io_status.u.Status == STATUS_SUCCESS || conn->io_status.u.Status == STATUS_PIPE_CONNECTED)
cconn = rpcrt4_spawn_connection(&conn->common);
else
- ERR("listen failed %x\n", conn->io_status.Status);
+ ERR("listen failed %x\n", conn->io_status.u.Status);
break;
}
}