From bd3f2eea3cb6dccbc17cfef7c6a5c36df991355d Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Thu, 11 Aug 2005 03:23:44 +0000 Subject: [PATCH] - Use correct, documented, LPC Message structures (PORT_VIEW, REMOTE_PORT_VIEW). Fix all caller code to use new member names and structure names. svn path=/trunk/; revision=17277 --- reactos/include/ndk/lpctypes.h | 28 +++++++++++------------ reactos/include/ndk/zwfuncs.h | 12 +++++----- reactos/lib/ntdll/csr/lpc.c | 6 ++--- reactos/ntoskrnl/lpc/connect.c | 40 ++++++++++++++++----------------- reactos/subsys/csrss/api/wapi.c | 2 +- 5 files changed, 43 insertions(+), 45 deletions(-) diff --git a/reactos/include/ndk/lpctypes.h b/reactos/include/ndk/lpctypes.h index 7d41eb9be0c..5de4377e882 100644 --- a/reactos/include/ndk/lpctypes.h +++ b/reactos/include/ndk/lpctypes.h @@ -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 diff --git a/reactos/include/ndk/zwfuncs.h b/reactos/include/ndk/zwfuncs.h index 0ed81a89a90..f12369714de 100644 --- a/reactos/include/ndk/zwfuncs.h +++ b/reactos/include/ndk/zwfuncs.h @@ -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 diff --git a/reactos/lib/ntdll/csr/lpc.c b/reactos/lib/ntdll/csr/lpc.c index 01652ccf714..e3412ca0b45 100644 --- a/reactos/lib/ntdll/csr/lpc.c +++ b/reactos/lib/ntdll/csr/lpc.c @@ -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, diff --git a/reactos/ntoskrnl/lpc/connect.c b/reactos/ntoskrnl/lpc/connect.c index 3dbb1b7f742..da2ca475670 100644 --- a/reactos/ntoskrnl/lpc/connect.c +++ b/reactos/ntoskrnl/lpc/connect.c @@ -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) diff --git a/reactos/subsys/csrss/api/wapi.c b/reactos/subsys/csrss/api/wapi.c index aa588dbd522..01e4b6655f0 100644 --- a/reactos/subsys/csrss/api/wapi.c +++ b/reactos/subsys/csrss/api/wapi.c @@ -192,7 +192,7 @@ ServerApiPortThread (PVOID PortHandle) for (;;) { - LPC_SECTION_READ LpcRead; + REMOTE_PORT_VIEW LpcRead; ServerPort = NULL; Status = NtListenPort (hApiListenPort, & Request.Header);