mirror of
https://github.com/reactos/reactos.git
synced 2024-08-21 02:43:48 +00:00
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:
parent
81fe025857
commit
9f1cf7b990
|
@ -35,8 +35,6 @@
|
||||||
#include <portio.h>
|
#include <portio.h>
|
||||||
#include <reactos.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")
|
#define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n")
|
||||||
|
|
||||||
extern BOOL UserInterfaceUp; /* Tells us if the user interface is displayed */
|
extern BOOL UserInterfaceUp; /* Tells us if the user interface is displayed */
|
||||||
|
|
|
@ -33,8 +33,45 @@ List:
|
||||||
Priority 4:
|
Priority 4:
|
||||||
- FIXED: Kernel and Memory Types are not architecture-specific (Eric) [ketypes.h, mmtypes.h]
|
- 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]
|
- 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:
|
Priority 5:
|
||||||
- LPC Types are totally wrong. [lpctypes.h]
|
- FIXED: LPC Types are totally wrong. (Alex) [lpctypes.h]
|
||||||
- Missing System Info Classes [zwtypes.h]
|
- Missing System Info Classes [zwtypes.h]
|
||||||
- FIXED: Process Priority Classes are messed up (Alex) [pstypes.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.
|
||||||
|
|
|
@ -9,18 +9,10 @@
|
||||||
#ifndef _LPCTYPES_H
|
#ifndef _LPCTYPES_H
|
||||||
#define _LPCTYPES_H
|
#define _LPCTYPES_H
|
||||||
|
|
||||||
#define LPC_MESSAGE_TYPE(m) ((m).Header.u2.s2.Type)
|
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* 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 **************************************************************/
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
typedef enum _LPC_TYPE
|
typedef enum _LPC_TYPE
|
||||||
|
@ -42,6 +34,13 @@ typedef enum _LPC_TYPE
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* 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)
|
#if defined(USE_LPC6432)
|
||||||
#define LPC_CLIENT_ID CLIENT_ID64
|
#define LPC_CLIENT_ID CLIENT_ID64
|
||||||
#define LPC_SIZE_T ULONGLONG
|
#define LPC_SIZE_T ULONGLONG
|
||||||
|
@ -104,11 +103,98 @@ typedef struct _REMOTE_PORT_VIEW
|
||||||
LPC_PVOID ViewBase;
|
LPC_PVOID ViewBase;
|
||||||
} REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
|
} REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
|
||||||
|
|
||||||
/* FIXME: USE REAL DEFINITION */
|
typedef struct _LPCP_MESSAGE
|
||||||
typedef struct _LPC_MAX_MESSAGE
|
|
||||||
{
|
{
|
||||||
PORT_MESSAGE Header;
|
UCHAR Data[0x14];
|
||||||
BYTE Data[MAX_MESSAGE_DATA];
|
PORT_MESSAGE Request;
|
||||||
} LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE;
|
} 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
|
#endif
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <excpt.h>
|
#include <excpt.h>
|
||||||
|
|
||||||
|
/* Helper Header */
|
||||||
|
#include <helper.h>
|
||||||
|
|
||||||
/* Kernel-Mode NDK */
|
/* Kernel-Mode NDK */
|
||||||
#ifndef NTOS_MODE_USER
|
#ifndef NTOS_MODE_USER
|
||||||
#include "kdtypes.h" /* Kernel Debugger Types */
|
#include "kdtypes.h" /* Kernel Debugger Types */
|
||||||
|
@ -27,7 +30,6 @@
|
||||||
#include "iofuncs.h" /* Input/Output Manager Functions */
|
#include "iofuncs.h" /* Input/Output Manager Functions */
|
||||||
#include "ketypes.h" /* Kernel Types */
|
#include "ketypes.h" /* Kernel Types */
|
||||||
#include "kefuncs.h" /* Kernel Functions */
|
#include "kefuncs.h" /* Kernel Functions */
|
||||||
#include "lpctypes.h" /* Local Procedure Call Types */
|
|
||||||
#include "mmtypes.h" /* Memory Manager Types */
|
#include "mmtypes.h" /* Memory Manager Types */
|
||||||
#include "mmfuncs.h" /* Memory Manager Functions */
|
#include "mmfuncs.h" /* Memory Manager Functions */
|
||||||
#include "obtypes.h" /* Object Manager Types */
|
#include "obtypes.h" /* Object Manager Types */
|
||||||
|
@ -45,6 +47,7 @@
|
||||||
/* Shared NDK */
|
/* Shared NDK */
|
||||||
#include "ldrfuncs.h" /* Loader Functions */
|
#include "ldrfuncs.h" /* Loader Functions */
|
||||||
#include "ldrtypes.h" /* Loader Types */
|
#include "ldrtypes.h" /* Loader Types */
|
||||||
|
#include "lpctypes.h" /* Local Procedure Call Types */
|
||||||
#include "pstypes.h" /* Process Manager Types */
|
#include "pstypes.h" /* Process Manager Types */
|
||||||
#include "rtltypes.h" /* Runtime Library Types */
|
#include "rtltypes.h" /* Runtime Library Types */
|
||||||
#include "rtlfuncs.h" /* Runtime Library Functions */
|
#include "rtlfuncs.h" /* Runtime Library Functions */
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef _HELPER_H
|
#ifndef _HELPER_H
|
||||||
#define _HELPER_H
|
#define _HELPER_H
|
||||||
|
|
||||||
|
/* FIXME: clean this mess up and move to NDK */
|
||||||
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
|
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
|
||||||
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
|
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
|
||||||
#define ROUND_UP ROUNDUP
|
#define ROUND_UP ROUNDUP
|
||||||
|
|
|
@ -411,19 +411,19 @@ typedef struct
|
||||||
} CSRSS_GET_INPUT_WAIT_HANDLE, *PCSRSS_GET_INPUT_WAIT_HANDLE;
|
} CSRSS_GET_INPUT_WAIT_HANDLE, *PCSRSS_GET_INPUT_WAIT_HANDLE;
|
||||||
|
|
||||||
#define CSRSS_MAX_WRITE_CONSOLE \
|
#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! */
|
/* WCHARs, not bytes! */
|
||||||
#define CSRSS_MAX_TITLE_LENGTH 80
|
#define CSRSS_MAX_TITLE_LENGTH 80
|
||||||
|
@ -485,7 +485,7 @@ typedef struct
|
||||||
#define GET_PROCESS_LIST (0x36)
|
#define GET_PROCESS_LIST (0x36)
|
||||||
|
|
||||||
/* Keep in sync with definition below. */
|
/* 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
|
typedef struct _CSR_API_MESSAGE
|
||||||
{
|
{
|
||||||
|
@ -494,7 +494,7 @@ typedef struct _CSR_API_MESSAGE
|
||||||
PORT_MESSAGE Header;
|
PORT_MESSAGE Header;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
BYTE HeaderReserved[LPC_MESSAGE_BASE_SIZE];
|
BYTE HeaderReserved[sizeof(PORT_MESSAGE)];
|
||||||
ULONG Type;
|
ULONG Type;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
union
|
union
|
||||||
|
|
|
@ -98,7 +98,7 @@ typedef union _LSASS_REQUEST
|
||||||
{
|
{
|
||||||
PORT_MESSAGE Header;
|
PORT_MESSAGE Header;
|
||||||
struct {
|
struct {
|
||||||
UCHAR LpcHeader[LPC_MESSAGE_BASE_SIZE];
|
UCHAR LpcHeader[sizeof(PORT_MESSAGE)];
|
||||||
ULONG Type;
|
ULONG Type;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,7 +112,7 @@ typedef union _SM_PORT_MESSAGE
|
||||||
/*** LPC common header ***/
|
/*** LPC common header ***/
|
||||||
PORT_MESSAGE Header;
|
PORT_MESSAGE Header;
|
||||||
struct {
|
struct {
|
||||||
UCHAR LpcHeader[LPC_MESSAGE_BASE_SIZE];
|
UCHAR LpcHeader[sizeof(PORT_MESSAGE)];
|
||||||
/*** SM common header ***/
|
/*** SM common header ***/
|
||||||
struct {
|
struct {
|
||||||
DWORD ApiIndex;
|
DWORD ApiIndex;
|
||||||
|
|
|
@ -19,7 +19,7 @@ InitializeLsaPort(VOID)
|
||||||
{
|
{
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
UNICODE_STRING PortName;
|
UNICODE_STRING PortName;
|
||||||
LPC_MAX_MESSAGE Request;
|
PORT_MESSAGE Request;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
ConnectPortHandle = NULL;
|
ConnectPortHandle = NULL;
|
||||||
|
@ -46,7 +46,7 @@ InitializeLsaPort(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = NtListenPort(ConnectPortHandle,
|
Status = NtListenPort(ConnectPortHandle,
|
||||||
&Request.Header);
|
&Request);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtListenPort() failed (Status %lx)\n", Status);
|
DPRINT1("NtListenPort() failed (Status %lx)\n", Status);
|
||||||
|
@ -89,7 +89,7 @@ ByeBye:
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
ProcessPortMessage(VOID)
|
ProcessPortMessage(VOID)
|
||||||
{
|
{
|
||||||
LPC_MAX_MESSAGE Request;
|
PORT_MESSAGE Request;
|
||||||
// LPC_MAX_MESSAGE Reply;
|
// LPC_MAX_MESSAGE Reply;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ ProcessPortMessage(VOID)
|
||||||
Status = NtReplyWaitReceivePort(MessagePortHandle,
|
Status = NtReplyWaitReceivePort(MessagePortHandle,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&Request.Header);
|
&Request);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtReplyWaitReceivePort() failed (Status %lx)\n", Status);
|
DPRINT1("NtReplyWaitReceivePort() failed (Status %lx)\n", Status);
|
||||||
|
@ -112,18 +112,18 @@ ProcessPortMessage(VOID)
|
||||||
|
|
||||||
DPRINT("Received message\n");
|
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");
|
DPRINT("Port closed\n");
|
||||||
|
|
||||||
// return STATUS_UNSUCCESSFUL;
|
// return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
if (Request.Header.u2.s2.Type == LPC_REQUEST)
|
if (Request.u2.s2.Type == LPC_REQUEST)
|
||||||
{
|
{
|
||||||
DPRINT("Received request\n");
|
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");
|
DPRINT("Received datagram\n");
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ CsrClientCallServer(PCSR_API_MESSAGE Request,
|
||||||
|
|
||||||
/* Fill out the header */
|
/* Fill out the header */
|
||||||
Request->Type = ApiNumber;
|
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;
|
Request->Header.u1.s1.TotalLength = RequestLength;
|
||||||
DPRINT("CSR: API: %x, u1.s1.DataLength: %x, u1.s1.TotalLength: %x\n",
|
DPRINT("CSR: API: %x, u1.s1.DataLength: %x, u1.s1.TotalLength: %x\n",
|
||||||
ApiNumber,
|
ApiNumber,
|
||||||
|
|
|
@ -192,7 +192,7 @@ RtlCreateUserThread(HANDLE ProcessHandle,
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
CONTEXT Context;
|
CONTEXT Context;
|
||||||
|
|
||||||
DPRINT("RtlCreateUserThread: (hProcess: %lx, Suspended: %lx,"
|
DPRINT1("RtlCreateUserThread: (hProcess: %lx, Suspended: %lx,"
|
||||||
"ZeroBits: %lx, StackReserve: %lx, StackCommit: %lx,"
|
"ZeroBits: %lx, StackReserve: %lx, StackCommit: %lx,"
|
||||||
"StartAddress: %p, Parameter: %lx)\n", ProcessHandle,
|
"StartAddress: %p, Parameter: %lx)\n", ProcessHandle,
|
||||||
CreateSuspended, StackZeroBits, StackReserve, StackCommit,
|
CreateSuspended, StackZeroBits, StackReserve, StackCommit,
|
||||||
|
|
|
@ -75,18 +75,18 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle,
|
||||||
{
|
{
|
||||||
PLSASS_REQUEST Request;
|
PLSASS_REQUEST Request;
|
||||||
PLSASS_REPLY Reply;
|
PLSASS_REPLY Reply;
|
||||||
UCHAR RawRequest[MAX_MESSAGE_DATA];
|
LSASS_REQUEST RawRequest;
|
||||||
UCHAR RawReply[MAX_MESSAGE_DATA];
|
LSASS_REPLY RawReply;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG OutBufferSize;
|
ULONG OutBufferSize;
|
||||||
|
|
||||||
Request = (PLSASS_REQUEST)RawRequest;
|
Request = (PLSASS_REQUEST)&RawRequest;
|
||||||
Reply = (PLSASS_REPLY)RawReply;
|
Reply = (PLSASS_REPLY)&RawReply;
|
||||||
|
|
||||||
Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + SubmitBufferLength -
|
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.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->Type = LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE;
|
||||||
Request->d.CallAuthenticationPackageRequest.AuthenticationPackage =
|
Request->d.CallAuthenticationPackageRequest.AuthenticationPackage =
|
||||||
AuthenticationPackage;
|
AuthenticationPackage;
|
||||||
|
@ -142,14 +142,14 @@ LsaLookupAuthenticationPackage(HANDLE LsaHandle,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PLSASS_REQUEST Request;
|
PLSASS_REQUEST Request;
|
||||||
UCHAR RawRequest[MAX_MESSAGE_DATA];
|
LSASS_REQUEST RawRequest;
|
||||||
LSASS_REPLY Reply;
|
LSASS_REPLY Reply;
|
||||||
|
|
||||||
Request = (PLSASS_REQUEST)RawRequest;
|
Request = (PLSASS_REQUEST)&RawRequest;
|
||||||
Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + PackageName->Length -
|
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 +
|
Request->Header.u1.s1.TotalLength = Request->Header.u1.s1.DataLength +
|
||||||
LPC_MESSAGE_BASE_SIZE;
|
sizeof(PORT_MESSAGE);
|
||||||
Request->Type = LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE;
|
Request->Type = LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE;
|
||||||
|
|
||||||
Status = NtRequestWaitReplyPort(LsaHandle,
|
Status = NtRequestWaitReplyPort(LsaHandle,
|
||||||
|
@ -192,23 +192,23 @@ LsaLogonUser(HANDLE LsaHandle,
|
||||||
ULONG RequestLength;
|
ULONG RequestLength;
|
||||||
ULONG CurrentLength;
|
ULONG CurrentLength;
|
||||||
PLSASS_REQUEST Request;
|
PLSASS_REQUEST Request;
|
||||||
UCHAR RawMessage[MAX_MESSAGE_DATA];
|
LSASS_REQUEST RawMessage;
|
||||||
PLSASS_REPLY Reply;
|
PLSASS_REPLY Reply;
|
||||||
UCHAR RawReply[MAX_MESSAGE_DATA];
|
LSASS_REPLY RawReply;
|
||||||
NTSTATUS Status;
|
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 + (OriginName->Length * sizeof(WCHAR));
|
||||||
RequestLength = RequestLength + AuthenticationInformationLength;
|
RequestLength = RequestLength + AuthenticationInformationLength;
|
||||||
RequestLength = RequestLength +
|
RequestLength = RequestLength +
|
||||||
(LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
|
(LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
|
||||||
|
|
||||||
CurrentLength = 0;
|
CurrentLength = 0;
|
||||||
Request = (PLSASS_REQUEST)RawMessage;
|
Request = (PLSASS_REQUEST)&RawMessage;
|
||||||
|
|
||||||
Request->d.LogonUserRequest.OriginNameLength = OriginName->Length;
|
Request->d.LogonUserRequest.OriginNameLength = OriginName->Length;
|
||||||
Request->d.LogonUserRequest.OriginName = (PWSTR)&RawMessage[CurrentLength];
|
Request->d.LogonUserRequest.OriginName = (PWSTR)&RawMessage + CurrentLength;
|
||||||
memcpy((PWSTR)&RawMessage[CurrentLength],
|
memcpy((PWSTR)&RawMessage + CurrentLength,
|
||||||
OriginName->Buffer,
|
OriginName->Buffer,
|
||||||
OriginName->Length * sizeof(WCHAR));
|
OriginName->Length * sizeof(WCHAR));
|
||||||
CurrentLength = CurrentLength + (OriginName->Length * sizeof(WCHAR));
|
CurrentLength = CurrentLength + (OriginName->Length * sizeof(WCHAR));
|
||||||
|
@ -219,28 +219,28 @@ LsaLogonUser(HANDLE LsaHandle,
|
||||||
AuthenticationPackage;
|
AuthenticationPackage;
|
||||||
|
|
||||||
Request->d.LogonUserRequest.AuthenticationInformation =
|
Request->d.LogonUserRequest.AuthenticationInformation =
|
||||||
(PVOID)&RawMessage[CurrentLength];
|
(PVOID)((ULONG_PTR)&RawMessage + CurrentLength);
|
||||||
Request->d.LogonUserRequest.AuthenticationInformationLength =
|
Request->d.LogonUserRequest.AuthenticationInformationLength =
|
||||||
AuthenticationInformationLength;
|
AuthenticationInformationLength;
|
||||||
memcpy((PVOID)&RawMessage[CurrentLength],
|
memcpy((PVOID)((ULONG_PTR)&RawMessage + CurrentLength),
|
||||||
AuthenticationInformation,
|
AuthenticationInformation,
|
||||||
AuthenticationInformationLength);
|
AuthenticationInformationLength);
|
||||||
CurrentLength = CurrentLength + AuthenticationInformationLength;
|
CurrentLength = CurrentLength + AuthenticationInformationLength;
|
||||||
|
|
||||||
Request->d.LogonUserRequest.LocalGroupsCount = LocalGroups->GroupCount;
|
Request->d.LogonUserRequest.LocalGroupsCount = LocalGroups->GroupCount;
|
||||||
Request->d.LogonUserRequest.LocalGroups =
|
Request->d.LogonUserRequest.LocalGroups =
|
||||||
(PSID_AND_ATTRIBUTES)&RawMessage[CurrentLength];
|
(PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength;
|
||||||
memcpy((PSID_AND_ATTRIBUTES)&RawMessage[CurrentLength],
|
memcpy((PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength,
|
||||||
LocalGroups->Groups,
|
LocalGroups->Groups,
|
||||||
LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
|
LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
|
||||||
|
|
||||||
Request->d.LogonUserRequest.SourceContext = *SourceContext;
|
Request->d.LogonUserRequest.SourceContext = *SourceContext;
|
||||||
|
|
||||||
Request->Type = LSASS_REQUEST_LOGON_USER;
|
Request->Type = LSASS_REQUEST_LOGON_USER;
|
||||||
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 + LPC_MESSAGE_BASE_SIZE;
|
Request->Header.u1.s1.TotalLength = RequestLength + sizeof(PORT_MESSAGE);
|
||||||
|
|
||||||
Reply = (PLSASS_REPLY)RawReply;
|
Reply = (PLSASS_REPLY)&RawReply;
|
||||||
|
|
||||||
Status = NtRequestWaitReplyPort(LsaHandle,
|
Status = NtRequestWaitReplyPort(LsaHandle,
|
||||||
&Request->Header,
|
&Request->Header,
|
||||||
|
@ -304,7 +304,7 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName,
|
||||||
|
|
||||||
Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS;
|
Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS;
|
||||||
Request.Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) -
|
Request.Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) -
|
||||||
LPC_MESSAGE_BASE_SIZE;
|
sizeof(PORT_MESSAGE);
|
||||||
Request.Header.u1.s1.TotalLength = sizeof(LSASS_REQUEST);
|
Request.Header.u1.s1.TotalLength = sizeof(LSASS_REQUEST);
|
||||||
|
|
||||||
Request.d.RegisterLogonProcessRequest.Length = LsaLogonProcessName->Length;
|
Request.d.RegisterLogonProcessRequest.Length = LsaLogonProcessName->Length;
|
||||||
|
|
|
@ -88,7 +88,6 @@ typedef struct _QUEUEDMESSAGE
|
||||||
PEPORT Sender;
|
PEPORT Sender;
|
||||||
LIST_ENTRY QueueListEntry;
|
LIST_ENTRY QueueListEntry;
|
||||||
PORT_MESSAGE Message;
|
PORT_MESSAGE Message;
|
||||||
UCHAR MessageData [MAX_MESSAGE_DATA];
|
|
||||||
} QUEUEDMESSAGE, *PQUEUEDMESSAGE;
|
} QUEUEDMESSAGE, *PQUEUEDMESSAGE;
|
||||||
|
|
||||||
typedef struct _LPC_DBG_MESSAGE
|
typedef struct _LPC_DBG_MESSAGE
|
||||||
|
|
|
@ -159,7 +159,7 @@ static VOID STDCALL
|
||||||
IopLogWorker (PVOID Parameter)
|
IopLogWorker (PVOID Parameter)
|
||||||
{
|
{
|
||||||
PERROR_LOG_ENTRY LogEntry;
|
PERROR_LOG_ENTRY LogEntry;
|
||||||
PLPC_MAX_MESSAGE Request;
|
PPORT_MESSAGE Request;
|
||||||
PIO_ERROR_LOG_MESSAGE Message;
|
PIO_ERROR_LOG_MESSAGE Message;
|
||||||
PIO_ERROR_LOG_PACKET Packet;
|
PIO_ERROR_LOG_PACKET Packet;
|
||||||
KIRQL Irql;
|
KIRQL Irql;
|
||||||
|
@ -249,7 +249,7 @@ IopLogWorker (PVOID Parameter)
|
||||||
|
|
||||||
/* Allocate request buffer */
|
/* Allocate request buffer */
|
||||||
Request = ExAllocatePool (NonPagedPool,
|
Request = ExAllocatePool (NonPagedPool,
|
||||||
sizeof(LPC_MAX_MESSAGE));
|
sizeof(PORT_MESSAGE) + PORT_MAXIMUM_MESSAGE_LENGTH);
|
||||||
if (Request == NULL)
|
if (Request == NULL)
|
||||||
{
|
{
|
||||||
DPRINT ("Failed to allocate request buffer!\n");
|
DPRINT ("Failed to allocate request buffer!\n");
|
||||||
|
@ -264,7 +264,7 @@ IopLogWorker (PVOID Parameter)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the log message */
|
/* 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->Type = IO_TYPE_ERROR_MESSAGE;
|
||||||
Message->Size =
|
Message->Size =
|
||||||
sizeof(IO_ERROR_LOG_MESSAGE) - sizeof(IO_ERROR_LOG_PACKET) +
|
sizeof(IO_ERROR_LOG_MESSAGE) - sizeof(IO_ERROR_LOG_PACKET) +
|
||||||
|
@ -285,13 +285,13 @@ IopLogWorker (PVOID Parameter)
|
||||||
|
|
||||||
DPRINT ("SequenceNumber %lx\n", Packet->SequenceNumber);
|
DPRINT ("SequenceNumber %lx\n", Packet->SequenceNumber);
|
||||||
|
|
||||||
Request->Header.u1.s1.DataLength = Message->Size;
|
Request->u1.s1.DataLength = Message->Size;
|
||||||
Request->Header.u1.s1.TotalLength =
|
Request->u1.s1.TotalLength =
|
||||||
Request->Header.u1.s1.DataLength + sizeof(PPORT_MESSAGE);
|
Request->u1.s1.DataLength + sizeof(PPORT_MESSAGE);
|
||||||
|
|
||||||
/* Send the error message to the log port */
|
/* Send the error message to the log port */
|
||||||
Status = ZwRequestPort (IopLogPort,
|
Status = ZwRequestPort (IopLogPort,
|
||||||
&Request->Header);
|
Request);
|
||||||
|
|
||||||
/* Release request buffer */
|
/* Release request buffer */
|
||||||
ExFreePool (Request);
|
ExFreePool (Request);
|
||||||
|
|
|
@ -292,7 +292,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
|
||||||
KeDetachProcess();
|
KeDetachProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LpcRequestMessageSize > (sizeof(PORT_MESSAGE) + MAX_MESSAGE_DATA))
|
if (LpcRequestMessageSize > LPC_MAX_MESSAGE_LENGTH)
|
||||||
{
|
{
|
||||||
if (NULL != AttachedProcess)
|
if (NULL != AttachedProcess)
|
||||||
{
|
{
|
||||||
|
@ -347,7 +347,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
|
||||||
LpcRequestDataSize = LpcRequest->u1.s1.DataLength;
|
LpcRequestDataSize = LpcRequest->u1.s1.DataLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LpcRequestMessageSize > (sizeof(PORT_MESSAGE) + MAX_MESSAGE_DATA))
|
if (LpcRequestMessageSize > LPC_MAX_MESSAGE_LENGTH)
|
||||||
{
|
{
|
||||||
ExFreePool(LpcRequest);
|
ExFreePool(LpcRequest);
|
||||||
if (NULL != AttachedProcess)
|
if (NULL != AttachedProcess)
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
#ifndef __EVENTLOG_H__
|
#ifndef __EVENTLOG_H__
|
||||||
#define __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
|
BOOL
|
||||||
StartPortThread(VOID);
|
StartPortThread(VOID);
|
||||||
|
|
|
@ -50,7 +50,7 @@ InitLogPort(VOID)
|
||||||
{
|
{
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
UNICODE_STRING PortName;
|
UNICODE_STRING PortName;
|
||||||
LPC_MAX_MESSAGE Request;
|
PORT_MESSAGE Request;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
ConnectPortHandle = NULL;
|
ConnectPortHandle = NULL;
|
||||||
|
@ -76,7 +76,7 @@ InitLogPort(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = NtListenPort(ConnectPortHandle,
|
Status = NtListenPort(ConnectPortHandle,
|
||||||
&Request.Header);
|
&Request);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtListenPort() failed (Status %lx)\n", Status);
|
DPRINT1("NtListenPort() failed (Status %lx)\n", Status);
|
||||||
|
@ -115,11 +115,10 @@ ByeBye:
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
ProcessPortMessage(VOID)
|
ProcessPortMessage(VOID)
|
||||||
{
|
{
|
||||||
LPC_MAX_MESSAGE Request;
|
IO_ERROR_LPC Request;
|
||||||
PIO_ERROR_LOG_MESSAGE Message;
|
PIO_ERROR_LOG_MESSAGE Message;
|
||||||
//#ifndef NDEBUG
|
//#ifndef NDEBUG
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
@ -162,7 +161,7 @@ ProcessPortMessage(VOID)
|
||||||
DPRINT("Received datagram\n");
|
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->Type %hx\n", Message->Type);
|
||||||
DPRINT("Message->Size %hu\n", Message->Size);
|
DPRINT("Message->Size %hu\n", Message->Size);
|
||||||
|
|
|
@ -194,7 +194,7 @@ CSR_API(CsrCreateProcess)
|
||||||
PCSRSS_PROCESS_DATA NewProcessData;
|
PCSRSS_PROCESS_DATA NewProcessData;
|
||||||
NTSTATUS Status;
|
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);
|
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
||||||
|
|
||||||
NewProcessData = CsrCreateProcessData(Request->Data.CreateProcessRequest.NewProcessId);
|
NewProcessData = CsrCreateProcessData(Request->Data.CreateProcessRequest.NewProcessId);
|
||||||
|
@ -224,7 +224,7 @@ CSR_API(CsrCreateProcess)
|
||||||
|
|
||||||
CSR_API(CsrTerminateProcess)
|
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);
|
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE);
|
||||||
|
|
||||||
if (ProcessData == NULL)
|
if (ProcessData == NULL)
|
||||||
|
@ -239,7 +239,7 @@ CSR_API(CsrTerminateProcess)
|
||||||
CSR_API(CsrConnectProcess)
|
CSR_API(CsrConnectProcess)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
Request->Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ CSR_API(CsrConnectProcess)
|
||||||
CSR_API(CsrGetShutdownParameters)
|
CSR_API(CsrGetShutdownParameters)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
|
@ -267,7 +267,7 @@ CSR_API(CsrGetShutdownParameters)
|
||||||
CSR_API(CsrSetShutdownParameters)
|
CSR_API(CsrSetShutdownParameters)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
|
@ -285,7 +285,7 @@ CSR_API(CsrSetShutdownParameters)
|
||||||
CSR_API(CsrGetInputHandle)
|
CSR_API(CsrGetInputHandle)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
|
@ -310,7 +310,7 @@ CSR_API(CsrGetInputHandle)
|
||||||
CSR_API(CsrGetOutputHandle)
|
CSR_API(CsrGetOutputHandle)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
|
@ -337,7 +337,7 @@ CSR_API(CsrGetOutputHandle)
|
||||||
CSR_API(CsrCloseHandle)
|
CSR_API(CsrCloseHandle)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
|
@ -353,7 +353,7 @@ CSR_API(CsrCloseHandle)
|
||||||
CSR_API(CsrVerifyHandle)
|
CSR_API(CsrVerifyHandle)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Request->Status = CsrVerifyObject(ProcessData, Request->Data.VerifyHandleRequest.Handle);
|
||||||
if (!NT_SUCCESS(Request->Status))
|
if (!NT_SUCCESS(Request->Status))
|
||||||
|
@ -369,7 +369,7 @@ CSR_API(CsrDuplicateHandle)
|
||||||
Object_t *Object;
|
Object_t *Object;
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
ProcessData = CsrGetProcessData(Request->Data.DuplicateHandleRequest.ProcessId);
|
||||||
Request->Status = CsrGetObject(ProcessData, Request->Data.DuplicateHandleRequest.Handle, &Object);
|
Request->Status = CsrGetObject(ProcessData, Request->Data.DuplicateHandleRequest.Handle, &Object);
|
||||||
|
@ -389,7 +389,7 @@ CSR_API(CsrDuplicateHandle)
|
||||||
CSR_API(CsrGetInputWaitHandle)
|
CSR_API(CsrGetInputWaitHandle)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ CSR_API(CsrRegisterServicesProcess)
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ServicesProcessIdValid == TRUE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,7 +97,7 @@ CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
{
|
{
|
||||||
DPRINT1("CSR: Unknown request type 0x%x\n", Request->Type);
|
DPRINT1("CSR: Unknown request type 0x%x\n", Request->Type);
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
Request->Status = STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,7 @@ STDCALL
|
||||||
ClientConnectionThread(HANDLE ServerPort)
|
ClientConnectionThread(HANDLE ServerPort)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
LPC_MAX_MESSAGE LpcRequest;
|
CSR_API_MESSAGE Request;
|
||||||
PCSR_API_MESSAGE Request;
|
|
||||||
PCSR_API_MESSAGE Reply;
|
PCSR_API_MESSAGE Reply;
|
||||||
PCSRSS_PROCESS_DATA ProcessData;
|
PCSRSS_PROCESS_DATA ProcessData;
|
||||||
|
|
||||||
|
@ -125,7 +124,7 @@ ClientConnectionThread(HANDLE ServerPort)
|
||||||
Status = NtReplyWaitReceivePort(ServerPort,
|
Status = NtReplyWaitReceivePort(ServerPort,
|
||||||
0,
|
0,
|
||||||
&Reply->Header,
|
&Reply->Header,
|
||||||
&LpcRequest.Header);
|
&Request.Header);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("CSR: NtReplyWaitReceivePort failed\n");
|
DPRINT1("CSR: NtReplyWaitReceivePort failed\n");
|
||||||
|
@ -133,34 +132,31 @@ ClientConnectionThread(HANDLE ServerPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the connection was closed, handle that */
|
/* 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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the CSR Message */
|
|
||||||
Request = (PCSR_API_MESSAGE)&LpcRequest;
|
|
||||||
|
|
||||||
DPRINT("CSR: Got CSR API: %x [Message Origin: %x]\n",
|
DPRINT("CSR: Got CSR API: %x [Message Origin: %x]\n",
|
||||||
Request->Type,
|
Request.Type,
|
||||||
Request->Header.ClientId.UniqueProcess);
|
Request.Header.ClientId.UniqueProcess);
|
||||||
|
|
||||||
/* Get the Process Data */
|
/* Get the Process Data */
|
||||||
ProcessData = CsrGetProcessData(LpcRequest.Header.ClientId.UniqueProcess);
|
ProcessData = CsrGetProcessData(Request.Header.ClientId.UniqueProcess);
|
||||||
if (ProcessData == NULL)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
DPRINT1("CSR: Message %d: Unable to find data for process 0x%x\n",
|
DPRINT1("CSR: Message %d: Unable to find data for process 0x%x\n",
|
||||||
LpcRequest.Header.u2.s2.Type,
|
Request.Header.u2.s2.Type,
|
||||||
LpcRequest.Header.ClientId.UniqueProcess);
|
Request.Header.ClientId.UniqueProcess);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call the Handler */
|
/* Call the Handler */
|
||||||
CsrApiCallHandler(ProcessData, Request);
|
CsrApiCallHandler(ProcessData, &Request);
|
||||||
|
|
||||||
/* Send back the reply */
|
/* Send back the reply */
|
||||||
Reply = Request;
|
Reply = &Request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close the port and exit the thread */
|
/* Close the port and exit the thread */
|
||||||
|
@ -180,7 +176,7 @@ DWORD STDCALL
|
||||||
ServerApiPortThread (PVOID PortHandle)
|
ServerApiPortThread (PVOID PortHandle)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
LPC_MAX_MESSAGE Request;
|
PORT_MESSAGE Request;
|
||||||
HANDLE hApiListenPort = * (PHANDLE) PortHandle;
|
HANDLE hApiListenPort = * (PHANDLE) PortHandle;
|
||||||
HANDLE ServerPort = (HANDLE) 0;
|
HANDLE ServerPort = (HANDLE) 0;
|
||||||
HANDLE ServerThread = (HANDLE) 0;
|
HANDLE ServerThread = (HANDLE) 0;
|
||||||
|
@ -195,7 +191,7 @@ ServerApiPortThread (PVOID PortHandle)
|
||||||
REMOTE_PORT_VIEW LpcRead;
|
REMOTE_PORT_VIEW LpcRead;
|
||||||
ServerPort = NULL;
|
ServerPort = NULL;
|
||||||
|
|
||||||
Status = NtListenPort (hApiListenPort, & Request.Header);
|
Status = NtListenPort (hApiListenPort, &Request);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("CSR: NtListenPort() failed\n");
|
DPRINT1("CSR: NtListenPort() failed\n");
|
||||||
|
@ -213,11 +209,11 @@ ServerApiPortThread (PVOID PortHandle)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessData = CsrCreateProcessData(Request.Header.ClientId.UniqueProcess);
|
ProcessData = CsrCreateProcessData(Request.ClientId.UniqueProcess);
|
||||||
if (ProcessData == NULL)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
DPRINT1("Unable to allocate or find data for process 0x%x\n",
|
DPRINT1("Unable to allocate or find data for process 0x%x\n",
|
||||||
Request.Header.ClientId.UniqueProcess);
|
Request.ClientId.UniqueProcess);
|
||||||
Status = STATUS_UNSUCCESSFUL;
|
Status = STATUS_UNSUCCESSFUL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -273,14 +269,14 @@ ServerSbApiPortThread (PVOID PortHandle)
|
||||||
{
|
{
|
||||||
HANDLE hSbApiPortListen = * (PHANDLE) PortHandle;
|
HANDLE hSbApiPortListen = * (PHANDLE) PortHandle;
|
||||||
HANDLE hConnectedPort = (HANDLE) 0;
|
HANDLE hConnectedPort = (HANDLE) 0;
|
||||||
LPC_MAX_MESSAGE Request;
|
PORT_MESSAGE Request;
|
||||||
PVOID Context = NULL;
|
PVOID Context = NULL;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
DPRINT("CSR: %s called\n", __FUNCTION__);
|
DPRINT("CSR: %s called\n", __FUNCTION__);
|
||||||
|
|
||||||
RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
|
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
|
||||||
Status = NtListenPort (hSbApiPortListen, & Request.Header);
|
Status = NtListenPort (hSbApiPortListen, & Request);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("CSR: %s: NtListenPort(SB) failed (Status=0x%08lx)\n",
|
DPRINT1("CSR: %s: NtListenPort(SB) failed (Status=0x%08lx)\n",
|
||||||
|
@ -324,19 +320,19 @@ DPRINT("-- 4\n");
|
||||||
Status = NtReplyWaitReceivePort(hConnectedPort,
|
Status = NtReplyWaitReceivePort(hConnectedPort,
|
||||||
Context,
|
Context,
|
||||||
Reply,
|
Reply,
|
||||||
& Request.Header);
|
& Request);
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("CSR: %s: NtReplyWaitReceivePort failed (Status=0x%08lx)\n",
|
DPRINT1("CSR: %s: NtReplyWaitReceivePort failed (Status=0x%08lx)\n",
|
||||||
__FUNCTION__, Status);
|
__FUNCTION__, Status);
|
||||||
break;
|
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 */
|
/* TODO */
|
||||||
default:
|
default:
|
||||||
DPRINT1("CSR: %s received message (type=%d)\n",
|
DPRINT1("CSR: %s received message (type=%d)\n",
|
||||||
__FUNCTION__, Request.Header.u2.s2.Type);
|
__FUNCTION__, Request.u2.s2.Type);
|
||||||
}
|
}
|
||||||
DPRINT("-- 5\n");
|
DPRINT("-- 5\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,7 +228,7 @@ CSR_API(CsrAllocConsole)
|
||||||
DPRINT("CsrAllocConsole\n");
|
DPRINT("CsrAllocConsole\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
|
@ -357,7 +357,7 @@ CSR_API(CsrFreeConsole)
|
||||||
DPRINT("CsrFreeConsole\n");
|
DPRINT("CsrFreeConsole\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (ProcessData == NULL || ProcessData->Console == NULL)
|
||||||
{
|
{
|
||||||
|
@ -562,7 +562,7 @@ CSR_API(CsrReadConsole)
|
||||||
/* truncate length to CSRSS_MAX_READ_CONSOLE_REQUEST */
|
/* truncate length to CSRSS_MAX_READ_CONSOLE_REQUEST */
|
||||||
nNumberOfCharsToRead = min(Request->Data.ReadConsoleRequest.NrCharactersToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
|
nNumberOfCharsToRead = min(Request->Data.ReadConsoleRequest.NrCharactersToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
Buffer = Request->Data.ReadConsoleRequest.Buffer;
|
||||||
UnicodeBuffer = (PWCHAR)Buffer;
|
UnicodeBuffer = (PWCHAR)Buffer;
|
||||||
|
@ -927,13 +927,13 @@ CSR_API(CsrWriteConsole)
|
||||||
{
|
{
|
||||||
DPRINT1("Invalid request size\n");
|
DPRINT1("Invalid request size\n");
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
return Request->Status = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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 (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -1431,7 +1431,7 @@ CSR_API(CsrGetScreenBufferInfo)
|
||||||
DPRINT("CsrGetScreenBufferInfo\n");
|
DPRINT("CsrGetScreenBufferInfo\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ScreenBufferInfoRequest.ConsoleHandle, &Buff);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -1474,7 +1474,7 @@ CSR_API(CsrSetCursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetCursorRequest.ConsoleHandle, &Buff);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -1562,13 +1562,13 @@ CSR_API(CsrWriteConsoleOutputChar)
|
||||||
{
|
{
|
||||||
DPRINT1("Invalid request size\n");
|
DPRINT1("Invalid request size\n");
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
return Request->Status = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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 (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
if(Request->Data.WriteConsoleOutputCharRequest.Unicode)
|
if(Request->Data.WriteConsoleOutputCharRequest.Unicode)
|
||||||
|
@ -1660,7 +1660,7 @@ CSR_API(CsrFillOutputChar)
|
||||||
DPRINT("CsrFillOutputChar\n");
|
DPRINT("CsrFillOutputChar\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -1729,7 +1729,7 @@ CSR_API(CsrReadInputEvent)
|
||||||
DPRINT("CsrReadInputEvent\n");
|
DPRINT("CsrReadInputEvent\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
Request->Data.ReadInputRequest.Event = ProcessData->ConsoleEvent;
|
||||||
|
|
||||||
Status = ConioLockConsole(ProcessData, Request->Data.ReadInputRequest.ConsoleHandle, &Console);
|
Status = ConioLockConsole(ProcessData, Request->Data.ReadInputRequest.ConsoleHandle, &Console);
|
||||||
|
@ -1814,13 +1814,13 @@ CSR_API(CsrWriteConsoleOutputAttrib)
|
||||||
{
|
{
|
||||||
DPRINT1("Invalid request size\n");
|
DPRINT1("Invalid request size\n");
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
return Request->Status = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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 (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return Request->Status = 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.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);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.FillOutputAttribRequest.ConsoleHandle, &Buff);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -1953,7 +1953,7 @@ CSR_API(CsrGetCursorInfo)
|
||||||
DPRINT("CsrGetCursorInfo\n");
|
DPRINT("CsrGetCursorInfo\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.GetCursorInfoRequest.ConsoleHandle, &Buff);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -1977,7 +1977,7 @@ CSR_API(CsrSetCursorInfo)
|
||||||
DPRINT("CsrSetCursorInfo\n");
|
DPRINT("CsrSetCursorInfo\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -2085,7 +2085,7 @@ CSR_API(CsrSetConsoleMode)
|
||||||
DPRINT("CsrSetConsoleMode\n");
|
DPRINT("CsrSetConsoleMode\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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,
|
Status = Win32CsrGetObject(ProcessData,
|
||||||
Request->Data.SetConsoleModeRequest.ConsoleHandle,
|
Request->Data.SetConsoleModeRequest.ConsoleHandle,
|
||||||
(Object_t **) &Console);
|
(Object_t **) &Console);
|
||||||
|
@ -2122,7 +2122,7 @@ CSR_API(CsrGetConsoleMode)
|
||||||
DPRINT("CsrGetConsoleMode\n");
|
DPRINT("CsrGetConsoleMode\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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,
|
Status = Win32CsrGetObject(ProcessData, Request->Data.GetConsoleModeRequest.ConsoleHandle,
|
||||||
(Object_t **) &Console);
|
(Object_t **) &Console);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -2171,7 +2171,7 @@ CSR_API(CsrCreateScreenBuffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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));
|
Buff = HeapAlloc(Win32CsrApiHeap, 0, sizeof(CSRSS_SCREEN_BUFFER));
|
||||||
if (NULL == Buff)
|
if (NULL == Buff)
|
||||||
|
@ -2214,7 +2214,7 @@ CSR_API(CsrSetScreenBuffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetScreenBufferRequest.OutputHandle, &Buff);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -2261,13 +2261,13 @@ CSR_API(CsrSetTitle)
|
||||||
{
|
{
|
||||||
DPRINT1("Invalid request size\n");
|
DPRINT1("Invalid request size\n");
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
return Request->Status = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ConioLockConsole(ProcessData, Request->Data.SetTitleRequest.Console, &Console);
|
Status = ConioLockConsole(ProcessData, Request->Data.SetTitleRequest.Console, &Console);
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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(! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
Request->Status = Status;
|
Request->Status = Status;
|
||||||
|
@ -2299,7 +2299,7 @@ CSR_API(CsrGetTitle)
|
||||||
DPRINT("CsrGetTitle\n");
|
DPRINT("CsrGetTitle\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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,
|
Status = ConioLockConsole(ProcessData,
|
||||||
Request->Data.GetTitleRequest.ConsoleHandle,
|
Request->Data.GetTitleRequest.ConsoleHandle,
|
||||||
&Console);
|
&Console);
|
||||||
|
@ -2347,7 +2347,7 @@ CSR_API(CsrWriteConsoleOutput)
|
||||||
}
|
}
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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,
|
Status = ConioLockScreenBuffer(ProcessData,
|
||||||
Request->Data.WriteConsoleOutputRequest.ConsoleHandle,
|
Request->Data.WriteConsoleOutputRequest.ConsoleHandle,
|
||||||
&Buff);
|
&Buff);
|
||||||
|
@ -2440,7 +2440,7 @@ CSR_API(CsrFlushInputBuffer)
|
||||||
DPRINT("CsrFlushInputBuffer\n");
|
DPRINT("CsrFlushInputBuffer\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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,
|
Status = ConioLockConsole(ProcessData,
|
||||||
Request->Data.FlushInputBufferRequest.ConsoleInput,
|
Request->Data.FlushInputBufferRequest.ConsoleInput,
|
||||||
&Console);
|
&Console);
|
||||||
|
@ -2492,7 +2492,7 @@ CSR_API(CsrScrollConsoleScreenBuffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockScreenBuffer(ProcessData, ConsoleHandle, &Buff);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -2592,7 +2592,7 @@ CSR_API(CsrReadConsoleOutputChar)
|
||||||
DPRINT("CsrReadConsoleOutputChar\n");
|
DPRINT("CsrReadConsoleOutputChar\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
ReadBuffer = Request->Data.ReadConsoleOutputCharRequest.String;
|
||||||
|
|
||||||
CharSize = (Request->Data.ReadConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
|
CharSize = (Request->Data.ReadConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
|
||||||
|
@ -2668,7 +2668,7 @@ CSR_API(CsrReadConsoleOutputAttrib)
|
||||||
DPRINT("CsrReadConsoleOutputAttrib\n");
|
DPRINT("CsrReadConsoleOutputAttrib\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
ReadBuffer = Request->Data.ReadConsoleOutputAttribRequest.String;
|
||||||
|
|
||||||
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputAttribRequest.ConsoleHandle, &Buff);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputAttribRequest.ConsoleHandle, &Buff);
|
||||||
|
@ -2724,7 +2724,7 @@ CSR_API(CsrGetNumberOfConsoleInputEvents)
|
||||||
DPRINT("CsrGetNumberOfConsoleInputEvents\n");
|
DPRINT("CsrGetNumberOfConsoleInputEvents\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockConsole(ProcessData, Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -2769,7 +2769,7 @@ CSR_API(CsrPeekConsoleInput)
|
||||||
DPRINT("CsrPeekConsoleInput\n");
|
DPRINT("CsrPeekConsoleInput\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockConsole(ProcessData, Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console);
|
||||||
if(! NT_SUCCESS(Status))
|
if(! NT_SUCCESS(Status))
|
||||||
|
@ -2847,7 +2847,7 @@ CSR_API(CsrReadConsoleOutput)
|
||||||
DPRINT("CsrReadConsoleOutput\n");
|
DPRINT("CsrReadConsoleOutput\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputRequest.ConsoleHandle, &Buff);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -2936,7 +2936,7 @@ CSR_API(CsrWriteConsoleInput)
|
||||||
DPRINT("CsrWriteConsoleInput\n");
|
DPRINT("CsrWriteConsoleInput\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioLockConsole(ProcessData, Request->Data.WriteConsoleInputRequest.ConsoleHandle, &Console);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -3027,7 +3027,7 @@ CSR_API(CsrHardwareStateProperty)
|
||||||
DPRINT("CsrHardwareStateProperty\n");
|
DPRINT("CsrHardwareStateProperty\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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,
|
Status = ConioLockConsole(ProcessData,
|
||||||
Request->Data.ConsoleHardwareStateRequest.ConsoleHandle,
|
Request->Data.ConsoleHardwareStateRequest.ConsoleHandle,
|
||||||
|
@ -3067,7 +3067,7 @@ CSR_API(CsrGetConsoleWindow)
|
||||||
DPRINT("CsrGetConsoleWindow\n");
|
DPRINT("CsrGetConsoleWindow\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -3089,7 +3089,7 @@ CSR_API(CsrSetConsoleIcon)
|
||||||
DPRINT("CsrSetConsoleIcon\n");
|
DPRINT("CsrSetConsoleIcon\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -3118,7 +3118,7 @@ CSR_API(CsrGetConsoleCodePage)
|
||||||
}
|
}
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
Request->Data.GetConsoleCodePage.CodePage = Console->CodePage;
|
||||||
ConioUnlockConsole(Console);
|
ConioUnlockConsole(Console);
|
||||||
return Request->Status = STATUS_SUCCESS;
|
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.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))
|
if (IsValidCodePage(Request->Data.SetConsoleCodePage.CodePage))
|
||||||
{
|
{
|
||||||
Console->CodePage = 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.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;
|
Request->Data.GetConsoleOutputCodePage.CodePage = Console->OutputCodePage;
|
||||||
ConioUnlockConsole(Console);
|
ConioUnlockConsole(Console);
|
||||||
return Request->Status = STATUS_SUCCESS;
|
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.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))
|
if (IsValidCodePage(Request->Data.SetConsoleOutputCodePage.CodePage))
|
||||||
{
|
{
|
||||||
Console->OutputCodePage = Request->Data.SetConsoleOutputCodePage.CodePage;
|
Console->OutputCodePage = Request->Data.SetConsoleOutputCodePage.CodePage;
|
||||||
|
@ -3207,7 +3207,7 @@ CSR_API(CsrGetProcessList)
|
||||||
|
|
||||||
Buffer = Request->Data.GetProcessListRequest.ProcessId;
|
Buffer = Request->Data.GetProcessListRequest.ProcessId;
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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;
|
nItems = nCopied = 0;
|
||||||
Request->Data.GetProcessListRequest.nProcessIdsCopied = 0;
|
Request->Data.GetProcessListRequest.nProcessIdsCopied = 0;
|
||||||
|
|
|
@ -202,7 +202,7 @@ CSR_API(CsrCreateDesktop)
|
||||||
DPRINT("CsrCreateDesktop\n");
|
DPRINT("CsrCreateDesktop\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (! BgInitialized)
|
||||||
{
|
{
|
||||||
|
@ -252,7 +252,7 @@ CSR_API(CsrShowDesktop)
|
||||||
DPRINT("CsrShowDesktop\n");
|
DPRINT("CsrShowDesktop\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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.hwndFrom = Request->Data.ShowDesktopRequest.DesktopWindow;
|
||||||
nmh.hdr.idFrom = 0;
|
nmh.hdr.idFrom = 0;
|
||||||
|
@ -276,7 +276,7 @@ CSR_API(CsrHideDesktop)
|
||||||
DPRINT("CsrHideDesktop\n");
|
DPRINT("CsrHideDesktop\n");
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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.hwndFrom = Request->Data.ShowDesktopRequest.DesktopWindow;
|
||||||
nmh.hdr.idFrom = 0;
|
nmh.hdr.idFrom = 0;
|
||||||
|
|
|
@ -19,7 +19,7 @@ static HANDLE LogonProcess = NULL;
|
||||||
CSR_API(CsrRegisterLogonProcess)
|
CSR_API(CsrRegisterLogonProcess)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (Request->Data.RegisterLogonProcessRequest.Register)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ CSR_API(CsrSetLogonNotifyWindow)
|
||||||
DWORD WindowCreator;
|
DWORD WindowCreator;
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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,
|
if (0 == GetWindowThreadProcessId(Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow,
|
||||||
&WindowCreator))
|
&WindowCreator))
|
||||||
|
@ -78,7 +78,7 @@ CSR_API(CsrSetLogonNotifyWindow)
|
||||||
CSR_API(CsrExitReactos)
|
CSR_API(CsrExitReactos)
|
||||||
{
|
{
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
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)
|
if (NULL == LogonNotifyWindow)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,12 +40,12 @@ static VOID STDCALL
|
||||||
DbgSsApiPortThread (PVOID dummy)
|
DbgSsApiPortThread (PVOID dummy)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
LPC_MAX_MESSAGE Request ;
|
PORT_MESSAGE Request ;
|
||||||
|
|
||||||
RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
|
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
Status = NtListenPort (DbgSsApiPort, & Request.Header);
|
Status = NtListenPort (DbgSsApiPort, & Request);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
|
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
|
||||||
|
@ -60,12 +60,12 @@ static VOID STDCALL
|
||||||
DbgUiApiPortThread (PVOID dummy)
|
DbgUiApiPortThread (PVOID dummy)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
LPC_MAX_MESSAGE Request;
|
PORT_MESSAGE Request;
|
||||||
|
|
||||||
RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
|
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
Status = NtListenPort (DbgUiApiPort, & Request.Header);
|
Status = NtListenPort (DbgUiApiPort, & Request);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
|
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
|
||||||
|
|
|
@ -40,8 +40,8 @@ SM_PORT_API SmApi [] =
|
||||||
* with a macro) */
|
* with a macro) */
|
||||||
PSM_CONNECT_DATA FASTCALL SmpGetConnectData (PSM_PORT_MESSAGE Request)
|
PSM_CONNECT_DATA FASTCALL SmpGetConnectData (PSM_PORT_MESSAGE Request)
|
||||||
{
|
{
|
||||||
PLPC_MAX_MESSAGE LpcMaxMessage = (PLPC_MAX_MESSAGE) Request;
|
PPORT_MESSAGE PortMessage = (PPORT_MESSAGE) Request;
|
||||||
return (PSM_CONNECT_DATA) & LpcMaxMessage->Data[0];
|
return (PSM_CONNECT_DATA)(PortMessage + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__USE_NT_LPC__)
|
#if !defined(__USE_NT_LPC__)
|
||||||
|
@ -127,7 +127,7 @@ SmpApiConnectedThread(PVOID pConnectedPort)
|
||||||
{
|
{
|
||||||
DPRINT("SM: %s: message received (type=%d)\n",
|
DPRINT("SM: %s: message received (type=%d)\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
LPC_MESSAGE_TYPE(Request));
|
Request.Header.u2.s2.Type);
|
||||||
|
|
||||||
switch (Request.Header.u2.s2.Type)
|
switch (Request.Header.u2.s2.Type)
|
||||||
{
|
{
|
||||||
|
@ -318,10 +318,10 @@ VOID STDCALL
|
||||||
SmpApiThread (HANDLE ListeningPort)
|
SmpApiThread (HANDLE ListeningPort)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
LPC_MAX_MESSAGE Request;
|
SM_PORT_MESSAGE Request;
|
||||||
|
|
||||||
DPRINT("SM: %s called\n", __FUNCTION__);
|
DPRINT("SM: %s called\n", __FUNCTION__);
|
||||||
RtlZeroMemory(&Request, sizeof(LPC_MAX_MESSAGE));
|
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
|
||||||
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
|
@ -331,7 +331,7 @@ SmpApiThread (HANDLE ListeningPort)
|
||||||
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
|
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Status = SmpHandleConnectionRequest ((PSM_PORT_MESSAGE) & Request);
|
Status = SmpHandleConnectionRequest (& Request);
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("SM: %s: SmpHandleConnectionRequest failed (Status=0x%08lx)\n",
|
DPRINT1("SM: %s: SmpHandleConnectionRequest failed (Status=0x%08lx)\n",
|
||||||
|
|
|
@ -110,8 +110,6 @@ char *option_as_string(unsigned int code, unsigned char *data, int len);
|
||||||
int fork_privchld(int, int);
|
int fork_privchld(int, int);
|
||||||
int check_arp( struct interface_info *ip, struct client_lease *lp );
|
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))
|
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
|
||||||
|
|
||||||
time_t scripttime;
|
time_t scripttime;
|
||||||
|
|
|
@ -54,7 +54,7 @@ CsrNotify(PCSR_API_MESSAGE Request)
|
||||||
return STATUS_INVALID_PORT_HANDLE;
|
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);
|
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
||||||
|
|
||||||
/* Switch to the process in which the WindowsApiPort handle is valid */
|
/* Switch to the process in which the WindowsApiPort handle is valid */
|
||||||
|
|
|
@ -1323,6 +1323,68 @@ typedef struct _RTL_SPLAY_LINKS {
|
||||||
struct _RTL_SPLAY_LINKS *RightChild;
|
struct _RTL_SPLAY_LINKS *RightChild;
|
||||||
} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
|
} 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 {
|
typedef struct _SE_EXPORTS {
|
||||||
|
|
||||||
LUID SeCreateTokenPrivilege;
|
LUID SeCreateTokenPrivilege;
|
||||||
|
|
|
@ -23,11 +23,6 @@
|
||||||
#ifndef __PRNTFONT_H
|
#ifndef __PRNTFONT_H
|
||||||
#define __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 UNIFM_VERSION_1_0 0x10000
|
||||||
#define UNI_GLYPHSETDATA_VERSION_1_0 0x10000
|
#define UNI_GLYPHSETDATA_VERSION_1_0 0x10000
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue