- Various fixes to headers, such as fixing some LPC prototypes, adding/correcting some structures, adding some missing definitions, etc...

svn path=/trunk/; revision=17638
This commit is contained in:
Alex Ionescu 2005-09-04 18:00:59 +00:00
parent 84727764b0
commit ff6172bd8f
16 changed files with 194 additions and 149 deletions

View file

@ -35,6 +35,7 @@ typedef struct _DEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION
} DEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION, * } DEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION, *
PDEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION; PDEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION;
#ifndef NTOS_MODE_USER
typedef struct _DBGK_DEBUG_OBJECT typedef struct _DBGK_DEBUG_OBJECT
{ {
KEVENT Event; KEVENT Event;
@ -45,11 +46,12 @@ typedef struct _DBGK_DEBUG_OBJECT
ULONG Flags; ULONG Flags;
struct struct
{ {
UCHAR DebuggerInactive :1; UCHAR DebuggerInactive:1;
UCHAR KillProcessOnExit :1; UCHAR KillProcessOnExit:1;
}; };
}; };
} DBGK_DEBUG_OBJECT, *PDBGK_DEBUG_OBJECT; } DBGK_DEBUG_OBJECT, *PDBGK_DEBUG_OBJECT;
#endif
typedef enum _DBG_STATE typedef enum _DBG_STATE
{ {
@ -136,4 +138,21 @@ typedef struct _DBGUI_WAIT_STATE_CHANGE
} StateInfo; } StateInfo;
} DBGUI_WAIT_STATE_CHANGE, *PDBGUI_WAIT_STATE_CHANGE; } DBGUI_WAIT_STATE_CHANGE, *PDBGUI_WAIT_STATE_CHANGE;
typedef struct _DBGKM_MSG
{
PORT_MESSAGE h;
ULONG Opcode;
ULONG Status;
union
{
DBGKM_EXCEPTION Exception;
DBGKM_CREATE_THREAD CreateThread;
DBGKM_CREATE_PROCESS CreateProcess;
DBGKM_EXIT_THREAD ExitThread;
DBGKM_EXIT_PROCESS ExitProcess;
DBGKM_LOAD_DLL LoadDll;
DBGKM_UNLOAD_DLL UnloadDll;
};
} DBGKM_MSG, *PDBGKM_MSG;
#endif #endif

View file

@ -37,6 +37,8 @@ extern NTOSAPI POBJECT_TYPE ExTimerType;
#define SEMAPHORE_QUERY_STATE 0x0001 #define SEMAPHORE_QUERY_STATE 0x0001
#endif #endif
#define MAXIMUM_HARDERROR_PARAMETERS 4
/* ENUMERATIONS **************************************************************/ /* ENUMERATIONS **************************************************************/
/* TYPES *********************************************************************/ /* TYPES *********************************************************************/

View file

@ -171,6 +171,24 @@ typedef struct _LPCP_CONNECTION_MESSAGE
} LPCP_CONNECTION_MESSAGE, *PLPCP_CONNECTION_MESSAGE; } LPCP_CONNECTION_MESSAGE, *PLPCP_CONNECTION_MESSAGE;
#endif #endif
typedef struct _HARDERROR_MSG
{
PORT_MESSAGE h;
NTSTATUS Status;
LARGE_INTEGER ErrorTime;
ULONG ValidResponseOptions;
ULONG Response;
ULONG NumberOfParameters;
ULONG UnicodeStringParameterMask;
ULONG Parameters[MAXIMUM_HARDERROR_PARAMETERS];
} HARDERROR_MSG, *PHARDERROR_MSG;
typedef struct _CLIENT_DIED_MSG
{
PORT_MESSAGE h;
LARGE_INTEGER CreateTime;
} CLIENT_DIED_MSG, *PCLIENT_DIED_MSG;
/* CONSTANTS *****************************************************************/ /* CONSTANTS *****************************************************************/
#define PORT_MAXIMUM_MESSAGE_LENGTH 256 #define PORT_MAXIMUM_MESSAGE_LENGTH 256

View file

@ -15,6 +15,10 @@
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
/* CONSTANTS *****************************************************************/ /* CONSTANTS *****************************************************************/
#ifdef NTOS_MODE_USER
#define SEC_BASED 0x00200000
#define SEC_NO_CHANGE 0x00400000
#endif
/* ENUMERATIONS **************************************************************/ /* ENUMERATIONS **************************************************************/

View file

@ -25,7 +25,6 @@
#include "kdfuncs.h" /* Kernel Debugger Functions */ #include "kdfuncs.h" /* Kernel Debugger Functions */
#include "cctypes.h" /* Cache Manager Types */ #include "cctypes.h" /* Cache Manager Types */
#include "potypes.h" /* Power Manager Types */ #include "potypes.h" /* Power Manager Types */
#include "dbgktypes.h" /* User-Mode Kernel Debugging Types */
#include "haltypes.h" /* Hardware Abstraction Layer Types */ #include "haltypes.h" /* Hardware Abstraction Layer Types */
#include "halfuncs.h" /* Hardware Abstraction Layer Functions */ #include "halfuncs.h" /* Hardware Abstraction Layer Functions */
#include "inbvfuncs.h" /* Initialization Boot Video Functions */ #include "inbvfuncs.h" /* Initialization Boot Video Functions */
@ -34,7 +33,6 @@
#include "mmfuncs.h" /* Memory Manager Functions */ #include "mmfuncs.h" /* Memory Manager Functions */
#include "obfuncs.h" /* Object Manager Functions */ #include "obfuncs.h" /* Object Manager Functions */
#include "psfuncs.h" /* Process Manager Functions */ #include "psfuncs.h" /* Process Manager Functions */
#include "setypes.h" /* Security Subsystem Types */
#include "sefuncs.h" /* Security Subsystem Functions */ #include "sefuncs.h" /* Security Subsystem Functions */
#endif /* !NTOS_MODE_USER */ #endif /* !NTOS_MODE_USER */
@ -50,10 +48,12 @@
#include "obtypes.h" /* Object Manager Types */ #include "obtypes.h" /* Object Manager Types */
#include "pstypes.h" /* Process Manager Types */ #include "pstypes.h" /* Process Manager Types */
#include "lpctypes.h" /* Local Procedure Call Types */ #include "lpctypes.h" /* Local Procedure Call Types */
#include "dbgktypes.h" /* User-Mode Kernel Debugging Types */
#include "zwtypes.h" /* Native Types */ #include "zwtypes.h" /* Native Types */
#include "zwfuncs.h" /* Native Functions (System Calls) */ #include "zwfuncs.h" /* Native Functions (System Calls) */
#include "rtltypes.h" /* Runtime Library Types */ #include "rtltypes.h" /* Runtime Library Types */
#include "rtlfuncs.h" /* Runtime Library Functions */ #include "rtlfuncs.h" /* Runtime Library Functions */
#include "setypes.h" /* Security Subsystem Types */
#include "umfuncs.h" /* User-Mode NT Library Functions */ #include "umfuncs.h" /* User-Mode NT Library Functions */
#include "i386/floatsave.h" /* Floating Point Save Area Definitions for i386 */ #include "i386/floatsave.h" /* Floating Point Save Area Definitions for i386 */
#include "i386/segment.h" /* Kernel CPU Segment Definitions for i386 */ #include "i386/segment.h" /* Kernel CPU Segment Definitions for i386 */

View file

@ -53,6 +53,10 @@ VOID
STDCALL STDCALL
RtlRaiseStatus(NTSTATUS Status); RtlRaiseStatus(NTSTATUS Status);
LONG
STDCALL
RtlUnhandledExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo);
VOID VOID
STDCALL STDCALL
RtlUnwind( RtlUnwind(
@ -229,6 +233,15 @@ RtlAddAuditAccessAce(
BOOLEAN Failure BOOLEAN Failure
); );
NTSTATUS
STDCALL
RtlAdjustPrivilege(
IN ULONG Privilege,
IN BOOLEAN NewValue,
IN BOOLEAN ForThread,
OUT PBOOLEAN OldValue
);
NTSTATUS NTSTATUS
STDCALL STDCALL
RtlAllocateAndInitializeSid( RtlAllocateAndInitializeSid(

View file

@ -210,6 +210,9 @@ RemoveTailList(
sizeof(__SOURCE_STRING__), \ sizeof(__SOURCE_STRING__), \
(__SOURCE_STRING__) \ (__SOURCE_STRING__) \
} }
#define RtlEqualLuid(L1, L2) (((L1)->HighPart == (L2)->HighPart) && \
((L1)->LowPart == (L2)->LowPart))
#endif #endif
/* FIXME: Rename these */ /* FIXME: Rename these */

View file

@ -14,11 +14,40 @@
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
/* CONSTANTS *****************************************************************/ /* CONSTANTS *****************************************************************/
#ifdef NTOS_MODE_USER
#define SE_MIN_WELL_KNOWN_PRIVILEGE (2L)
#define SE_CREATE_TOKEN_PRIVILEGE (2L)
#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE (3L)
#define SE_LOCK_MEMORY_PRIVILEGE (4L)
#define SE_INCREASE_QUOTA_PRIVILEGE (5L)
#define SE_UNSOLICITED_INPUT_PRIVILEGE (6L)
#define SE_MACHINE_ACCOUNT_PRIVILEGE (6L)
#define SE_TCB_PRIVILEGE (7L)
#define SE_SECURITY_PRIVILEGE (8L)
#define SE_TAKE_OWNERSHIP_PRIVILEGE (9L)
#define SE_LOAD_DRIVER_PRIVILEGE (10L)
#define SE_SYSTEM_PROFILE_PRIVILEGE (11L)
#define SE_SYSTEMTIME_PRIVILEGE (12L)
#define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L)
#define SE_INC_BASE_PRIORITY_PRIVILEGE (14L)
#define SE_CREATE_PAGEFILE_PRIVILEGE (15L)
#define SE_CREATE_PERMANENT_PRIVILEGE (16L)
#define SE_BACKUP_PRIVILEGE (17L)
#define SE_RESTORE_PRIVILEGE (18L)
#define SE_SHUTDOWN_PRIVILEGE (19L)
#define SE_DEBUG_PRIVILEGE (20L)
#define SE_AUDIT_PRIVILEGE (21L)
#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE (22L)
#define SE_CHANGE_NOTIFY_PRIVILEGE (23L)
#define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L)
#define SE_MAX_WELL_KNOWN_PRIVILEGE (SE_REMOTE_SHUTDOWN_PRIVILEGE)
#endif
/* ENUMERATIONS **************************************************************/ /* ENUMERATIONS **************************************************************/
/* TYPES *********************************************************************/ /* TYPES *********************************************************************/
#ifndef NTOS_MODE_USER
typedef struct _SEP_AUDIT_POLICY_CATEGORIES typedef struct _SEP_AUDIT_POLICY_CATEGORIES
{ {
UCHAR System:4; UCHAR System:4;
@ -96,3 +125,4 @@ typedef struct _SE_AUDIT_PROCESS_CREATION_INFO
} SE_AUDIT_PROCESS_CREATION_INFO, *PSE_AUDIT_PROCESS_CREATION_INFO; } SE_AUDIT_PROCESS_CREATION_INFO, *PSE_AUDIT_PROCESS_CREATION_INFO;
#endif #endif
#endif

View file

@ -138,10 +138,10 @@ LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress);
NTSTATUS NTSTATUS
STDCALL STDCALL
LdrGetDllHandle( LdrGetDllHandle(
IN PWCHAR Path OPTIONAL, IN PWSTR DllPath OPTIONAL,
IN ULONG Unknown2, IN PULONG DllCharacteristics,
IN PUNICODE_STRING DllName, IN PUNICODE_STRING DllName,
OUT PVOID *BaseAddress OUT PVOID *DllHandle
); );
NTSTATUS NTSTATUS

View file

@ -21,11 +21,22 @@ NTSTATUS
STDCALL STDCALL
NtAcceptConnectPort( NtAcceptConnectPort(
PHANDLE PortHandle, PHANDLE PortHandle,
HANDLE NamedPortHandle, PVOID PortContext OPTIONAL,
PPORT_MESSAGE ServerReply, PPORT_MESSAGE ConnectionRequest,
BOOLEAN AcceptIt, BOOLEAN AcceptConnection,
PPORT_VIEW WriteMap, PPORT_VIEW ServerView OPTIONAL,
PREMOTE_PORT_VIEW ReadMap PREMOTE_PORT_VIEW ClientView OPTIONAL
);
NTSTATUS
STDCALL
ZwAcceptConnectPort(
PHANDLE PortHandle,
PVOID PortContext OPTIONAL,
PPORT_MESSAGE ConnectionRequest,
BOOLEAN AcceptConnection,
PPORT_VIEW ServerView OPTIONAL,
PREMOTE_PORT_VIEW ClientView OPTIONAL
); );
NTSTATUS NTSTATUS
@ -347,11 +358,11 @@ NtConnectPort(
PHANDLE PortHandle, PHANDLE PortHandle,
PUNICODE_STRING PortName, PUNICODE_STRING PortName,
PSECURITY_QUALITY_OF_SERVICE SecurityQos, PSECURITY_QUALITY_OF_SERVICE SecurityQos,
PPORT_VIEW SectionInfo, PPORT_VIEW ClientView OPTIONAL,
PREMOTE_PORT_VIEW MapInfo, PREMOTE_PORT_VIEW ServerView OPTIONAL,
PULONG MaxMessageSize, PULONG MaxMessageLength OPTIONAL,
PVOID ConnectInfo, PVOID ConnectionInformation OPTIONAL,
PULONG ConnectInfoLength PULONG ConnectionInformationLength OPTIONAL
); );
NTSTATUS NTSTATUS
@ -360,11 +371,11 @@ ZwConnectPort(
PHANDLE PortHandle, PHANDLE PortHandle,
PUNICODE_STRING PortName, PUNICODE_STRING PortName,
PSECURITY_QUALITY_OF_SERVICE SecurityQos, PSECURITY_QUALITY_OF_SERVICE SecurityQos,
PPORT_VIEW SectionInfo, PPORT_VIEW ClientView OPTIONAL,
PREMOTE_PORT_VIEW MapInfo, PREMOTE_PORT_VIEW ServerView OPTIONAL,
PULONG MaxMessageSize, PULONG MaxMessageLength OPTIONAL,
PVOID ConnectInfo, PVOID ConnectionInformation OPTIONAL,
PULONG ConnectInfoLength PULONG ConnectionInformationLength OPTIONAL
); );
NTSTATUS NTSTATUS
@ -612,19 +623,19 @@ STDCALL
NtCreatePort( NtCreatePort(
PHANDLE PortHandle, PHANDLE PortHandle,
POBJECT_ATTRIBUTES ObjectAttributes, POBJECT_ATTRIBUTES ObjectAttributes,
ULONG MaxConnectInfoLength, ULONG MaxConnectionInfoLength,
ULONG MaxDataLength, ULONG MaxMessageLength,
ULONG NPMessageQueueSize OPTIONAL ULONG MaxPoolUsage
); );
NTSTATUS NTSTATUS
STDCALL STDCALL
NtCreatePort( ZwCreatePort(
PHANDLE PortHandle, PHANDLE PortHandle,
POBJECT_ATTRIBUTES ObjectAttributes, POBJECT_ATTRIBUTES ObjectAttributes,
ULONG MaxConnectInfoLength, ULONG MaxConnectionInfoLength,
ULONG MaxDataLength, ULONG MaxMessageLength,
ULONG NPMessageQueueSize OPTIONAL ULONG MaxPoolUsage
); );
NTSTATUS NTSTATUS
@ -1313,13 +1324,13 @@ ZwIsProcessInJob(
NTSTATUS NTSTATUS
STDCALL STDCALL
NtListenPort(HANDLE PortHandle, NtListenPort(HANDLE PortHandle,
PPORT_MESSAGE LpcMessage PPORT_MESSAGE ConnectionRequest
); );
NTSTATUS NTSTATUS
STDCALL STDCALL
ZwListenPort(HANDLE PortHandle, ZwListenPort(HANDLE PortHandle,
PPORT_MESSAGE LpcMessage PPORT_MESSAGE ConnectionRequest
); );
NTSTATUS NTSTATUS
@ -2745,11 +2756,11 @@ STDCALL
NtRaiseHardError( NtRaiseHardError(
IN NTSTATUS ErrorStatus, IN NTSTATUS ErrorStatus,
IN ULONG NumberOfParameters, IN ULONG NumberOfParameters,
IN PUNICODE_STRING UnicodeStringParameterMask OPTIONAL, IN ULONG UnicodeStringParameterMask,
IN PVOID *Parameters, IN PULONG_PTR Parameters,
IN HARDERROR_RESPONSE_OPTION ResponseOption, IN ULONG ValidResponseOptions,
OUT PHARDERROR_RESPONSE Response OUT PULONG Response
); );
NTSTATUS NTSTATUS
STDCALL STDCALL
@ -2955,18 +2966,18 @@ NTSTATUS
STDCALL STDCALL
NtReplyWaitReceivePort( NtReplyWaitReceivePort(
HANDLE PortHandle, HANDLE PortHandle,
PULONG PortId, PVOID *PortContext OPTIONAL,
PPORT_MESSAGE MessageReply, PPORT_MESSAGE ReplyMessage OPTIONAL,
PPORT_MESSAGE MessageRequest PPORT_MESSAGE ReceiveMessage
); );
NTSTATUS NTSTATUS
STDCALL STDCALL
ZwReplyWaitReceivePort( ZwReplyWaitReceivePort(
HANDLE PortHandle, HANDLE PortHandle,
PULONG PortId, PVOID *PortContext OPTIONAL,
PPORT_MESSAGE MessageReply, PPORT_MESSAGE ReplyMessage,
PPORT_MESSAGE MessageRequest PPORT_MESSAGE ReceiveMessage
); );
NTSTATUS NTSTATUS

View file

@ -2285,33 +2285,34 @@ LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress)
* @implemented * @implemented
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
LdrGetDllHandle(IN PWCHAR Path OPTIONAL, LdrGetDllHandle(IN PWSTR DllPath OPTIONAL,
IN ULONG Unknown2, IN PULONG DllCharacteristics,
IN PUNICODE_STRING DllName, IN PUNICODE_STRING DllName,
OUT PVOID* BaseAddress) OUT PVOID *DllHandle)
{ {
PLDR_DATA_TABLE_ENTRY Module; PLDR_DATA_TABLE_ENTRY Module;
NTSTATUS Status; NTSTATUS Status;
TRACE_LDR("LdrGetDllHandle, searching for %wZ from %S\n", DllName, Path ? Path : L""); TRACE_LDR("LdrGetDllHandle, searching for %wZ from %S\n",
DllName, DllPath ? DllPath : L"");
/* NULL is the current executable */ /* NULL is the current executable */
if (DllName == NULL) if (DllName == NULL)
{ {
*BaseAddress = ExeModule->DllBase; *DllHandle = ExeModule->DllBase;
DPRINT("BaseAddress %x\n", *BaseAddress); DPRINT("BaseAddress %x\n", *DllHandle);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
Status = LdrFindEntryForName(DllName, &Module, FALSE); Status = LdrFindEntryForName(DllName, &Module, FALSE);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
*BaseAddress = Module->DllBase; *DllHandle = Module->DllBase;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
DPRINT("Failed to find dll %wZ\n", DllName); DPRINT("Failed to find dll %wZ\n", DllName);
*BaseAddress = NULL; *DllHandle = NULL;
return STATUS_DLL_NOT_FOUND; return STATUS_DLL_NOT_FOUND;
} }

View file

@ -92,10 +92,10 @@ VOID
STDCALL STDCALL
ExRaiseHardError(IN NTSTATUS ErrorStatus, ExRaiseHardError(IN NTSTATUS ErrorStatus,
IN ULONG NumberOfParameters, IN ULONG NumberOfParameters,
IN PUNICODE_STRING UnicodeStringParameterMask OPTIONAL, IN ULONG UnicodeStringParameterMask,
IN PVOID *Parameters, IN PULONG_PTR Parameters,
IN HARDERROR_RESPONSE_OPTION ResponseOption, IN ULONG ValidResponseOptions,
OUT PHARDERROR_RESPONSE Response) OUT PULONG Response)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
@ -104,10 +104,10 @@ NTSTATUS
STDCALL STDCALL
NtRaiseHardError(IN NTSTATUS ErrorStatus, NtRaiseHardError(IN NTSTATUS ErrorStatus,
IN ULONG NumberOfParameters, IN ULONG NumberOfParameters,
IN PUNICODE_STRING UnicodeStringParameterMask OPTIONAL, IN ULONG UnicodeStringParameterMask,
IN PVOID *Parameters, IN PULONG_PTR Parameters,
IN HARDERROR_RESPONSE_OPTION ResponseOption, IN ULONG ValidResponseOptions,
OUT PHARDERROR_RESPONSE Response) OUT PULONG Response)
{ {
DPRINT1("Hard error %x\n", ErrorStatus); DPRINT1("Hard error %x\n", ErrorStatus);
@ -116,7 +116,7 @@ NtRaiseHardError(IN NTSTATUS ErrorStatus,
NumberOfParameters, NumberOfParameters,
UnicodeStringParameterMask, UnicodeStringParameterMask,
Parameters, Parameters,
ResponseOption, ValidResponseOptions,
Response); Response);
/* Return Success */ /* Return Success */

View file

@ -90,61 +90,6 @@ typedef struct _QUEUEDMESSAGE
PORT_MESSAGE Message; PORT_MESSAGE Message;
} QUEUEDMESSAGE, *PQUEUEDMESSAGE; } QUEUEDMESSAGE, *PQUEUEDMESSAGE;
typedef struct _LPC_DBG_MESSAGE
{
PORT_MESSAGE Header;
ULONG Type;
ULONG Status;
union
{
struct
{
EXCEPTION_RECORD ExceptionRecord;
ULONG FirstChance;
} Exception;
struct
{
ULONG Reserved;
PVOID StartAddress;
} CreateThread;
struct
{
ULONG Reserved;
HANDLE FileHandle;
PVOID Base;
ULONG PointerToSymbolTable;
ULONG NumberOfSymbols;
ULONG Reserved2;
PVOID EntryPoint;
} CreateProcess;
struct
{
ULONG ExitCode;
} ExitThread;
struct
{
ULONG ExitCode;
} ExitProcess;
struct
{
HANDLE FileHandle;
PVOID Base;
ULONG PointerToSymbolTable;
ULONG NumberOfSymbols;
} LoadDll;
struct
{
PVOID Base;
} UnloadDll;
} Data;
} LPC_DBG_MESSAGE, *PLPC_DBG_MESSAGE;
typedef struct _LPC_TERMINATION_MESSAGE
{
PORT_MESSAGE Header;
LARGE_INTEGER CreationTime;
} LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE;
/* Code in ntoskrnl/lpc/close.h */ /* Code in ntoskrnl/lpc/close.h */
VOID STDCALL VOID STDCALL

View file

@ -146,11 +146,11 @@ NtReplyPort (IN HANDLE PortHandle,
* REVISIONS * REVISIONS
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
NtReplyWaitReceivePortEx(IN HANDLE PortHandle, NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
OUT PULONG PortId, OUT PVOID *PortContext OPTIONAL,
IN PPORT_MESSAGE LpcReply, IN PPORT_MESSAGE ReplyMessage OPTIONAL,
OUT PPORT_MESSAGE LpcMessage, OUT PPORT_MESSAGE ReceiveMessage,
IN PLARGE_INTEGER Timeout) IN PLARGE_INTEGER Timeout OPTIONAL)
{ {
PEPORT Port; PEPORT Port;
KIRQL oldIrql; KIRQL oldIrql;
@ -169,7 +169,7 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
{ {
_SEH_TRY _SEH_TRY
{ {
ProbeForWrite(LpcMessage, ProbeForWrite(ReceiveMessage,
sizeof(PORT_MESSAGE), sizeof(PORT_MESSAGE),
1); 1);
} }
@ -211,10 +211,10 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
/* /*
* Send the reply, only if port is connected * Send the reply, only if port is connected
*/ */
if (LpcReply != NULL && !Disconnected) if (ReplyMessage != NULL && !Disconnected)
{ {
Status = EiReplyOrRequestPort(Port->OtherPort, Status = EiReplyOrRequestPort(Port->OtherPort,
LpcReply, ReplyMessage,
LPC_REPLY, LPC_REPLY,
Port); Port);
KeReleaseSemaphore(&Port->OtherPort->Semaphore, IO_NO_INCREMENT, 1, KeReleaseSemaphore(&Port->OtherPort->Semaphore, IO_NO_INCREMENT, 1,
@ -283,14 +283,14 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
{ {
_SEH_TRY _SEH_TRY
{ {
ProbeForWrite((PVOID)(LpcMessage + 1), ProbeForWrite((PVOID)(ReceiveMessage + 1),
CRequest->ConnectDataLength, CRequest->ConnectDataLength,
1); 1);
RtlCopyMemory(LpcMessage, RtlCopyMemory(ReceiveMessage,
&Header, &Header,
sizeof(PORT_MESSAGE)); sizeof(PORT_MESSAGE));
RtlCopyMemory((PVOID)(LpcMessage + 1), RtlCopyMemory((PVOID)(ReceiveMessage + 1),
CRequest->ConnectData, CRequest->ConnectData,
CRequest->ConnectDataLength); CRequest->ConnectDataLength);
} }
@ -302,10 +302,10 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
} }
else else
{ {
RtlCopyMemory(LpcMessage, RtlCopyMemory(ReceiveMessage,
&Header, &Header,
sizeof(PORT_MESSAGE)); sizeof(PORT_MESSAGE));
RtlCopyMemory((PVOID)(LpcMessage + 1), RtlCopyMemory((PVOID)(ReceiveMessage + 1),
CRequest->ConnectData, CRequest->ConnectData,
CRequest->ConnectDataLength); CRequest->ConnectDataLength);
} }
@ -316,11 +316,11 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
{ {
_SEH_TRY _SEH_TRY
{ {
ProbeForWrite(LpcMessage, ProbeForWrite(ReceiveMessage,
Request->Message.u1.s1.TotalLength, Request->Message.u1.s1.TotalLength,
1); 1);
RtlCopyMemory(LpcMessage, RtlCopyMemory(ReceiveMessage,
&Request->Message, &Request->Message,
Request->Message.u1.s1.TotalLength); Request->Message.u1.s1.TotalLength);
} }
@ -332,7 +332,7 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
} }
else else
{ {
RtlCopyMemory(LpcMessage, RtlCopyMemory(ReceiveMessage,
&Request->Message, &Request->Message,
Request->Message.u1.s1.TotalLength); Request->Message.u1.s1.TotalLength);
} }
@ -387,16 +387,16 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
* REVISIONS * REVISIONS
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
NtReplyWaitReceivePort (IN HANDLE PortHandle, NtReplyWaitReceivePort(IN HANDLE PortHandle,
OUT PULONG PortId, OUT PVOID *PortContext OPTIONAL,
IN PPORT_MESSAGE LpcReply, IN PPORT_MESSAGE ReplyMessage OPTIONAL,
OUT PPORT_MESSAGE LpcMessage) OUT PPORT_MESSAGE ReceiveMessage)
{ {
return(NtReplyWaitReceivePortEx (PortHandle, return NtReplyWaitReceivePortEx(PortHandle,
PortId, PortContext,
LpcReply, ReplyMessage,
LpcMessage, ReceiveMessage,
NULL)); NULL);
} }
/********************************************************************** /**********************************************************************

View file

@ -30,16 +30,16 @@
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
LpcSendTerminationPort (IN PEPORT Port, LpcSendTerminationPort (IN PEPORT Port,
IN LARGE_INTEGER CreationTime) IN LARGE_INTEGER CreateTime)
{ {
NTSTATUS Status; NTSTATUS Status;
LPC_TERMINATION_MESSAGE Msg; CLIENT_DIED_MSG Msg;
#ifdef __USE_NT_LPC__ #ifdef __USE_NT_LPC__
Msg.Header.u2.s2.Type = LPC_NEW_MESSAGE; Msg.h.u2.s2.Type = LPC_CLIENT_DIED;
#endif #endif
Msg.CreationTime = CreationTime; Msg.CreateTime = CreateTime;
Status = LpcRequestPort (Port, &Msg.Header); Status = LpcRequestPort (Port, &Msg.h);
return(Status); return(Status);
} }
@ -58,15 +58,15 @@ LpcSendTerminationPort (IN PEPORT Port,
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
LpcSendDebugMessagePort (IN PEPORT Port, LpcSendDebugMessagePort (IN PEPORT Port,
IN PLPC_DBG_MESSAGE Message, IN PDBGKM_MSG Message,
OUT PLPC_DBG_MESSAGE Reply) OUT PDBGKM_MSG Reply)
{ {
NTSTATUS Status; NTSTATUS Status;
KIRQL oldIrql; KIRQL oldIrql;
PQUEUEDMESSAGE ReplyMessage; PQUEUEDMESSAGE ReplyMessage;
Status = EiReplyOrRequestPort(Port, Status = EiReplyOrRequestPort(Port,
&Message->Header, &Message->h,
LPC_REQUEST, LPC_REQUEST,
Port); Port);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))

View file

@ -107,7 +107,6 @@ VOID STDCALL
SmpApiConnectedThread(PVOID pConnectedPort) SmpApiConnectedThread(PVOID pConnectedPort)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
PVOID Unknown = NULL;
PPORT_MESSAGE Reply = NULL; PPORT_MESSAGE Reply = NULL;
SM_PORT_MESSAGE Request; SM_PORT_MESSAGE Request;
HANDLE ConnectedPort = * (PHANDLE) pConnectedPort; HANDLE ConnectedPort = * (PHANDLE) pConnectedPort;
@ -120,7 +119,7 @@ SmpApiConnectedThread(PVOID pConnectedPort)
DPRINT("SM: %s: waiting for message\n",__FUNCTION__); DPRINT("SM: %s: waiting for message\n",__FUNCTION__);
Status = NtReplyWaitReceivePort(ConnectedPort, Status = NtReplyWaitReceivePort(ConnectedPort,
(PULONG) & Unknown, NULL,
Reply, Reply,
(PPORT_MESSAGE) & Request); (PPORT_MESSAGE) & Request);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))