1 diff -prudN .\wine\dlls\rpcrt4/cproxy.c .\reactos\dll\win32\rpcrt4/cproxy.c
2 --- .\wine\dlls\rpcrt4/cproxy.c 2014-05-09 03:43:55.921033400 +0200
3 +++ .\reactos\dll\win32\rpcrt4/cproxy.c 2013-12-27 18:11:56.483967600 +0100
5 * TODO: Handle non-i386 architectures
9 -#include "wine/port.h"
17 -#include "winerror.h"
20 -#include "rpcproxy.h"
23 -#include "ndr_misc.h"
24 -#include "ndr_stubless.h"
25 -#include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(ole);
30 diff -prudN .\wine\dlls\rpcrt4/cpsf.c .\reactos\dll\win32\rpcrt4/cpsf.c
31 --- .\wine\dlls\rpcrt4/cpsf.c 2014-05-09 03:43:55.924033600 +0200
32 +++ .\reactos\dll\win32\rpcrt4/cpsf.c 2013-12-27 18:11:57.185968800 +0100
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
38 -#include "wine/port.h"
48 -#include "winerror.h"
53 -#include "rpcproxy.h"
55 -#include "wine/unicode.h"
56 -#include "wine/debug.h"
62 WINE_DEFAULT_DEBUG_CHANNEL(ole);
64 diff -prudN .\wine\dlls\rpcrt4/cstub.c .\reactos\dll\win32\rpcrt4/cstub.c
65 --- .\wine\dlls\rpcrt4/cstub.c 2014-05-09 03:43:55.927033800 +0200
66 +++ .\reactos\dll\win32\rpcrt4/cstub.c 2013-12-27 18:11:56.905168300 +0100
68 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
72 -#include "wine/port.h"
80 -#include "winerror.h"
84 -#include "rpcproxy.h"
86 -#include "wine/debug.h"
87 -#include "wine/exception.h"
92 WINE_DEFAULT_DEBUG_CHANNEL(ole);
94 diff -prudN .\wine\dlls\rpcrt4/epm_towers.h .\reactos\dll\win32\rpcrt4/epm_towers.h
95 --- .\wine\dlls\rpcrt4/epm_towers.h 2014-05-09 03:43:55.988037200 +0200
96 +++ .\reactos\dll\win32\rpcrt4/epm_towers.h 2013-12-27 18:11:57.170368800 +0100
106 #define EPM_PROTOCOL_DNET_NSP 0x04
107 #define EPM_PROTOCOL_OSI_TP4 0x05
108 diff -prudN .\wine\dlls\rpcrt4/msvc.S .\reactos\dll\win32\rpcrt4/msvc.S
109 --- .\wine\dlls\rpcrt4/msvc.S 1970-01-01 01:00:00.000000000 +0100
110 +++ .\reactos\dll\win32\rpcrt4/msvc.S 2012-02-14 21:27:35.943001900 +0100
118 +EXTERN _ndr_client_call:PROC
120 +PUBLIC _call_stubless_func
121 +_call_stubless_func:
123 + mov ecx,[esp+4] /* This Pointer */
124 + mov ecx,[ecx] /* This->lpVtbl */
125 + mov ecx,[ecx-8] /* MIDL_STUBLESS_PROXY_INFO */
126 + mov edx,[ecx+8] /* Info->FormatStringOffset */
127 + mov edx,[edx+eax*2] /* FormatStringOffset[index] */
129 + add edx,[ecx+4] /* info->ProcFormatString + offset */
130 + mov eax, [edx+8] /* arguments size */
133 + lea eax, [esp+8] /* &This */
135 + push edx /* format string */
136 + push [ecx] /* info->pstubdesc */
137 + call _ndr_client_call
139 + pop edx /* arguments size */
140 + mov ecx, [esp] /* return address */
146 +EXTERN ndr_client_call:PROC
148 +PUBLIC call_stubless_func
149 +FUNC call_stubless_func
152 + mov [rsp + 10h], rdx
154 + mov [rsp + 18h], r8
156 + mov [rsp + 20h], r9
162 + lea r8, [rsp +38h + 8] /* &This */
163 + mov rcx, [rcx] /* This->lpVtbl */
164 + mov rcx, [rcx - 10h] /* MIDL_STUBLESS_PROXY_INFO */
165 + mov rdx, [rcx + 10h] /* info->FormatStringOffset */
166 + movzx rdx, word ptr [rdx+r10*2] /* FormatStringOffset[index] */
167 + add rdx, [rcx + 8] /* info->ProcFormatString + offset */
168 + mov rcx, [rcx] /* info->pStubDesc */
170 + movaps [rsp + 20h], xmm1
171 + movaps [rsp + 28h], xmm2
172 + movaps [rsp + 30h], xmm3
173 + lea r9, [rsp + 18h] /* fpu_args */
174 + call ndr_client_call
179 +PUBLIC call_server_func
180 +FUNC call_server_func
190 + mov rax, rcx /* function to call */
191 + mov rcx, 32 /* allocate max(32,stack_size) bytes of stack space */
200 + rep movsq /* copy arguments */
211 + lea rsp, [rbp - 16] /* restore stack */
219 +PUBLIC NdrClientCall2
221 + mov [rsp + 18h], r8
223 + mov [rsp + 20h], r9
229 + lea r8, [rsp + 28h + 18h]
231 + call ndr_client_call
237 +EXTERN ndr_async_client_call:PROC
238 +PUBLIC NdrAsyncClientCall
239 +FUNC NdrAsyncClientCall
240 + mov [rsp + 18h], r8
242 + mov [rsp + 20h], r9
248 + lea r8, [rsp + 28h + 18h]
249 + call ndr_async_client_call
258 diff -prudN .\wine\dlls\rpcrt4/ncastatus.h .\reactos\dll\win32\rpcrt4/ncastatus.h
259 --- .\wine\dlls\rpcrt4/ncastatus.h 2014-05-09 03:43:55.867030300 +0200
260 +++ .\reactos\dll\win32\rpcrt4/ncastatus.h 2013-12-27 18:11:56.764768100 +0100
262 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
267 #define NCA_S_COMM_FAILURE 0x1C010001
268 #define NCA_S_OP_RNG_ERROR 0x1C010002
269 #define NCA_S_UNK_IF 0x1C010003
270 diff -prudN .\wine\dlls\rpcrt4/ndr_clientserver.c .\reactos\dll\win32\rpcrt4/ndr_clientserver.c
271 --- .\wine\dlls\rpcrt4/ndr_clientserver.c 2014-05-09 03:43:55.931034000 +0200
272 +++ .\reactos\dll\win32\rpcrt4/ndr_clientserver.c 2013-12-27 18:11:56.437167500 +0100
274 * - check for errors and throw exceptions
282 -#include "winbase.h"
283 -#include "winerror.h"
285 -#include "objbase.h"
287 -#include "rpcproxy.h"
289 -#include "wine/debug.h"
291 -#include "ndr_misc.h"
293 +#include "precomp.h"
295 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
297 diff -prudN .\wine\dlls\rpcrt4/ndr_contexthandle.c .\reactos\dll\win32\rpcrt4/ndr_contexthandle.c
298 --- .\wine\dlls\rpcrt4/ndr_contexthandle.c 2014-05-09 03:43:55.935034200 +0200
299 +++ .\reactos\dll\win32\rpcrt4/ndr_contexthandle.c 2013-12-27 18:11:56.639967900 +0100
301 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
304 -#include "ndr_misc.h"
305 -#include "rpc_assoc.h"
308 -#include "wine/rpcfc.h"
310 -#include "wine/debug.h"
311 -#include "wine/list.h"
312 +#include "precomp.h"
314 WINE_DEFAULT_DEBUG_CHANNEL(ole);
316 diff -prudN .\wine\dlls\rpcrt4/ndr_es.c .\reactos\dll\win32\rpcrt4/ndr_es.c
317 --- .\wine\dlls\rpcrt4/ndr_es.c 2014-05-09 03:43:55.938034400 +0200
318 +++ .\reactos\dll\win32\rpcrt4/ndr_es.c 2013-12-27 18:11:56.764768100 +0100
320 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
327 -#include "winbase.h"
328 -#include "winerror.h"
331 -#include "ndrtypes.h"
333 -#include "ndr_misc.h"
334 -#include "ndr_stubless.h"
335 +#include "precomp.h"
337 -#include "wine/debug.h"
338 -#include "wine/rpcfc.h"
341 WINE_DEFAULT_DEBUG_CHANNEL(ole);
343 diff -prudN .\wine\dlls\rpcrt4/ndr_fullpointer.c .\reactos\dll\win32\rpcrt4/ndr_fullpointer.c
344 --- .\wine\dlls\rpcrt4/ndr_fullpointer.c 2014-05-09 03:43:55.941034600 +0200
345 +++ .\reactos\dll\win32\rpcrt4/ndr_fullpointer.c 2013-12-27 18:11:56.655567900 +0100
347 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
353 -#include "winbase.h"
357 -#include "wine/debug.h"
358 +#include "precomp.h"
360 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
362 diff -prudN .\wine\dlls\rpcrt4/ndr_marshall.c .\reactos\dll\win32\rpcrt4/ndr_marshall.c
363 --- .\wine\dlls\rpcrt4/ndr_marshall.c 2014-05-09 03:43:55.945034800 +0200
364 +++ .\reactos\dll\win32\rpcrt4/ndr_marshall.c 2014-04-27 11:37:38.078578700 +0200
366 * - Checks for integer addition overflow in user marshall functions
375 -#define NONAMELESSUNION
377 -#include "winbase.h"
378 -#include "winerror.h"
380 -#include "ndr_misc.h"
382 -#include "ndrtypes.h"
384 -#include "wine/unicode.h"
385 -#include "wine/rpcfc.h"
387 -#include "wine/debug.h"
388 +#include "precomp.h"
390 WINE_DEFAULT_DEBUG_CHANNEL(ole);
392 diff -prudN .\wine\dlls\rpcrt4/ndr_misc.h .\reactos\dll\win32\rpcrt4/ndr_misc.h
393 --- .\wine\dlls\rpcrt4/ndr_misc.h 2014-05-09 03:43:55.873030700 +0200
394 +++ .\reactos\dll\win32\rpcrt4/ndr_misc.h 2013-12-27 18:11:56.624367800 +0100
396 #ifndef __WINE_NDR_MISC_H
397 #define __WINE_NDR_MISC_H
402 -#include "winbase.h"
406 struct IPSFactoryBuffer;
408 PFORMAT_STRING ComputeConformanceOrVariance(
409 diff -prudN .\wine\dlls\rpcrt4/ndr_ole.c .\reactos\dll\win32\rpcrt4/ndr_ole.c
410 --- .\wine\dlls\rpcrt4/ndr_ole.c 2014-05-09 03:43:55.948035000 +0200
411 +++ .\reactos\dll\win32\rpcrt4/ndr_ole.c 2013-12-27 18:11:56.468367600 +0100
413 * - finish RpcStream_Vtbl
421 -#define NONAMELESSUNION
422 -#define NONAMELESSSTRUCT
425 -#include "winbase.h"
426 -#include "winerror.h"
428 -#include "objbase.h"
430 -#include "ndr_misc.h"
432 -#include "rpcproxy.h"
433 -#include "wine/rpcfc.h"
436 -#include "wine/debug.h"
437 +#include "precomp.h"
439 WINE_DEFAULT_DEBUG_CHANNEL(ole);
441 diff -prudN .\wine\dlls\rpcrt4/ndr_stubless.c .\reactos\dll\win32\rpcrt4/ndr_stubless.c
442 --- .\wine\dlls\rpcrt4/ndr_stubless.c 2014-05-09 03:43:55.952035200 +0200
443 +++ .\reactos\dll\win32\rpcrt4/ndr_stubless.c 2013-12-27 18:11:56.437167500 +0100
445 * - Some types of binding handles
449 -#include "wine/port.h"
456 -#include "winbase.h"
457 -#include "winerror.h"
459 -#include "objbase.h"
461 -#include "rpcproxy.h"
463 -#include "wine/exception.h"
464 -#include "wine/debug.h"
465 -#include "wine/rpcfc.h"
468 -#include "ndr_misc.h"
469 -#include "ndr_stubless.h"
470 +#include "precomp.h"
472 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
474 diff -prudN .\wine\dlls\rpcrt4/ndr_stubless.h .\reactos\dll\win32\rpcrt4/ndr_stubless.h
475 --- .\wine\dlls\rpcrt4/ndr_stubless.h 2014-05-09 03:43:55.878030900 +0200
476 +++ .\reactos\dll\win32\rpcrt4/ndr_stubless.h 2013-12-27 18:11:56.452767500 +0100
478 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
481 -#include "ndrtypes.h"
484 +#include <ndrtypes.h>
486 /* there can't be any alignment with the structures in this file */
487 -#include "pshpack1.h"
488 +#include <pshpack1.h>
490 typedef struct _NDR_PROC_HEADER
492 @@ -223,7 +225,7 @@ typedef struct _NDR_EHD_CONTEXT
493 unsigned char param_num;
496 -#include "poppack.h"
497 +#include <poppack.h>
501 diff -prudN .\wine\dlls\rpcrt4/precomp.h .\reactos\dll\win32\rpcrt4/precomp.h
502 --- .\wine\dlls\rpcrt4/precomp.h 1970-01-01 01:00:00.000000000 +0100
503 +++ .\reactos\dll\win32\rpcrt4/precomp.h 2014-03-14 01:43:22.357516600 +0100
505 +#ifndef _RPCRT4_PCH_
506 +#define _RPCRT4_PCH_
514 +#define _INC_WINDOWS
517 +#define NONAMELESSUNION
518 +#define NONAMELESSSTRUCT
520 +#include <ntstatus.h>
521 +#define WIN32_NO_STATUS
523 +#include <winbase.h>
524 +#include <winternl.h>
525 +#include <objbase.h>
526 +#include <rpcproxy.h>
527 +#include <security.h>
529 +#include <wine/debug.h>
530 +#include <wine/exception.h>
531 +#include <wine/list.h>
532 +#include <wine/rpcfc.h>
533 +#include <wine/unicode.h>
536 +#include "ncastatus.h"
537 +#include "ndr_misc.h"
538 +#include "ndr_stubless.h"
539 +#include "rpc_assoc.h"
540 +#include "rpc_binding.h"
541 +#include "rpc_message.h"
542 +#include "rpc_server.h"
544 +#endif /* _RPCRT4_PCH_ */
545 diff -prudN .\wine\dlls\rpcrt4/rpc_assoc.c .\reactos\dll\win32\rpcrt4/rpc_assoc.c
546 --- .\wine\dlls\rpcrt4/rpc_assoc.c 2014-05-09 03:43:55.955035400 +0200
547 +++ .\reactos\dll\win32\rpcrt4/rpc_assoc.c 2013-12-27 18:11:56.780368100 +0100
557 -#include "winternl.h"
559 -#include "wine/unicode.h"
560 -#include "wine/debug.h"
562 -#include "rpc_binding.h"
563 -#include "rpc_assoc.h"
564 -#include "rpc_message.h"
565 +#include "precomp.h"
567 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
569 diff -prudN .\wine\dlls\rpcrt4/rpc_assoc.h .\reactos\dll\win32\rpcrt4/rpc_assoc.h
570 --- .\wine\dlls\rpcrt4/rpc_assoc.h 2014-05-09 03:43:55.884031300 +0200
571 +++ .\reactos\dll\win32\rpcrt4/rpc_assoc.h 2013-12-27 18:11:56.905168300 +0100
575 #include "rpc_binding.h"
576 -#include "wine/list.h"
578 typedef struct _RpcAssoc
580 diff -prudN .\wine\dlls\rpcrt4/rpc_async.c .\reactos\dll\win32\rpcrt4/rpc_async.c
581 --- .\wine\dlls\rpcrt4/rpc_async.c 2014-05-09 03:43:55.958035500 +0200
582 +++ .\reactos\dll\win32\rpcrt4/rpc_async.c 2013-12-27 18:11:56.468367600 +0100
591 -#include "rpcasync.h"
593 -#include "wine/debug.h"
595 -#include "rpc_binding.h"
596 -#include "rpc_message.h"
597 -#include "ndr_stubless.h"
598 +#include "precomp.h"
600 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
602 diff -prudN .\wine\dlls\rpcrt4/rpc_binding.c .\reactos\dll\win32\rpcrt4/rpc_binding.c
603 --- .\wine\dlls\rpcrt4/rpc_binding.c 2014-05-09 03:43:55.962035800 +0200
604 +++ .\reactos\dll\win32\rpcrt4/rpc_binding.c 2013-12-27 18:11:56.452767500 +0100
606 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
615 -#include "winbase.h"
617 -#include "winerror.h"
618 -#include "winternl.h"
619 -#include "wine/unicode.h"
624 -#include "wine/debug.h"
626 -#include "rpc_binding.h"
627 -#include "rpc_assoc.h"
628 +#include "precomp.h"
630 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
632 diff -prudN .\wine\dlls\rpcrt4/rpc_binding.h .\reactos\dll\win32\rpcrt4/rpc_binding.h
633 --- .\wine\dlls\rpcrt4/rpc_binding.h 2014-05-09 03:43:55.890031600 +0200
634 +++ .\reactos\dll\win32\rpcrt4/rpc_binding.h 2013-12-27 18:11:56.483967600 +0100
636 #ifndef __WINE_RPC_BINDING_H
637 #define __WINE_RPC_BINDING_H
640 -#include "security.h"
641 -#include "wine/list.h"
642 #include "rpc_defs.h"
645 enum secure_packet_direction
648 diff -prudN .\wine\dlls\rpcrt4/rpc_defs.h .\reactos\dll\win32\rpcrt4/rpc_defs.h
649 --- .\wine\dlls\rpcrt4/rpc_defs.h 2014-05-09 03:43:55.895031900 +0200
650 +++ .\reactos\dll\win32\rpcrt4/rpc_defs.h 2013-01-25 00:19:54.167254400 +0100
652 #ifndef __WINE_RPC_DEFS_H
653 #define __WINE_RPC_DEFS_H
655 -#include "pshpack1.h"
656 +#include <pshpack1.h>
659 unsigned char rpc_ver; /* RPC major version (5) */
660 @@ -168,7 +168,7 @@ typedef struct
661 unsigned char auth_reserved; /* reserved, must be zero */
662 unsigned int auth_context_id; /* unique value for the authenticated connection */
664 -#include "poppack.h"
665 +#include <poppack.h>
667 #define RPC_AUTH_VERIFIER_LEN(common_hdr) \
668 ((common_hdr)->auth_len ? (common_hdr)->auth_len + sizeof(RpcAuthVerifier) : 0)
669 diff -prudN .\wine\dlls\rpcrt4/rpc_epmap.c .\reactos\dll\win32\rpcrt4/rpc_epmap.c
670 --- .\wine\dlls\rpcrt4/rpc_epmap.c 2014-05-09 03:43:55.965035900 +0200
671 +++ .\reactos\dll\win32\rpcrt4/rpc_epmap.c 2013-12-27 18:11:56.421567500 +0100
673 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
679 -#include "winbase.h"
680 -#include "winerror.h"
684 -#include "wine/debug.h"
685 -#include "wine/exception.h"
687 -#include "rpc_binding.h"
689 +#include "precomp.h"
690 #include "epm_towers.h"
692 WINE_DEFAULT_DEBUG_CHANNEL(ole);
693 @@ -92,7 +80,7 @@ static BOOL start_rpcss(void)
694 lstrcatW( cmd, rpcss );
696 Wow64DisableWow64FsRedirection( &redir );
697 - rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi );
698 + rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
699 Wow64RevertWow64FsRedirection( redir );
702 @@ -162,7 +150,7 @@ static RPC_STATUS get_epm_handle_server(
704 static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *__eptr)
706 - switch (GetExceptionCode())
707 + switch (__eptr->ExceptionRecord->ExceptionCode)
709 case EXCEPTION_ACCESS_VIOLATION:
710 case EXCEPTION_ILLEGAL_INSTRUCTION:
711 diff -prudN .\wine\dlls\rpcrt4/rpc_message.c .\reactos\dll\win32\rpcrt4/rpc_message.c
712 --- .\wine\dlls\rpcrt4/rpc_message.c 2014-05-09 03:43:55.969036200 +0200
713 +++ .\reactos\dll\win32\rpcrt4/rpc_message.c 2014-04-27 11:37:38.078578700 +0200
715 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
723 -#include "winbase.h"
724 -#include "winerror.h"
725 -#include "winuser.h"
729 -#include "rpcdcep.h"
731 -#include "wine/debug.h"
732 +#include "precomp.h"
734 -#include "rpc_binding.h"
735 -#include "rpc_defs.h"
736 -#include "rpc_message.h"
737 -#include "ncastatus.h"
738 +#include <winuser.h>
740 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
742 diff -prudN .\wine\dlls\rpcrt4/rpc_message.h .\reactos\dll\win32\rpcrt4/rpc_message.h
743 --- .\wine\dlls\rpcrt4/rpc_message.h 2014-05-09 03:43:55.901032300 +0200
744 +++ .\reactos\dll\win32\rpcrt4/rpc_message.h 2013-12-27 18:11:56.499567600 +0100
746 #ifndef __WINE_RPC_MESSAGE_H
747 #define __WINE_RPC_MESSAGE_H
749 -#include "rpc_defs.h"
751 typedef unsigned int NCA_STATUS;
753 RpcPktHdr *RPCRT4_BuildFaultHeader(ULONG DataRepresentation, RPC_STATUS Status) DECLSPEC_HIDDEN;
754 diff -prudN .\wine\dlls\rpcrt4/rpc_server.c .\reactos\dll\win32\rpcrt4/rpc_server.c
755 --- .\wine\dlls\rpcrt4/rpc_server.c 2014-05-09 03:43:55.973036400 +0200
756 +++ .\reactos\dll\win32\rpcrt4/rpc_server.c 2013-12-27 18:11:56.780368100 +0100
758 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
762 -#include "wine/port.h"
770 -#include "winbase.h"
771 -#include "winerror.h"
777 -#include "wine/debug.h"
778 -#include "wine/exception.h"
779 +#include "precomp.h"
781 -#include "rpc_server.h"
782 -#include "rpc_assoc.h"
783 -#include "rpc_message.h"
784 -#include "rpc_defs.h"
785 -#include "ncastatus.h"
789 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
791 @@ -1075,8 +1053,10 @@ void RPCRT4_destroy_all_protseqs(void)
792 EnterCriticalSection(&server_cs);
793 LIST_FOR_EACH_ENTRY_SAFE(cps, cursor2, &protseqs, RpcServerProtseq, entry)
796 if (listen_count != 0)
797 RPCRT4_sync_with_server_thread(cps);
799 destroy_serverprotoseq(cps);
801 LeaveCriticalSection(&server_cs);
802 diff -prudN .\wine\dlls\rpcrt4/rpc_server.h .\reactos\dll\win32\rpcrt4/rpc_server.h
803 --- .\wine\dlls\rpcrt4/rpc_server.h 2014-05-09 03:43:55.907032600 +0200
804 +++ .\reactos\dll\win32\rpcrt4/rpc_server.h 2013-12-27 18:11:56.905168300 +0100
806 #define __WINE_RPC_SERVER_H
808 #include "rpc_binding.h"
809 -#include "wine/list.h"
813 diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_transport.c
814 --- .\wine\dlls\rpcrt4/rpc_transport.c 2014-05-09 03:43:55.977036600 +0200
815 +++ .\reactos\dll\win32\rpcrt4/rpc_transport.c 2014-05-09 03:10:59.250551600 +0200
827 -#include <sys/types.h>
828 +#include "precomp.h"
830 #if defined(__MINGW32__) || defined (_MSC_VER)
831 # include <ws2tcpip.h>
833 # define ioctlsocket ioctl
834 #endif /* defined(__MINGW32__) || defined (_MSC_VER) */
837 -#include "winbase.h"
839 -#include "winerror.h"
840 -#include "wininet.h"
841 -#include "winternl.h"
842 -#include "wine/unicode.h"
847 -#include "wine/debug.h"
848 +#include <wininet.h>
850 -#include "rpc_binding.h"
851 -#include "rpc_assoc.h"
852 -#include "rpc_message.h"
853 -#include "rpc_server.h"
854 #include "epm_towers.h"
857 @@ -113,31 +91,41 @@ typedef struct _RpcConnection_np
859 RpcConnection common;
861 - HANDLE listen_thread;
866 static RpcConnection *rpcrt4_conn_np_alloc(void)
868 RpcConnection_np *npc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcConnection_np));
872 + memset(&npc->ovl, 0, sizeof(npc->ovl));
873 + npc->listening = FALSE;
878 -static DWORD CALLBACK listen_thread(void *arg)
879 +static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc)
881 - RpcConnection_np *npc = arg;
882 + if (npc->listening)
885 + npc->listening = TRUE;
888 - if (ConnectNamedPipe(npc->pipe, NULL))
889 + if (ConnectNamedPipe(npc->pipe, &npc->ovl))
892 switch(GetLastError())
894 case ERROR_PIPE_CONNECTED:
895 + SetEvent(npc->ovl.hEvent);
897 + case ERROR_IO_PENDING:
898 + /* will be completed in rpcrt4_protseq_np_wait_for_new_connection */
900 - case ERROR_HANDLES_CLOSED:
901 - /* connection closed during listen */
902 - return RPC_S_NO_CONTEXT_AVAILABLE;
903 case ERROR_NO_DATA_DETECTED:
904 /* client has disconnected, retry */
905 DisconnectNamedPipe( npc->pipe );
906 @@ -150,6 +138,7 @@ static DWORD CALLBACK listen_thread(void
911 static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc)
914 @@ -165,13 +154,14 @@ static RPC_STATUS rpcrt4_conn_listen_pip
920 static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *Connection, LPCSTR pname)
922 RpcConnection_np *npc = (RpcConnection_np *) Connection;
923 TRACE("listening on %s\n", pname);
925 - npc->pipe = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX,
926 + npc->pipe = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
927 PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE,
928 PIPE_UNLIMITED_INSTANCES,
929 RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
930 @@ -183,6 +173,9 @@ static RPC_STATUS rpcrt4_conn_create_pip
931 return RPC_S_CANT_CREATE_ENDPOINT;
934 + memset(&npc->ovl, 0, sizeof(npc->ovl));
935 + npc->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
937 /* Note: we don't call ConnectNamedPipe here because it must be done in the
938 * server thread as the thread must be alertable */
940 @@ -229,6 +222,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe(
941 if (err == ERROR_PIPE_BUSY) {
942 TRACE("connection failed, error=%x\n", err);
943 return RPC_S_SERVER_TOO_BUSY;
944 + } else if (err == ERROR_BAD_NETPATH) {
945 + TRACE("connection failed, error=%x\n", err);
946 + return RPC_S_SERVER_UNAVAILABLE;
948 if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) {
949 err = GetLastError();
950 @@ -238,9 +234,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe(
954 + memset(&npc->ovl, 0, sizeof(npc->ovl));
955 /* pipe is connected; change to message-read mode. */
956 dwMode = PIPE_READMODE_MESSAGE;
957 SetNamedPipeHandleState(pipe, &dwMode, NULL, NULL);
958 + npc->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
962 @@ -308,18 +306,59 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc
963 static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
965 RpcConnection_np *npc = (RpcConnection_np *) Connection;
966 - static const char prefix[] = "\\\\.";
967 + static const char prefix[] = "\\\\";
968 + static const char local[] = ".";
969 + BOOL bUseLocalName = TRUE;
970 + CHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
971 + DWORD bufLen = sizeof(ComputerName)/sizeof(ComputerName[0]);
976 /* already connected? */
980 /* protseq=ncacn_np: named pipes */
981 - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1);
982 - strcat(strcpy(pname, prefix), Connection->Endpoint);
983 - r = rpcrt4_conn_open_pipe(Connection, pname, FALSE);
984 + size = strlen(prefix);
986 + if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
988 + bUseLocalName = TRUE;
989 + size += strlen(local);
993 + if (GetComputerNameA(ComputerName, &bufLen))
995 + if (stricmp(ComputerName, Connection->NetworkAddr) == 0)
997 + bUseLocalName = TRUE;
998 + size += strlen(local);
1002 + bUseLocalName = FALSE;
1003 + size += strlen(Connection->NetworkAddr);
1008 + bUseLocalName = FALSE;
1009 + size += strlen(Connection->NetworkAddr);
1013 + size += strlen(Connection->Endpoint) + 1;
1015 + pname = I_RpcAllocate(size);
1016 + strcpy(pname, prefix);
1017 + if (bUseLocalName)
1018 + strcat(pname, local);
1020 + strcat(pname, Connection->NetworkAddr);
1021 + strcat(pname, Connection->Endpoint);
1022 + r = rpcrt4_conn_open_pipe(Connection, pname, TRUE);
1026 @@ -368,9 +407,9 @@ static void rpcrt4_conn_np_handoff(RpcCo
1027 * to the child, then reopen the server binding to continue listening */
1029 new_npc->pipe = old_npc->pipe;
1030 - new_npc->listen_thread = old_npc->listen_thread;
1031 + new_npc->ovl = old_npc->ovl;
1033 - old_npc->listen_thread = 0;
1034 + memset(&old_npc->ovl, 0, sizeof(old_npc->ovl));
1035 old_npc->listening = FALSE;
1038 @@ -415,11 +454,17 @@ static int rpcrt4_conn_np_read(RpcConnec
1041 unsigned int bytes_left = count;
1044 + ZeroMemory(&ovl, sizeof(ovl));
1045 + ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
1050 - ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, NULL);
1051 + ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, &ovl);
1052 + if (!ret && GetLastError() == ERROR_IO_PENDING)
1053 + ret = GetOverlappedResult(npc->pipe, &ovl, &bytes_read, TRUE);
1054 if (!ret && GetLastError() == ERROR_MORE_DATA)
1056 if (!ret || !bytes_read)
1057 @@ -427,6 +472,7 @@ static int rpcrt4_conn_np_read(RpcConnec
1058 bytes_left -= bytes_read;
1061 + CloseHandle(ovl.hEvent);
1062 return ret ? count : -1;
1065 @@ -437,16 +483,23 @@ static int rpcrt4_conn_np_write(RpcConne
1066 const char *buf = buffer;
1068 unsigned int bytes_left = count;
1071 + ZeroMemory(&ovl, sizeof(ovl));
1072 + ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
1076 DWORD bytes_written;
1077 - ret = WriteFile(npc->pipe, buf, bytes_left, &bytes_written, NULL);
1078 + ret = WriteFile(npc->pipe, buf, bytes_left, &bytes_written, &ovl);
1079 + if (!ret && GetLastError() == ERROR_IO_PENDING)
1080 + ret = GetOverlappedResult(npc->pipe, &ovl, &bytes_written, TRUE);
1081 if (!ret || !bytes_written)
1083 bytes_left -= bytes_written;
1084 buf += bytes_written;
1086 + CloseHandle(ovl.hEvent);
1087 return ret ? count : -1;
1090 @@ -458,9 +511,9 @@ static int rpcrt4_conn_np_close(RpcConne
1091 CloseHandle(npc->pipe);
1094 - if (npc->listen_thread) {
1095 - CloseHandle(npc->listen_thread);
1096 - npc->listen_thread = 0;
1097 + if (npc->ovl.hEvent) {
1098 + CloseHandle(npc->ovl.hEvent);
1099 + npc->ovl.hEvent = 0;
1103 @@ -664,7 +717,7 @@ static void *rpcrt4_protseq_np_get_wait_
1104 conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common);
1106 rpcrt4_conn_listen_pipe(conn);
1107 - if (conn->listen_thread)
1108 + if (conn->ovl.hEvent)
1110 conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common);
1112 @@ -685,7 +738,7 @@ static void *rpcrt4_protseq_np_get_wait_
1114 conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common);
1116 - if ((objs[*count] = conn->listen_thread))
1117 + if ((objs[*count] = conn->ovl.hEvent))
1119 conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common);
1121 @@ -732,18 +785,12 @@ static int rpcrt4_protseq_np_wait_for_ne
1122 EnterCriticalSection(&protseq->cs);
1123 conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common);
1125 - if (b_handle == conn->listen_thread) break;
1126 + if (b_handle == conn->ovl.hEvent) break;
1127 conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common);
1133 - if (GetExitCodeThread(conn->listen_thread, &exit_code) && exit_code == RPC_S_OK)
1134 - RPCRT4_SpawnConnection(&cconn, &conn->common);
1135 - CloseHandle(conn->listen_thread);
1136 - conn->listen_thread = 0;
1138 + RPCRT4_SpawnConnection(&cconn, &conn->common);
1140 ERR("failed to locate connection for handle %p\n", b_handle);
1141 LeaveCriticalSection(&protseq->cs);
1142 diff -prudN .\wine\dlls\rpcrt4/rpcrt4.spec .\reactos\dll\win32\rpcrt4/rpcrt4.spec
1143 --- .\wine\dlls\rpcrt4/rpcrt4.spec 2014-05-09 03:43:55.911032800 +0200
1144 +++ .\reactos\dll\win32\rpcrt4/rpcrt4.spec 2013-12-07 15:35:15.331527800 +0100
1146 @ stdcall NdrRangeUnmarshall(ptr ptr ptr long)
1147 @ stub NdrRpcSmClientAllocate
1148 @ stub NdrRpcSmClientFree
1149 -@ stub NdrRpcSmSetClientToOsf
1150 +@ stdcall NdrRpcSmSetClientToOsf(ptr)
1151 @ stub NdrRpcSsDefaultAllocate
1152 @ stub NdrRpcSsDefaultFree
1153 @ stub NdrRpcSsDisableAllocate
1154 diff -prudN .\wine\dlls\rpcrt4/rpcrt4_main.c .\reactos\dll\win32\rpcrt4/rpcrt4_main.c
1155 --- .\wine\dlls\rpcrt4/rpcrt4_main.c 2014-05-09 03:43:55.980036800 +0200
1156 +++ .\reactos\dll\win32\rpcrt4/rpcrt4_main.c 2014-05-09 03:45:42.047103500 +0200
1158 * NT-based native rpcrt4's. Commonly-used transport for self-to-self RPC's.
1161 -#include "config.h"
1163 -#include <stdarg.h>
1165 -#include <stdlib.h>
1166 -#include <string.h>
1168 -#include "ntstatus.h"
1169 -#define WIN32_NO_STATUS
1170 -#include "windef.h"
1171 -#include "winerror.h"
1172 -#include "winbase.h"
1173 -#include "winuser.h"
1175 -#include "winternl.h"
1176 -#include "ntsecapi.h"
1177 -#include "iptypes.h"
1178 -#include "iphlpapi.h"
1179 -#include "wine/unicode.h"
1183 -#include "rpcndr.h"
1184 -#include "rpcproxy.h"
1186 -#include "rpc_binding.h"
1187 -#include "rpc_server.h"
1188 +#include "precomp.h"
1190 -#include "wine/debug.h"
1191 +#include <ntsecapi.h>
1192 +#include <iphlpapi.h>
1194 WINE_DEFAULT_DEBUG_CHANNEL(rpc);
1196 diff -prudN .\wine\dlls\rpcrt4/unix_func.c .\reactos\dll\win32\rpcrt4/unix_func.c
1197 --- .\wine\dlls\rpcrt4/unix_func.c 1970-01-01 01:00:00.000000000 +0100
1198 +++ .\reactos\dll\win32\rpcrt4/unix_func.c 2013-01-25 00:19:53.278052800 +0100
1200 +#define WIN32_NO_STATUS
1201 +#define _INC_WINDOWS
1202 +#include <windef.h>
1203 +#include <winsock2.h>
1212 + struct in_addr in;
1215 + if (af == AF_INET)
1217 + memcpy(&in.s_addr, src, sizeof(in.s_addr));
1218 + text_addr = inet_ntoa(in);
1219 + if (text_addr && dst)
1221 + strncpy(dst, text_addr, cnt);