Author: hbelusca Date: Fri May 9 01:57:43 2014 New Revision: 63202
URL: http://svn.reactos.org/svn/reactos?rev=63202&view=rev Log: [RPCRT4] Detect whether we are connecting to a pipe on the local machine and use the \.\ prefix instead of the full machine name. This patch modifies ReactOS-specific code (that was introduced by Eric in revision 53630) (Wine still supports only local pipes), so I also update our rpcrt4_ros.diff file accordingly, r63201 with respect to the latest Wine 1.7.17 rpcrt4 code.
CORE-6561 #resolve CORE-6562 #resolve CORE-7562 #comment Partly solved in revision 63202. Please retest.
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_transp... ============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Fri May 9 01:57:43 2014 @@ -307,7 +307,10 @@ { RpcConnection_np *npc = (RpcConnection_np *) Connection; static const char prefix[] = "\\"; - static const char local[] ="."; + static const char local[] = "."; + BOOL bUseLocalName = TRUE; + CHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD bufLen = sizeof(ComputerName)/sizeof(ComputerName[0]); RPC_STATUS r; LPSTR pname; INT size; @@ -318,15 +321,39 @@
/* protseq=ncacn_np: named pipes */ size = strlen(prefix); + if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0) + { + bUseLocalName = TRUE; size += strlen(local); + } else - size += strlen(Connection->NetworkAddr); + { + if (GetComputerNameA(ComputerName, &bufLen)) + { + if (stricmp(ComputerName, Connection->NetworkAddr) == 0) + { + bUseLocalName = TRUE; + size += strlen(local); + } + else + { + bUseLocalName = FALSE; + size += strlen(Connection->NetworkAddr); + } + } + else + { + bUseLocalName = FALSE; + size += strlen(Connection->NetworkAddr); + } + } + size += strlen(Connection->Endpoint) + 1;
pname = I_RpcAllocate(size); strcpy(pname, prefix); - if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0) + if (bUseLocalName) strcat(pname, local); else strcat(pname, Connection->NetworkAddr);
Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros... ============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] Fri May 9 01:57:43 2014 @@ -1,40 +1,705 @@ -diff -prudN e:\Wine\dlls\rpcrt4/epm_towers.h e:\reactos\dll\win32\rpcrt4/epm_towers.h ---- e:\Wine\dlls\rpcrt4/epm_towers.h 2011-09-16 23:22:37.031828000 +0100 -+++ e:\reactos\dll\win32\rpcrt4/epm_towers.h 2013-01-25 14:13:03.257632500 +0100 -@@ -19,7 +19,7 @@ +diff -prudN .\wine\dlls\rpcrt4/cproxy.c .\reactos\dll\win32\rpcrt4/cproxy.c +--- .\wine\dlls\rpcrt4/cproxy.c 2014-05-09 03:43:55.921033400 +0200 ++++ .\reactos\dll\win32\rpcrt4/cproxy.c 2013-12-27 18:11:56.483967600 +0100 +@@ -21,24 +21,7 @@ + * TODO: Handle non-i386 architectures + */ + +-#include "config.h" +-#include "wine/port.h" +- +-#include <stdarg.h> +- +-#define COBJMACROS +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +- +-#include "objbase.h" +-#include "rpcproxy.h" +- +-#include "cpsf.h" +-#include "ndr_misc.h" +-#include "ndr_stubless.h" +-#include "wine/debug.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(ole); + +diff -prudN .\wine\dlls\rpcrt4/cpsf.c .\reactos\dll\win32\rpcrt4/cpsf.c +--- .\wine\dlls\rpcrt4/cpsf.c 2014-05-09 03:43:55.924033600 +0200 ++++ .\reactos\dll\win32\rpcrt4/cpsf.c 2013-12-27 18:11:57.185968800 +0100 +@@ -18,28 +18,9 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include "config.h" +-#include "wine/port.h" +- +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +- +-#define COBJMACROS +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +-#include "winreg.h" +- +-#include "objbase.h" +- +-#include "rpcproxy.h" +- +-#include "wine/unicode.h" +-#include "wine/debug.h" ++#include "precomp.h" + +-#include "cpsf.h" ++#include <winreg.h> + + WINE_DEFAULT_DEBUG_CHANNEL(ole); + +diff -prudN .\wine\dlls\rpcrt4/cstub.c .\reactos\dll\win32\rpcrt4/cstub.c +--- .\wine\dlls\rpcrt4/cstub.c 2014-05-09 03:43:55.927033800 +0200 ++++ .\reactos\dll\win32\rpcrt4/cstub.c 2013-12-27 18:11:56.905168300 +0100 +@@ -19,25 +19,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include "config.h" +-#include "wine/port.h" +- +-#include <stdarg.h> +- +-#define COBJMACROS +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +-#include "excpt.h" +- +-#include "objbase.h" +-#include "rpcproxy.h" +- +-#include "wine/debug.h" +-#include "wine/exception.h" +- +-#include "cpsf.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(ole); + +diff -prudN .\wine\dlls\rpcrt4/epm_towers.h .\reactos\dll\win32\rpcrt4/epm_towers.h +--- .\wine\dlls\rpcrt4/epm_towers.h 2014-05-09 03:43:55.988037200 +0200 ++++ .\reactos\dll\win32\rpcrt4/epm_towers.h 2013-12-27 18:11:57.170368800 +0100 +@@ -19,7 +19,9 @@ * */
-#include "epm.h" ++#pragma once ++ +#include <epm_c.h>
#define EPM_PROTOCOL_DNET_NSP 0x04 #define EPM_PROTOCOL_OSI_TP4 0x05 -diff -prudN e:\Wine\dlls\rpcrt4/ndr_marshall.c e:\reactos\dll\win32\rpcrt4/ndr_marshall.c ---- e:\Wine\dlls\rpcrt4/ndr_marshall.c 2012-04-02 20:39:58.270363100 +0100 -+++ e:\reactos\dll\win32\rpcrt4/ndr_marshall.c 2013-12-06 20:04:02.897835300 +0100 -@@ -1211,7 +1211,7 @@ static unsigned char * EmbeddedPointerMa - 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; - } -@@ -1365,7 +1365,7 @@ static void EmbeddedPointerBufferSize(PM - 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; - } -diff -prudN e:\Wine\dlls\rpcrt4/rpc_epmap.c e:\reactos\dll\win32\rpcrt4/rpc_epmap.c ---- e:\Wine\dlls\rpcrt4/rpc_epmap.c 2013-03-02 14:18:00.736492500 +0100 -+++ e:\reactos\dll\win32\rpcrt4/rpc_epmap.c 2013-12-06 20:28:21.361553600 +0100 -@@ -162,7 +169,7 @@ static RPC_STATUS get_epm_handle_server( +diff -prudN .\wine\dlls\rpcrt4/msvc.S .\reactos\dll\win32\rpcrt4/msvc.S +--- .\wine\dlls\rpcrt4/msvc.S 1970-01-01 01:00:00.000000000 +0100 ++++ .\reactos\dll\win32\rpcrt4/msvc.S 2012-02-14 21:27:35.943001900 +0100 +@@ -0,0 +1,146 @@ ++ ++#include <asm.inc> ++ ++#ifdef _M_IX86 ++.code32 ++ ++EXTERN _ndr_client_call:PROC ++ ++PUBLIC _call_stubless_func ++_call_stubless_func: ++ ++ mov ecx,[esp+4] /* This Pointer */ ++ mov ecx,[ecx] /* This->lpVtbl */ ++ mov ecx,[ecx-8] /* MIDL_STUBLESS_PROXY_INFO */ ++ mov edx,[ecx+8] /* Info->FormatStringOffset */ ++ mov edx,[edx+eax*2] /* FormatStringOffset[index] */ ++ and edx, 0000FFFFh ++ add edx,[ecx+4] /* info->ProcFormatString + offset */ ++ mov eax, [edx+8] /* arguments size */ ++ and eax, 0000FFFFh ++ push eax ++ lea eax, [esp+8] /* &This */ ++ push eax ++ push edx /* format string */ ++ push [ecx] /* info->pstubdesc */ ++ call _ndr_client_call ++ lea esp, [esp+12] ++ pop edx /* arguments size */ ++ mov ecx, [esp] /* return address */ ++ add esp, edx ++ jmp ecx ++#else ++.code64 ++ ++EXTERN ndr_client_call:PROC ++ ++PUBLIC call_stubless_func ++FUNC call_stubless_func ++ mov [rsp + 8], rcx ++ .SAVEREG rcx, 8 ++ mov [rsp + 10h], rdx ++ .SAVEREG rdx, 10h ++ mov [rsp + 18h], r8 ++ .SAVEREG r8, 18h ++ mov [rsp + 20h], r9 ++ .SAVEREG r9, 20h ++ sub rsp, 38h ++ .ALLOCSTACK 38h ++ .ENDPROLOG ++ ++ lea r8, [rsp +38h + 8] /* &This */ ++ mov rcx, [rcx] /* This->lpVtbl */ ++ mov rcx, [rcx - 10h] /* MIDL_STUBLESS_PROXY_INFO */ ++ mov rdx, [rcx + 10h] /* info->FormatStringOffset */ ++ movzx rdx, word ptr [rdx+r10*2] /* FormatStringOffset[index] */ ++ add rdx, [rcx + 8] /* info->ProcFormatString + offset */ ++ mov rcx, [rcx] /* info->pStubDesc */ ++ ++ movaps [rsp + 20h], xmm1 ++ movaps [rsp + 28h], xmm2 ++ movaps [rsp + 30h], xmm3 ++ lea r9, [rsp + 18h] /* fpu_args */ ++ call ndr_client_call ++ add rsp, 38h ++ ret ++ENDFUNC ++ ++PUBLIC call_server_func ++FUNC call_server_func ++ push rbp ++ .PUSHREG rbp ++ mov rbp, rsp ++ push rsi ++ .PUSHREG rsi ++ push rdi ++ .PUSHREG rdi ++ .ENDPROLOG ++ ++ mov rax, rcx /* function to call */ ++ mov rcx, 32 /* allocate max(32,stack_size) bytes of stack space */ ++ cmp r8, rcx ++ cmovg rcx, r8 ++ sub rsp, rcx ++ and rsp, NOT 15 ++ mov rcx, r8 ++ shr rcx, 3 ++ mov rdi, rsp ++ mov rsi, rdx ++ rep movsq /* copy arguments */ ++ mov rcx, [rsp] ++ mov rdx, [rsp + 8] ++ mov r8, [rsp + 16] ++ mov r9, [rsp + 24] ++ movd xmm0, rcx ++ movd xmm1, rdx ++ movd xmm2, r8 ++ movd xmm3, r9 ++ call rax ++ ++ lea rsp, [rbp - 16] /* restore stack */ ++ pop rdi ++ pop rsi ++ pop rbp ++ ret ++ENDFUNC ++ ++ ++PUBLIC NdrClientCall2 ++FUNC NdrClientCall2 ++ mov [rsp + 18h], r8 ++ .SAVEREG r8, 18h ++ mov [rsp + 20h], r9 ++ .SAVEREG r9, 20h ++ sub rsp, 28h ++ .ALLOCSTACK 28h ++ .ENDPROLOG ++ ++ lea r8, [rsp + 28h + 18h] ++ xor r9, r9 ++ call ndr_client_call ++ ++ add rsp, 28h ++ ret ++ENDFUNC ++ ++EXTERN ndr_async_client_call:PROC ++PUBLIC NdrAsyncClientCall ++FUNC NdrAsyncClientCall ++ mov [rsp + 18h], r8 ++ .SAVEREG r8, 18h ++ mov [rsp + 20h], r9 ++ .SAVEREG r9, 20h ++ sub rsp, 28h ++ .ALLOCSTACK 28h ++ .ENDPROLOG ++ ++ lea r8, [rsp + 28h + 18h] ++ call ndr_async_client_call ++ ++ add rsp, 28h ++ ret ++ENDFUNC ++ ++#endif ++ ++END +diff -prudN .\wine\dlls\rpcrt4/ncastatus.h .\reactos\dll\win32\rpcrt4/ncastatus.h +--- .\wine\dlls\rpcrt4/ncastatus.h 2014-05-09 03:43:55.867030300 +0200 ++++ .\reactos\dll\win32\rpcrt4/ncastatus.h 2013-12-27 18:11:56.764768100 +0100 +@@ -18,6 +18,8 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + ++#pragma once ++ + #define NCA_S_COMM_FAILURE 0x1C010001 + #define NCA_S_OP_RNG_ERROR 0x1C010002 + #define NCA_S_UNK_IF 0x1C010003 +diff -prudN .\wine\dlls\rpcrt4/ndr_clientserver.c .\reactos\dll\win32\rpcrt4/ndr_clientserver.c +--- .\wine\dlls\rpcrt4/ndr_clientserver.c 2014-05-09 03:43:55.931034000 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_clientserver.c 2013-12-27 18:11:56.437167500 +0100 +@@ -22,22 +22,7 @@ + * - check for errors and throw exceptions + */ + +-#include <stdarg.h> +- +-#define COBJMACROS +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +- +-#include "objbase.h" +- +-#include "rpcproxy.h" +- +-#include "wine/debug.h" +- +-#include "ndr_misc.h" +-#include "rpcndr.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/ndr_contexthandle.c .\reactos\dll\win32\rpcrt4/ndr_contexthandle.c +--- .\wine\dlls\rpcrt4/ndr_contexthandle.c 2014-05-09 03:43:55.935034200 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_contexthandle.c 2013-12-27 18:11:56.639967900 +0100 +@@ -19,14 +19,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include "ndr_misc.h" +-#include "rpc_assoc.h" +-#include "rpcndr.h" +- +-#include "wine/rpcfc.h" +- +-#include "wine/debug.h" +-#include "wine/list.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(ole); + +diff -prudN .\wine\dlls\rpcrt4/ndr_es.c .\reactos\dll\win32\rpcrt4/ndr_es.c +--- .\wine\dlls\rpcrt4/ndr_es.c 2014-05-09 03:43:55.938034400 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_es.c 2013-12-27 18:11:56.764768100 +0100 +@@ -18,21 +18,9 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include <stdarg.h> +-#include <stdio.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +-#include "rpc.h" +-#include "midles.h" +-#include "ndrtypes.h" +- +-#include "ndr_misc.h" +-#include "ndr_stubless.h" ++#include "precomp.h" + +-#include "wine/debug.h" +-#include "wine/rpcfc.h" ++#include <midles.h> + + WINE_DEFAULT_DEBUG_CHANNEL(ole); + +diff -prudN .\wine\dlls\rpcrt4/ndr_fullpointer.c .\reactos\dll\win32\rpcrt4/ndr_fullpointer.c +--- .\wine\dlls\rpcrt4/ndr_fullpointer.c 2014-05-09 03:43:55.941034600 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_fullpointer.c 2013-12-27 18:11:56.655567900 +0100 +@@ -18,14 +18,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include <stdarg.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "rpc.h" +-#include "rpcndr.h" +- +-#include "wine/debug.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/ndr_marshall.c .\reactos\dll\win32\rpcrt4/ndr_marshall.c +--- .\wine\dlls\rpcrt4/ndr_marshall.c 2014-05-09 03:43:55.945034800 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_marshall.c 2014-04-27 11:37:38.078578700 +0200 +@@ -27,25 +27,7 @@ + * - Checks for integer addition overflow in user marshall functions + */ + +-#include <assert.h> +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +-#include <limits.h> +- +-#define NONAMELESSUNION +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +- +-#include "ndr_misc.h" +-#include "rpcndr.h" +-#include "ndrtypes.h" +- +-#include "wine/unicode.h" +-#include "wine/rpcfc.h" +- +-#include "wine/debug.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(ole); + +diff -prudN .\wine\dlls\rpcrt4/ndr_misc.h .\reactos\dll\win32\rpcrt4/ndr_misc.h +--- .\wine\dlls\rpcrt4/ndr_misc.h 2014-05-09 03:43:55.873030700 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_misc.h 2013-12-27 18:11:56.624367800 +0100 +@@ -21,13 +21,6 @@ + #ifndef __WINE_NDR_MISC_H + #define __WINE_NDR_MISC_H + +-#include <stdarg.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "rpc.h" +-#include "rpcndr.h" +- + struct IPSFactoryBuffer; + + PFORMAT_STRING ComputeConformanceOrVariance( +diff -prudN .\wine\dlls\rpcrt4/ndr_ole.c .\reactos\dll\win32\rpcrt4/ndr_ole.c +--- .\wine\dlls\rpcrt4/ndr_ole.c 2014-05-09 03:43:55.948035000 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_ole.c 2013-12-27 18:11:56.468367600 +0100 +@@ -22,27 +22,7 @@ + * - finish RpcStream_Vtbl + */ + +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +- +-#define COBJMACROS +-#define NONAMELESSUNION +-#define NONAMELESSSTRUCT +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +- +-#include "objbase.h" +- +-#include "ndr_misc.h" +-#include "rpcndr.h" +-#include "rpcproxy.h" +-#include "wine/rpcfc.h" +-#include "cpsf.h" +- +-#include "wine/debug.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(ole); + +diff -prudN .\wine\dlls\rpcrt4/ndr_stubless.c .\reactos\dll\win32\rpcrt4/ndr_stubless.c +--- .\wine\dlls\rpcrt4/ndr_stubless.c 2014-05-09 03:43:55.952035200 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_stubless.c 2013-12-27 18:11:56.437167500 +0100 +@@ -23,28 +23,7 @@ + * - Some types of binding handles + */ + +-#include "config.h" +-#include "wine/port.h" +- +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +- +-#include "objbase.h" +-#include "rpc.h" +-#include "rpcproxy.h" +- +-#include "wine/exception.h" +-#include "wine/debug.h" +-#include "wine/rpcfc.h" +- +-#include "cpsf.h" +-#include "ndr_misc.h" +-#include "ndr_stubless.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/ndr_stubless.h .\reactos\dll\win32\rpcrt4/ndr_stubless.h +--- .\wine\dlls\rpcrt4/ndr_stubless.h 2014-05-09 03:43:55.878030900 +0200 ++++ .\reactos\dll\win32\rpcrt4/ndr_stubless.h 2013-12-27 18:11:56.452767500 +0100 +@@ -18,10 +18,12 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include "ndrtypes.h" ++#pragma once ++ ++#include <ndrtypes.h> + + /* there can't be any alignment with the structures in this file */ +-#include "pshpack1.h" ++#include <pshpack1.h> + + typedef struct _NDR_PROC_HEADER + { +@@ -223,7 +225,7 @@ typedef struct _NDR_EHD_CONTEXT + unsigned char param_num; + } NDR_EHD_CONTEXT; + +-#include "poppack.h" ++#include <poppack.h> + + enum stubless_phase + { +diff -prudN .\wine\dlls\rpcrt4/precomp.h .\reactos\dll\win32\rpcrt4/precomp.h +--- .\wine\dlls\rpcrt4/precomp.h 1970-01-01 01:00:00.000000000 +0100 ++++ .\reactos\dll\win32\rpcrt4/precomp.h 2014-03-14 01:43:22.357516600 +0100 +@@ -0,0 +1,40 @@ ++#ifndef _RPCRT4_PCH_ ++#define _RPCRT4_PCH_ ++ ++#include <config.h> ++ ++#include <assert.h> ++#include <stdarg.h> ++#include <stdio.h> ++ ++#define _INC_WINDOWS ++ ++#define COBJMACROS ++#define NONAMELESSUNION ++#define NONAMELESSSTRUCT ++ ++#include <ntstatus.h> ++#define WIN32_NO_STATUS ++#include <windef.h> ++#include <winbase.h> ++#include <winternl.h> ++#include <objbase.h> ++#include <rpcproxy.h> ++#include <security.h> ++ ++#include <wine/debug.h> ++#include <wine/exception.h> ++#include <wine/list.h> ++#include <wine/rpcfc.h> ++#include <wine/unicode.h> ++ ++#include "cpsf.h" ++#include "ncastatus.h" ++#include "ndr_misc.h" ++#include "ndr_stubless.h" ++#include "rpc_assoc.h" ++#include "rpc_binding.h" ++#include "rpc_message.h" ++#include "rpc_server.h" ++ ++#endif /* _RPCRT4_PCH_ */ +diff -prudN .\wine\dlls\rpcrt4/rpc_assoc.c .\reactos\dll\win32\rpcrt4/rpc_assoc.c +--- .\wine\dlls\rpcrt4/rpc_assoc.c 2014-05-09 03:43:55.955035400 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_assoc.c 2013-12-27 18:11:56.780368100 +0100 +@@ -19,19 +19,7 @@ + * + */ + +-#include <stdarg.h> +-#include <assert.h> +- +-#include "rpc.h" +-#include "rpcndr.h" +-#include "winternl.h" +- +-#include "wine/unicode.h" +-#include "wine/debug.h" +- +-#include "rpc_binding.h" +-#include "rpc_assoc.h" +-#include "rpc_message.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/rpc_assoc.h .\reactos\dll\win32\rpcrt4/rpc_assoc.h +--- .\wine\dlls\rpcrt4/rpc_assoc.h 2014-05-09 03:43:55.884031300 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_assoc.h 2013-12-27 18:11:56.905168300 +0100 +@@ -20,7 +20,6 @@ + */ + + #include "rpc_binding.h" +-#include "wine/list.h" + + typedef struct _RpcAssoc + { +diff -prudN .\wine\dlls\rpcrt4/rpc_async.c .\reactos\dll\win32\rpcrt4/rpc_async.c +--- .\wine\dlls\rpcrt4/rpc_async.c 2014-05-09 03:43:55.958035500 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_async.c 2013-12-27 18:11:56.468367600 +0100 +@@ -19,17 +19,7 @@ + * + */ + +-#include <stdarg.h> +- +-#include "rpc.h" +-#include "rpcndr.h" +-#include "rpcasync.h" +- +-#include "wine/debug.h" +- +-#include "rpc_binding.h" +-#include "rpc_message.h" +-#include "ndr_stubless.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/rpc_binding.c .\reactos\dll\win32\rpcrt4/rpc_binding.c +--- .\wine\dlls\rpcrt4/rpc_binding.c 2014-05-09 03:43:55.962035800 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_binding.c 2013-12-27 18:11:56.452767500 +0100 +@@ -21,25 +21,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +-#include <assert.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "winnls.h" +-#include "winerror.h" +-#include "winternl.h" +-#include "wine/unicode.h" +- +-#include "rpc.h" +-#include "rpcndr.h" +- +-#include "wine/debug.h" +- +-#include "rpc_binding.h" +-#include "rpc_assoc.h" ++#include "precomp.h" + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/rpc_binding.h .\reactos\dll\win32\rpcrt4/rpc_binding.h +--- .\wine\dlls\rpcrt4/rpc_binding.h 2014-05-09 03:43:55.890031600 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_binding.h 2013-12-27 18:11:56.483967600 +0100 +@@ -21,12 +21,8 @@ + #ifndef __WINE_RPC_BINDING_H + #define __WINE_RPC_BINDING_H + +-#include "rpcndr.h" +-#include "security.h" +-#include "wine/list.h" + #include "rpc_defs.h" + +- + enum secure_packet_direction + { + SECURE_PACKET_SEND, +diff -prudN .\wine\dlls\rpcrt4/rpc_defs.h .\reactos\dll\win32\rpcrt4/rpc_defs.h +--- .\wine\dlls\rpcrt4/rpc_defs.h 2014-05-09 03:43:55.895031900 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_defs.h 2013-01-25 00:19:54.167254400 +0100 +@@ -22,7 +22,7 @@ + #ifndef __WINE_RPC_DEFS_H + #define __WINE_RPC_DEFS_H + +-#include "pshpack1.h" ++#include <pshpack1.h> + typedef struct + { + unsigned char rpc_ver; /* RPC major version (5) */ +@@ -168,7 +168,7 @@ typedef struct + unsigned char auth_reserved; /* reserved, must be zero */ + unsigned int auth_context_id; /* unique value for the authenticated connection */ + } RpcAuthVerifier; +-#include "poppack.h" ++#include <poppack.h> + + #define RPC_AUTH_VERIFIER_LEN(common_hdr) \ + ((common_hdr)->auth_len ? (common_hdr)->auth_len + sizeof(RpcAuthVerifier) : 0) +diff -prudN .\wine\dlls\rpcrt4/rpc_epmap.c .\reactos\dll\win32\rpcrt4/rpc_epmap.c +--- .\wine\dlls\rpcrt4/rpc_epmap.c 2014-05-09 03:43:55.965035900 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_epmap.c 2013-12-27 18:11:56.421567500 +0100 +@@ -20,19 +20,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include <stdarg.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +- +-#include "rpc.h" +- +-#include "wine/debug.h" +-#include "wine/exception.h" +- +-#include "rpc_binding.h" +-#include "epm.h" ++#include "precomp.h" + #include "epm_towers.h" + + WINE_DEFAULT_DEBUG_CHANNEL(ole); +@@ -92,7 +80,7 @@ static BOOL start_rpcss(void) + lstrcatW( cmd, rpcss ); + + Wow64DisableWow64FsRedirection( &redir ); +- rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ); ++ rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); + Wow64RevertWow64FsRedirection( redir ); + + if (rslt) +@@ -162,7 +150,7 @@ static RPC_STATUS get_epm_handle_server(
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *__eptr) { @@ -43,10 +708,87 @@ { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_ILLEGAL_INSTRUCTION: -diff -prudN e:\Wine\dlls\rpcrt4/rpc_server.c e:\reactos\dll\win32\rpcrt4/rpc_server.c ---- e:\Wine\dlls\rpcrt4/rpc_server.c 2012-12-09 09:57:02.680308600 +0100 -+++ e:\reactos\dll\win32\rpcrt4/rpc_server.c 2013-12-06 23:50:04.564226300 +0100 -@@ -1075,8 +1077,10 @@ void RPCRT4_destroy_all_protseqs(void) +diff -prudN .\wine\dlls\rpcrt4/rpc_message.c .\reactos\dll\win32\rpcrt4/rpc_message.c +--- .\wine\dlls\rpcrt4/rpc_message.c 2014-05-09 03:43:55.969036200 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_message.c 2014-04-27 11:37:38.078578700 +0200 +@@ -20,25 +20,9 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +-#include "winuser.h" +- +-#include "rpc.h" +-#include "rpcndr.h" +-#include "rpcdcep.h" +- +-#include "wine/debug.h" ++#include "precomp.h" + +-#include "rpc_binding.h" +-#include "rpc_defs.h" +-#include "rpc_message.h" +-#include "ncastatus.h" ++#include <winuser.h> + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/rpc_message.h .\reactos\dll\win32\rpcrt4/rpc_message.h +--- .\wine\dlls\rpcrt4/rpc_message.h 2014-05-09 03:43:55.901032300 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_message.h 2013-12-27 18:11:56.499567600 +0100 +@@ -21,8 +21,6 @@ + #ifndef __WINE_RPC_MESSAGE_H + #define __WINE_RPC_MESSAGE_H + +-#include "rpc_defs.h" +- + typedef unsigned int NCA_STATUS; + + RpcPktHdr *RPCRT4_BuildFaultHeader(ULONG DataRepresentation, RPC_STATUS Status) DECLSPEC_HIDDEN; +diff -prudN .\wine\dlls\rpcrt4/rpc_server.c .\reactos\dll\win32\rpcrt4/rpc_server.c +--- .\wine\dlls\rpcrt4/rpc_server.c 2014-05-09 03:43:55.973036400 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_server.c 2013-12-27 18:11:56.780368100 +0100 +@@ -20,31 +20,9 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +-#include "config.h" +-#include "wine/port.h" +- +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +-#include <assert.h> +- +-#include "windef.h" +-#include "winbase.h" +-#include "winerror.h" +- +-#include "rpc.h" +-#include "rpcndr.h" +-#include "excpt.h" +- +-#include "wine/debug.h" +-#include "wine/exception.h" ++#include "precomp.h" + +-#include "rpc_server.h" +-#include "rpc_assoc.h" +-#include "rpc_message.h" +-#include "rpc_defs.h" +-#include "ncastatus.h" +-#include "secext.h" ++#include <secext.h> + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +@@ -1075,8 +1053,10 @@ void RPCRT4_destroy_all_protseqs(void) EnterCriticalSection(&server_cs); LIST_FOR_EACH_ENTRY_SAFE(cps, cursor2, &protseqs, RpcServerProtseq, entry) { @@ -57,10 +799,62 @@ destroy_serverprotoseq(cps); } LeaveCriticalSection(&server_cs); -diff -prudN e:\Wine\dlls\rpcrt4/rpc_transport.c e:\reactos\dll\win32\rpcrt4/rpc_transport.c ---- e:\Wine\dlls\rpcrt4/rpc_transport.c 2013-12-06 20:10:59.302378700 +0100 -+++ e:\reactos\dll\win32\rpcrt4/rpc_transport.c 2013-12-06 23:39:38.664465200 +0100 -@@ -111,31 +115,41 @@ typedef struct _RpcConnection_np +diff -prudN .\wine\dlls\rpcrt4/rpc_server.h .\reactos\dll\win32\rpcrt4/rpc_server.h +--- .\wine\dlls\rpcrt4/rpc_server.h 2014-05-09 03:43:55.907032600 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_server.h 2013-12-27 18:11:56.905168300 +0100 +@@ -22,7 +22,6 @@ + #define __WINE_RPC_SERVER_H + + #include "rpc_binding.h" +-#include "wine/list.h" + + struct protseq_ops; + +diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_transport.c +--- .\wine\dlls\rpcrt4/rpc_transport.c 2014-05-09 03:43:55.977036600 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpc_transport.c 2014-05-09 03:10:59.250551600 +0200 +@@ -23,14 +23,7 @@ + * + */ + +-#include "config.h" +- +-#include <stdarg.h> +-#include <stdio.h> +-#include <string.h> +-#include <assert.h> +-#include <stdlib.h> +-#include <sys/types.h> ++#include "precomp.h" + + #if defined(__MINGW32__) || defined (_MSC_VER) + # include <ws2tcpip.h> +@@ -76,23 +69,8 @@ + # define ioctlsocket ioctl + #endif /* defined(__MINGW32__) || defined (_MSC_VER) */ + +-#include "windef.h" +-#include "winbase.h" +-#include "winnls.h" +-#include "winerror.h" +-#include "wininet.h" +-#include "winternl.h" +-#include "wine/unicode.h" +- +-#include "rpc.h" +-#include "rpcndr.h" +- +-#include "wine/debug.h" ++#include <wininet.h> + +-#include "rpc_binding.h" +-#include "rpc_assoc.h" +-#include "rpc_message.h" +-#include "rpc_server.h" + #include "epm_towers.h" + + #ifndef SOL_TCP +@@ -113,31 +91,41 @@ typedef struct _RpcConnection_np { RpcConnection common; HANDLE pipe; @@ -109,26 +903,20 @@ case ERROR_NO_DATA_DETECTED: /* client has disconnected, retry */ DisconnectNamedPipe( npc->pipe ); -@@ -148,28 +162,12 @@ static DWORD CALLBACK listen_thread(void +@@ -150,6 +138,7 @@ static DWORD CALLBACK listen_thread(void } }
--static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc) --{ -- if (npc->listening) -- return RPC_S_OK; -- -- npc->listening = TRUE; -- npc->listen_thread = CreateThread(NULL, 0, listen_thread, npc, 0, NULL); -- if (!npc->listen_thread) -- { -- npc->listening = FALSE; -- ERR("Couldn't create listen thread (error was %d)\n", GetLastError()); -- return RPC_S_OUT_OF_RESOURCES; -- } -- return RPC_S_OK; --} -- ++#ifndef __REACTOS__ + static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc) + { + if (npc->listening) +@@ -165,13 +154,14 @@ static RPC_STATUS rpcrt4_conn_listen_pip + } + return RPC_S_OK; + } ++#endif + static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *Connection, LPCSTR pname) { RpcConnection_np *npc = (RpcConnection_np *) Connection; @@ -139,7 +927,7 @@ PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES, RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); -@@ -181,6 +179,9 @@ static RPC_STATUS rpcrt4_conn_create_pip +@@ -183,6 +173,9 @@ static RPC_STATUS rpcrt4_conn_create_pip return RPC_S_CANT_CREATE_ENDPOINT; }
@@ -149,7 +937,7 @@ /* Note: we don't call ConnectNamedPipe here because it must be done in the * server thread as the thread must be alertable */ return RPC_S_OK; -@@ -227,6 +228,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe( +@@ -229,6 +222,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; @@ -159,7 +947,7 @@ } if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { err = GetLastError(); -@@ -236,9 +240,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe( +@@ -238,9 +234,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe( }
/* success */ @@ -171,13 +959,16 @@ npc->pipe = pipe;
return RPC_S_OK; -@@ -306,18 +312,32 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc +@@ -308,18 +306,59 @@ 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[] ="."; ++ static const char local[] = "."; ++ BOOL bUseLocalName = TRUE; ++ CHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; ++ DWORD bufLen = sizeof(ComputerName)/sizeof(ComputerName[0]); RPC_STATUS r; LPSTR pname; + INT size; @@ -191,15 +982,39 @@ - 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) ++ { ++ bUseLocalName = TRUE; + size += strlen(local); ++ } + else -+ size += strlen(Connection->NetworkAddr); ++ { ++ if (GetComputerNameA(ComputerName, &bufLen)) ++ { ++ if (stricmp(ComputerName, Connection->NetworkAddr) == 0) ++ { ++ bUseLocalName = TRUE; ++ size += strlen(local); ++ } ++ else ++ { ++ bUseLocalName = FALSE; ++ size += strlen(Connection->NetworkAddr); ++ } ++ } ++ else ++ { ++ bUseLocalName = FALSE; ++ size += strlen(Connection->NetworkAddr); ++ } ++ } ++ + size += strlen(Connection->Endpoint) + 1; + + pname = I_RpcAllocate(size); + strcpy(pname, prefix); -+ if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0) ++ if (bUseLocalName) + strcat(pname, local); + else + strcat(pname, Connection->NetworkAddr); @@ -208,7 +1023,7 @@ I_RpcFree(pname);
return r; -@@ -366,9 +386,9 @@ static void rpcrt4_conn_np_handoff(RpcCo +@@ -368,9 +407,9 @@ static void rpcrt4_conn_np_handoff(RpcCo * to the child, then reopen the server binding to continue listening */
new_npc->pipe = old_npc->pipe; @@ -220,7 +1035,7 @@ old_npc->listening = FALSE; }
-@@ -413,11 +433,17 @@ static int rpcrt4_conn_np_read(RpcConnec +@@ -415,11 +454,17 @@ static int rpcrt4_conn_np_read(RpcConnec char *buf = buffer; BOOL ret = TRUE; unsigned int bytes_left = count; @@ -239,7 +1054,7 @@ if (!ret && GetLastError() == ERROR_MORE_DATA) ret = TRUE; if (!ret || !bytes_read) -@@ -425,6 +451,7 @@ static int rpcrt4_conn_np_read(RpcConnec +@@ -427,6 +472,7 @@ static int rpcrt4_conn_np_read(RpcConnec bytes_left -= bytes_read; buf += bytes_read; } @@ -247,7 +1062,7 @@ return ret ? count : -1; }
-@@ -435,16 +462,23 @@ static int rpcrt4_conn_np_write(RpcConne +@@ -437,16 +483,23 @@ static int rpcrt4_conn_np_write(RpcConne const char *buf = buffer; BOOL ret = TRUE; unsigned int bytes_left = count; @@ -272,7 +1087,7 @@ return ret ? count : -1; }
-@@ -456,9 +490,9 @@ static int rpcrt4_conn_np_close(RpcConne +@@ -458,9 +511,9 @@ static int rpcrt4_conn_np_close(RpcConne CloseHandle(npc->pipe); npc->pipe = 0; } @@ -285,7 +1100,7 @@ } return 0; } -@@ -662,7 +696,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -664,7 +717,7 @@ static void *rpcrt4_protseq_np_get_wait_ conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { rpcrt4_conn_listen_pipe(conn); @@ -294,7 +1109,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -683,7 +717,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -685,7 +738,7 @@ static void *rpcrt4_protseq_np_get_wait_ *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { @@ -303,7 +1118,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -730,18 +764,12 @@ static int rpcrt4_protseq_np_wait_for_ne +@@ -732,18 +785,12 @@ static int rpcrt4_protseq_np_wait_for_ne EnterCriticalSection(&protseq->cs); conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { @@ -324,9 +1139,9 @@ else ERR("failed to locate connection for handle %p\n", b_handle); LeaveCriticalSection(&protseq->cs); -diff -prudN e:\Wine\dlls\rpcrt4/rpcrt4.spec e:\reactos\dll\win32\rpcrt4/rpcrt4.spec ---- e:\Wine\dlls\rpcrt4/rpcrt4.spec 2012-09-09 19:47:53.677232900 +0100 -+++ e:\reactos\dll\win32\rpcrt4/rpcrt4.spec 2013-12-06 20:29:09.804227500 +0100 +diff -prudN .\wine\dlls\rpcrt4/rpcrt4.spec .\reactos\dll\win32\rpcrt4/rpcrt4.spec +--- .\wine\dlls\rpcrt4/rpcrt4.spec 2014-05-09 03:43:55.911032800 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpcrt4.spec 2013-12-07 15:35:15.331527800 +0100 @@ -266,7 +266,7 @@ @ stdcall NdrRangeUnmarshall(ptr ptr ptr long) @ stub NdrRpcSmClientAllocate @@ -336,3 +1151,78 @@ @ stub NdrRpcSsDefaultAllocate @ stub NdrRpcSsDefaultFree @ stub NdrRpcSsDisableAllocate +diff -prudN .\wine\dlls\rpcrt4/rpcrt4_main.c .\reactos\dll\win32\rpcrt4/rpcrt4_main.c +--- .\wine\dlls\rpcrt4/rpcrt4_main.c 2014-05-09 03:43:55.980036800 +0200 ++++ .\reactos\dll\win32\rpcrt4/rpcrt4_main.c 2014-05-09 03:45:42.047103500 +0200 +@@ -28,35 +28,10 @@ + * NT-based native rpcrt4's. Commonly-used transport for self-to-self RPC's. + */ + +-#include "config.h" +- +-#include <stdarg.h> +-#include <stdio.h> +-#include <stdlib.h> +-#include <string.h> +- +-#include "ntstatus.h" +-#define WIN32_NO_STATUS +-#include "windef.h" +-#include "winerror.h" +-#include "winbase.h" +-#include "winuser.h" +-#include "winnt.h" +-#include "winternl.h" +-#include "ntsecapi.h" +-#include "iptypes.h" +-#include "iphlpapi.h" +-#include "wine/unicode.h" +-#include "rpc.h" +- +-#include "ole2.h" +-#include "rpcndr.h" +-#include "rpcproxy.h" +- +-#include "rpc_binding.h" +-#include "rpc_server.h" ++#include "precomp.h" + +-#include "wine/debug.h" ++#include <ntsecapi.h> ++#include <iphlpapi.h> + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +diff -prudN .\wine\dlls\rpcrt4/unix_func.c .\reactos\dll\win32\rpcrt4/unix_func.c +--- .\wine\dlls\rpcrt4/unix_func.c 1970-01-01 01:00:00.000000000 +0100 ++++ .\reactos\dll\win32\rpcrt4/unix_func.c 2013-01-25 00:19:53.278052800 +0100 +@@ -0,0 +1,29 @@ ++#define WIN32_NO_STATUS ++#define _INC_WINDOWS ++#include <windef.h> ++#include <winsock2.h> ++ ++const char * ++WSAAPI ++inet_ntop (int af, ++ const void *src, ++ char *dst, ++ size_t cnt) ++{ ++ struct in_addr in; ++ char *text_addr; ++ ++ if (af == AF_INET) ++ { ++ memcpy(&in.s_addr, src, sizeof(in.s_addr)); ++ text_addr = inet_ntoa(in); ++ if (text_addr && dst) ++ { ++ strncpy(dst, text_addr, cnt); ++ return dst; ++ } ++ } ++ ++ return 0; ++} ++