- Use correct, documented, LPC Message structures (PORT_VIEW, REMOTE_PORT_VIEW)....
authorAlex Ionescu <aionescu@gmail.com>
Thu, 11 Aug 2005 03:23:44 +0000 (03:23 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Thu, 11 Aug 2005 03:23:44 +0000 (03:23 +0000)
svn path=/trunk/; revision=17277

reactos/include/ndk/lpctypes.h
reactos/include/ndk/zwfuncs.h
reactos/lib/ntdll/csr/lpc.c
reactos/ntoskrnl/lpc/connect.c
reactos/subsys/csrss/api/wapi.c

index 7d41eb9..5de4377 100644 (file)
@@ -87,24 +87,22 @@ typedef struct _PORT_MESSAGE
     };
 } PORT_MESSAGE, *PPORT_MESSAGE;
 
-/* FIXME: USE REAL DEFINITION */
-typedef struct _LPC_SECTION_WRITE
+typedef struct _PORT_VIEW
 {
-    ULONG  Length;
-    HANDLE  SectionHandle;
-    ULONG  SectionOffset;
-    ULONG  ViewSize;
-    PVOID  ViewBase;
-    PVOID  TargetViewBase;
-} LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
+    ULONG Length;
+    LPC_HANDLE SectionHandle;
+    ULONG SectionOffset;
+    LPC_SIZE_T ViewSize;
+    LPC_PVOID ViewBase;
+    LPC_PVOID ViewRemoteBase;
+} PORT_VIEW, *PPORT_VIEW;
 
-/* FIXME: USE REAL DEFINITION */
-typedef struct _LPC_SECTION_READ
+typedef struct _REMOTE_PORT_VIEW
 {
-    ULONG  Length;
-    ULONG  ViewSize;
-    PVOID  ViewBase;
-} LPC_SECTION_READ, *PLPC_SECTION_READ;
+    ULONG Length;
+    LPC_SIZE_T ViewSize;
+    LPC_PVOID ViewBase;
+} REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
 
 /* FIXME: USE REAL DEFINITION */
 typedef struct _LPC_MAX_MESSAGE
index 0ed81a8..f123697 100644 (file)
@@ -27,8 +27,8 @@ NtAcceptConnectPort(
     HANDLE NamedPortHandle,
     PPORT_MESSAGE ServerReply,
     BOOLEAN AcceptIt,
-    PLPC_SECTION_WRITE WriteMap,
-    PLPC_SECTION_READ ReadMap
+    PPORT_VIEW WriteMap,
+    PREMOTE_PORT_VIEW ReadMap
 );
 
 NTSTATUS
@@ -350,8 +350,8 @@ NtConnectPort(
     PHANDLE PortHandle,
     PUNICODE_STRING PortName,
     PSECURITY_QUALITY_OF_SERVICE SecurityQos,
-    PLPC_SECTION_WRITE SectionInfo,
-    PLPC_SECTION_READ MapInfo,
+    PPORT_VIEW SectionInfo,
+    PREMOTE_PORT_VIEW MapInfo,
     PULONG MaxMessageSize,
     PVOID ConnectInfo,
     PULONG ConnectInfoLength
@@ -363,8 +363,8 @@ ZwConnectPort(
     PHANDLE PortHandle,
     PUNICODE_STRING PortName,
     PSECURITY_QUALITY_OF_SERVICE SecurityQos,
-    PLPC_SECTION_WRITE SectionInfo,
-    PLPC_SECTION_READ MapInfo,
+    PPORT_VIEW SectionInfo,
+    PREMOTE_PORT_VIEW MapInfo,
     PULONG MaxMessageSize,
     PVOID ConnectInfo,
     PULONG ConnectInfoLength
index 01652cc..e3412ca 100644 (file)
@@ -113,7 +113,7 @@ CsrClientConnectToServer(PWSTR ObjectDirectory,
    UNICODE_STRING PortName = RTL_CONSTANT_STRING(L"\\Windows\\ApiPort");
    ULONG ConnectInfoLength;
    CSR_API_MESSAGE Request;
-   LPC_SECTION_WRITE LpcWrite;
+   PORT_VIEW LpcWrite;
    HANDLE CsrSectionHandle;
    LARGE_INTEGER CsrSectionViewSize;
 
@@ -135,7 +135,7 @@ CsrClientConnectToServer(PWSTR ObjectDirectory,
        return(Status);
      }
    ConnectInfoLength = 0;
-   LpcWrite.Length = sizeof(LPC_SECTION_WRITE);
+   LpcWrite.Length = sizeof(PORT_VIEW);
    LpcWrite.SectionHandle = CsrSectionHandle;
    LpcWrite.SectionOffset = 0;
    LpcWrite.ViewSize = CsrSectionViewSize.u.LowPart;
@@ -155,7 +155,7 @@ CsrClientConnectToServer(PWSTR ObjectDirectory,
 
    NtClose(CsrSectionHandle);
    CsrSectionMapBase = LpcWrite.ViewBase;
-   CsrSectionMapServerBase = LpcWrite.TargetViewBase;
+   CsrSectionMapServerBase = LpcWrite.ViewRemoteBase;
 
    /* Create the heap for communication for csrss. */
    CsrCommHeap = RtlCreateHeap(0,
index 3dbb1b7..da2ca47 100644 (file)
@@ -240,15 +240,15 @@ NTSTATUS STDCALL
 NtConnectPort (PHANDLE                         UnsafeConnectedPortHandle,
               PUNICODE_STRING                  PortName,
               PSECURITY_QUALITY_OF_SERVICE     Qos,
-              PLPC_SECTION_WRITE               UnsafeWriteMap,
-              PLPC_SECTION_READ                UnsafeReadMap,
+              PPORT_VIEW               UnsafeWriteMap,
+              PREMOTE_PORT_VIEW                UnsafeReadMap,
               PULONG                           UnsafeMaximumMessageSize,
               PVOID                            UnsafeConnectData,
               PULONG                           UnsafeConnectDataLength)
 {
   HANDLE ConnectedPortHandle;
-  LPC_SECTION_WRITE WriteMap;
-  LPC_SECTION_READ ReadMap;
+  PORT_VIEW WriteMap;
+  REMOTE_PORT_VIEW ReadMap;
   ULONG MaximumMessageSize;
   PVOID ConnectData = NULL;
   ULONG ConnectDataLength = 0;
@@ -297,11 +297,11 @@ NtConnectPort (PHANDLE                            UnsafeConnectedPortHandle,
           _SEH_TRY
             {
               ProbeForWrite(UnsafeWriteMap,
-                            sizeof(LPC_SECTION_WRITE),
+                            sizeof(PORT_VIEW),
                             1);
               RtlCopyMemory(&WriteMap,
                             UnsafeWriteMap,
-                            sizeof(LPC_SECTION_WRITE));
+                            sizeof(PORT_VIEW));
             }
           _SEH_HANDLE
             {
@@ -318,10 +318,10 @@ NtConnectPort (PHANDLE                            UnsafeConnectedPortHandle,
         {
           RtlCopyMemory(&WriteMap,
                         UnsafeWriteMap,
-                        sizeof(LPC_SECTION_WRITE));
+                        sizeof(PORT_VIEW));
         }
 
-      if (WriteMap.Length != sizeof(LPC_SECTION_WRITE))
+      if (WriteMap.Length != sizeof(PORT_VIEW))
        {
          return(STATUS_INVALID_PARAMETER_4);
        }
@@ -457,7 +457,7 @@ NtConnectPort (PHANDLE                              UnsafeConnectedPortHandle,
                         SectionOffset,
                         WriteMap.ViewSize,
                         &WriteMap.ViewBase,
-                        &WriteMap.TargetViewBase,
+                        &WriteMap.ViewRemoteBase,
                         &ReadMap.ViewSize,
                         &ReadMap.ViewBase,
                         &MaximumMessageSize,
@@ -579,14 +579,14 @@ NtConnectPort (PHANDLE                            UnsafeConnectedPortHandle,
             {
               RtlCopyMemory(UnsafeWriteMap,
                             &WriteMap,
-                            sizeof(LPC_SECTION_WRITE));
+                            sizeof(PORT_VIEW));
             }
 
           if (UnsafeReadMap != NULL)
             {
               RtlCopyMemory(UnsafeReadMap,
                             &ReadMap,
-                            sizeof(LPC_SECTION_READ));
+                            sizeof(REMOTE_PORT_VIEW));
             }
 
           if (UnsafeMaximumMessageSize != NULL)
@@ -613,14 +613,14 @@ NtConnectPort (PHANDLE                            UnsafeConnectedPortHandle,
         {
           RtlCopyMemory(UnsafeWriteMap,
                         &WriteMap,
-                        sizeof(LPC_SECTION_WRITE));
+                        sizeof(PORT_VIEW));
         }
 
       if (UnsafeReadMap != NULL)
         {
           RtlCopyMemory(UnsafeReadMap,
                         &ReadMap,
-                        sizeof(LPC_SECTION_READ));
+                        sizeof(REMOTE_PORT_VIEW));
         }
 
       if (UnsafeMaximumMessageSize != NULL)
@@ -658,8 +658,8 @@ NtAcceptConnectPort (PHANDLE                        ServerPortHandle,
                     HANDLE                     NamedPortHandle,
                     PPORT_MESSAGE              LpcMessage,
                     BOOLEAN                    AcceptIt,
-                    PLPC_SECTION_WRITE WriteMap,
-                    PLPC_SECTION_READ  ReadMap)
+                    PPORT_VIEW WriteMap,
+                    PREMOTE_PORT_VIEW  ReadMap)
 {
   NTSTATUS     Status;
   PEPORT               NamedPort;
@@ -799,11 +799,11 @@ NtAcceptConnectPort (PHANDLE                      ServerPortHandle,
        }
 
       SectionOffset.QuadPart = WriteMap->SectionOffset;
-      WriteMap->TargetViewBase = 0;
+      WriteMap->ViewRemoteBase = 0;
       CReply->ReceiveClientViewSize = WriteMap->ViewSize;
       Status = MmMapViewOfSection(SectionObject,
                                  CRequest->ConnectingProcess,
-                                 &WriteMap->TargetViewBase,
+                                 &WriteMap->ViewRemoteBase,
                                  0,
                                  CReply->ReceiveClientViewSize,
                                  &SectionOffset,
@@ -870,7 +870,7 @@ NtAcceptConnectPort (PHANDLE                        ServerPortHandle,
     }
   if (WriteMap != NULL)
     {
-      CReply->ReceiveClientViewBase = WriteMap->TargetViewBase;
+      CReply->ReceiveClientViewBase = WriteMap->ViewRemoteBase;
     }
   CReply->MaximumMessageSize = LPC_MAX_MESSAGE_LENGTH;
 
@@ -920,9 +920,9 @@ NTSTATUS STDCALL
 NtSecureConnectPort (OUT    PHANDLE                            ConnectedPort,
                     IN     PUNICODE_STRING                     PortName,
                     IN     PSECURITY_QUALITY_OF_SERVICE        Qos,
-                    IN OUT PLPC_SECTION_WRITE                  WriteMap                OPTIONAL,
+                    IN OUT PPORT_VIEW                  WriteMap                OPTIONAL,
                     IN     PSID                                ServerSid               OPTIONAL,
-                    IN OUT PLPC_SECTION_READ                   ReadMap                 OPTIONAL,
+                    IN OUT PREMOTE_PORT_VIEW                   ReadMap                 OPTIONAL,
                     OUT    PULONG                              MaxMessageSize          OPTIONAL,
                     IN OUT PVOID                               ConnectInfo             OPTIONAL,
                     IN OUT PULONG                              UserConnectInfoLength   OPTIONAL)
index aa588db..01e4b66 100644 (file)
@@ -192,7 +192,7 @@ ServerApiPortThread (PVOID PortHandle)
 
    for (;;)
      {
-        LPC_SECTION_READ LpcRead;
+        REMOTE_PORT_VIEW LpcRead;
         ServerPort = NULL;
 
        Status = NtListenPort (hApiListenPort, & Request.Header);