- Use correct, documented, LPC Message structure (PORT_MESSAGE). Fix all caller code...
authorAlex Ionescu <aionescu@gmail.com>
Thu, 11 Aug 2005 02:58:54 +0000 (02:58 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Thu, 11 Aug 2005 02:58:54 +0000 (02:58 +0000)
svn path=/trunk/; revision=17275

30 files changed:
reactos/include/ndk/lpctypes.h
reactos/include/ndk/zwfuncs.h
reactos/include/subsys/csrss/csrss.h
reactos/include/subsys/lsass/lsass.h
reactos/include/subsys/sm/api.h
reactos/lib/lsasrv/lsaport.c
reactos/lib/ntdll/csr/lpc.c
reactos/lib/ntdll/dbg/debug.c
reactos/lib/secur32/lsa.c
reactos/lib/smdll/query.c
reactos/lib/smlib/compses.c
reactos/lib/smlib/execpgm.c
reactos/ntoskrnl/include/internal/port.h
reactos/ntoskrnl/io/error.c
reactos/ntoskrnl/lpc/close.c
reactos/ntoskrnl/lpc/connect.c
reactos/ntoskrnl/lpc/create.c
reactos/ntoskrnl/lpc/listen.c
reactos/ntoskrnl/lpc/port.c
reactos/ntoskrnl/lpc/receive.c
reactos/ntoskrnl/lpc/reply.c
reactos/ntoskrnl/lpc/send.c
reactos/subsys/csrss/api/process.c
reactos/subsys/csrss/api/user.c
reactos/subsys/csrss/api/wapi.c
reactos/subsys/csrss/win32csr/conio.c
reactos/subsys/csrss/win32csr/desktopbg.c
reactos/subsys/csrss/win32csr/exitros.c
reactos/subsys/smss/debug.c
reactos/subsys/smss/smapi.c

index ef1abc1..7d41eb9 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _LPCTYPES_H
 #define _LPCTYPES_H
 
-#define PORT_MESSAGE_TYPE(m) ((m).Header.MessageType)
+#define LPC_MESSAGE_TYPE(m) ((m).Header.u2.s2.Type)
 
 /* DEPENDENCIES **************************************************************/
 
@@ -18,8 +18,8 @@
 /* CONSTANTS *****************************************************************/
 #define LPC_MESSAGE_BASE_SIZE 24
 #define MAX_MESSAGE_DATA      (0x130)
-#define PORT_MAX_DATA_LENGTH 0x104
-#define PORT_MAX_MESSAGE_LENGTH 0x148
+#define LPC_MAX_DATA_LENGTH 0x104
+#define LPC_MAX_MESSAGE_LENGTH 0x148
 
 /* ENUMERATIONS **************************************************************/
 
@@ -42,17 +42,50 @@ typedef enum _LPC_TYPE
 
 /* TYPES *********************************************************************/
 
-/* FIXME: USE REAL DEFINITION */
-typedef struct _LPC_MESSAGE
+#if defined(USE_LPC6432)
+#define LPC_CLIENT_ID CLIENT_ID64
+#define LPC_SIZE_T ULONGLONG
+#define LPC_PVOID ULONGLONG
+#define LPC_HANDLE ULONGLONG
+#else
+#define LPC_CLIENT_ID CLIENT_ID
+#define LPC_SIZE_T SIZE_T
+#define LPC_PVOID PVOID
+#define LPC_HANDLE HANDLE
+#endif
+
+typedef struct _PORT_MESSAGE
 {
-    USHORT  DataSize;
-    USHORT  MessageSize;
-    USHORT  MessageType;
-    USHORT  VirtualRangesOffset;
-    CLIENT_ID  ClientId;
-    ULONG  MessageId;
-    ULONG  SectionSize;
-} LPC_MESSAGE, *PLPC_MESSAGE;
+    union
+    {
+        struct
+        {
+            CSHORT DataLength;
+            CSHORT TotalLength;
+        } s1;
+        ULONG Length;
+    } u1;
+    union
+    {
+        struct
+        {
+            CSHORT Type;
+            CSHORT DataInfoOffset;
+        } s2;
+        ULONG ZeroInit;
+    } u2;
+    union
+    {
+        LPC_CLIENT_ID ClientId;
+        double DoNotUseThisField;
+    };
+    ULONG MessageId;
+    union
+    {
+        LPC_SIZE_T ClientViewSize;
+        ULONG CallbackId;
+    };
+} PORT_MESSAGE, *PPORT_MESSAGE;
 
 /* FIXME: USE REAL DEFINITION */
 typedef struct _LPC_SECTION_WRITE
@@ -76,7 +109,7 @@ typedef struct _LPC_SECTION_READ
 /* FIXME: USE REAL DEFINITION */
 typedef struct _LPC_MAX_MESSAGE
 {
-    LPC_MESSAGE Header;
+    PORT_MESSAGE Header;
     BYTE Data[MAX_MESSAGE_DATA];
 } LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE;
 
index d09c55d..0ed81a8 100644 (file)
@@ -25,7 +25,7 @@ STDCALL
 NtAcceptConnectPort(
     PHANDLE PortHandle,
     HANDLE NamedPortHandle,
-    PLPC_MESSAGE ServerReply,
+    PPORT_MESSAGE ServerReply,
     BOOLEAN AcceptIt,
     PLPC_SECTION_WRITE WriteMap,
     PLPC_SECTION_READ ReadMap
@@ -1243,14 +1243,14 @@ NTSTATUS
 STDCALL
 NtImpersonateClientOfPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE ClientMessage
+    PPORT_MESSAGE ClientMessage
 );
 
 NTSTATUS
 STDCALL
 ZwImpersonateClientOfPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE ClientMessage
+    PPORT_MESSAGE ClientMessage
 );
 
 NTSTATUS
@@ -1316,13 +1316,13 @@ ZwIsProcessInJob(
 NTSTATUS
 STDCALL
 NtListenPort(HANDLE PortHandle,
-             PLPC_MESSAGE LpcMessage
+             PPORT_MESSAGE LpcMessage
 );
 
 NTSTATUS
 STDCALL
 ZwListenPort(HANDLE PortHandle,
-             PLPC_MESSAGE LpcMessage
+             PPORT_MESSAGE LpcMessage
 );
 
 NTSTATUS
@@ -2825,7 +2825,7 @@ NTSTATUS
 STDCALL
 NtReadRequestData(
     HANDLE PortHandle,
-    PLPC_MESSAGE Message,
+    PPORT_MESSAGE Message,
     ULONG Index,
     PVOID Buffer,
     ULONG BufferLength,
@@ -2836,7 +2836,7 @@ NTSTATUS
 STDCALL
 ZwReadRequestData(
     HANDLE PortHandle,
-    PLPC_MESSAGE Message,
+    PPORT_MESSAGE Message,
     ULONG Index,
     PVOID Buffer,
     ULONG BufferLength,
@@ -2944,14 +2944,14 @@ NTSTATUS
 STDCALL
 NtReplyPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE LpcReply
+    PPORT_MESSAGE LpcReply
 );
 
 NTSTATUS
 STDCALL
 ZwReplyPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE LpcReply
+    PPORT_MESSAGE LpcReply
 );
 
 NTSTATUS
@@ -2959,8 +2959,8 @@ STDCALL
 NtReplyWaitReceivePort(
     HANDLE PortHandle,
     PULONG PortId,
-    PLPC_MESSAGE MessageReply,
-    PLPC_MESSAGE MessageRequest
+    PPORT_MESSAGE MessageReply,
+    PPORT_MESSAGE MessageRequest
 );
 
 NTSTATUS
@@ -2968,51 +2968,51 @@ STDCALL
 ZwReplyWaitReceivePort(
     HANDLE PortHandle,
     PULONG PortId,
-    PLPC_MESSAGE MessageReply,
-    PLPC_MESSAGE MessageRequest
+    PPORT_MESSAGE MessageReply,
+    PPORT_MESSAGE MessageRequest
 );
 
 NTSTATUS
 STDCALL
 NtReplyWaitReplyPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE ReplyMessage
+    PPORT_MESSAGE ReplyMessage
 );
 
 NTSTATUS
 STDCALL
 ZwReplyWaitReplyPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE ReplyMessage
+    PPORT_MESSAGE ReplyMessage
 );
 
 NTSTATUS
 STDCALL
 NtRequestPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE LpcMessage);
+    PPORT_MESSAGE LpcMessage);
 
 NTSTATUS
 STDCALL
 ZwRequestPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE LpcMessage
+    PPORT_MESSAGE LpcMessage
 );
 
 NTSTATUS
 STDCALL
 NtRequestWaitReplyPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE LpcReply,
-    PLPC_MESSAGE LpcRequest
+    PPORT_MESSAGE LpcReply,
+    PPORT_MESSAGE LpcRequest
 );
 
 NTSTATUS
 STDCALL
 ZwRequestWaitReplyPort(
     HANDLE PortHandle,
-    PLPC_MESSAGE LpcReply,
-    PLPC_MESSAGE LpcRequest
+    PPORT_MESSAGE LpcReply,
+    PPORT_MESSAGE LpcRequest
 );
 
 NTSTATUS
@@ -3975,7 +3975,7 @@ NTSTATUS
 STDCALL
 NtWriteRequestData(
     HANDLE PortHandle,
-    PLPC_MESSAGE Message,
+    PPORT_MESSAGE Message,
     ULONG Index,
     PVOID Buffer,
     ULONG BufferLength,
@@ -3986,7 +3986,7 @@ NTSTATUS
 STDCALL
 ZwWriteRequestData(
     HANDLE PortHandle,
-    PLPC_MESSAGE Message,
+    PPORT_MESSAGE Message,
     ULONG Index,
     PVOID Buffer,
     ULONG BufferLength,
index 9c9f540..2d56e18 100644 (file)
@@ -491,7 +491,7 @@ typedef struct _CSR_API_MESSAGE
 {
   union
   {
-    LPC_MESSAGE Header;
+    PORT_MESSAGE Header;
     struct
     {
       BYTE HeaderReserved[LPC_MESSAGE_BASE_SIZE];
index ec4f07b..63e7e68 100644 (file)
@@ -96,7 +96,7 @@ typedef struct _LSASS_REGISTER_LOGON_PROCESS_REPLY
 
 typedef union _LSASS_REQUEST
 {
-   LPC_MESSAGE Header;
+   PORT_MESSAGE Header;
    struct {
       UCHAR LpcHeader[LPC_MESSAGE_BASE_SIZE];
       ULONG Type;
@@ -115,7 +115,7 @@ typedef union _LSASS_REQUEST
 
 typedef struct _LSASS_REPLY
 {
-   LPC_MESSAGE Header;
+   PORT_MESSAGE Header;
    NTSTATUS Status;
    union
      {
index 37d4b42..f04f608 100644 (file)
@@ -110,7 +110,7 @@ typedef struct _SM_PORT_MESSAGE_QRYINFO
 typedef union _SM_PORT_MESSAGE
 {
   /*** LPC common header ***/
-  LPC_MESSAGE Header;
+  PORT_MESSAGE Header;
   struct {
     UCHAR LpcHeader[LPC_MESSAGE_BASE_SIZE];
     /*** SM common header ***/
@@ -138,7 +138,7 @@ typedef union _SM_PORT_MESSAGE
 
 /*** MACRO ***********************************************************/
 
-#define SM_CONNECT_DATA_SIZE(m)  ((m).Header.DataSize-sizeof(USHORT)-sizeof(WORD))
+#define SM_CONNECT_DATA_SIZE(m)  ((m).Header.u1.s1.DataLength-sizeof(USHORT)-sizeof(WORD))
 #define SM_PORT_DATA_SIZE(c)     (sizeof(DWORD)+sizeof(NTSTATUS)+sizeof(c))
 #define SM_PORT_MESSAGE_SIZE     (sizeof(SM_PORT_MESSAGE))
 
index 86cb20c..fe9ffe3 100644 (file)
@@ -112,18 +112,18 @@ ProcessPortMessage(VOID)
 
       DPRINT("Received message\n");
 
-      if (Request.Header.MessageType == LPC_PORT_CLOSED)
+      if (Request.Header.u2.s2.Type == LPC_PORT_CLOSED)
        {
          DPRINT("Port closed\n");
 
 //       return STATUS_UNSUCCESSFUL;
        }
-      if (Request.Header.MessageType == LPC_REQUEST)
+      if (Request.Header.u2.s2.Type == LPC_REQUEST)
        {
          DPRINT("Received request\n");
 
        }
-      else if (Request.Header.MessageType == LPC_DATAGRAM)
+      else if (Request.Header.u2.s2.Type == LPC_DATAGRAM)
        {
          DPRINT("Received datagram\n");
 
index 562fe7a..01652cc 100644 (file)
@@ -81,12 +81,12 @@ CsrClientCallServer(PCSR_API_MESSAGE Request,
 
     /* Fill out the header */
     Request->Type = ApiNumber;
-    Request->Header.DataSize = RequestLength - LPC_MESSAGE_BASE_SIZE;
-    Request->Header.MessageSize = RequestLength;
-    DPRINT("CSR: API: %x, DataSize: %x, MessageSize: %x\n", 
+    Request->Header.u1.s1.DataLength = RequestLength - LPC_MESSAGE_BASE_SIZE;
+    Request->Header.u1.s1.TotalLength = RequestLength;
+    DPRINT("CSR: API: %x, u1.s1.DataLength: %x, u1.s1.TotalLength: %x\n", 
             ApiNumber,
-            Request->Header.DataSize,
-            Request->Header.MessageSize);
+            Request->Header.u1.s1.DataLength,
+            Request->Header.u1.s1.TotalLength);
                 
     /* Send the LPC Message */
     Status = NtRequestWaitReplyPort(WindowsApiPort,
index 1f7185b..b778aa7 100644 (file)
@@ -24,7 +24,7 @@ static NTSTATUS (STDCALL * DbgSsCallback)(PVOID,PVOID) = NULL;
 
 typedef struct _LPC_DBGSS_MESSAGE
 {
-       LPC_MESSAGE Header;
+       PORT_MESSAGE Header;
        ULONG Unknown1;
        ULONG Unknown2;
        ULONG Unknown3;
@@ -45,7 +45,7 @@ DbgSsServerThread(PVOID Unused)
                Status = NtReplyWaitReceivePort (DbgSsApiPort,
                                                 NULL,
                                                 NULL,
-                                                (PLPC_MESSAGE)&Message);
+                                                (PPORT_MESSAGE)&Message);
                if (!NT_SUCCESS(Status))
                {
                        DbgPrint ("DbgSs: NtReplyWaitReceivePort failed - Status == %lx\n",
index a594de9..92f580d 100644 (file)
@@ -32,8 +32,8 @@ LsaDeregisterLogonProcess(HANDLE LsaHandle)
    LSASS_REPLY Reply;
    NTSTATUS Status;
       
-   Request.Header.DataSize = 0;
-   Request.Header.MessageSize = sizeof(LSASS_REQUEST);
+   Request.Header.u1.s1.DataLength = 0;
+   Request.Header.u1.s1.TotalLength = sizeof(LSASS_REQUEST);
    Request.Type = LSASS_REQUEST_DEREGISTER_LOGON_PROCESS;
    Status = NtRequestWaitReplyPort(LsaHandle,
                                   &Request.Header,
@@ -82,10 +82,10 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle,
    Request = (PLSASS_REQUEST)RawRequest;
    Reply = (PLSASS_REPLY)RawReply;
    
-   Request->Header.DataSize = sizeof(LSASS_REQUEST) + SubmitBufferLength -
+   Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + SubmitBufferLength -
      LPC_MESSAGE_BASE_SIZE;
-   Request->Header.MessageSize = 
-     Request->Header.DataSize + LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = 
+     Request->Header.u1.s1.DataLength + LPC_MESSAGE_BASE_SIZE;
    Request->Type = LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE;
    Request->d.CallAuthenticationPackageRequest.AuthenticationPackage =
      AuthenticationPackage;
@@ -145,9 +145,9 @@ LsaLookupAuthenticationPackage(HANDLE LsaHandle,
    LSASS_REPLY Reply;
    
    Request = (PLSASS_REQUEST)RawRequest;
-   Request->Header.DataSize = sizeof(LSASS_REQUEST) + PackageName->Length -
+   Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + PackageName->Length -
      LPC_MESSAGE_BASE_SIZE;
-   Request->Header.MessageSize = Request->Header.DataSize +
+   Request->Header.u1.s1.TotalLength = Request->Header.u1.s1.DataLength +
      LPC_MESSAGE_BASE_SIZE;
    Request->Type = LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE;
    
@@ -236,8 +236,8 @@ LsaLogonUser(HANDLE LsaHandle,
    Request->d.LogonUserRequest.SourceContext = *SourceContext;
    
    Request->Type = LSASS_REQUEST_LOGON_USER;
-   Request->Header.DataSize = RequestLength - LPC_MESSAGE_BASE_SIZE;
-   Request->Header.MessageSize = RequestLength + LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.DataLength = RequestLength - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = RequestLength + LPC_MESSAGE_BASE_SIZE;
    
    Reply = (PLSASS_REPLY)RawReply;
    
@@ -302,9 +302,9 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName,
      }
    
    Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS;
-   Request.Header.DataSize = sizeof(LSASS_REQUEST) - 
+   Request.Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) - 
      LPC_MESSAGE_BASE_SIZE;
-   Request.Header.MessageSize = sizeof(LSASS_REQUEST);
+   Request.Header.u1.s1.TotalLength = sizeof(LSASS_REQUEST);
    
    Request.d.RegisterLogonProcessRequest.Length = LsaLogonProcessName->Length;
    memcpy(Request.d.RegisterLogonProcessRequest.LogonProcessNameBuffer,
index 558d5e7..5ee23e5 100644 (file)
@@ -85,10 +85,10 @@ SmQueryInformation (IN      HANDLE                hSmApiPort,
        SmReqMsg.SmHeader.ApiIndex = SM_API_QUERY_INFORMATION;
 
        /* Prepare the port request message */
-       SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE;
-       SmReqMsg.Header.DataSize    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
-       SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE;
-       Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg);
+       SmReqMsg.Header.u2.s2.Type = LPC_NEW_MESSAGE;
+       SmReqMsg.Header.u1.s1.DataLength    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
+       SmReqMsg.Header.u1.s1.TotalLength = SM_PORT_MESSAGE_SIZE;
+       Status = NtRequestWaitReplyPort (hSmApiPort, (PPORT_MESSAGE) & SmReqMsg, (PPORT_MESSAGE) & SmReqMsg);
        if (NT_SUCCESS(Status))
        {
                /* Unmarshal data */
index b3f293a..e2cde91 100644 (file)
@@ -50,10 +50,10 @@ SmCompleteSession (IN HANDLE hSmApiPort,
   SmReqMsg.SmHeader.ApiIndex = SM_API_COMPLETE_SESSION;
 
   /* Port message */
-  SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE;
-  SmReqMsg.Header.DataSize    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
-  SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE;
-  Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg);
+  SmReqMsg.Header.u2.s2.Type = LPC_NEW_MESSAGE;
+  SmReqMsg.Header.u1.s1.DataLength    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
+  SmReqMsg.Header.u1.s1.TotalLength = SM_PORT_MESSAGE_SIZE;
+  Status = NtRequestWaitReplyPort (hSmApiPort, (PPORT_MESSAGE) & SmReqMsg, (PPORT_MESSAGE) & SmReqMsg);
   if (NT_SUCCESS(Status))
   {
     return SmReqMsg.SmHeader.Status;
index 4c0ce7e..d8c0b4b 100644 (file)
@@ -60,23 +60,23 @@ SmExecuteProgram (IN HANDLE          hSmApiPort,
   SmReqMsg.SmHeader.ApiIndex = SM_API_EXECUTE_PROGRAMME;
 
   /* LPC message */
-  SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE;
-  SmReqMsg.Header.DataSize    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
-  SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE;
+  SmReqMsg.Header.u2.s2.Type = LPC_NEW_MESSAGE;
+  SmReqMsg.Header.u1.s1.DataLength    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
+  SmReqMsg.Header.u1.s1.TotalLength = SM_PORT_MESSAGE_SIZE;
 
   DPRINT("SMLIB: %s:\n"
-         "  MessageType = %d\n"
-         "  DataSize    = %d\n"
-         "  MessageSize = %d\n"
-         "  sizeof(LPC_MESSAGE)==%d\n",
+         "  u2.s2.Type = %d\n"
+         "  u1.s1.DataLength    = %d\n"
+         "  u1.s1.TotalLength = %d\n"
+         "  sizeof(PORT_MESSAGE)==%d\n",
          __FUNCTION__,
-         SmReqMsg.Header.MessageType,
-         SmReqMsg.Header.DataSize,
-         SmReqMsg.Header.MessageSize,
-         sizeof(LPC_MESSAGE));
+         SmReqMsg.Header.u2.s2.Type,
+         SmReqMsg.Header.u1.s1.DataLength,
+         SmReqMsg.Header.u1.s1.TotalLength,
+         sizeof(PORT_MESSAGE));
 
   /* Call SM and wait for a reply */
-  Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg);
+  Status = NtRequestWaitReplyPort (hSmApiPort, (PPORT_MESSAGE) & SmReqMsg, (PPORT_MESSAGE) & SmReqMsg);
   if (NT_SUCCESS(Status))
   {
     return SmReqMsg.SmHeader.Status;
index 66fbb9f..083f58d 100644 (file)
@@ -31,7 +31,7 @@ typedef struct _EPORT
 
 typedef struct _EPORT_CONNECT_REQUEST_MESSAGE
 {
-  LPC_MESSAGE MessageHeader;
+  PORT_MESSAGE MessageHeader;
   PEPROCESS ConnectingProcess;
   struct _SECTION_OBJECT* SendSectionObject;
   LARGE_INTEGER SendSectionOffset;
@@ -42,7 +42,7 @@ typedef struct _EPORT_CONNECT_REQUEST_MESSAGE
 
 typedef struct _EPORT_CONNECT_REPLY_MESSAGE
 {
-  LPC_MESSAGE MessageHeader;
+  PORT_MESSAGE MessageHeader;
   PVOID SendServerViewBase;
   ULONG ReceiveClientViewSize;
   PVOID ReceiveClientViewBase;
@@ -58,7 +58,7 @@ typedef struct _TERMINATION_PORT {
 
 NTSTATUS STDCALL
 LpcRequestPort (PEPORT         Port,
-               PLPC_MESSAGE    LpcMessage);
+               PPORT_MESSAGE   LpcMessage);
 NTSTATUS
 STDCALL
 LpcSendTerminationPort (PEPORT Port,
@@ -87,13 +87,13 @@ typedef struct _QUEUEDMESSAGE
 {
   PEPORT               Sender;
   LIST_ENTRY   QueueListEntry;
-  LPC_MESSAGE  Message;
+  PORT_MESSAGE Message;
   UCHAR                MessageData [MAX_MESSAGE_DATA];
 } QUEUEDMESSAGE,  *PQUEUEDMESSAGE;
 
 typedef struct _LPC_DBG_MESSAGE
 {
-   LPC_MESSAGE Header;
+   PORT_MESSAGE Header;
    ULONG Type;
    ULONG Status;
    union
@@ -142,7 +142,7 @@ typedef struct _LPC_DBG_MESSAGE
 
 typedef struct _LPC_TERMINATION_MESSAGE
 {
-   LPC_MESSAGE Header;
+   PORT_MESSAGE Header;
    LARGE_INTEGER CreationTime;
 } LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE;
 
@@ -196,7 +196,7 @@ extern FAST_MUTEX   LpcpLock;
 
 NTSTATUS STDCALL
 EiReplyOrRequestPort (IN       PEPORT          Port,
-                     IN        PLPC_MESSAGE    LpcReply,
+                     IN        PPORT_MESSAGE   LpcReply,
                      IN        ULONG           MessageType,
                      IN        PEPORT          Sender);
 
index bd4c81f..64ba0b9 100644 (file)
@@ -265,7 +265,7 @@ IopLogWorker (PVOID Parameter)
 
       /* Initialize the log message */
       Message = (PIO_ERROR_LOG_MESSAGE)Request->Data;
-      Message->Type = 0xC; //IO_TYPE_ERROR_MESSAGE;
+      Message->Type = IO_TYPE_ERROR_MESSAGE;
       Message->Size =
        sizeof(IO_ERROR_LOG_MESSAGE) - sizeof(IO_ERROR_LOG_PACKET) +
        LogEntry->PacketSize + DriverNameLength;
@@ -285,9 +285,9 @@ IopLogWorker (PVOID Parameter)
 
       DPRINT ("SequenceNumber %lx\n", Packet->SequenceNumber);
 
-      Request->Header.DataSize = Message->Size;
-      Request->Header.MessageSize =
-       Request->Header.DataSize + sizeof(LPC_MESSAGE);
+      Request->Header.u1.s1.DataLength = Message->Size;
+      Request->Header.u1.s1.TotalLength =
+       Request->Header.u1.s1.DataLength + sizeof(PPORT_MESSAGE);
 
       /* Send the error message to the log port */
       Status = ZwRequestPort (IopLogPort,
index 625406d..b36162f 100644 (file)
@@ -31,7 +31,7 @@ VOID STDCALL
 LpcpClosePort (PVOID   ObjectBody, ULONG       HandleCount)
 {
   PEPORT Port = (PEPORT)ObjectBody;
-  LPC_MESSAGE Message;
+  PORT_MESSAGE Message;
 
   /* FIXME Race conditions here! */
 
@@ -44,8 +44,8 @@ LpcpClosePort (PVOID  ObjectBody, ULONG       HandleCount)
   if (HandleCount == 1 && Port->State == EPORT_CONNECTED_CLIENT)
     {
       DPRINT("Informing server\n");
-      Message.MessageSize = sizeof(LPC_MESSAGE);
-      Message.DataSize = 0;
+      Message.u1.s1.TotalLength = sizeof(PORT_MESSAGE);
+      Message.u1.s1.DataLength = 0;
       EiReplyOrRequestPort (Port->OtherPort,
                            &Message,
                            LPC_PORT_CLOSED,
index 3ef7025..3dbb1b7 100644 (file)
@@ -90,14 +90,14 @@ EiConnectPort(IN PEPORT* ConnectedPort,
   /*
    * Initialize the request message.
    */
-  RequestMessage->MessageHeader.DataSize =
+  RequestMessage->MessageHeader.u1.s1.DataLength =
     sizeof(EPORT_CONNECT_REQUEST_MESSAGE) + RequestConnectDataLength -
-    sizeof(LPC_MESSAGE);
-  RequestMessage->MessageHeader.MessageSize =
+    sizeof(PORT_MESSAGE);
+  RequestMessage->MessageHeader.u1.s1.TotalLength =
     sizeof(EPORT_CONNECT_REQUEST_MESSAGE) + RequestConnectDataLength;
   DPRINT("RequestMessageSize %d\n",
-        RequestMessage->MessageHeader.MessageSize);
-  RequestMessage->MessageHeader.SectionSize = 0;
+        RequestMessage->MessageHeader.u1.s1.TotalLength);
+  RequestMessage->MessageHeader.ClientViewSize = 0;
   RequestMessage->ConnectingProcess = PsGetCurrentProcess();
   ObReferenceObjectByPointer(RequestMessage->ConnectingProcess,
                             PROCESS_VM_OPERATION,
@@ -148,7 +148,7 @@ EiConnectPort(IN PEPORT* ConnectedPort,
   /*
    * Check for connection refusal.
    */
-  if (CReply->MessageHeader.MessageType == LPC_CONNECTION_REFUSED)
+  if (CReply->MessageHeader.u2.s2.Type == LPC_CONNECTION_REFUSED)
     {
       ObDereferenceObject(OurPort);
       ExFreePool(Reply);
@@ -656,7 +656,7 @@ NtConnectPort (PHANDLE                              UnsafeConnectedPortHandle,
 /*EXPORTED*/ NTSTATUS STDCALL
 NtAcceptConnectPort (PHANDLE                   ServerPortHandle,
                     HANDLE                     NamedPortHandle,
-                    PLPC_MESSAGE               LpcMessage,
+                    PPORT_MESSAGE              LpcMessage,
                     BOOLEAN                    AcceptIt,
                     PLPC_SECTION_WRITE WriteMap,
                     PLPC_SECTION_READ  ReadMap)
@@ -674,7 +674,7 @@ NtAcceptConnectPort (PHANDLE                        ServerPortHandle,
   Size = sizeof(EPORT_CONNECT_REPLY_MESSAGE);
   if (LpcMessage)
   {
-     Size += LpcMessage->DataSize;
+     Size += LpcMessage->u1.s1.DataLength;
   }
 
   CReply = ExAllocatePool(NonPagedPool, Size);
@@ -746,20 +746,20 @@ NtAcceptConnectPort (PHANDLE                      ServerPortHandle,
    */
   if (LpcMessage != NULL)
     {
-      memcpy(&CReply->MessageHeader, LpcMessage, sizeof(LPC_MESSAGE));
+      memcpy(&CReply->MessageHeader, LpcMessage, sizeof(PORT_MESSAGE));
       memcpy(&CReply->ConnectData, (PVOID)(LpcMessage + 1),
-            LpcMessage->DataSize);
-      CReply->MessageHeader.MessageSize =
-       sizeof(EPORT_CONNECT_REPLY_MESSAGE) + LpcMessage->DataSize;
-      CReply->MessageHeader.DataSize = CReply->MessageHeader.MessageSize -
-       sizeof(LPC_MESSAGE);
-      CReply->ConnectDataLength = LpcMessage->DataSize;
+            LpcMessage->u1.s1.DataLength);
+      CReply->MessageHeader.u1.s1.TotalLength =
+       sizeof(EPORT_CONNECT_REPLY_MESSAGE) + LpcMessage->u1.s1.DataLength;
+      CReply->MessageHeader.u1.s1.DataLength = CReply->MessageHeader.u1.s1.TotalLength -
+       sizeof(PORT_MESSAGE);
+      CReply->ConnectDataLength = LpcMessage->u1.s1.DataLength;
     }
   else
     {
-      CReply->MessageHeader.MessageSize = sizeof(EPORT_CONNECT_REPLY_MESSAGE);
-      CReply->MessageHeader.DataSize = sizeof(EPORT_CONNECT_REPLY_MESSAGE) -
-       sizeof(LPC_MESSAGE);
+      CReply->MessageHeader.u1.s1.TotalLength = sizeof(EPORT_CONNECT_REPLY_MESSAGE);
+      CReply->MessageHeader.u1.s1.DataLength = sizeof(EPORT_CONNECT_REPLY_MESSAGE) -
+       sizeof(PORT_MESSAGE);
       CReply->ConnectDataLength = 0;
     }
   if (!AcceptIt)
@@ -872,7 +872,7 @@ NtAcceptConnectPort (PHANDLE                        ServerPortHandle,
     {
       CReply->ReceiveClientViewBase = WriteMap->TargetViewBase;
     }
-  CReply->MaximumMessageSize = PORT_MAX_MESSAGE_LENGTH;
+  CReply->MaximumMessageSize = LPC_MAX_MESSAGE_LENGTH;
 
 
   /*
@@ -881,7 +881,7 @@ NtAcceptConnectPort (PHANDLE                        ServerPortHandle,
   OurPort->OtherPort = ConnectionRequest->Sender;
   OurPort->OtherPort->OtherPort = OurPort;
   EiReplyOrRequestPort(ConnectionRequest->Sender,
-                      (PLPC_MESSAGE)CReply,
+                      (PPORT_MESSAGE)CReply,
                       LPC_REPLY,
                       OurPort);
   ExFreePool(ConnectionRequest);
index e5d5c6b..55c8645 100644 (file)
@@ -49,11 +49,11 @@ LpcpVerifyCreateParameters (IN      PHANDLE                 PortHandle,
   {
     return (STATUS_INVALID_PORT_ATTRIBUTES);
   }
-  if (MaxConnectInfoLength > PORT_MAX_DATA_LENGTH)
+  if (MaxConnectInfoLength > LPC_MAX_DATA_LENGTH)
     {
       return (STATUS_INVALID_PARAMETER_3);
     }
-  if (MaxDataLength > PORT_MAX_MESSAGE_LENGTH)
+  if (MaxDataLength > LPC_MAX_MESSAGE_LENGTH)
     {
       return (STATUS_INVALID_PARAMETER_4);
     }
@@ -128,8 +128,8 @@ NtCreatePort (PHANDLE                     PortHandle,
     }
 
   Status = LpcpInitializePort (Port, EPORT_TYPE_SERVER_RQST_PORT, NULL);
-  Port->MaxConnectInfoLength = PORT_MAX_DATA_LENGTH;
-  Port->MaxDataLength = PORT_MAX_MESSAGE_LENGTH;
+  Port->MaxConnectInfoLength = LPC_MAX_DATA_LENGTH;
+  Port->MaxDataLength = LPC_MAX_MESSAGE_LENGTH;
   Port->MaxPoolUsage = MaxPoolUsage;
 
   ObDereferenceObject (Port);
index d83d843..901c816 100644 (file)
@@ -40,7 +40,7 @@
  */
 /*EXPORTED*/ NTSTATUS STDCALL
 NtListenPort (IN       HANDLE          PortHandle,
-             IN        PLPC_MESSAGE    ConnectMsg)
+             IN        PPORT_MESSAGE   ConnectMsg)
 {
   NTSTATUS     Status;
 
@@ -58,12 +58,12 @@ NtListenPort (IN    HANDLE          PortHandle,
        * Drop any other message.
        */
       if (!NT_SUCCESS(Status) ||
-         LPC_CONNECTION_REQUEST == ConnectMsg->MessageType)
+         LPC_CONNECTION_REQUEST == ConnectMsg->u2.s2.Type)
        {
          DPRINT("Got message (type %x)\n", LPC_CONNECTION_REQUEST);
          break;
        }
-      DPRINT("Got message (type %x)\n", ConnectMsg->MessageType);
+      DPRINT("Got message (type %x)\n", ConnectMsg->u2.s2.Type);
     }
 
   return (Status);
index 51f5751..6f361e2 100644 (file)
@@ -121,7 +121,7 @@ LpcpInitializePort (IN OUT  PEPORT Port,
  */
 NTSTATUS STDCALL
 NtImpersonateClientOfPort (HANDLE              PortHandle,
-                          PLPC_MESSAGE ClientMessage)
+                          PPORT_MESSAGE        ClientMessage)
 {
   UNIMPLEMENTED;
   return(STATUS_NOT_IMPLEMENTED);
index f45d9c7..83631aa 100644 (file)
@@ -27,7 +27,7 @@
  */
 NTSTATUS STDCALL
 NtReadRequestData (HANDLE              PortHandle,
-                  PLPC_MESSAGE Message,
+                  PPORT_MESSAGE        Message,
                   ULONG                Index,
                   PVOID                Buffer,
                   ULONG                BufferLength,
index b3c7af8..7ebda68 100644 (file)
@@ -31,7 +31,7 @@
  */
 NTSTATUS STDCALL
 EiReplyOrRequestPort (IN       PEPORT          Port,
-                     IN        PLPC_MESSAGE    LpcReply,
+                     IN        PPORT_MESSAGE   LpcReply,
                      IN        ULONG           MessageType,
                      IN        PEPORT          Sender)
 {
@@ -49,12 +49,12 @@ EiReplyOrRequestPort (IN    PEPORT          Port,
 
    if (LpcReply != NULL)
      {
-       memcpy(&MessageReply->Message, LpcReply, LpcReply->MessageSize);
+       memcpy(&MessageReply->Message, LpcReply, LpcReply->u1.s1.TotalLength);
      }
 
    MessageReply->Message.ClientId.UniqueProcess = PsGetCurrentProcessId();
    MessageReply->Message.ClientId.UniqueThread = PsGetCurrentThreadId();
-   MessageReply->Message.MessageType = MessageType;
+   MessageReply->Message.u2.s2.Type = MessageType;
    MessageReply->Message.MessageId = InterlockedIncrementUL(&LpcpNextMessageId);
 
    KeAcquireSpinLock(&Port->Lock, &oldIrql);
@@ -78,7 +78,7 @@ EiReplyOrRequestPort (IN      PEPORT          Port,
  */
 NTSTATUS STDCALL
 NtReplyPort (IN        HANDLE          PortHandle,
-            IN PLPC_MESSAGE    LpcReply)
+            IN PPORT_MESSAGE   LpcReply)
 {
    NTSTATUS Status;
    PEPORT Port;
@@ -137,8 +137,8 @@ NtReplyPort (IN     HANDLE          PortHandle,
 NTSTATUS STDCALL
 NtReplyWaitReceivePortEx(IN  HANDLE            PortHandle,
                         OUT PULONG             PortId,
-                        IN  PLPC_MESSAGE       LpcReply,
-                        OUT PLPC_MESSAGE       LpcMessage,
+                        IN  PPORT_MESSAGE      LpcReply,
+                        OUT PPORT_MESSAGE      LpcMessage,
                         IN  PLARGE_INTEGER     Timeout)
 {
    PEPORT Port;
@@ -159,7 +159,7 @@ NtReplyWaitReceivePortEx(IN  HANDLE         PortHandle,
        _SEH_TRY
          {
            ProbeForWrite(LpcMessage,
-                         sizeof(LPC_MESSAGE),
+                         sizeof(PORT_MESSAGE),
                          1);
          }
        _SEH_HANDLE
@@ -252,15 +252,15 @@ NtReplyWaitReceivePortEx(IN  HANDLE               PortHandle,
    Request = EiDequeueMessagePort(Port);
    KeReleaseSpinLock(&Port->Lock, oldIrql);
 
-   if (Request->Message.MessageType == LPC_CONNECTION_REQUEST)
+   if (Request->Message.u2.s2.Type == LPC_CONNECTION_REQUEST)
      {
-       LPC_MESSAGE Header;
+       PORT_MESSAGE Header;
        PEPORT_CONNECT_REQUEST_MESSAGE CRequest;
 
        CRequest = (PEPORT_CONNECT_REQUEST_MESSAGE)&Request->Message;
-       memcpy(&Header, &Request->Message, sizeof(LPC_MESSAGE));
-       Header.DataSize = CRequest->ConnectDataLength;
-       Header.MessageSize = Header.DataSize + sizeof(LPC_MESSAGE);
+       memcpy(&Header, &Request->Message, sizeof(PORT_MESSAGE));
+       Header.u1.s1.DataLength = CRequest->ConnectDataLength;
+       Header.u1.s1.TotalLength = Header.u1.s1.DataLength + sizeof(PORT_MESSAGE);
        
        if (PreviousMode != KernelMode)
          {
@@ -272,7 +272,7 @@ NtReplyWaitReceivePortEx(IN  HANDLE         PortHandle,
 
                RtlCopyMemory(LpcMessage,
                              &Header,
-                             sizeof(LPC_MESSAGE));
+                             sizeof(PORT_MESSAGE));
                RtlCopyMemory((PVOID)(LpcMessage + 1),
                              CRequest->ConnectData,
                              CRequest->ConnectDataLength);
@@ -287,7 +287,7 @@ NtReplyWaitReceivePortEx(IN  HANDLE         PortHandle,
          {
            RtlCopyMemory(LpcMessage,
                          &Header,
-                         sizeof(LPC_MESSAGE));
+                         sizeof(PORT_MESSAGE));
            RtlCopyMemory((PVOID)(LpcMessage + 1),
                          CRequest->ConnectData,
                          CRequest->ConnectDataLength);
@@ -300,12 +300,12 @@ NtReplyWaitReceivePortEx(IN  HANDLE               PortHandle,
            _SEH_TRY
              {
                ProbeForWrite(LpcMessage,
-                             Request->Message.MessageSize,
+                             Request->Message.u1.s1.TotalLength,
                              1);
 
                RtlCopyMemory(LpcMessage,
                              &Request->Message,
-                             Request->Message.MessageSize);
+                             Request->Message.u1.s1.TotalLength);
              }
            _SEH_HANDLE
              {
@@ -317,7 +317,7 @@ NtReplyWaitReceivePortEx(IN  HANDLE         PortHandle,
          {
            RtlCopyMemory(LpcMessage,
                          &Request->Message,
-                         Request->Message.MessageSize);
+                         Request->Message.u1.s1.TotalLength);
          }
      }
    if (!NT_SUCCESS(Status))
@@ -333,7 +333,7 @@ NtReplyWaitReceivePortEx(IN  HANDLE         PortHandle,
        ObDereferenceObject(Port);
        return(Status);
      }
-   if (Request->Message.MessageType == LPC_CONNECTION_REQUEST)
+   if (Request->Message.u2.s2.Type == LPC_CONNECTION_REQUEST)
      {
        KeAcquireSpinLock(&Port->Lock, &oldIrql);
        EiEnqueueConnectMessagePort(Port, Request);
@@ -372,8 +372,8 @@ NtReplyWaitReceivePortEx(IN  HANDLE         PortHandle,
 NTSTATUS STDCALL
 NtReplyWaitReceivePort (IN  HANDLE             PortHandle,
                        OUT PULONG              PortId,
-                       IN  PLPC_MESSAGE        LpcReply,
-                       OUT PLPC_MESSAGE        LpcMessage)
+                       IN  PPORT_MESSAGE       LpcReply,
+                       OUT PPORT_MESSAGE       LpcMessage)
 {
   return(NtReplyWaitReceivePortEx (PortHandle,
                                   PortId,
@@ -395,7 +395,7 @@ NtReplyWaitReceivePort (IN  HANDLE          PortHandle,
  */
 NTSTATUS STDCALL
 NtReplyWaitReplyPort (HANDLE           PortHandle,
-                     PLPC_MESSAGE      ReplyMessage)
+                     PPORT_MESSAGE     ReplyMessage)
 {
    UNIMPLEMENTED;
    return(STATUS_NOT_IMPLEMENTED);
@@ -408,8 +408,8 @@ NTSTATUS
 STDCALL
 LpcRequestWaitReplyPort (
        IN PEPORT               Port,
-       IN PLPC_MESSAGE LpcMessageRequest,
-       OUT PLPC_MESSAGE        LpcMessageReply
+       IN PPORT_MESSAGE        LpcMessageRequest,
+       OUT PPORT_MESSAGE       LpcMessageReply
        )
 {
        UNIMPLEMENTED;
index b1b8abb..1ec7ffd 100644 (file)
@@ -36,7 +36,7 @@ LpcSendTerminationPort (IN PEPORT Port,
   LPC_TERMINATION_MESSAGE Msg;
 
 #ifdef __USE_NT_LPC__
-  Msg.Header.MessageType = LPC_NEW_MESSAGE;
+  Msg.Header.u2.s2.Type = LPC_NEW_MESSAGE;
 #endif
   Msg.CreationTime = CreationTime;
   Status = LpcRequestPort (Port, &Msg.Header);
@@ -91,7 +91,7 @@ LpcSendDebugMessagePort (IN PEPORT Port,
    KeAcquireSpinLock(&Port->Lock, &oldIrql);
    ReplyMessage = EiDequeueMessagePort(Port);
    KeReleaseSpinLock(&Port->Lock, oldIrql);
-   memcpy(Reply, &ReplyMessage->Message, ReplyMessage->Message.MessageSize);
+   memcpy(Reply, &ReplyMessage->Message, ReplyMessage->Message.u1.s1.TotalLength);
    ExFreePool(ReplyMessage);
 
    return(STATUS_SUCCESS);
@@ -118,7 +118,7 @@ LpcSendDebugMessagePort (IN PEPORT Port,
  * @implemented
  */
 NTSTATUS STDCALL LpcRequestPort (IN    PEPORT          Port,
-                                IN     PLPC_MESSAGE    LpcMessage)
+                                IN     PPORT_MESSAGE   LpcMessage)
 {
    NTSTATUS Status;
 
@@ -126,15 +126,15 @@ NTSTATUS STDCALL LpcRequestPort (IN       PEPORT          Port,
 
 #ifdef __USE_NT_LPC__
    /* Check the message's type */
-   if (LPC_NEW_MESSAGE == LpcMessage->MessageType)
+   if (LPC_NEW_MESSAGE == LpcMessage->u2.s2.Type)
    {
-      LpcMessage->MessageType = LPC_DATAGRAM;
+      LpcMessage->u2.s2.Type = LPC_DATAGRAM;
    }
-   else if (LPC_DATAGRAM == LpcMessage->MessageType)
+   else if (LPC_DATAGRAM == LpcMessage->u2.s2.Type)
    {
       return STATUS_INVALID_PARAMETER;
    }
-   else if (LpcMessage->MessageType > LPC_CLIENT_DIED)
+   else if (LpcMessage->u2.s2.Type > LPC_CLIENT_DIED)
    {
       return STATUS_INVALID_PARAMETER;
    }
@@ -170,7 +170,7 @@ NTSTATUS STDCALL LpcRequestPort (IN PEPORT          Port,
  * @implemented
  */
 NTSTATUS STDCALL NtRequestPort (IN     HANDLE          PortHandle,
-                               IN      PLPC_MESSAGE    LpcMessage)
+                               IN      PPORT_MESSAGE   LpcMessage)
 {
    NTSTATUS Status;
    PEPORT Port;
@@ -214,15 +214,15 @@ NTSTATUS STDCALL NtRequestPort (IN        HANDLE          PortHandle,
  */
 NTSTATUS STDCALL
 NtRequestWaitReplyPort (IN HANDLE PortHandle,
-                       PLPC_MESSAGE UnsafeLpcRequest,
-                       PLPC_MESSAGE UnsafeLpcReply)
+                       PPORT_MESSAGE UnsafeLpcRequest,
+                       PPORT_MESSAGE UnsafeLpcReply)
 {
    PETHREAD CurrentThread;
    struct _KPROCESS *AttachedProcess;
    PEPORT Port;
    PQUEUEDMESSAGE Message;
    KIRQL oldIrql;
-   PLPC_MESSAGE LpcRequest;
+   PPORT_MESSAGE LpcRequest;
    USHORT LpcRequestMessageSize = 0, LpcRequestDataSize = 0;
    KPROCESSOR_MODE PreviousMode;
    NTSTATUS Status = STATUS_SUCCESS;
@@ -234,12 +234,12 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
        _SEH_TRY
          {
            ProbeForRead(UnsafeLpcRequest,
-                        sizeof(LPC_MESSAGE),
+                        sizeof(PORT_MESSAGE),
                         1);
            ProbeForWrite(UnsafeLpcReply,
-                         sizeof(LPC_MESSAGE),
+                         sizeof(PORT_MESSAGE),
                          1);
-           LpcRequestMessageSize = UnsafeLpcRequest->MessageSize;
+           LpcRequestMessageSize = UnsafeLpcRequest->u1.s1.TotalLength;
          }
        _SEH_HANDLE
          {
@@ -254,7 +254,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
      }
    else
      {
-       LpcRequestMessageSize = UnsafeLpcRequest->MessageSize;
+       LpcRequestMessageSize = UnsafeLpcRequest->u1.s1.TotalLength;
      }
 
    DPRINT("NtRequestWaitReplyPort(PortHandle %x, LpcRequest %x, "
@@ -292,7 +292,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
        KeDetachProcess();
      }
 
-   if (LpcRequestMessageSize > (sizeof(LPC_MESSAGE) + MAX_MESSAGE_DATA))
+   if (LpcRequestMessageSize > (sizeof(PORT_MESSAGE) + MAX_MESSAGE_DATA))
      {
        if (NULL != AttachedProcess)
          {
@@ -318,8 +318,8 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
            RtlCopyMemory(LpcRequest,
                          UnsafeLpcRequest,
                          LpcRequestMessageSize);
-           LpcRequestMessageSize = LpcRequest->MessageSize;
-           LpcRequestDataSize = LpcRequest->DataSize;
+           LpcRequestMessageSize = LpcRequest->u1.s1.TotalLength;
+           LpcRequestDataSize = LpcRequest->u1.s1.DataLength;
          }
        _SEH_HANDLE
          {
@@ -343,11 +343,11 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
        RtlCopyMemory(LpcRequest,
                      UnsafeLpcRequest,
                      LpcRequestMessageSize);
-       LpcRequestMessageSize = LpcRequest->MessageSize;
-       LpcRequestDataSize = LpcRequest->DataSize;
+       LpcRequestMessageSize = LpcRequest->u1.s1.TotalLength;
+       LpcRequestDataSize = LpcRequest->u1.s1.DataLength;
      }
 
-   if (LpcRequestMessageSize > (sizeof(LPC_MESSAGE) + MAX_MESSAGE_DATA))
+   if (LpcRequestMessageSize > (sizeof(PORT_MESSAGE) + MAX_MESSAGE_DATA))
      {
        ExFreePool(LpcRequest);
        if (NULL != AttachedProcess)
@@ -357,7 +357,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
        ObDereferenceObject(Port);
        return(STATUS_PORT_MESSAGE_TOO_LONG);
      }
-   if (LpcRequestDataSize != (LpcRequestMessageSize - sizeof(LPC_MESSAGE)))
+   if (LpcRequestDataSize != (LpcRequestMessageSize - sizeof(PORT_MESSAGE)))
      {
        ExFreePool(LpcRequest);
        if (NULL != AttachedProcess)
@@ -406,15 +406,15 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
        KeReleaseSpinLock(&Port->Lock, oldIrql);
        if (Message)
          {
-           DPRINT("Message->Message.MessageSize %d\n",
-                 Message->Message.MessageSize);
+           DPRINT("Message->Message.u1.s1.TotalLength %d\n",
+                 Message->Message.u1.s1.TotalLength);
            if (PreviousMode != KernelMode)
              {
                _SEH_TRY
                  {
                    RtlCopyMemory(UnsafeLpcReply,
                                  &Message->Message,
-                                 Message->Message.MessageSize);
+                                 Message->Message.u1.s1.TotalLength);
                  }
                _SEH_HANDLE
                  {
@@ -426,7 +426,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
              {
                RtlCopyMemory(UnsafeLpcReply,
                              &Message->Message,
-                             Message->Message.MessageSize);
+                             Message->Message.u1.s1.TotalLength);
              }
            ExFreePool(Message);
          }
@@ -463,7 +463,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
  * REVISIONS
  */
 NTSTATUS STDCALL NtWriteRequestData (HANDLE            PortHandle,
-                                    PLPC_MESSAGE       Message,
+                                    PPORT_MESSAGE      Message,
                                     ULONG              Index,
                                     PVOID              Buffer,
                                     ULONG              BufferLength,
index bc8880d..69637ae 100644 (file)
@@ -194,8 +194,8 @@ CSR_API(CsrCreateProcess)
    PCSRSS_PROCESS_DATA NewProcessData;
    NTSTATUS Status;
 
-   Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
-   Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
+   Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
 
    NewProcessData = CsrCreateProcessData(Request->Data.CreateProcessRequest.NewProcessId);
    if (NewProcessData == NULL)
@@ -224,8 +224,8 @@ CSR_API(CsrCreateProcess)
 
 CSR_API(CsrTerminateProcess)
 {
-   Request->Header.MessageSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
-   Request->Header.DataSize = sizeof(CSR_API_MESSAGE);
+   Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE);
 
    if (ProcessData == NULL)
    {
@@ -238,8 +238,8 @@ CSR_API(CsrTerminateProcess)
 
 CSR_API(CsrConnectProcess)
 {
-   Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-   Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+   Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
    Request->Status = STATUS_SUCCESS;
 
@@ -248,8 +248,8 @@ CSR_API(CsrConnectProcess)
 
 CSR_API(CsrGetShutdownParameters)
 {
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (ProcessData == NULL)
   {
@@ -266,8 +266,8 @@ CSR_API(CsrGetShutdownParameters)
 
 CSR_API(CsrSetShutdownParameters)
 {
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (ProcessData == NULL)
   {
@@ -284,8 +284,8 @@ CSR_API(CsrSetShutdownParameters)
 
 CSR_API(CsrGetInputHandle)
 {
-   Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-   Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+   Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
    if (ProcessData == NULL)
    {
@@ -309,8 +309,8 @@ CSR_API(CsrGetInputHandle)
 
 CSR_API(CsrGetOutputHandle)
 {
-   Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-   Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+   Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
    if (ProcessData == NULL)
    {
@@ -336,8 +336,8 @@ CSR_API(CsrGetOutputHandle)
 
 CSR_API(CsrCloseHandle)
 {
-   Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-   Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+   Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
    if (ProcessData == NULL)
    {
@@ -352,8 +352,8 @@ CSR_API(CsrCloseHandle)
 
 CSR_API(CsrVerifyHandle)
 {
-   Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-   Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+   Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
    Request->Status = CsrVerifyObject(ProcessData, Request->Data.VerifyHandleRequest.Handle);
    if (!NT_SUCCESS(Request->Status))
@@ -368,8 +368,8 @@ CSR_API(CsrDuplicateHandle)
 {
   Object_t *Object;
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   ProcessData = CsrGetProcessData(Request->Data.DuplicateHandleRequest.ProcessId);
   Request->Status = CsrGetObject(ProcessData, Request->Data.DuplicateHandleRequest.Handle, &Object);
@@ -388,8 +388,8 @@ CSR_API(CsrDuplicateHandle)
 
 CSR_API(CsrGetInputWaitHandle)
 {
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (ProcessData == NULL)
   {
index 4b839af..6c55ddf 100644 (file)
@@ -26,8 +26,8 @@ CSR_API(CsrRegisterServicesProcess)
 {
   NTSTATUS Status;
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (ServicesProcessIdValid == TRUE)
     {
index f533780..aa588db 100644 (file)
@@ -79,11 +79,11 @@ CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData,
     {
       if (ApiDefinitions[DefIndex].Type == Type)
         {
-          if (Request->Header.DataSize < ApiDefinitions[DefIndex].MinRequestSize)
+          if (Request->Header.u1.s1.DataLength < ApiDefinitions[DefIndex].MinRequestSize)
             {
               DPRINT1("Request type %d min request size %d actual %d\n",
                       Type, ApiDefinitions[DefIndex].MinRequestSize,
-                      Request->Header.DataSize);
+                      Request->Header.u1.s1.DataLength);
               Request->Status = STATUS_INVALID_PARAMETER;
             }
           else
@@ -96,8 +96,8 @@ CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData,
   if (! Found)
     {
       DPRINT1("CSR: Unknown request type 0x%x\n", Request->Type);
-      Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-      Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+      Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+      Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
       Request->Status = STATUS_INVALID_SYSTEM_SERVICE;
     }
 }
@@ -133,7 +133,7 @@ ClientConnectionThread(HANDLE ServerPort)
         }
         
         /* If the connection was closed, handle that */
-        if (LpcRequest.Header.MessageType == LPC_PORT_CLOSED)
+        if (LpcRequest.Header.u2.s2.Type == LPC_PORT_CLOSED)
         {
             CsrFreeProcessData( LpcRequest.Header.ClientId.UniqueProcess );
             break;
@@ -151,7 +151,7 @@ ClientConnectionThread(HANDLE ServerPort)
         if (ProcessData == NULL)
         {
             DPRINT1("CSR: Message %d: Unable to find data for process 0x%x\n",
-                    LpcRequest.Header.MessageType,
+                    LpcRequest.Header.u2.s2.Type,
                     LpcRequest.Header.ClientId.UniqueProcess);
             break;
         }
@@ -273,12 +273,13 @@ ServerSbApiPortThread (PVOID PortHandle)
 {
        HANDLE          hSbApiPortListen = * (PHANDLE) PortHandle;
        HANDLE          hConnectedPort = (HANDLE) 0;
-       LPC_MAX_MESSAGE Request = {{0}};
+       LPC_MAX_MESSAGE Request;
        PVOID           Context = NULL;
        NTSTATUS        Status = STATUS_SUCCESS;
 
        DPRINT("CSR: %s called\n", __FUNCTION__);
 
+    RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
        Status = NtListenPort (hSbApiPortListen, & Request.Header);
        if (!NT_SUCCESS(Status))
        {
@@ -305,7 +306,7 @@ DPRINT("-- 2\n");
                                        __FUNCTION__, Status);
                        } else {
 DPRINT("-- 3\n");
-                               PLPC_MESSAGE Reply = NULL;
+                               PPORT_MESSAGE Reply = NULL;
                                /*
                                 * Tell the init thread the SM gave the
                                 * green light for boostrapping.
@@ -330,12 +331,12 @@ DPRINT("-- 4\n");
                                                        __FUNCTION__, Status);
                                                break;
                                        }
-                                       switch (Request.Header.MessageType)//fix .h PORT_MESSAGE_TYPE(Request))
+                                       switch (Request.Header.u2.s2.Type)//fix .h PORT_MESSAGE_TYPE(Request))
                                        {
                                                /* TODO */
                                        default:
                                                DPRINT1("CSR: %s received message (type=%d)\n",
-                                                       __FUNCTION__, Request.Header.MessageType);
+                                                       __FUNCTION__, Request.Header.u2.s2.Type);
                                        }
 DPRINT("-- 5\n");
                                }
index fdcca68..8e1c209 100644 (file)
@@ -227,8 +227,8 @@ CSR_API(CsrAllocConsole)
 
     DPRINT("CsrAllocConsole\n");
 
-    Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-    Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+    Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+    Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
     if (ProcessData == NULL)
     {
@@ -356,8 +356,8 @@ CSR_API(CsrFreeConsole)
 
   DPRINT("CsrFreeConsole\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (ProcessData == NULL || ProcessData->Console == NULL)
     {
@@ -561,8 +561,8 @@ CSR_API(CsrReadConsole)
 
   /* truncate length to CSRSS_MAX_READ_CONSOLE_REQUEST */
   nNumberOfCharsToRead = min(Request->Data.ReadConsoleRequest.NrCharactersToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = Request->Header.MessageSize - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
 
   Buffer = Request->Data.ReadConsoleRequest.Buffer;
   UnicodeBuffer = (PWCHAR)Buffer;
@@ -670,7 +670,7 @@ CSR_API(CsrReadConsole)
     {
       Console->EchoCount = 0;             /* if the client is no longer waiting on input, do not echo */
     }
-  Request->Header.MessageSize += i * CharSize;
+  Request->Header.u1.s1.TotalLength += i * CharSize;
 
   ConioUnlockConsole(Console);
   return Request->Status;
@@ -921,19 +921,19 @@ CSR_API(CsrWriteConsole)
 
   DPRINT("CsrWriteConsole\n");
 
-  if (Request->Header.DataSize
+  if (Request->Header.u1.s1.DataLength
       < sizeof(CSRSS_WRITE_CONSOLE) - 1
         + (Request->Data.WriteConsoleRequest.NrCharactersToWrite * CharSize))
     {
       DPRINT1("Invalid request size\n");
-      Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-      Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+      Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+      Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
       return Request->Status = STATUS_INVALID_PARAMETER;
     }
   Status = ConioConsoleFromProcessData(ProcessData, &Console);
   
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   
   if (! NT_SUCCESS(Status))
     {
@@ -1430,8 +1430,8 @@ CSR_API(CsrGetScreenBufferInfo)
 
   DPRINT("CsrGetScreenBufferInfo\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockScreenBuffer(ProcessData, Request->Data.ScreenBufferInfoRequest.ConsoleHandle, &Buff);
   if (! NT_SUCCESS(Status))
@@ -1473,8 +1473,8 @@ CSR_API(CsrSetCursor)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetCursorRequest.ConsoleHandle, &Buff);
   if (! NT_SUCCESS(Status))
@@ -1556,19 +1556,19 @@ CSR_API(CsrWriteConsoleOutputChar)
 
   CharSize = (Request->Data.WriteConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
 
-  if (Request->Header.DataSize
+  if (Request->Header.u1.s1.DataLength
       < sizeof(CSRSS_WRITE_CONSOLE_OUTPUT_CHAR) - 1
         + (Request->Data.WriteConsoleOutputCharRequest.Length * CharSize))
     {
       DPRINT1("Invalid request size\n");
-      Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-      Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+      Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+      Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
       return Request->Status = STATUS_INVALID_PARAMETER;
     }
 
   Status = ConioConsoleFromProcessData(ProcessData, &Console);
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   if (NT_SUCCESS(Status))
     {
       if(Request->Data.WriteConsoleOutputCharRequest.Unicode)
@@ -1659,8 +1659,8 @@ CSR_API(CsrFillOutputChar)
 
   DPRINT("CsrFillOutputChar\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioConsoleFromProcessData(ProcessData, &Console);
   if (! NT_SUCCESS(Status))
@@ -1728,8 +1728,8 @@ CSR_API(CsrReadInputEvent)
 
   DPRINT("CsrReadInputEvent\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Request->Data.ReadInputRequest.Event = ProcessData->ConsoleEvent;
 
   Status = ConioLockConsole(ProcessData, Request->Data.ReadInputRequest.ConsoleHandle, &Console);
@@ -1808,19 +1808,19 @@ CSR_API(CsrWriteConsoleOutputAttrib)
 
   DPRINT("CsrWriteConsoleOutputAttrib\n");
 
-  if (Request->Header.DataSize
+  if (Request->Header.u1.s1.DataLength
       < sizeof(CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB) - 1
         + Request->Data.WriteConsoleOutputAttribRequest.Length)
     {
       DPRINT1("Invalid request size\n");
-      Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-      Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+      Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+      Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
       return Request->Status = STATUS_INVALID_PARAMETER;
     }
 
   Status = ConioConsoleFromProcessData(ProcessData, &Console);
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   if (! NT_SUCCESS(Status))
     {
       return Request->Status = Status;
@@ -1896,8 +1896,8 @@ CSR_API(CsrFillOutputAttrib)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Status = ConioLockScreenBuffer(ProcessData, Request->Data.FillOutputAttribRequest.ConsoleHandle, &Buff);
   if (! NT_SUCCESS(Status))
     {
@@ -1952,8 +1952,8 @@ CSR_API(CsrGetCursorInfo)
 
   DPRINT("CsrGetCursorInfo\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockScreenBuffer(ProcessData, Request->Data.GetCursorInfoRequest.ConsoleHandle, &Buff);
   if (! NT_SUCCESS(Status))
@@ -1976,8 +1976,8 @@ CSR_API(CsrSetCursorInfo)
 
   DPRINT("CsrSetCursorInfo\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioConsoleFromProcessData(ProcessData, &Console);
   if (! NT_SUCCESS(Status))
@@ -2084,8 +2084,8 @@ CSR_API(CsrSetConsoleMode)
 
   DPRINT("CsrSetConsoleMode\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Status = Win32CsrGetObject(ProcessData,
                              Request->Data.SetConsoleModeRequest.ConsoleHandle,
                              (Object_t **) &Console);
@@ -2121,8 +2121,8 @@ CSR_API(CsrGetConsoleMode)
 
   DPRINT("CsrGetConsoleMode\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Status = Win32CsrGetObject(ProcessData, Request->Data.GetConsoleModeRequest.ConsoleHandle,
                              (Object_t **) &Console);
   if (! NT_SUCCESS(Status))
@@ -2170,8 +2170,8 @@ CSR_API(CsrCreateScreenBuffer)
       return Request->Status = STATUS_INVALID_HANDLE;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Buff = HeapAlloc(Win32CsrApiHeap, 0, sizeof(CSRSS_SCREEN_BUFFER));
   if (NULL == Buff)
@@ -2213,8 +2213,8 @@ CSR_API(CsrSetScreenBuffer)
       return Request->Status = STATUS_INVALID_HANDLE;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetScreenBufferRequest.OutputHandle, &Buff);
   if (! NT_SUCCESS(Status))
@@ -2255,19 +2255,19 @@ CSR_API(CsrSetTitle)
 
   DPRINT("CsrSetTitle\n");
 
-  if (Request->Header.DataSize
+  if (Request->Header.u1.s1.DataLength
       < sizeof(CSRSS_SET_TITLE) - 1
         + Request->Data.SetTitleRequest.Length)
     {
       DPRINT1("Invalid request size\n");
-      Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-      Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+      Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+      Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
       return Request->Status = STATUS_INVALID_PARAMETER;
     }
 
   Status = ConioLockConsole(ProcessData, Request->Data.SetTitleRequest.Console, &Console);
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   if(! NT_SUCCESS(Status))
     {
       Request->Status = Status;
@@ -2298,8 +2298,8 @@ CSR_API(CsrGetTitle)
 
   DPRINT("CsrGetTitle\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Status = ConioLockConsole(ProcessData,
                             Request->Data.GetTitleRequest.ConsoleHandle,
                             &Console);
@@ -2314,8 +2314,8 @@ CSR_API(CsrGetTitle)
   Request->Data.GetTitleRequest.ConsoleHandle = Request->Data.GetTitleRequest.ConsoleHandle;
   Request->Data.GetTitleRequest.Length = Console->Title.Length;
   wcscpy (Request->Data.GetTitleRequest.Title, Console->Title.Buffer);
-  Request->Header.MessageSize += Console->Title.Length;
-  Request->Header.DataSize += Console->Title.Length;
+  Request->Header.u1.s1.TotalLength += Console->Title.Length;
+  Request->Header.u1.s1.DataLength += Console->Title.Length;
   Request->Status = STATUS_SUCCESS;
 
   ConioUnlockConsole(Console);
@@ -2346,8 +2346,8 @@ CSR_API(CsrWriteConsoleOutput)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Status = ConioLockScreenBuffer(ProcessData,
                                  Request->Data.WriteConsoleOutputRequest.ConsoleHandle,
                                  &Buff);
@@ -2439,8 +2439,8 @@ CSR_API(CsrFlushInputBuffer)
 
   DPRINT("CsrFlushInputBuffer\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Status = ConioLockConsole(ProcessData,
                             Request->Data.FlushInputBufferRequest.ConsoleInput,
                             &Console);
@@ -2491,8 +2491,8 @@ CSR_API(CsrScrollConsoleScreenBuffer)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Status = ConioLockScreenBuffer(ProcessData, ConsoleHandle, &Buff);
   if (! NT_SUCCESS(Status))
     {
@@ -2591,8 +2591,8 @@ CSR_API(CsrReadConsoleOutputChar)
 
   DPRINT("CsrReadConsoleOutputChar\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = Request->Header.MessageSize - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
   ReadBuffer = Request->Data.ReadConsoleOutputCharRequest.String;
 
   CharSize = (Request->Data.ReadConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
@@ -2642,8 +2642,8 @@ CSR_API(CsrReadConsoleOutputChar)
   Request->Status = STATUS_SUCCESS;
   Request->Data.ReadConsoleOutputCharRequest.EndCoord.X = Xpos - Buff->ShowX;
   Request->Data.ReadConsoleOutputCharRequest.EndCoord.Y = (Ypos - Buff->ShowY + Buff->MaxY) % Buff->MaxY;
-  Request->Header.MessageSize += Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead;
-  Request->Header.DataSize += Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead;
+  Request->Header.u1.s1.TotalLength += Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead;
+  Request->Header.u1.s1.DataLength += Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead;
 
   ConioUnlockScreenBuffer(Buff);
   if (NULL != Console)
@@ -2667,8 +2667,8 @@ CSR_API(CsrReadConsoleOutputAttrib)
 
   DPRINT("CsrReadConsoleOutputAttrib\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = Request->Header.MessageSize - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
   ReadBuffer = Request->Data.ReadConsoleOutputAttribRequest.String;
 
   Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputAttribRequest.ConsoleHandle, &Buff);
@@ -2704,8 +2704,8 @@ CSR_API(CsrReadConsoleOutputAttrib)
   Request->Status = STATUS_SUCCESS;
   Request->Data.ReadConsoleOutputAttribRequest.EndCoord.X = Xpos - Buff->ShowX;
   Request->Data.ReadConsoleOutputAttribRequest.EndCoord.Y = (Ypos - Buff->ShowY + Buff->MaxY) % Buff->MaxY;
-  Request->Header.MessageSize += Request->Data.ReadConsoleOutputAttribRequest.NumAttrsToRead;
-  Request->Header.DataSize += Request->Data.ReadConsoleOutputAttribRequest.NumAttrsToRead;
+  Request->Header.u1.s1.TotalLength += Request->Data.ReadConsoleOutputAttribRequest.NumAttrsToRead;
+  Request->Header.u1.s1.DataLength += Request->Data.ReadConsoleOutputAttribRequest.NumAttrsToRead;
 
   ConioUnlockScreenBuffer(Buff);
 
@@ -2723,8 +2723,8 @@ CSR_API(CsrGetNumberOfConsoleInputEvents)
 
   DPRINT("CsrGetNumberOfConsoleInputEvents\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = Request->Header.MessageSize - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockConsole(ProcessData, Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console);
   if (! NT_SUCCESS(Status))
@@ -2768,8 +2768,8 @@ CSR_API(CsrPeekConsoleInput)
 
   DPRINT("CsrPeekConsoleInput\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockConsole(ProcessData, Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console);
   if(! NT_SUCCESS(Status))
@@ -2846,8 +2846,8 @@ CSR_API(CsrReadConsoleOutput)
 
   DPRINT("CsrReadConsoleOutput\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputRequest.ConsoleHandle, &Buff);
   if (! NT_SUCCESS(Status))
@@ -2935,8 +2935,8 @@ CSR_API(CsrWriteConsoleInput)
 
   DPRINT("CsrWriteConsoleInput\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockConsole(ProcessData, Request->Data.WriteConsoleInputRequest.ConsoleHandle, &Console);
   if (! NT_SUCCESS(Status))
@@ -3026,8 +3026,8 @@ CSR_API(CsrHardwareStateProperty)
 
   DPRINT("CsrHardwareStateProperty\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioLockConsole(ProcessData,
                             Request->Data.ConsoleHardwareStateRequest.ConsoleHandle,
@@ -3066,8 +3066,8 @@ CSR_API(CsrGetConsoleWindow)
 
   DPRINT("CsrGetConsoleWindow\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioConsoleFromProcessData(ProcessData, &Console);
   if (! NT_SUCCESS(Status))
@@ -3088,8 +3088,8 @@ CSR_API(CsrSetConsoleIcon)
 
   DPRINT("CsrSetConsoleIcon\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   Status = ConioConsoleFromProcessData(ProcessData, &Console);
   if (! NT_SUCCESS(Status))
@@ -3117,8 +3117,8 @@ CSR_API(CsrGetConsoleCodePage)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Request->Data.GetConsoleCodePage.CodePage = Console->CodePage;
   ConioUnlockConsole(Console);
   return Request->Status = STATUS_SUCCESS;
@@ -3137,8 +3137,8 @@ CSR_API(CsrSetConsoleCodePage)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   if (IsValidCodePage(Request->Data.SetConsoleCodePage.CodePage))
     {
       Console->CodePage = Request->Data.SetConsoleCodePage.CodePage;
@@ -3162,8 +3162,8 @@ CSR_API(CsrGetConsoleOutputCodePage)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   Request->Data.GetConsoleOutputCodePage.CodePage = Console->OutputCodePage;
   ConioUnlockConsole(Console);
   return Request->Status = STATUS_SUCCESS;
@@ -3182,8 +3182,8 @@ CSR_API(CsrSetConsoleOutputCodePage)
       return Request->Status = Status;
     }
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
   if (IsValidCodePage(Request->Data.SetConsoleOutputCodePage.CodePage))
     {
       Console->OutputCodePage = Request->Data.SetConsoleOutputCodePage.CodePage;
@@ -3206,8 +3206,8 @@ CSR_API(CsrGetProcessList)
   DPRINT("CsrGetProcessList\n");
 
   Buffer = Request->Data.GetProcessListRequest.ProcessId;
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = Request->Header.MessageSize - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
 
   nItems = nCopied = 0;
   Request->Data.GetProcessListRequest.nProcessIdsCopied = 0;
index 68b07dd..207e9f9 100644 (file)
@@ -201,8 +201,8 @@ CSR_API(CsrCreateDesktop)
 
   DPRINT("CsrCreateDesktop\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (! BgInitialized)
     {
@@ -251,8 +251,8 @@ CSR_API(CsrShowDesktop)
   PRIVATE_NOTIFY_DESKTOP nmh;
   DPRINT("CsrShowDesktop\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   nmh.hdr.hwndFrom = Request->Data.ShowDesktopRequest.DesktopWindow;
   nmh.hdr.idFrom = 0;
@@ -275,8 +275,8 @@ CSR_API(CsrHideDesktop)
   PRIVATE_NOTIFY_DESKTOP nmh;
   DPRINT("CsrHideDesktop\n");
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   nmh.hdr.hwndFrom = Request->Data.ShowDesktopRequest.DesktopWindow;
   nmh.hdr.idFrom = 0;
index b94066d..d4b19a9 100644 (file)
@@ -18,8 +18,8 @@ static HANDLE LogonProcess = NULL;
 
 CSR_API(CsrRegisterLogonProcess)
 {
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (Request->Data.RegisterLogonProcessRequest.Register)
     {
@@ -51,8 +51,8 @@ CSR_API(CsrSetLogonNotifyWindow)
 {
   DWORD WindowCreator;
 
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (0 == GetWindowThreadProcessId(Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow,
                                     &WindowCreator))
@@ -77,8 +77,8 @@ CSR_API(CsrSetLogonNotifyWindow)
 
 CSR_API(CsrExitReactos)
 {
-  Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
-  Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
+  Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+  Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
 
   if (NULL == LogonNotifyWindow)
     {
index 99a7988..34ca595 100644 (file)
@@ -40,8 +40,9 @@ static VOID STDCALL
 DbgSsApiPortThread (PVOID dummy)
 {
        NTSTATUS Status = STATUS_SUCCESS;
-       LPC_MAX_MESSAGE Request = {{0}};
+       LPC_MAX_MESSAGE Request ;
     
+    RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
        while (TRUE)
        {
                Status = NtListenPort (DbgSsApiPort, & Request.Header);
@@ -59,8 +60,9 @@ static VOID STDCALL
 DbgUiApiPortThread (PVOID dummy)
 {
        NTSTATUS Status = STATUS_SUCCESS;
-       LPC_MAX_MESSAGE Request = {{0}};
+       LPC_MAX_MESSAGE Request;
     
+    RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
        while (TRUE)
        {
                Status = NtListenPort (DbgUiApiPort, & Request.Header);
index 6d2941a..cbd107f 100644 (file)
@@ -108,11 +108,12 @@ SmpApiConnectedThread(PVOID pConnectedPort)
 {
        NTSTATUS        Status = STATUS_SUCCESS;
        PVOID           Unknown = NULL;
-       PLPC_MESSAGE    Reply = NULL;
-       SM_PORT_MESSAGE Request = {{0}};
+       PPORT_MESSAGE   Reply = NULL;
+       SM_PORT_MESSAGE Request;
        HANDLE          ConnectedPort = * (PHANDLE) pConnectedPort;
 
        DPRINT("SM: %s called\n", __FUNCTION__);
+    RtlZeroMemory(&Request, sizeof(SM_PORT_MESSAGE));
 
        while (TRUE)
        {
@@ -121,14 +122,14 @@ SmpApiConnectedThread(PVOID pConnectedPort)
                Status = NtReplyWaitReceivePort(ConnectedPort,
                                                (PULONG) & Unknown,
                                                Reply,
-                                               (PLPC_MESSAGE) & Request);
+                                               (PPORT_MESSAGE) & Request);
                if (NT_SUCCESS(Status))
                {
                        DPRINT("SM: %s: message received (type=%d)\n",
                                __FUNCTION__,
-                               PORT_MESSAGE_TYPE(Request));
+                               LPC_MESSAGE_TYPE(Request));
 
-                       switch (Request.Header.MessageType)
+                       switch (Request.Header.u2.s2.Type)
                        {
                        case LPC_CONNECTION_REQUEST:
                                SmpHandleConnectionRequest (&Request);
@@ -146,10 +147,10 @@ SmpApiConnectedThread(PVOID pConnectedPort)
                                        (Request.SmHeader.ApiIndex < (sizeof SmApi / sizeof SmApi[0])))
                                {
                                        Status = SmApi[Request.SmHeader.ApiIndex](&Request);
-                                       Reply = (PLPC_MESSAGE) & Request;
+                                       Reply = (PPORT_MESSAGE) & Request;
                                } else {
                                        Request.SmHeader.Status = STATUS_NOT_IMPLEMENTED;
-                                       Reply = (PLPC_MESSAGE) & Request;
+                                       Reply = (PPORT_MESSAGE) & Request;
                                }
                        }
                } else {
@@ -187,7 +188,7 @@ SmpHandleConnectionRequest (PSM_PORT_MESSAGE Request)
        DPRINT("SM: %s called:\n  SubSystemID=%d\n  SbName=\"%S\"\n",
                        __FUNCTION__, ConnectData->SubSystemId, ConnectData->SbName);
 
-       if(sizeof (SM_CONNECT_DATA) == Request->Header.DataSize)
+       if(sizeof (SM_CONNECT_DATA) == Request->Header.u1.s1.DataLength)
        {
                if(IMAGE_SUBSYSTEM_UNKNOWN == ConnectData->SubSystemId)
                {
@@ -248,7 +249,7 @@ SmpHandleConnectionRequest (PSM_PORT_MESSAGE Request)
 #if defined(__USE_NT_LPC__)
        Status = NtAcceptConnectPort (ClientDataApiPort,
                                      Context,
-                                     (PLPC_MESSAGE) Request,
+                                     (PPORT_MESSAGE) Request,
                                      Accept,
                                      NULL,
                                      NULL);
@@ -317,9 +318,10 @@ VOID STDCALL
 SmpApiThread (HANDLE ListeningPort)
 {
        NTSTATUS        Status = STATUS_SUCCESS;
-       LPC_MAX_MESSAGE Request = {{0}};
+       LPC_MAX_MESSAGE Request;
 
        DPRINT("SM: %s called\n", __FUNCTION__);
+    RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
 
        while (TRUE)
        {