- 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
This commit is contained in:
Alex Ionescu 2005-08-11 03:23:44 +00:00
parent c5785454c2
commit bd3f2eea3c
5 changed files with 43 additions and 45 deletions

View file

@ -87,24 +87,22 @@ typedef struct _PORT_MESSAGE
}; };
} PORT_MESSAGE, *PPORT_MESSAGE; } PORT_MESSAGE, *PPORT_MESSAGE;
/* FIXME: USE REAL DEFINITION */ typedef struct _PORT_VIEW
typedef struct _LPC_SECTION_WRITE
{ {
ULONG Length; ULONG Length;
HANDLE SectionHandle; LPC_HANDLE SectionHandle;
ULONG SectionOffset; ULONG SectionOffset;
ULONG ViewSize; LPC_SIZE_T ViewSize;
PVOID ViewBase; LPC_PVOID ViewBase;
PVOID TargetViewBase; LPC_PVOID ViewRemoteBase;
} LPC_SECTION_WRITE, *PLPC_SECTION_WRITE; } PORT_VIEW, *PPORT_VIEW;
/* FIXME: USE REAL DEFINITION */ typedef struct _REMOTE_PORT_VIEW
typedef struct _LPC_SECTION_READ
{ {
ULONG Length; ULONG Length;
ULONG ViewSize; LPC_SIZE_T ViewSize;
PVOID ViewBase; LPC_PVOID ViewBase;
} LPC_SECTION_READ, *PLPC_SECTION_READ; } REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
/* FIXME: USE REAL DEFINITION */ /* FIXME: USE REAL DEFINITION */
typedef struct _LPC_MAX_MESSAGE typedef struct _LPC_MAX_MESSAGE

View file

@ -27,8 +27,8 @@ NtAcceptConnectPort(
HANDLE NamedPortHandle, HANDLE NamedPortHandle,
PPORT_MESSAGE ServerReply, PPORT_MESSAGE ServerReply,
BOOLEAN AcceptIt, BOOLEAN AcceptIt,
PLPC_SECTION_WRITE WriteMap, PPORT_VIEW WriteMap,
PLPC_SECTION_READ ReadMap PREMOTE_PORT_VIEW ReadMap
); );
NTSTATUS NTSTATUS
@ -350,8 +350,8 @@ NtConnectPort(
PHANDLE PortHandle, PHANDLE PortHandle,
PUNICODE_STRING PortName, PUNICODE_STRING PortName,
PSECURITY_QUALITY_OF_SERVICE SecurityQos, PSECURITY_QUALITY_OF_SERVICE SecurityQos,
PLPC_SECTION_WRITE SectionInfo, PPORT_VIEW SectionInfo,
PLPC_SECTION_READ MapInfo, PREMOTE_PORT_VIEW MapInfo,
PULONG MaxMessageSize, PULONG MaxMessageSize,
PVOID ConnectInfo, PVOID ConnectInfo,
PULONG ConnectInfoLength PULONG ConnectInfoLength
@ -363,8 +363,8 @@ ZwConnectPort(
PHANDLE PortHandle, PHANDLE PortHandle,
PUNICODE_STRING PortName, PUNICODE_STRING PortName,
PSECURITY_QUALITY_OF_SERVICE SecurityQos, PSECURITY_QUALITY_OF_SERVICE SecurityQos,
PLPC_SECTION_WRITE SectionInfo, PPORT_VIEW SectionInfo,
PLPC_SECTION_READ MapInfo, PREMOTE_PORT_VIEW MapInfo,
PULONG MaxMessageSize, PULONG MaxMessageSize,
PVOID ConnectInfo, PVOID ConnectInfo,
PULONG ConnectInfoLength PULONG ConnectInfoLength

View file

@ -113,7 +113,7 @@ CsrClientConnectToServer(PWSTR ObjectDirectory,
UNICODE_STRING PortName = RTL_CONSTANT_STRING(L"\\Windows\\ApiPort"); UNICODE_STRING PortName = RTL_CONSTANT_STRING(L"\\Windows\\ApiPort");
ULONG ConnectInfoLength; ULONG ConnectInfoLength;
CSR_API_MESSAGE Request; CSR_API_MESSAGE Request;
LPC_SECTION_WRITE LpcWrite; PORT_VIEW LpcWrite;
HANDLE CsrSectionHandle; HANDLE CsrSectionHandle;
LARGE_INTEGER CsrSectionViewSize; LARGE_INTEGER CsrSectionViewSize;
@ -135,7 +135,7 @@ CsrClientConnectToServer(PWSTR ObjectDirectory,
return(Status); return(Status);
} }
ConnectInfoLength = 0; ConnectInfoLength = 0;
LpcWrite.Length = sizeof(LPC_SECTION_WRITE); LpcWrite.Length = sizeof(PORT_VIEW);
LpcWrite.SectionHandle = CsrSectionHandle; LpcWrite.SectionHandle = CsrSectionHandle;
LpcWrite.SectionOffset = 0; LpcWrite.SectionOffset = 0;
LpcWrite.ViewSize = CsrSectionViewSize.u.LowPart; LpcWrite.ViewSize = CsrSectionViewSize.u.LowPart;
@ -155,7 +155,7 @@ CsrClientConnectToServer(PWSTR ObjectDirectory,
NtClose(CsrSectionHandle); NtClose(CsrSectionHandle);
CsrSectionMapBase = LpcWrite.ViewBase; CsrSectionMapBase = LpcWrite.ViewBase;
CsrSectionMapServerBase = LpcWrite.TargetViewBase; CsrSectionMapServerBase = LpcWrite.ViewRemoteBase;
/* Create the heap for communication for csrss. */ /* Create the heap for communication for csrss. */
CsrCommHeap = RtlCreateHeap(0, CsrCommHeap = RtlCreateHeap(0,

View file

@ -240,15 +240,15 @@ NTSTATUS STDCALL
NtConnectPort (PHANDLE UnsafeConnectedPortHandle, NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
PUNICODE_STRING PortName, PUNICODE_STRING PortName,
PSECURITY_QUALITY_OF_SERVICE Qos, PSECURITY_QUALITY_OF_SERVICE Qos,
PLPC_SECTION_WRITE UnsafeWriteMap, PPORT_VIEW UnsafeWriteMap,
PLPC_SECTION_READ UnsafeReadMap, PREMOTE_PORT_VIEW UnsafeReadMap,
PULONG UnsafeMaximumMessageSize, PULONG UnsafeMaximumMessageSize,
PVOID UnsafeConnectData, PVOID UnsafeConnectData,
PULONG UnsafeConnectDataLength) PULONG UnsafeConnectDataLength)
{ {
HANDLE ConnectedPortHandle; HANDLE ConnectedPortHandle;
LPC_SECTION_WRITE WriteMap; PORT_VIEW WriteMap;
LPC_SECTION_READ ReadMap; REMOTE_PORT_VIEW ReadMap;
ULONG MaximumMessageSize; ULONG MaximumMessageSize;
PVOID ConnectData = NULL; PVOID ConnectData = NULL;
ULONG ConnectDataLength = 0; ULONG ConnectDataLength = 0;
@ -297,11 +297,11 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
_SEH_TRY _SEH_TRY
{ {
ProbeForWrite(UnsafeWriteMap, ProbeForWrite(UnsafeWriteMap,
sizeof(LPC_SECTION_WRITE), sizeof(PORT_VIEW),
1); 1);
RtlCopyMemory(&WriteMap, RtlCopyMemory(&WriteMap,
UnsafeWriteMap, UnsafeWriteMap,
sizeof(LPC_SECTION_WRITE)); sizeof(PORT_VIEW));
} }
_SEH_HANDLE _SEH_HANDLE
{ {
@ -318,10 +318,10 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
{ {
RtlCopyMemory(&WriteMap, RtlCopyMemory(&WriteMap,
UnsafeWriteMap, 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); return(STATUS_INVALID_PARAMETER_4);
} }
@ -457,7 +457,7 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
SectionOffset, SectionOffset,
WriteMap.ViewSize, WriteMap.ViewSize,
&WriteMap.ViewBase, &WriteMap.ViewBase,
&WriteMap.TargetViewBase, &WriteMap.ViewRemoteBase,
&ReadMap.ViewSize, &ReadMap.ViewSize,
&ReadMap.ViewBase, &ReadMap.ViewBase,
&MaximumMessageSize, &MaximumMessageSize,
@ -579,14 +579,14 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
{ {
RtlCopyMemory(UnsafeWriteMap, RtlCopyMemory(UnsafeWriteMap,
&WriteMap, &WriteMap,
sizeof(LPC_SECTION_WRITE)); sizeof(PORT_VIEW));
} }
if (UnsafeReadMap != NULL) if (UnsafeReadMap != NULL)
{ {
RtlCopyMemory(UnsafeReadMap, RtlCopyMemory(UnsafeReadMap,
&ReadMap, &ReadMap,
sizeof(LPC_SECTION_READ)); sizeof(REMOTE_PORT_VIEW));
} }
if (UnsafeMaximumMessageSize != NULL) if (UnsafeMaximumMessageSize != NULL)
@ -613,14 +613,14 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
{ {
RtlCopyMemory(UnsafeWriteMap, RtlCopyMemory(UnsafeWriteMap,
&WriteMap, &WriteMap,
sizeof(LPC_SECTION_WRITE)); sizeof(PORT_VIEW));
} }
if (UnsafeReadMap != NULL) if (UnsafeReadMap != NULL)
{ {
RtlCopyMemory(UnsafeReadMap, RtlCopyMemory(UnsafeReadMap,
&ReadMap, &ReadMap,
sizeof(LPC_SECTION_READ)); sizeof(REMOTE_PORT_VIEW));
} }
if (UnsafeMaximumMessageSize != NULL) if (UnsafeMaximumMessageSize != NULL)
@ -658,8 +658,8 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
HANDLE NamedPortHandle, HANDLE NamedPortHandle,
PPORT_MESSAGE LpcMessage, PPORT_MESSAGE LpcMessage,
BOOLEAN AcceptIt, BOOLEAN AcceptIt,
PLPC_SECTION_WRITE WriteMap, PPORT_VIEW WriteMap,
PLPC_SECTION_READ ReadMap) PREMOTE_PORT_VIEW ReadMap)
{ {
NTSTATUS Status; NTSTATUS Status;
PEPORT NamedPort; PEPORT NamedPort;
@ -799,11 +799,11 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
} }
SectionOffset.QuadPart = WriteMap->SectionOffset; SectionOffset.QuadPart = WriteMap->SectionOffset;
WriteMap->TargetViewBase = 0; WriteMap->ViewRemoteBase = 0;
CReply->ReceiveClientViewSize = WriteMap->ViewSize; CReply->ReceiveClientViewSize = WriteMap->ViewSize;
Status = MmMapViewOfSection(SectionObject, Status = MmMapViewOfSection(SectionObject,
CRequest->ConnectingProcess, CRequest->ConnectingProcess,
&WriteMap->TargetViewBase, &WriteMap->ViewRemoteBase,
0, 0,
CReply->ReceiveClientViewSize, CReply->ReceiveClientViewSize,
&SectionOffset, &SectionOffset,
@ -870,7 +870,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
} }
if (WriteMap != NULL) if (WriteMap != NULL)
{ {
CReply->ReceiveClientViewBase = WriteMap->TargetViewBase; CReply->ReceiveClientViewBase = WriteMap->ViewRemoteBase;
} }
CReply->MaximumMessageSize = LPC_MAX_MESSAGE_LENGTH; CReply->MaximumMessageSize = LPC_MAX_MESSAGE_LENGTH;
@ -920,9 +920,9 @@ NTSTATUS STDCALL
NtSecureConnectPort (OUT PHANDLE ConnectedPort, NtSecureConnectPort (OUT PHANDLE ConnectedPort,
IN PUNICODE_STRING PortName, IN PUNICODE_STRING PortName,
IN PSECURITY_QUALITY_OF_SERVICE Qos, IN PSECURITY_QUALITY_OF_SERVICE Qos,
IN OUT PLPC_SECTION_WRITE WriteMap OPTIONAL, IN OUT PPORT_VIEW WriteMap OPTIONAL,
IN PSID ServerSid OPTIONAL, IN PSID ServerSid OPTIONAL,
IN OUT PLPC_SECTION_READ ReadMap OPTIONAL, IN OUT PREMOTE_PORT_VIEW ReadMap OPTIONAL,
OUT PULONG MaxMessageSize OPTIONAL, OUT PULONG MaxMessageSize OPTIONAL,
IN OUT PVOID ConnectInfo OPTIONAL, IN OUT PVOID ConnectInfo OPTIONAL,
IN OUT PULONG UserConnectInfoLength OPTIONAL) IN OUT PULONG UserConnectInfoLength OPTIONAL)

View file

@ -192,7 +192,7 @@ ServerApiPortThread (PVOID PortHandle)
for (;;) for (;;)
{ {
LPC_SECTION_READ LpcRead; REMOTE_PORT_VIEW LpcRead;
ServerPort = NULL; ServerPort = NULL;
Status = NtListenPort (hApiListenPort, & Request.Header); Status = NtListenPort (hApiListenPort, & Request.Header);