Import and merge Wine-20041201
Added: trunk/reactos/lib/rpcrt4/
Added: trunk/reactos/lib/rpcrt4/Makefile
Added: trunk/reactos/lib/rpcrt4/Makefile.ros-template
Modified: trunk/reactos/lib/rpcrt4/rpc_server.c

Copied: trunk/reactos/lib/rpcrt4 (from rev 12594, vendor/wine/dlls/rpcrt4/current)

Added: trunk/reactos/lib/rpcrt4/Makefile
--- vendor/wine/dlls/rpcrt4/current/Makefile	2004-12-31 15:50:08 UTC (rev 12594)
+++ trunk/reactos/lib/rpcrt4/Makefile	2004-12-31 15:52:05 UTC (rev 12595)
@@ -0,0 +1,9 @@
+# $Id: Makefile 9303 2004-05-04 20:10:07Z navaraf $
+
+PATH_TO_TOP = ../..
+
+TARGET_TYPE = winedll
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk

Added: trunk/reactos/lib/rpcrt4/Makefile.ros-template
--- vendor/wine/dlls/rpcrt4/current/Makefile.ros-template	2004-12-31 15:50:08 UTC (rev 12594)
+++ trunk/reactos/lib/rpcrt4/Makefile.ros-template	2004-12-31 15:52:05 UTC (rev 12595)
@@ -0,0 +1,22 @@
+# $Id: Makefile.ros-template 11910 2004-12-03 23:37:44Z blight $
+
+TARGET_NAME = rpcrt4
+
+TARGET_OBJECTS = @C_SRCS@
+
+TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__ -Wall
+
+TARGET_SDKLIBS = @IMPORTS@ winmm.a wine.a wine_uuid.a ntdll.a
+
+TARGET_BASE = $(TARGET_BASE_LIB_RPCRT4)
+
+TARGET_RC_BINSRC = @RC_BINSRC@
+TARGET_RC_BINARIES = @RC_BINARIES@
+
+TARGET_NORC = yes
+
+default: all
+
+DEP_OBJECTS = $(TARGET_OBJECTS)
+
+include $(TOOLS_PATH)/depend.mk

Modified: trunk/reactos/lib/rpcrt4/rpc_server.c
--- vendor/wine/dlls/rpcrt4/current/rpc_server.c	2004-12-31 15:50:08 UTC (rev 12594)
+++ trunk/reactos/lib/rpcrt4/rpc_server.c	2004-12-31 15:52:05 UTC (rev 12595)
@@ -185,6 +185,7 @@
   return packet;
 }
 
+#ifndef __REACTOS__
 typedef struct {
   PRPC_MESSAGE msg;
   void* buf;
@@ -205,20 +206,25 @@
   TRACE("returning failure packet\n");
   return EXCEPTION_EXECUTE_HANDLER;
 }
+#endif
 
 static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSAGE* msg)
 {
   RpcServerInterface* sif;
   RPC_DISPATCH_FUNCTION func;
+#ifndef __REACTOS__
   packet_state state;
+#endif
   UUID *object_uuid;
   RpcPktHdr *response;
   void *buf = msg->Buffer;
   RPC_STATUS status;
 
+#ifndef __REACTOS__
   state.msg = msg;
   state.buf = buf;
   TlsSetValue(worker_tls, &state);
+#endif
 
   switch (hdr->common.ptype) {
     case PKT_BIND:
@@ -305,11 +311,15 @@
                   MAKEWORD(hdr->common.drep[2], hdr->common.drep[3]));
 
       /* dispatch */
+#ifndef __REACTOS__
       __TRY {
         if (func) func(msg);
       } __EXCEPT(rpc_filter) {
         /* failure packet was created in rpc_filter */
       } __ENDTRY
+#else
+      if (func) func(msg);
+#endif
 
       /* send response packet */
       I_RpcSend(msg);
@@ -333,7 +343,9 @@
   I_RpcFreeBuffer(msg);
   msg->Buffer = NULL;
   RPCRT4_FreeHeader(hdr);
+#ifndef __REACTOS__
   TlsSetValue(worker_tls, NULL);
+#endif
 }
 
 static DWORD CALLBACK RPCRT4_worker_thread(LPVOID the_arg)