Remove all non-official LPC structures/defines/hardcoded hacks, and use actual correct sizes and structures.

svn path=/trunk/; revision=17417
This commit is contained in:
Alex Ionescu 2005-08-16 23:05:33 +00:00
parent 81fe025857
commit 9f1cf7b990
29 changed files with 361 additions and 182 deletions

View file

@ -35,8 +35,6 @@
#include <portio.h>
#include <reactos.h>
#define ROUND_UP(N, S) (((N) + (S) - 1) & ~((S) - 1))
#define ROUND_DOWN(N, S) ((N) & ~((S) - 1))
#define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n")
extern BOOL UserInterfaceUp; /* Tells us if the user interface is displayed */

View file

@ -33,8 +33,45 @@ List:
Priority 4:
- FIXED: Kernel and Memory Types are not architecture-specific (Eric) [ketypes.h, mmtypes.h]
- FIXED: Win32K Builds with windows.h (Filip) [extypes.h, ketypes.h]
- Move out stuff from umtypes.h into the actual header where they should go. Use ifdeffing
directly in that file to protect user-mode versus kernel-mode types. umtypes.h will only
end up containing the misc types that are needed for compatibility. This would create a
significant cleanup.
Priority 5:
- LPC Types are totally wrong. [lpctypes.h]
- FIXED: LPC Types are totally wrong. (Alex) [lpctypes.h]
- Missing System Info Classes [zwtypes.h]
- FIXED: Process Priority Classes are messed up (Alex) [pstypes.h]
Generic Note:
One of the most difficult things is when certain structures require the IFS for some of their
members. Up until some time ago, the IFS was 1000$, so it was senseless to require it in order
to allow people to use the NDK. Recently, however, the IFS price went down to 100$. This is
still way too much. Even though the GNU NTIFS.H exists, I don't want to fallback on it. The
good news is that the WDK (Windows Driver Kit), which will supplant the DDK in about a year,
includes the IFS. At that point we can remove all the #ifndef/ifdef NTIFS hacks, since it'll
be OK to "force" IFS usage.
UPDATE:
However, I'm giving serious consideration of making the IFS a requirement, and suggesting
usage of the GNU IFS for anyone that needs it. The problem, however, is that the official
GNU IFS is outdated and quite invalid in many ways, compared to the ReactOS IFS (which still
isn't perfect yet). Also, this would include many more definitions then needed. A third
option that I'm considering is creating a new header, until the WDK is out, which will be
called ifstypes. It would be the brother of umtypes, but for kernel mode. Only a small
number of types will need to be included, and hence they will be easy to locate in case
the official ones change (by the time they do, the WDK will be out however, so no worries).
It would reduce all the ifdeffing to a single file.
UPDATE2:
No. This is a bad idea. I've just added a note to purge out large parts of umtypes.h into the
actual xxtypes.h files, and then use iffdefing. This is a direct contradiction to my idea of
generalizing all the IFS stuff together.
UPDATE3:
No. This is different...the user-mode types will always be unavailable in kernel-mode, and
dissipating them into the real files is a good thing, because they will never move out and
they are much easier to maintain. However, once the WDK comes out, all #ifdef ntifs will
become obsolete, and they will have to be hunted down and removed. Having a single file that
is automatically added if the IFS is not detected is much easier to remove once the time
comes.

View file

@ -9,18 +9,10 @@
#ifndef _LPCTYPES_H
#define _LPCTYPES_H
#define LPC_MESSAGE_TYPE(m) ((m).Header.u2.s2.Type)
/* DEPENDENCIES **************************************************************/
/* EXPORTED DATA *************************************************************/
/* CONSTANTS *****************************************************************/
#define LPC_MESSAGE_BASE_SIZE 24
#define MAX_MESSAGE_DATA (0x130)
#define LPC_MAX_DATA_LENGTH 0x104
#define LPC_MAX_MESSAGE_LENGTH 0x148
/* ENUMERATIONS **************************************************************/
typedef enum _LPC_TYPE
@ -42,6 +34,13 @@ typedef enum _LPC_TYPE
/* TYPES *********************************************************************/
/*
* Native Structures in IFS. Duplicated here for user-mode.
* Also duplicated if the IFS is not present. Until the WDK is
* released, we should not force the usage of a 100$ kit.
*/
#if defined(NTOS_MODE_USER) || !(defined(_NTIFS_))
#if defined(USE_LPC6432)
#define LPC_CLIENT_ID CLIENT_ID64
#define LPC_SIZE_T ULONGLONG
@ -104,11 +103,98 @@ typedef struct _REMOTE_PORT_VIEW
LPC_PVOID ViewBase;
} REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
/* FIXME: USE REAL DEFINITION */
typedef struct _LPC_MAX_MESSAGE
typedef struct _LPCP_MESSAGE
{
PORT_MESSAGE Header;
BYTE Data[MAX_MESSAGE_DATA];
} LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE;
UCHAR Data[0x14];
PORT_MESSAGE Request;
} LPCP_MESSAGE;
typedef struct _LPCP_CONNECTION_MESSAGE
{
UCHAR Data[0x2C];
} LPCP_CONNECTION_MESSAGE;
/* Kernel-Mode Structures */
#else
typedef struct _LPCP_NONPAGED_PORT_QUEUE
{
KSEMAPHORE Semaphore;
struct _LPCP_PORT_OBJECT *BackPointer;
} LPCP_NONPAGED_PORT_QUEUE, *PLPCP_NONPAGED_PORT_QUEUE;
typedef struct _LPCP_PORT_QUEUE
{
PLPCP_NONPAGED_PORT_QUEUE NonPagedPortQueue;
KSEMAPHORE Semaphore;
LIST_ENTRY ReceiveHead;
} LPCP_PORT_QUEUE, *PLPCP_PORT_QUEUE;
#ifdef _NTIFS_
typedef struct _LPCP_PORT_OBJECT
{
ULONG Length;
ULONG Flags;
struct _LPCP_PORT_OBJECT *ConnectionPort;
struct _LPCP_PORT_OBJECT *ConnectedPort;
LPCP_PORT_QUEUE MsgQueue;
CLIENT_ID Creator;
PVOID ClientSectionBase;
PVOID ServerSectionBase;
PVOID PortContext;
ULONG MaxMessageLength;
ULONG MaxConnectionInfoLength;
PETHREAD ClientThread;
SECURITY_QUALITY_OF_SERVICE SecurityQos;
SECURITY_CLIENT_CONTEXT StaticSecurity;
LIST_ENTRY LpcReplyChainHead;
LIST_ENTRY LpcDataInfoChainHead;
} LPCP_PORT_OBJECT, *PLPCP_PORT_OBJECT;
typedef struct _LPCP_MESSAGE
{
union
{
LIST_ENTRY Entry;
struct
{
SINGLE_LIST_ENTRY FreeEntry;
ULONG Reserved0;
};
};
PLPCP_PORT_OBJECT SenderPort;
PETHREAD RepliedToThread;
PVOID PortContext;
PORT_MESSAGE Request;
} LPCP_MESSAGE, *PLPCP_MESSAGE;
typedef struct _LPCP_CONNECTION_MESSAGE
{
PORT_VIEW ClientView;
PLPCP_PORT_OBJECT ClientPort;
PVOID SectionToMap;
REMOTE_PORT_VIEW ServerView;
} LPCP_CONNECTION_MESSAGE, *PLPCP_CONNECTION_MESSAGE;
#endif
#endif
/* CONSTANTS *****************************************************************/
#define PORT_MAXIMUM_MESSAGE_LENGTH 256
#define LPCP_MAX_MESSAGE_SIZE \
ROUND_UP(PORT_MAXIMUM_MESSAGE_LENGTH + \
sizeof(LPCP_MESSAGE) + \
sizeof(LPCP_CONNECTION_MESSAGE), 16)
#define LPC_MAX_MESSAGE_LENGTH \
(LPCP_MAX_MESSAGE_SIZE - \
FIELD_OFFSET(LPCP_MESSAGE, Request))
#define LPC_MAX_DATA_LENGTH \
(LPC_MAX_MESSAGE_LENGTH - \
sizeof(PORT_MESSAGE) - \
sizeof(LPCP_CONNECTION_MESSAGE))
#endif

View file

@ -13,6 +13,9 @@
#include <stdarg.h>
#include <excpt.h>
/* Helper Header */
#include <helper.h>
/* Kernel-Mode NDK */
#ifndef NTOS_MODE_USER
#include "kdtypes.h" /* Kernel Debugger Types */
@ -27,7 +30,6 @@
#include "iofuncs.h" /* Input/Output Manager Functions */
#include "ketypes.h" /* Kernel Types */
#include "kefuncs.h" /* Kernel Functions */
#include "lpctypes.h" /* Local Procedure Call Types */
#include "mmtypes.h" /* Memory Manager Types */
#include "mmfuncs.h" /* Memory Manager Functions */
#include "obtypes.h" /* Object Manager Types */
@ -45,6 +47,7 @@
/* Shared NDK */
#include "ldrfuncs.h" /* Loader Functions */
#include "ldrtypes.h" /* Loader Types */
#include "lpctypes.h" /* Local Procedure Call Types */
#include "pstypes.h" /* Process Manager Types */
#include "rtltypes.h" /* Runtime Library Types */
#include "rtlfuncs.h" /* Runtime Library Functions */

View file

@ -1,6 +1,7 @@
#ifndef _HELPER_H
#define _HELPER_H
/* FIXME: clean this mess up and move to NDK */
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
#define ROUND_UP ROUNDUP

View file

@ -411,19 +411,19 @@ typedef struct
} CSRSS_GET_INPUT_WAIT_HANDLE, *PCSRSS_GET_INPUT_WAIT_HANDLE;
#define CSRSS_MAX_WRITE_CONSOLE \
(MAX_MESSAGE_DATA - sizeof(ULONG) - sizeof(CSRSS_WRITE_CONSOLE))
(LPC_MAX_DATA_LENGTH - sizeof(ULONG) - sizeof(CSRSS_WRITE_CONSOLE))
#define CSRSS_MAX_SET_TITLE (MAX_MESSAGE_DATA - sizeof( HANDLE ) - sizeof( DWORD ) - sizeof( ULONG ) - LPC_MESSAGE_BASE_SIZE)
#define CSRSS_MAX_SET_TITLE (LPC_MAX_DATA_LENGTH - sizeof( HANDLE ) - sizeof( DWORD ) - sizeof( ULONG ) - sizeof(PORT_MESSAGE))
#define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR (MAX_MESSAGE_DATA - sizeof( ULONG ) - sizeof( CSRSS_WRITE_CONSOLE_OUTPUT_CHAR ))
#define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR (LPC_MAX_DATA_LENGTH - sizeof( ULONG ) - sizeof( CSRSS_WRITE_CONSOLE_OUTPUT_CHAR ))
#define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB ((MAX_MESSAGE_DATA - sizeof( ULONG ) - sizeof( CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB )) / 2)
#define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB ((LPC_MAX_DATA_LENGTH - sizeof( ULONG ) - sizeof( CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB )) / 2)
#define CSRSS_MAX_READ_CONSOLE (MAX_MESSAGE_DATA - sizeof( ULONG ) - sizeof( CSRSS_READ_CONSOLE ))
#define CSRSS_MAX_READ_CONSOLE (LPC_MAX_DATA_LENGTH - sizeof( ULONG ) - sizeof( CSRSS_READ_CONSOLE ))
#define CSRSS_MAX_READ_CONSOLE_OUTPUT_CHAR (MAX_MESSAGE_DATA - sizeof(ULONG) - sizeof(HANDLE) - sizeof(DWORD) - sizeof(CSRSS_READ_CONSOLE_OUTPUT_CHAR))
#define CSRSS_MAX_READ_CONSOLE_OUTPUT_CHAR (LPC_MAX_DATA_LENGTH - sizeof(ULONG) - sizeof(HANDLE) - sizeof(DWORD) - sizeof(CSRSS_READ_CONSOLE_OUTPUT_CHAR))
#define CSRSS_MAX_READ_CONSOLE_OUTPUT_ATTRIB (MAX_MESSAGE_DATA - sizeof(ULONG) - sizeof(HANDLE) - sizeof(DWORD) - sizeof(CSRSS_READ_CONSOLE_OUTPUT_ATTRIB))
#define CSRSS_MAX_READ_CONSOLE_OUTPUT_ATTRIB (LPC_MAX_DATA_LENGTH - sizeof(ULONG) - sizeof(HANDLE) - sizeof(DWORD) - sizeof(CSRSS_READ_CONSOLE_OUTPUT_ATTRIB))
/* WCHARs, not bytes! */
#define CSRSS_MAX_TITLE_LENGTH 80
@ -485,7 +485,7 @@ typedef struct
#define GET_PROCESS_LIST (0x36)
/* Keep in sync with definition below. */
#define CSRSS_HEADER_SIZE (LPC_MESSAGE_BASE_SIZE + sizeof(ULONG) + sizeof(NTSTATUS))
#define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS))
typedef struct _CSR_API_MESSAGE
{
@ -494,7 +494,7 @@ typedef struct _CSR_API_MESSAGE
PORT_MESSAGE Header;
struct
{
BYTE HeaderReserved[LPC_MESSAGE_BASE_SIZE];
BYTE HeaderReserved[sizeof(PORT_MESSAGE)];
ULONG Type;
NTSTATUS Status;
union

View file

@ -98,7 +98,7 @@ typedef union _LSASS_REQUEST
{
PORT_MESSAGE Header;
struct {
UCHAR LpcHeader[LPC_MESSAGE_BASE_SIZE];
UCHAR LpcHeader[sizeof(PORT_MESSAGE)];
ULONG Type;
union
{

View file

@ -112,7 +112,7 @@ typedef union _SM_PORT_MESSAGE
/*** LPC common header ***/
PORT_MESSAGE Header;
struct {
UCHAR LpcHeader[LPC_MESSAGE_BASE_SIZE];
UCHAR LpcHeader[sizeof(PORT_MESSAGE)];
/*** SM common header ***/
struct {
DWORD ApiIndex;

View file

@ -19,7 +19,7 @@ InitializeLsaPort(VOID)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING PortName;
LPC_MAX_MESSAGE Request;
PORT_MESSAGE Request;
NTSTATUS Status;
ConnectPortHandle = NULL;
@ -46,7 +46,7 @@ InitializeLsaPort(VOID)
}
Status = NtListenPort(ConnectPortHandle,
&Request.Header);
&Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtListenPort() failed (Status %lx)\n", Status);
@ -89,7 +89,7 @@ ByeBye:
static NTSTATUS
ProcessPortMessage(VOID)
{
LPC_MAX_MESSAGE Request;
PORT_MESSAGE Request;
// LPC_MAX_MESSAGE Reply;
NTSTATUS Status;
@ -103,7 +103,7 @@ ProcessPortMessage(VOID)
Status = NtReplyWaitReceivePort(MessagePortHandle,
0,
NULL,
&Request.Header);
&Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtReplyWaitReceivePort() failed (Status %lx)\n", Status);
@ -112,18 +112,18 @@ ProcessPortMessage(VOID)
DPRINT("Received message\n");
if (Request.Header.u2.s2.Type == LPC_PORT_CLOSED)
if (Request.u2.s2.Type == LPC_PORT_CLOSED)
{
DPRINT("Port closed\n");
// return STATUS_UNSUCCESSFUL;
}
if (Request.Header.u2.s2.Type == LPC_REQUEST)
if (Request.u2.s2.Type == LPC_REQUEST)
{
DPRINT("Received request\n");
}
else if (Request.Header.u2.s2.Type == LPC_DATAGRAM)
else if (Request.u2.s2.Type == LPC_DATAGRAM)
{
DPRINT("Received datagram\n");

View file

@ -81,7 +81,7 @@ CsrClientCallServer(PCSR_API_MESSAGE Request,
/* Fill out the header */
Request->Type = ApiNumber;
Request->Header.u1.s1.DataLength = RequestLength - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = RequestLength - sizeof(PORT_MESSAGE);
Request->Header.u1.s1.TotalLength = RequestLength;
DPRINT("CSR: API: %x, u1.s1.DataLength: %x, u1.s1.TotalLength: %x\n",
ApiNumber,

View file

@ -192,7 +192,7 @@ RtlCreateUserThread(HANDLE ProcessHandle,
OBJECT_ATTRIBUTES ObjectAttributes;
CONTEXT Context;
DPRINT("RtlCreateUserThread: (hProcess: %lx, Suspended: %lx,"
DPRINT1("RtlCreateUserThread: (hProcess: %lx, Suspended: %lx,"
"ZeroBits: %lx, StackReserve: %lx, StackCommit: %lx,"
"StartAddress: %p, Parameter: %lx)\n", ProcessHandle,
CreateSuspended, StackZeroBits, StackReserve, StackCommit,

View file

@ -75,18 +75,18 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle,
{
PLSASS_REQUEST Request;
PLSASS_REPLY Reply;
UCHAR RawRequest[MAX_MESSAGE_DATA];
UCHAR RawReply[MAX_MESSAGE_DATA];
LSASS_REQUEST RawRequest;
LSASS_REPLY RawReply;
NTSTATUS Status;
ULONG OutBufferSize;
Request = (PLSASS_REQUEST)RawRequest;
Reply = (PLSASS_REPLY)RawReply;
Request = (PLSASS_REQUEST)&RawRequest;
Reply = (PLSASS_REPLY)&RawReply;
Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + SubmitBufferLength -
LPC_MESSAGE_BASE_SIZE;
sizeof(PORT_MESSAGE);
Request->Header.u1.s1.TotalLength =
Request->Header.u1.s1.DataLength + LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength + sizeof(PORT_MESSAGE);
Request->Type = LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE;
Request->d.CallAuthenticationPackageRequest.AuthenticationPackage =
AuthenticationPackage;
@ -142,14 +142,14 @@ LsaLookupAuthenticationPackage(HANDLE LsaHandle,
{
NTSTATUS Status;
PLSASS_REQUEST Request;
UCHAR RawRequest[MAX_MESSAGE_DATA];
LSASS_REQUEST RawRequest;
LSASS_REPLY Reply;
Request = (PLSASS_REQUEST)RawRequest;
Request = (PLSASS_REQUEST)&RawRequest;
Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + PackageName->Length -
LPC_MESSAGE_BASE_SIZE;
sizeof(PORT_MESSAGE);
Request->Header.u1.s1.TotalLength = Request->Header.u1.s1.DataLength +
LPC_MESSAGE_BASE_SIZE;
sizeof(PORT_MESSAGE);
Request->Type = LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE;
Status = NtRequestWaitReplyPort(LsaHandle,
@ -192,23 +192,23 @@ LsaLogonUser(HANDLE LsaHandle,
ULONG RequestLength;
ULONG CurrentLength;
PLSASS_REQUEST Request;
UCHAR RawMessage[MAX_MESSAGE_DATA];
LSASS_REQUEST RawMessage;
PLSASS_REPLY Reply;
UCHAR RawReply[MAX_MESSAGE_DATA];
LSASS_REPLY RawReply;
NTSTATUS Status;
RequestLength = sizeof(LSASS_REQUEST) - LPC_MESSAGE_BASE_SIZE;
RequestLength = sizeof(LSASS_REQUEST) - sizeof(PORT_MESSAGE);
RequestLength = RequestLength + (OriginName->Length * sizeof(WCHAR));
RequestLength = RequestLength + AuthenticationInformationLength;
RequestLength = RequestLength +
(LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
CurrentLength = 0;
Request = (PLSASS_REQUEST)RawMessage;
Request = (PLSASS_REQUEST)&RawMessage;
Request->d.LogonUserRequest.OriginNameLength = OriginName->Length;
Request->d.LogonUserRequest.OriginName = (PWSTR)&RawMessage[CurrentLength];
memcpy((PWSTR)&RawMessage[CurrentLength],
Request->d.LogonUserRequest.OriginName = (PWSTR)&RawMessage + CurrentLength;
memcpy((PWSTR)&RawMessage + CurrentLength,
OriginName->Buffer,
OriginName->Length * sizeof(WCHAR));
CurrentLength = CurrentLength + (OriginName->Length * sizeof(WCHAR));
@ -219,28 +219,28 @@ LsaLogonUser(HANDLE LsaHandle,
AuthenticationPackage;
Request->d.LogonUserRequest.AuthenticationInformation =
(PVOID)&RawMessage[CurrentLength];
(PVOID)((ULONG_PTR)&RawMessage + CurrentLength);
Request->d.LogonUserRequest.AuthenticationInformationLength =
AuthenticationInformationLength;
memcpy((PVOID)&RawMessage[CurrentLength],
memcpy((PVOID)((ULONG_PTR)&RawMessage + CurrentLength),
AuthenticationInformation,
AuthenticationInformationLength);
CurrentLength = CurrentLength + AuthenticationInformationLength;
Request->d.LogonUserRequest.LocalGroupsCount = LocalGroups->GroupCount;
Request->d.LogonUserRequest.LocalGroups =
(PSID_AND_ATTRIBUTES)&RawMessage[CurrentLength];
memcpy((PSID_AND_ATTRIBUTES)&RawMessage[CurrentLength],
(PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength;
memcpy((PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength,
LocalGroups->Groups,
LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
Request->d.LogonUserRequest.SourceContext = *SourceContext;
Request->Type = LSASS_REQUEST_LOGON_USER;
Request->Header.u1.s1.DataLength = RequestLength - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.TotalLength = RequestLength + LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = RequestLength - sizeof(PORT_MESSAGE);
Request->Header.u1.s1.TotalLength = RequestLength + sizeof(PORT_MESSAGE);
Reply = (PLSASS_REPLY)RawReply;
Reply = (PLSASS_REPLY)&RawReply;
Status = NtRequestWaitReplyPort(LsaHandle,
&Request->Header,
@ -304,7 +304,7 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName,
Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS;
Request.Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) -
LPC_MESSAGE_BASE_SIZE;
sizeof(PORT_MESSAGE);
Request.Header.u1.s1.TotalLength = sizeof(LSASS_REQUEST);
Request.d.RegisterLogonProcessRequest.Length = LsaLogonProcessName->Length;

View file

@ -88,7 +88,6 @@ typedef struct _QUEUEDMESSAGE
PEPORT Sender;
LIST_ENTRY QueueListEntry;
PORT_MESSAGE Message;
UCHAR MessageData [MAX_MESSAGE_DATA];
} QUEUEDMESSAGE, *PQUEUEDMESSAGE;
typedef struct _LPC_DBG_MESSAGE

View file

@ -159,7 +159,7 @@ static VOID STDCALL
IopLogWorker (PVOID Parameter)
{
PERROR_LOG_ENTRY LogEntry;
PLPC_MAX_MESSAGE Request;
PPORT_MESSAGE Request;
PIO_ERROR_LOG_MESSAGE Message;
PIO_ERROR_LOG_PACKET Packet;
KIRQL Irql;
@ -249,7 +249,7 @@ IopLogWorker (PVOID Parameter)
/* Allocate request buffer */
Request = ExAllocatePool (NonPagedPool,
sizeof(LPC_MAX_MESSAGE));
sizeof(PORT_MESSAGE) + PORT_MAXIMUM_MESSAGE_LENGTH);
if (Request == NULL)
{
DPRINT ("Failed to allocate request buffer!\n");
@ -264,7 +264,7 @@ IopLogWorker (PVOID Parameter)
}
/* Initialize the log message */
Message = (PIO_ERROR_LOG_MESSAGE)Request->Data;
Message = (PIO_ERROR_LOG_MESSAGE)(Request + 1);
Message->Type = IO_TYPE_ERROR_MESSAGE;
Message->Size =
sizeof(IO_ERROR_LOG_MESSAGE) - sizeof(IO_ERROR_LOG_PACKET) +
@ -285,13 +285,13 @@ IopLogWorker (PVOID Parameter)
DPRINT ("SequenceNumber %lx\n", Packet->SequenceNumber);
Request->Header.u1.s1.DataLength = Message->Size;
Request->Header.u1.s1.TotalLength =
Request->Header.u1.s1.DataLength + sizeof(PPORT_MESSAGE);
Request->u1.s1.DataLength = Message->Size;
Request->u1.s1.TotalLength =
Request->u1.s1.DataLength + sizeof(PPORT_MESSAGE);
/* Send the error message to the log port */
Status = ZwRequestPort (IopLogPort,
&Request->Header);
Request);
/* Release request buffer */
ExFreePool (Request);

View file

@ -292,7 +292,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
KeDetachProcess();
}
if (LpcRequestMessageSize > (sizeof(PORT_MESSAGE) + MAX_MESSAGE_DATA))
if (LpcRequestMessageSize > LPC_MAX_MESSAGE_LENGTH)
{
if (NULL != AttachedProcess)
{
@ -347,7 +347,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
LpcRequestDataSize = LpcRequest->u1.s1.DataLength;
}
if (LpcRequestMessageSize > (sizeof(PORT_MESSAGE) + MAX_MESSAGE_DATA))
if (LpcRequestMessageSize > LPC_MAX_MESSAGE_LENGTH)
{
ExFreePool(LpcRequest);
if (NULL != AttachedProcess)

View file

@ -2,6 +2,11 @@
#ifndef __EVENTLOG_H__
#define __EVENTLOG_H__
typedef struct _IO_ERROR_LPC
{
PORT_MESSAGE Header;
IO_ERROR_LOG_MESSAGE Message;
} IO_ERROR_LPC, *PIO_ERROR_LPC;
BOOL
StartPortThread(VOID);

View file

@ -50,7 +50,7 @@ InitLogPort(VOID)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING PortName;
LPC_MAX_MESSAGE Request;
PORT_MESSAGE Request;
NTSTATUS Status;
ConnectPortHandle = NULL;
@ -76,7 +76,7 @@ InitLogPort(VOID)
}
Status = NtListenPort(ConnectPortHandle,
&Request.Header);
&Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtListenPort() failed (Status %lx)\n", Status);
@ -115,11 +115,10 @@ ByeBye:
return Status;
}
static NTSTATUS
ProcessPortMessage(VOID)
{
LPC_MAX_MESSAGE Request;
IO_ERROR_LPC Request;
PIO_ERROR_LOG_MESSAGE Message;
//#ifndef NDEBUG
ULONG i;
@ -162,7 +161,7 @@ ProcessPortMessage(VOID)
DPRINT("Received datagram\n");
Message = (PIO_ERROR_LOG_MESSAGE)&Request.Data;
Message = (PIO_ERROR_LOG_MESSAGE)&Request.Message;
DPRINT("Message->Type %hx\n", Message->Type);
DPRINT("Message->Size %hu\n", Message->Size);

View file

@ -194,7 +194,7 @@ CSR_API(CsrCreateProcess)
PCSRSS_PROCESS_DATA NewProcessData;
NTSTATUS Status;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
NewProcessData = CsrCreateProcessData(Request->Data.CreateProcessRequest.NewProcessId);
@ -224,7 +224,7 @@ CSR_API(CsrCreateProcess)
CSR_API(CsrTerminateProcess)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE);
if (ProcessData == NULL)
@ -239,7 +239,7 @@ CSR_API(CsrTerminateProcess)
CSR_API(CsrConnectProcess)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Status = STATUS_SUCCESS;
@ -249,7 +249,7 @@ CSR_API(CsrConnectProcess)
CSR_API(CsrGetShutdownParameters)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL)
{
@ -267,7 +267,7 @@ CSR_API(CsrGetShutdownParameters)
CSR_API(CsrSetShutdownParameters)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL)
{
@ -285,7 +285,7 @@ CSR_API(CsrSetShutdownParameters)
CSR_API(CsrGetInputHandle)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL)
{
@ -310,7 +310,7 @@ CSR_API(CsrGetInputHandle)
CSR_API(CsrGetOutputHandle)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL)
{
@ -337,7 +337,7 @@ CSR_API(CsrGetOutputHandle)
CSR_API(CsrCloseHandle)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL)
{
@ -353,7 +353,7 @@ CSR_API(CsrCloseHandle)
CSR_API(CsrVerifyHandle)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Status = CsrVerifyObject(ProcessData, Request->Data.VerifyHandleRequest.Handle);
if (!NT_SUCCESS(Request->Status))
@ -369,7 +369,7 @@ CSR_API(CsrDuplicateHandle)
Object_t *Object;
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
ProcessData = CsrGetProcessData(Request->Data.DuplicateHandleRequest.ProcessId);
Request->Status = CsrGetObject(ProcessData, Request->Data.DuplicateHandleRequest.Handle, &Object);
@ -389,7 +389,7 @@ CSR_API(CsrDuplicateHandle)
CSR_API(CsrGetInputWaitHandle)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL)
{

View file

@ -27,7 +27,7 @@ CSR_API(CsrRegisterServicesProcess)
NTSTATUS Status;
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ServicesProcessIdValid == TRUE)
{

View file

@ -97,7 +97,7 @@ CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData,
{
DPRINT1("CSR: Unknown request type 0x%x\n", Request->Type);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Status = STATUS_INVALID_SYSTEM_SERVICE;
}
}
@ -108,8 +108,7 @@ STDCALL
ClientConnectionThread(HANDLE ServerPort)
{
NTSTATUS Status;
LPC_MAX_MESSAGE LpcRequest;
PCSR_API_MESSAGE Request;
CSR_API_MESSAGE Request;
PCSR_API_MESSAGE Reply;
PCSRSS_PROCESS_DATA ProcessData;
@ -125,7 +124,7 @@ ClientConnectionThread(HANDLE ServerPort)
Status = NtReplyWaitReceivePort(ServerPort,
0,
&Reply->Header,
&LpcRequest.Header);
&Request.Header);
if (!NT_SUCCESS(Status))
{
DPRINT1("CSR: NtReplyWaitReceivePort failed\n");
@ -133,34 +132,31 @@ ClientConnectionThread(HANDLE ServerPort)
}
/* If the connection was closed, handle that */
if (LpcRequest.Header.u2.s2.Type == LPC_PORT_CLOSED)
if (Request.Header.u2.s2.Type == LPC_PORT_CLOSED)
{
CsrFreeProcessData( LpcRequest.Header.ClientId.UniqueProcess );
CsrFreeProcessData( Request.Header.ClientId.UniqueProcess );
break;
}
/* Get the CSR Message */
Request = (PCSR_API_MESSAGE)&LpcRequest;
DPRINT("CSR: Got CSR API: %x [Message Origin: %x]\n",
Request->Type,
Request->Header.ClientId.UniqueProcess);
Request.Type,
Request.Header.ClientId.UniqueProcess);
/* Get the Process Data */
ProcessData = CsrGetProcessData(LpcRequest.Header.ClientId.UniqueProcess);
ProcessData = CsrGetProcessData(Request.Header.ClientId.UniqueProcess);
if (ProcessData == NULL)
{
DPRINT1("CSR: Message %d: Unable to find data for process 0x%x\n",
LpcRequest.Header.u2.s2.Type,
LpcRequest.Header.ClientId.UniqueProcess);
Request.Header.u2.s2.Type,
Request.Header.ClientId.UniqueProcess);
break;
}
/* Call the Handler */
CsrApiCallHandler(ProcessData, Request);
CsrApiCallHandler(ProcessData, &Request);
/* Send back the reply */
Reply = Request;
Reply = &Request;
}
/* Close the port and exit the thread */
@ -180,7 +176,7 @@ DWORD STDCALL
ServerApiPortThread (PVOID PortHandle)
{
NTSTATUS Status = STATUS_SUCCESS;
LPC_MAX_MESSAGE Request;
PORT_MESSAGE Request;
HANDLE hApiListenPort = * (PHANDLE) PortHandle;
HANDLE ServerPort = (HANDLE) 0;
HANDLE ServerThread = (HANDLE) 0;
@ -195,7 +191,7 @@ ServerApiPortThread (PVOID PortHandle)
REMOTE_PORT_VIEW LpcRead;
ServerPort = NULL;
Status = NtListenPort (hApiListenPort, & Request.Header);
Status = NtListenPort (hApiListenPort, &Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("CSR: NtListenPort() failed\n");
@ -213,11 +209,11 @@ ServerApiPortThread (PVOID PortHandle)
break;
}
ProcessData = CsrCreateProcessData(Request.Header.ClientId.UniqueProcess);
ProcessData = CsrCreateProcessData(Request.ClientId.UniqueProcess);
if (ProcessData == NULL)
{
DPRINT1("Unable to allocate or find data for process 0x%x\n",
Request.Header.ClientId.UniqueProcess);
Request.ClientId.UniqueProcess);
Status = STATUS_UNSUCCESSFUL;
break;
}
@ -273,14 +269,14 @@ ServerSbApiPortThread (PVOID PortHandle)
{
HANDLE hSbApiPortListen = * (PHANDLE) PortHandle;
HANDLE hConnectedPort = (HANDLE) 0;
LPC_MAX_MESSAGE Request;
PORT_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);
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
Status = NtListenPort (hSbApiPortListen, & Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("CSR: %s: NtListenPort(SB) failed (Status=0x%08lx)\n",
@ -324,19 +320,19 @@ DPRINT("-- 4\n");
Status = NtReplyWaitReceivePort(hConnectedPort,
Context,
Reply,
& Request.Header);
& Request);
if(!NT_SUCCESS(Status))
{
DPRINT1("CSR: %s: NtReplyWaitReceivePort failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
break;
}
switch (Request.Header.u2.s2.Type)//fix .h PORT_MESSAGE_TYPE(Request))
switch (Request.u2.s2.Type)//fix .h PORT_MESSAGE_TYPE(Request))
{
/* TODO */
default:
DPRINT1("CSR: %s received message (type=%d)\n",
__FUNCTION__, Request.Header.u2.s2.Type);
__FUNCTION__, Request.u2.s2.Type);
}
DPRINT("-- 5\n");
}

View file

@ -228,7 +228,7 @@ CSR_API(CsrAllocConsole)
DPRINT("CsrAllocConsole\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL)
{
@ -357,7 +357,7 @@ CSR_API(CsrFreeConsole)
DPRINT("CsrFreeConsole\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ProcessData == NULL || ProcessData->Console == NULL)
{
@ -562,7 +562,7 @@ CSR_API(CsrReadConsole)
/* truncate length to CSRSS_MAX_READ_CONSOLE_REQUEST */
nNumberOfCharsToRead = min(Request->Data.ReadConsoleRequest.NrCharactersToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
Buffer = Request->Data.ReadConsoleRequest.Buffer;
UnicodeBuffer = (PWCHAR)Buffer;
@ -927,13 +927,13 @@ CSR_API(CsrWriteConsole)
{
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
return Request->Status = STATUS_INVALID_PARAMETER;
}
Status = ConioConsoleFromProcessData(ProcessData, &Console);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (! NT_SUCCESS(Status))
{
@ -1431,7 +1431,7 @@ CSR_API(CsrGetScreenBufferInfo)
DPRINT("CsrGetScreenBufferInfo\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ScreenBufferInfoRequest.ConsoleHandle, &Buff);
if (! NT_SUCCESS(Status))
@ -1474,7 +1474,7 @@ CSR_API(CsrSetCursor)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetCursorRequest.ConsoleHandle, &Buff);
if (! NT_SUCCESS(Status))
@ -1562,13 +1562,13 @@ CSR_API(CsrWriteConsoleOutputChar)
{
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
return Request->Status = STATUS_INVALID_PARAMETER;
}
Status = ConioConsoleFromProcessData(ProcessData, &Console);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (NT_SUCCESS(Status))
{
if(Request->Data.WriteConsoleOutputCharRequest.Unicode)
@ -1660,7 +1660,7 @@ CSR_API(CsrFillOutputChar)
DPRINT("CsrFillOutputChar\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
@ -1729,7 +1729,7 @@ CSR_API(CsrReadInputEvent)
DPRINT("CsrReadInputEvent\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Data.ReadInputRequest.Event = ProcessData->ConsoleEvent;
Status = ConioLockConsole(ProcessData, Request->Data.ReadInputRequest.ConsoleHandle, &Console);
@ -1814,13 +1814,13 @@ CSR_API(CsrWriteConsoleOutputAttrib)
{
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
return Request->Status = STATUS_INVALID_PARAMETER;
}
Status = ConioConsoleFromProcessData(ProcessData, &Console);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (! NT_SUCCESS(Status))
{
return Request->Status = Status;
@ -1897,7 +1897,7 @@ CSR_API(CsrFillOutputAttrib)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData, Request->Data.FillOutputAttribRequest.ConsoleHandle, &Buff);
if (! NT_SUCCESS(Status))
{
@ -1953,7 +1953,7 @@ CSR_API(CsrGetCursorInfo)
DPRINT("CsrGetCursorInfo\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData, Request->Data.GetCursorInfoRequest.ConsoleHandle, &Buff);
if (! NT_SUCCESS(Status))
@ -1977,7 +1977,7 @@ CSR_API(CsrSetCursorInfo)
DPRINT("CsrSetCursorInfo\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
@ -2085,7 +2085,7 @@ CSR_API(CsrSetConsoleMode)
DPRINT("CsrSetConsoleMode\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = Win32CsrGetObject(ProcessData,
Request->Data.SetConsoleModeRequest.ConsoleHandle,
(Object_t **) &Console);
@ -2122,7 +2122,7 @@ CSR_API(CsrGetConsoleMode)
DPRINT("CsrGetConsoleMode\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = Win32CsrGetObject(ProcessData, Request->Data.GetConsoleModeRequest.ConsoleHandle,
(Object_t **) &Console);
if (! NT_SUCCESS(Status))
@ -2171,7 +2171,7 @@ CSR_API(CsrCreateScreenBuffer)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Buff = HeapAlloc(Win32CsrApiHeap, 0, sizeof(CSRSS_SCREEN_BUFFER));
if (NULL == Buff)
@ -2214,7 +2214,7 @@ CSR_API(CsrSetScreenBuffer)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetScreenBufferRequest.OutputHandle, &Buff);
if (! NT_SUCCESS(Status))
@ -2261,13 +2261,13 @@ CSR_API(CsrSetTitle)
{
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
return Request->Status = STATUS_INVALID_PARAMETER;
}
Status = ConioLockConsole(ProcessData, Request->Data.SetTitleRequest.Console, &Console);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if(! NT_SUCCESS(Status))
{
Request->Status = Status;
@ -2299,7 +2299,7 @@ CSR_API(CsrGetTitle)
DPRINT("CsrGetTitle\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockConsole(ProcessData,
Request->Data.GetTitleRequest.ConsoleHandle,
&Console);
@ -2347,7 +2347,7 @@ CSR_API(CsrWriteConsoleOutput)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.WriteConsoleOutputRequest.ConsoleHandle,
&Buff);
@ -2440,7 +2440,7 @@ CSR_API(CsrFlushInputBuffer)
DPRINT("CsrFlushInputBuffer\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockConsole(ProcessData,
Request->Data.FlushInputBufferRequest.ConsoleInput,
&Console);
@ -2492,7 +2492,7 @@ CSR_API(CsrScrollConsoleScreenBuffer)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData, ConsoleHandle, &Buff);
if (! NT_SUCCESS(Status))
{
@ -2592,7 +2592,7 @@ CSR_API(CsrReadConsoleOutputChar)
DPRINT("CsrReadConsoleOutputChar\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
ReadBuffer = Request->Data.ReadConsoleOutputCharRequest.String;
CharSize = (Request->Data.ReadConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
@ -2668,7 +2668,7 @@ CSR_API(CsrReadConsoleOutputAttrib)
DPRINT("CsrReadConsoleOutputAttrib\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
ReadBuffer = Request->Data.ReadConsoleOutputAttribRequest.String;
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputAttribRequest.ConsoleHandle, &Buff);
@ -2724,7 +2724,7 @@ CSR_API(CsrGetNumberOfConsoleInputEvents)
DPRINT("CsrGetNumberOfConsoleInputEvents\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
Status = ConioLockConsole(ProcessData, Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console);
if (! NT_SUCCESS(Status))
@ -2769,7 +2769,7 @@ CSR_API(CsrPeekConsoleInput)
DPRINT("CsrPeekConsoleInput\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockConsole(ProcessData, Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console);
if(! NT_SUCCESS(Status))
@ -2847,7 +2847,7 @@ CSR_API(CsrReadConsoleOutput)
DPRINT("CsrReadConsoleOutput\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputRequest.ConsoleHandle, &Buff);
if (! NT_SUCCESS(Status))
@ -2936,7 +2936,7 @@ CSR_API(CsrWriteConsoleInput)
DPRINT("CsrWriteConsoleInput\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockConsole(ProcessData, Request->Data.WriteConsoleInputRequest.ConsoleHandle, &Console);
if (! NT_SUCCESS(Status))
@ -3027,7 +3027,7 @@ CSR_API(CsrHardwareStateProperty)
DPRINT("CsrHardwareStateProperty\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioLockConsole(ProcessData,
Request->Data.ConsoleHardwareStateRequest.ConsoleHandle,
@ -3067,7 +3067,7 @@ CSR_API(CsrGetConsoleWindow)
DPRINT("CsrGetConsoleWindow\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
@ -3089,7 +3089,7 @@ CSR_API(CsrSetConsoleIcon)
DPRINT("CsrSetConsoleIcon\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
@ -3118,7 +3118,7 @@ CSR_API(CsrGetConsoleCodePage)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Data.GetConsoleCodePage.CodePage = Console->CodePage;
ConioUnlockConsole(Console);
return Request->Status = STATUS_SUCCESS;
@ -3138,7 +3138,7 @@ CSR_API(CsrSetConsoleCodePage)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (IsValidCodePage(Request->Data.SetConsoleCodePage.CodePage))
{
Console->CodePage = Request->Data.SetConsoleCodePage.CodePage;
@ -3163,7 +3163,7 @@ CSR_API(CsrGetConsoleOutputCodePage)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Data.GetConsoleOutputCodePage.CodePage = Console->OutputCodePage;
ConioUnlockConsole(Console);
return Request->Status = STATUS_SUCCESS;
@ -3183,7 +3183,7 @@ CSR_API(CsrSetConsoleOutputCodePage)
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (IsValidCodePage(Request->Data.SetConsoleOutputCodePage.CodePage))
{
Console->OutputCodePage = Request->Data.SetConsoleOutputCodePage.CodePage;
@ -3207,7 +3207,7 @@ CSR_API(CsrGetProcessList)
Buffer = Request->Data.GetProcessListRequest.ProcessId;
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
nItems = nCopied = 0;
Request->Data.GetProcessListRequest.nProcessIdsCopied = 0;

View file

@ -202,7 +202,7 @@ CSR_API(CsrCreateDesktop)
DPRINT("CsrCreateDesktop\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (! BgInitialized)
{
@ -252,7 +252,7 @@ CSR_API(CsrShowDesktop)
DPRINT("CsrShowDesktop\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
nmh.hdr.hwndFrom = Request->Data.ShowDesktopRequest.DesktopWindow;
nmh.hdr.idFrom = 0;
@ -276,7 +276,7 @@ CSR_API(CsrHideDesktop)
DPRINT("CsrHideDesktop\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
nmh.hdr.hwndFrom = Request->Data.ShowDesktopRequest.DesktopWindow;
nmh.hdr.idFrom = 0;

View file

@ -19,7 +19,7 @@ static HANDLE LogonProcess = NULL;
CSR_API(CsrRegisterLogonProcess)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (Request->Data.RegisterLogonProcessRequest.Register)
{
@ -52,7 +52,7 @@ CSR_API(CsrSetLogonNotifyWindow)
DWORD WindowCreator;
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (0 == GetWindowThreadProcessId(Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow,
&WindowCreator))
@ -78,7 +78,7 @@ CSR_API(CsrSetLogonNotifyWindow)
CSR_API(CsrExitReactos)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (NULL == LogonNotifyWindow)
{

View file

@ -40,12 +40,12 @@ static VOID STDCALL
DbgSsApiPortThread (PVOID dummy)
{
NTSTATUS Status = STATUS_SUCCESS;
LPC_MAX_MESSAGE Request ;
PORT_MESSAGE Request ;
RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
while (TRUE)
{
Status = NtListenPort (DbgSsApiPort, & Request.Header);
Status = NtListenPort (DbgSsApiPort, & Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
@ -60,12 +60,12 @@ static VOID STDCALL
DbgUiApiPortThread (PVOID dummy)
{
NTSTATUS Status = STATUS_SUCCESS;
LPC_MAX_MESSAGE Request;
PORT_MESSAGE Request;
RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
while (TRUE)
{
Status = NtListenPort (DbgUiApiPort, & Request.Header);
Status = NtListenPort (DbgUiApiPort, & Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);

View file

@ -40,8 +40,8 @@ SM_PORT_API SmApi [] =
* with a macro) */
PSM_CONNECT_DATA FASTCALL SmpGetConnectData (PSM_PORT_MESSAGE Request)
{
PLPC_MAX_MESSAGE LpcMaxMessage = (PLPC_MAX_MESSAGE) Request;
return (PSM_CONNECT_DATA) & LpcMaxMessage->Data[0];
PPORT_MESSAGE PortMessage = (PPORT_MESSAGE) Request;
return (PSM_CONNECT_DATA)(PortMessage + 1);
}
#if !defined(__USE_NT_LPC__)
@ -127,7 +127,7 @@ SmpApiConnectedThread(PVOID pConnectedPort)
{
DPRINT("SM: %s: message received (type=%d)\n",
__FUNCTION__,
LPC_MESSAGE_TYPE(Request));
Request.Header.u2.s2.Type);
switch (Request.Header.u2.s2.Type)
{
@ -318,10 +318,10 @@ VOID STDCALL
SmpApiThread (HANDLE ListeningPort)
{
NTSTATUS Status = STATUS_SUCCESS;
LPC_MAX_MESSAGE Request;
SM_PORT_MESSAGE Request;
DPRINT("SM: %s called\n", __FUNCTION__);
RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
while (TRUE)
{
@ -331,7 +331,7 @@ SmpApiThread (HANDLE ListeningPort)
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
break;
}
Status = SmpHandleConnectionRequest ((PSM_PORT_MESSAGE) & Request);
Status = SmpHandleConnectionRequest (& Request);
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: SmpHandleConnectionRequest failed (Status=0x%08lx)\n",

View file

@ -110,8 +110,6 @@ char *option_as_string(unsigned int code, unsigned char *data, int len);
int fork_privchld(int, int);
int check_arp( struct interface_info *ip, struct client_lease *lp );
#define ROUNDUP(a) \
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
time_t scripttime;

View file

@ -54,7 +54,7 @@ CsrNotify(PCSR_API_MESSAGE Request)
return STATUS_INVALID_PORT_HANDLE;
}
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
/* Switch to the process in which the WindowsApiPort handle is valid */

View file

@ -1323,6 +1323,68 @@ typedef struct _RTL_SPLAY_LINKS {
struct _RTL_SPLAY_LINKS *RightChild;
} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
#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
{
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;
typedef struct _PORT_VIEW
{
ULONG Length;
LPC_HANDLE SectionHandle;
ULONG SectionOffset;
LPC_SIZE_T ViewSize;
LPC_PVOID ViewBase;
LPC_PVOID ViewRemoteBase;
} PORT_VIEW, *PPORT_VIEW;
typedef struct _REMOTE_PORT_VIEW
{
ULONG Length;
LPC_SIZE_T ViewSize;
LPC_PVOID ViewBase;
} REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
typedef struct _SE_EXPORTS {
LUID SeCreateTokenPrivilege;

View file

@ -23,11 +23,6 @@
#ifndef __PRNTFONT_H
#define __PRNTFONT_H
#ifndef TAG
#define TAG(_a, _b, _c, _d) (ULONG) \
(((_a) << 0) + ((_b) << 8) + ((_c) << 16) + ((_d) << 24))
#endif
#define UNIFM_VERSION_1_0 0x10000
#define UNI_GLYPHSETDATA_VERSION_1_0 0x10000