diff --git a/reactos/apps/tests/lpc/lpcclt.c b/reactos/apps/tests/lpc/lpcclt.c index 129f24fce54..5f2ee956376 100644 --- a/reactos/apps/tests/lpc/lpcclt.c +++ b/reactos/apps/tests/lpc/lpcclt.c @@ -1,4 +1,4 @@ -/* $Id: lpcclt.c,v 1.13 2003/11/17 02:12:48 hyperion Exp $ +/* $Id: lpcclt.c,v 1.14 2004/01/06 16:07:21 ekohl Exp $ * * DESCRIPTION: Simple LPC Client * PROGRAMMER: David Welch @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/reactos/apps/tests/lpc/lpcsrv.c b/reactos/apps/tests/lpc/lpcsrv.c index 09daaefc585..9b488ee7053 100644 --- a/reactos/apps/tests/lpc/lpcsrv.c +++ b/reactos/apps/tests/lpc/lpcsrv.c @@ -1,4 +1,4 @@ -/* $Id: lpcsrv.c,v 1.13 2003/11/17 02:12:48 hyperion Exp $ +/* $Id: lpcsrv.c,v 1.14 2004/01/06 16:07:21 ekohl Exp $ * * DESCRIPTION: Simple LPC Server * PROGRAMMER: David Welch @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/reactos/include/csrss/csrss.h b/reactos/include/csrss/csrss.h index 8c03f679df6..0decd65a169 100644 --- a/reactos/include/csrss/csrss.h +++ b/reactos/include/csrss/csrss.h @@ -2,7 +2,6 @@ #define __INCLUDE_CSRSS_CSRSS_H #include -#include #include #include diff --git a/reactos/include/lsass/lsass.h b/reactos/include/lsass/lsass.h index a639074871a..6f9b1312855 100644 --- a/reactos/include/lsass/lsass.h +++ b/reactos/include/lsass/lsass.h @@ -1,4 +1,4 @@ -/* $Id: lsass.h,v 1.5 2003/09/08 09:56:56 weiden Exp $ +/* $Id: lsass.h,v 1.6 2004/01/06 16:04:18 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,7 +13,6 @@ #include #include -#include #define LSASS_REQUEST_REGISTER_LOGON_PROCESS (1) #define LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE (2) diff --git a/reactos/include/napi/dbg.h b/reactos/include/napi/dbg.h index 8745c55a2d8..d273e607f0a 100644 --- a/reactos/include/napi/dbg.h +++ b/reactos/include/napi/dbg.h @@ -1,8 +1,6 @@ #ifndef __INCLUDE_NAPI_DBG_H #define __INCLUDE_NAPI_DBG_H -#include - #define DBG_EVENT_EXCEPTION (1) #define DBG_EVENT_CREATE_THREAD (2) #define DBG_EVENT_CREATE_PROCESS (3) @@ -60,4 +58,11 @@ typedef struct _LPC_DBG_MESSAGE } Data; } LPC_DBG_MESSAGE, *PLPC_DBG_MESSAGE; + +typedef struct _LPC_TERMINATION_MESSAGE +{ + LPC_MESSAGE Header; + TIME CreationTime; +} LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE; + #endif /* __INCLUDE_NAPI_DBG_H */ diff --git a/reactos/include/napi/lpc.h b/reactos/include/napi/lpc.h deleted file mode 100644 index e35ce81395c..00000000000 --- a/reactos/include/napi/lpc.h +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef __INCLUDE_NAPI_LPC_H -#define __INCLUDE_NAPI_LPC_H - -#ifdef __USE_W32API -#include -#include -#endif /* !__USE_W32API */ - -#include - -#define MAX_MESSAGE_DATA (0x130) - -#ifndef __USE_W32API - -typedef enum -{ - UNUSED_MSG_TYPE = 0x0, /* ReactOS */ - LPC_NEW_MESSAGE = 0x0, /* NT */ - LPC_REQUEST = 0x1, - LPC_REPLY = 0x2, - LPC_DATAGRAM = 0x3, - LPC_LOST_REPLY = 0x4, - LPC_PORT_CLOSED = 0x5, - LPC_CLIENT_DIED = 0x6, - LPC_EXCEPTION = 0x7, - LPC_DEBUG_EVENT = 0x8, - LPC_ERROR_EVENT = 0x9, - LPC_CONNECTION_REQUEST = 0xa, - LPC_CONNECTION_REFUSED = 0xb - -} LPC_TYPE, *PLPC_TYPE; - -typedef struct _LPC_SECTION_WRITE -{ - ULONG Length; - HANDLE SectionHandle; - ULONG SectionOffset; - ULONG ViewSize; - PVOID ViewBase; - PVOID TargetViewBase; -} LPC_SECTION_WRITE, *PLPC_SECTION_WRITE; - -typedef struct _LPC_SECTION_READ -{ - ULONG Length; - ULONG ViewSize; - PVOID ViewBase; -} LPC_SECTION_READ, *PLPC_SECTION_READ; - -typedef struct _LPC_MESSAGE -{ - USHORT DataSize; - USHORT MessageSize; - USHORT MessageType; - USHORT VirtualRangesOffset; - CLIENT_ID ClientId; - ULONG MessageId; - ULONG SectionSize; /* CallbackID */ -} LPC_MESSAGE, *PLPC_MESSAGE; - -#endif /* !__USE_W32API */ - - -typedef struct _LPC_TERMINATION_MESSAGE -{ - LPC_MESSAGE Header; - TIME CreationTime; -} LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE; - -typedef struct _LPC_DEBUG_MESSAGE -{ - LPC_MESSAGE Header; - ULONG EventCode; - 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; -#ifdef ANONYMOUSUNIONS - }; -#else - } u; -#endif -} LPC_DEBUG_MESSAGE, * PLPC_DEBUG_MESSAGE; - -typedef struct _LPC_MAX_MESSAGE -{ - LPC_MESSAGE Header; - BYTE Data[MAX_MESSAGE_DATA]; -} LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE; - -#define PORT_MESSAGE_TYPE(m) (LPC_TYPE)((m).Header.MessageType) - -#ifndef __USE_NT_LPC__ -NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE PortHandle, - HANDLE NamedPortHandle, - PLPC_MESSAGE ServerReply, - BOOLEAN AcceptIt, - PLPC_SECTION_WRITE WriteMap, - PLPC_SECTION_READ ReadMap); -#else -NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE PortHandle, - ULONG PortIdentifier, - PLPC_MESSAGE ServerReply, - BOOLEAN AcceptIt, - PLPC_SECTION_WRITE WriteMap, - PLPC_SECTION_READ ReadMap); -#endif /* ndef __USE_NT_LPC__ */ - -NTSTATUS STDCALL NtCompleteConnectPort (HANDLE PortHandle); - -NTSTATUS STDCALL NtConnectPort(PHANDLE PortHandle, - PUNICODE_STRING PortName, - PSECURITY_QUALITY_OF_SERVICE SecurityQos, - PLPC_SECTION_WRITE SectionInfo, - PLPC_SECTION_READ MapInfo, - PULONG MaxMessageSize, - PVOID ConnectInfo, - PULONG ConnectInfoLength); - -NTSTATUS STDCALL NtReplyWaitReplyPort (HANDLE PortHandle, - PLPC_MESSAGE ReplyMessage); - -NTSTATUS STDCALL NtCreatePort(PHANDLE PortHandle, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG MaxConnectInfoLength, - ULONG MaxDataLength, - ULONG NPMessageQueueSize OPTIONAL); - -NTSTATUS STDCALL NtCreateWaitablePort(PHANDLE PortHandle, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG MaxConnectInfoLength, - ULONG MaxDataLength, - ULONG NPMessageQueueSize OPTIONAL); - -NTSTATUS STDCALL NtImpersonateClientOfPort (HANDLE PortHandle, - PLPC_MESSAGE ClientMessage); - -NTSTATUS STDCALL NtListenPort (HANDLE PortHandle, - PLPC_MESSAGE LpcMessage); - -NTSTATUS STDCALL NtQueryInformationPort (HANDLE PortHandle, - CINT PortInformationClass, - PVOID PortInformation, - ULONG PortInformationLength, - PULONG ReturnLength); -NTSTATUS STDCALL NtReplyPort (HANDLE PortHandle, - PLPC_MESSAGE LpcReply); -NTSTATUS STDCALL NtReplyWaitReceivePort (HANDLE PortHandle, - PULONG PortId, - PLPC_MESSAGE MessageReply, - PLPC_MESSAGE MessageRequest); -NTSTATUS STDCALL NtRequestPort (HANDLE PortHandle, - PLPC_MESSAGE LpcMessage); - -NTSTATUS STDCALL NtRequestWaitReplyPort (HANDLE PortHandle, - PLPC_MESSAGE LpcReply, - PLPC_MESSAGE LpcRequest); - -NTSTATUS STDCALL NtReadRequestData (HANDLE PortHandle, - PLPC_MESSAGE Message, - ULONG Index, - PVOID Buffer, - ULONG BufferLength, - PULONG ReturnLength); - -NTSTATUS STDCALL NtWriteRequestData (HANDLE PortHandle, - PLPC_MESSAGE Message, - ULONG Index, - PVOID Buffer, - ULONG BufferLength, - PULONG ReturnLength); - -NTSTATUS STDCALL ZwConnectPort(PHANDLE PortHandle, - PUNICODE_STRING PortName, - PSECURITY_QUALITY_OF_SERVICE SecurityQos, - PLPC_SECTION_WRITE SectionInfo, - PLPC_SECTION_READ MapInfo, - PULONG MaxMessageSize, - PVOID ConnectInfo, - PULONG ConnectInfoLength); - -NTSTATUS STDCALL ZwRequestWaitReplyPort(HANDLE PortHandle, - PLPC_MESSAGE LpcReply, - PLPC_MESSAGE LpcRequest); - - -#endif /* __INCLUDE_NAPI_LPC_H */ diff --git a/reactos/include/napi/npipe.h b/reactos/include/napi/npipe.h index 786e67273c5..b2e9520809c 100644 --- a/reactos/include/napi/npipe.h +++ b/reactos/include/napi/npipe.h @@ -5,84 +5,6 @@ #error you must not include directly, include instead #endif /* __NTDDK_H */ -/* - * FUNCTION: ZwCreateNamedPipeFile creates named pipe - * ARGUMENTS: - * NamedPipeFileHandle (OUT) = Caller supplied storage for the - * resulting handle - * DesiredAccess = Specifies the type of access that the caller - * requires to the file boject - * ObjectAttributes = Points to a structure that specifies the - * object attributes. - * IoStatusBlock = Points to a variable that receives the final - * completion status and information - * ShareAccess = Specifies the limitations on sharing of the file. - * This parameter can be zero or any compatible - * combination of the following flags - * FILE_SHARE_READ - * FILE_SHARE_WRITE - * CreateDisposition = Specifies what to do depending on whether - * the file already exists. This must be one of - * the following values - * FILE_OPEN - * FILE_CREATE - * FILE_OPEN_IF - * CreateOptions = Specifies the options to be applied when - * creating or opening the file, as a compatible - * combination of the following flags - * FILE_WRITE_THROUGH - * FILE_SYNCHRONOUS_IO_ALERT - * FILE_SYNCHRONOUS_IO_NONALERT - * TypeMessage = Specifies whether the data written to the pipe is - * interpreted as a sequence of messages or as a - * stream of bytes - * ReadModeMessage = Specifies whether the data read from the pipe - * is interpreted as a sequence of messages or as - * a stream of bytes - * NonBlocking = Specifies whether non-blocking mode is enabled - * MaxInstances = Specifies the maximum number of instancs that can - * be created for this pipe - * InBufferSize = Specifies the number of bytes to reserve for the - * input buffer - * OutBufferSize = Specifies the number of bytes to reserve for the - * output buffer - * DefaultTimeout = Optionally points to a variable that specifies - * the default timeout value in units of - * 100-nanoseconds. - * REMARKS: This funciton maps to the win32 function CreateNamedPipe - * RETURNS: - * Status - */ - -NTSTATUS STDCALL NtCreateNamedPipeFile(OUT PHANDLE NamedPipeFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG CreateDisposition, - IN ULONG CreateOptions, - IN BOOLEAN WriteModeMessage, - IN BOOLEAN ReadModeMessage, - IN BOOLEAN NonBlocking, - IN ULONG MaxInstances, - IN ULONG InBufferSize, - IN ULONG OutBufferSize, - IN PLARGE_INTEGER DefaultTimeOut); -NTSTATUS STDCALL ZwCreateNamedPipeFile(OUT PHANDLE NamedPipeFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG CreateDisposition, - IN ULONG CreateOptions, - IN BOOLEAN WriteModeMessage, - IN BOOLEAN ReadModeMessage, - IN BOOLEAN NonBlocking, - IN ULONG MaxInstances, - IN ULONG InBufferSize, - IN ULONG OutBufferSize, - IN PLARGE_INTEGER DefaultTimeOut); - #define FSCTL_PIPE_ASSIGN_EVENT \ CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) diff --git a/reactos/include/ntos.h b/reactos/include/ntos.h index 0a245c99f11..f461f9ab571 100644 --- a/reactos/include/ntos.h +++ b/reactos/include/ntos.h @@ -1,6 +1,6 @@ #ifndef _NTOS_H #define _NTOS_H -/* $Id: ntos.h,v 1.17 2003/10/15 21:15:18 ekohl Exp $ */ +/* $Id: ntos.h,v 1.18 2004/01/06 16:05:47 ekohl Exp $ */ #if defined(NTOS_MODE_USER) /* @@ -32,7 +32,6 @@ #include "napi/i386/segment.h" #include "napi/types.h" #include "napi/dbg.h" -#include "napi/lpc.h" #include "napi/npipe.h" #include "napi/shared_data.h" #include "napi/win32.h" @@ -74,7 +73,6 @@ #include "napi/i386/segment.h" #include "napi/types.h" #include "napi/dbg.h" -#include "napi/lpc.h" #include "napi/npipe.h" #include "napi/shared_data.h" #include "napi/win32.h" diff --git a/reactos/include/ntos/zw.h b/reactos/include/ntos/zw.h index 20dab133e65..6b593d4c0e6 100755 --- a/reactos/include/ntos/zw.h +++ b/reactos/include/ntos/zw.h @@ -1,5 +1,5 @@ -/* $Id: zw.h,v 1.20 2003/11/21 18:42:05 navaraf Exp $ +/* $Id: zw.h,v 1.21 2004/01/06 15:57:48 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -57,6 +57,24 @@ typedef struct _EVENT_BASIC_INFORMATION //#define SECURITY_INFORMATION ULONG //typedef ULONG SECURITY_INFORMATION; +#ifndef __USE_NT_LPC__ +NTSTATUS STDCALL +NtAcceptConnectPort (PHANDLE PortHandle, + HANDLE NamedPortHandle, + PLPC_MESSAGE ServerReply, + BOOLEAN AcceptIt, + PLPC_SECTION_WRITE WriteMap, + PLPC_SECTION_READ ReadMap); +#else +NTSTATUS STDCALL +NtAcceptConnectPort (PHANDLE PortHandle, + ULONG PortIdentifier, + PLPC_MESSAGE ServerReply, + BOOLEAN AcceptIt, + PLPC_SECTION_WRITE WriteMap, + PLPC_SECTION_READ ReadMap); +#endif /* ndef __USE_NT_LPC__ */ + /* * FUNCTION: Adjusts the groups in an access token * ARGUMENTS: @@ -344,6 +362,34 @@ ZwCloseObjectAuditAlarm( IN BOOLEAN GenerateOnClose ); + +NTSTATUS STDCALL +NtCompleteConnectPort (HANDLE PortHandle); + +NTSTATUS STDCALL +ZwCompleteConnectPort (HANDLE PortHandle); + + +NTSTATUS STDCALL +NtConnectPort (PHANDLE PortHandle, + PUNICODE_STRING PortName, + PSECURITY_QUALITY_OF_SERVICE SecurityQos, + PLPC_SECTION_WRITE SectionInfo, + PLPC_SECTION_READ MapInfo, + PULONG MaxMessageSize, + PVOID ConnectInfo, + PULONG ConnectInfoLength); + +NTSTATUS STDCALL +ZwConnectPort (PHANDLE PortHandle, + PUNICODE_STRING PortName, + PSECURITY_QUALITY_OF_SERVICE SecurityQos, + PLPC_SECTION_WRITE SectionInfo, + PLPC_SECTION_READ MapInfo, + PULONG MaxMessageSize, + PVOID ConnectInfo, + PULONG ConnectInfoLength); + /* * FUNCTION: Creates a directory object * ARGUMENTS: @@ -633,6 +679,102 @@ ZwCreateMutant( IN BOOLEAN InitialOwner ); +/* + * FUNCTION: Creates a named pipe + * ARGUMENTS: + * NamedPipeFileHandle (OUT) = Caller supplied storage for the + * resulting handle + * DesiredAccess = Specifies the type of access that the caller + * requires to the file boject + * ObjectAttributes = Points to a structure that specifies the + * object attributes. + * IoStatusBlock = Points to a variable that receives the final + * completion status and information + * ShareAccess = Specifies the limitations on sharing of the file. + * This parameter can be zero or any compatible + * combination of the following flags + * FILE_SHARE_READ + * FILE_SHARE_WRITE + * CreateDisposition = Specifies what to do depending on whether + * the file already exists. This must be one of + * the following values + * FILE_OPEN + * FILE_CREATE + * FILE_OPEN_IF + * CreateOptions = Specifies the options to be applied when + * creating or opening the file, as a compatible + * combination of the following flags + * FILE_WRITE_THROUGH + * FILE_SYNCHRONOUS_IO_ALERT + * FILE_SYNCHRONOUS_IO_NONALERT + * TypeMessage = Specifies whether the data written to the pipe is + * interpreted as a sequence of messages or as a + * stream of bytes + * ReadModeMessage = Specifies whether the data read from the pipe + * is interpreted as a sequence of messages or as + * a stream of bytes + * NonBlocking = Specifies whether non-blocking mode is enabled + * MaxInstances = Specifies the maximum number of instancs that can + * be created for this pipe + * InBufferSize = Specifies the number of bytes to reserve for the + * input buffer + * OutBufferSize = Specifies the number of bytes to reserve for the + * output buffer + * DefaultTimeout = Optionally points to a variable that specifies + * the default timeout value in units of + * 100-nanoseconds. + * REMARKS: This funciton maps to the win32 function CreateNamedPipe + * RETURNS: + * Status + */ +NTSTATUS STDCALL +NtCreateNamedPipeFile (OUT PHANDLE NamedPipeFileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG ShareAccess, + IN ULONG CreateDisposition, + IN ULONG CreateOptions, + IN BOOLEAN WriteModeMessage, + IN BOOLEAN ReadModeMessage, + IN BOOLEAN NonBlocking, + IN ULONG MaxInstances, + IN ULONG InBufferSize, + IN ULONG OutBufferSize, + IN PLARGE_INTEGER DefaultTimeOut); + +NTSTATUS STDCALL +ZwCreateNamedPipeFile (OUT PHANDLE NamedPipeFileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG ShareAccess, + IN ULONG CreateDisposition, + IN ULONG CreateOptions, + IN BOOLEAN WriteModeMessage, + IN BOOLEAN ReadModeMessage, + IN BOOLEAN NonBlocking, + IN ULONG MaxInstances, + IN ULONG InBufferSize, + IN ULONG OutBufferSize, + IN PLARGE_INTEGER DefaultTimeOut); + + +NTSTATUS STDCALL +NtCreatePort (PHANDLE PortHandle, + POBJECT_ATTRIBUTES ObjectAttributes, + ULONG MaxConnectInfoLength, + ULONG MaxDataLength, + ULONG NPMessageQueueSize OPTIONAL); + +NTSTATUS STDCALL +NtCreatePort (PHANDLE PortHandle, + POBJECT_ATTRIBUTES ObjectAttributes, + ULONG MaxConnectInfoLength, + ULONG MaxDataLength, + ULONG NPMessageQueueSize OPTIONAL); + + /* * FUNCTION: Creates a process. * ARGUMENTS: @@ -649,8 +791,8 @@ ZwCreateMutant( * This function maps to the win32 CreateProcess. * RETURNS: Status */ -NTSTATUS -STDCALL +NTSTATUS +STDCALL NtCreateProcess( OUT PHANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, @@ -662,8 +804,8 @@ NtCreateProcess( IN HANDLE ExceptionPort OPTIONAL ); -NTSTATUS -STDCALL +NTSTATUS +STDCALL ZwCreateProcess( OUT PHANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, @@ -692,11 +834,11 @@ ZwCreateProcess( NTSTATUS STDCALL -NtCreateSection( - OUT PHANDLE SectionHandle, +NtCreateSection( + OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN PLARGE_INTEGER MaximumSize OPTIONAL, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL @@ -704,11 +846,11 @@ NtCreateSection( NTSTATUS STDCALL -ZwCreateSection( - OUT PHANDLE SectionHandle, +ZwCreateSection( + OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN PLARGE_INTEGER MaximumSize OPTIONAL, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL @@ -874,6 +1016,22 @@ NtCurrentTeb(VOID ); #endif + +NTSTATUS STDCALL +NtCreateWaitablePort (PHANDLE PortHandle, + POBJECT_ATTRIBUTES ObjectAttributes, + ULONG MaxConnectInfoLength, + ULONG MaxDataLength, + ULONG NPMessageQueueSize OPTIONAL); + +NTSTATUS STDCALL +ZwCreateWaitablePort (PHANDLE PortHandle, + POBJECT_ATTRIBUTES ObjectAttributes, + ULONG MaxConnectInfoLength, + ULONG MaxDataLength, + ULONG NPMessageQueueSize OPTIONAL); + + /* * FUNCTION: Deletes an atom from the global atom table * ARGUMENTS: @@ -1256,17 +1414,26 @@ ZwFsControlFile( NTSTATUS STDCALL NtGetContextThread( - IN HANDLE ThreadHandle, + IN HANDLE ThreadHandle, OUT PCONTEXT Context ); NTSTATUS STDCALL ZwGetContextThread( - IN HANDLE ThreadHandle, + IN HANDLE ThreadHandle, OUT PCONTEXT Context ); + +NTSTATUS STDCALL +NtImpersonateClientOfPort (HANDLE PortHandle, + PLPC_MESSAGE ClientMessage); + +NTSTATUS STDCALL +ZwImpersonateClientOfPort (HANDLE PortHandle, + PLPC_MESSAGE ClientMessage); + /* * FUNCTION: Sets a thread to impersonate another * ARGUMENTS: @@ -1309,6 +1476,16 @@ ZwInitializeRegistry( BOOLEAN SetUpBoot ); + +NTSTATUS STDCALL +NtListenPort (HANDLE PortHandle, + PLPC_MESSAGE LpcMessage); + +NTSTATUS STDCALL +ZwListenPort (HANDLE PortHandle, + PLPC_MESSAGE LpcMessage); + + /* * FUNCTION: Loads a driver. * ARGUMENTS: @@ -2288,6 +2465,22 @@ ZwQueryInformationFile( ); +NTSTATUS STDCALL +NtQueryInformationPort (HANDLE PortHandle, + CINT PortInformationClass, + PVOID PortInformation, + ULONG PortInformationLength, + PULONG ReturnLength); + +#ifndef __USE_W32API +NTSTATUS STDCALL +ZwQueryInformationPort (HANDLE PortHandle, + CINT PortInformationClass, + PVOID PortInformation, + ULONG PortInformationLength, + PULONG ReturnLength); +#endif + /* * FUNCTION: Queries the information of a thread object. * ARGUMENTS: @@ -2858,34 +3051,53 @@ ZwReadFile( Key = Key = If a range is lock a matching key will allow the read to continue. * RETURNS: Status * -*/ +*/ NTSTATUS STDCALL -NtReadFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); +NtReadFileScatter( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, + IN PVOID UserApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK UserIoStatusBlock, + IN FILE_SEGMENT_ELEMENT BufferDescription[], + IN ULONG BufferLength, + IN PLARGE_INTEGER ByteOffset, + IN PULONG Key OPTIONAL + ); NTSTATUS STDCALL -ZwReadFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); +ZwReadFileScatter( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, + IN PVOID UserApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK UserIoStatusBlock, + IN FILE_SEGMENT_ELEMENT BufferDescription[], + IN ULONG BufferLength, + IN PLARGE_INTEGER ByteOffset, + IN PULONG Key OPTIONAL + ); + + +NTSTATUS STDCALL +NtReadRequestData (HANDLE PortHandle, + PLPC_MESSAGE Message, + ULONG Index, + PVOID Buffer, + ULONG BufferLength, + PULONG ReturnLength); + +NTSTATUS STDCALL +ZwReadRequestData (HANDLE PortHandle, + PLPC_MESSAGE Message, + ULONG Index, + PVOID Buffer, + ULONG BufferLength, + PULONG ReturnLength); + + /* * FUNCTION: Copies a range of virtual memory to a buffer * ARGUMENTS: @@ -3020,18 +3232,69 @@ ZwRemoveIoCompletion( NTSTATUS STDCALL NtReplaceKey( - IN POBJECT_ATTRIBUTES ObjectAttributes, + IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes + IN POBJECT_ATTRIBUTES ReplacedObjectAttributes ); NTSTATUS STDCALL ZwReplaceKey( - IN POBJECT_ATTRIBUTES ObjectAttributes, + IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes + IN POBJECT_ATTRIBUTES ReplacedObjectAttributes ); + +NTSTATUS STDCALL +NtReplyPort (HANDLE PortHandle, + PLPC_MESSAGE LpcReply); + +NTSTATUS STDCALL +ZwReplyPort (HANDLE PortHandle, + PLPC_MESSAGE LpcReply); + + +NTSTATUS STDCALL +NtReplyWaitReceivePort (HANDLE PortHandle, + PULONG PortId, + PLPC_MESSAGE MessageReply, + PLPC_MESSAGE MessageRequest); + +NTSTATUS STDCALL +ZwReplyWaitReceivePort (HANDLE PortHandle, + PULONG PortId, + PLPC_MESSAGE MessageReply, + PLPC_MESSAGE MessageRequest); + + +NTSTATUS STDCALL +NtReplyWaitReplyPort (HANDLE PortHandle, + PLPC_MESSAGE ReplyMessage); + +NTSTATUS STDCALL +ZwReplyWaitReplyPort (HANDLE PortHandle, + PLPC_MESSAGE ReplyMessage); + + +NTSTATUS STDCALL +NtRequestPort (HANDLE PortHandle, + PLPC_MESSAGE LpcMessage); + +NTSTATUS STDCALL +ZwRequestPort (HANDLE PortHandle, + PLPC_MESSAGE LpcMessage); + + +NTSTATUS STDCALL +NtRequestWaitReplyPort (HANDLE PortHandle, + PLPC_MESSAGE LpcReply, + PLPC_MESSAGE LpcRequest); + +NTSTATUS STDCALL +ZwRequestWaitReplyPort (HANDLE PortHandle, + PLPC_MESSAGE LpcReply, + PLPC_MESSAGE LpcRequest); + /* * FUNCTION: Resets a event to a non signaled state * ARGUMENTS: @@ -3705,12 +3968,36 @@ ZwShutdownSystem( IN SHUTDOWN_ACTION Action ); +/* + * FUNCTION: Signals an object and wait for an other one. + * ARGUMENTS: + * SignalObject = Handle to the object that should be signaled + * WaitObject = Handle to the object that should be waited for + * Alertable = True if the wait is alertable + * Time = The time to wait + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtSignalAndWaitForSingleObject( + IN HANDLE SignalObject, + IN HANDLE WaitObject, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Time + ); -/* --- PROFILING --- */ +NTSTATUS +STDCALL +NtSignalAndWaitForSingleObject( + IN HANDLE SignalObject, + IN HANDLE WaitObject, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Time + ); /* * FUNCTION: Starts profiling - * ARGUMENTS: + * ARGUMENTS: * ProfileHandle = Handle to the profile * RETURNS: Status */ @@ -3729,9 +4016,9 @@ ZwStartProfile( /* * FUNCTION: Stops profiling - * ARGUMENTS: + * ARGUMENTS: * ProfileHandle = Handle to the profile - * RETURNS: Status + * RETURNS: Status */ NTSTATUS @@ -3755,26 +4042,24 @@ ZwStopProfile( * ThreadHandle = Handle to the process * ExitStatus = The exit status of the process to terminate with. * REMARKS - Native applications should kill themselves using this function. + * Native applications should kill themselves using this function. * RETURNS: Status - */ + */ NTSTATUS STDCALL NtTerminateProcess( - IN HANDLE ProcessHandle , + IN HANDLE ProcessHandle, IN NTSTATUS ExitStatus ); NTSTATUS STDCALL ZwTerminateProcess( - IN HANDLE ProcessHandle , + IN HANDLE ProcessHandle, IN NTSTATUS ExitStatus ); -/* --- DEVICE DRIVER CONTROL --- */ - /* - * FUNCTION: Unloads a driver. + * FUNCTION: Unloads a driver. * ARGUMENTS: * DriverServiceName = Name of the driver to unload * RETURNS: Status @@ -3790,7 +4075,45 @@ ZwUnloadDriver( IN PUNICODE_STRING DriverServiceName ); -/* --- VIRTUAL MEMORY MANAGEMENT --- */ +/* + * FUNCTION: Unmaps a piece of virtual memory backed by a file. + * ARGUMENTS: + * ProcessHandle = Handle to the process + * BaseAddress = The address where the mapping begins + * REMARK: + This procedure maps to the win32 UnMapViewOfFile + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtUnmapViewOfSection( + IN HANDLE ProcessHandle, + IN PVOID BaseAddress + ); +NTSTATUS +STDCALL +ZwUnmapViewOfSection( + IN HANDLE ProcessHandle, + IN PVOID BaseAddress + ); + + +NTSTATUS STDCALL +NtWriteRequestData (HANDLE PortHandle, + PLPC_MESSAGE Message, + ULONG Index, + PVOID Buffer, + ULONG BufferLength, + PULONG ReturnLength); + +NTSTATUS STDCALL +ZwWriteRequestData (HANDLE PortHandle, + PLPC_MESSAGE Message, + ULONG Index, + PVOID Buffer, + ULONG BufferLength, + PULONG ReturnLength); + /* * FUNCTION: Writes a range of virtual memory @@ -3824,56 +4147,6 @@ ZwWriteVirtualMemory( OUT PULONG NumberOfBytesWritten ); -/* - * FUNCTION: Unmaps a piece of virtual memory backed by a file. - * ARGUMENTS: - * ProcessHandle = Handle to the process - * BaseAddress = The address where the mapping begins - * REMARK: - This procedure maps to the win32 UnMapViewOfFile - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtUnmapViewOfSection( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); -NTSTATUS -STDCALL -ZwUnmapViewOfSection( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); - -/* --- OBJECT SYNCHRONIZATION --- */ - -/* - * FUNCTION: Signals an object and wait for an other one. - * ARGUMENTS: - * SignalObject = Handle to the object that should be signaled - * WaitObject = Handle to the object that should be waited for - * Alertable = True if the wait is alertable - * Time = The time to wait - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSignalAndWaitForSingleObject( - IN HANDLE SignalObject, - IN HANDLE WaitObject, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -NTSTATUS -STDCALL -NtSignalAndWaitForSingleObject( - IN HANDLE SignalObject, - IN HANDLE WaitObject, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); /* * FUNCTION: Waits for an object to become signalled. diff --git a/reactos/include/ntos/zwtypes.h b/reactos/include/ntos/zwtypes.h index 91ba6faeb89..c22a0cf68df 100755 --- a/reactos/include/ntos/zwtypes.h +++ b/reactos/include/ntos/zwtypes.h @@ -1656,8 +1656,67 @@ typedef enum _TIMER_INFORMATION_CLASS TimerBasicInformation } TIMER_INFORMATION_CLASS; -typedef -struct _LPC_PORT_BASIC_INFORMATION +#ifndef __USE_W32API + +typedef enum +{ + UNUSED_MSG_TYPE = 0x0, /* ReactOS */ + LPC_NEW_MESSAGE = 0x0, /* NT */ + LPC_REQUEST = 0x1, + LPC_REPLY = 0x2, + LPC_DATAGRAM = 0x3, + LPC_LOST_REPLY = 0x4, + LPC_PORT_CLOSED = 0x5, + LPC_CLIENT_DIED = 0x6, + LPC_EXCEPTION = 0x7, + LPC_DEBUG_EVENT = 0x8, + LPC_ERROR_EVENT = 0x9, + LPC_CONNECTION_REQUEST = 0xa, + LPC_CONNECTION_REFUSED = 0xb + +} LPC_TYPE, *PLPC_TYPE; + +typedef struct _LPC_SECTION_WRITE +{ + ULONG Length; + HANDLE SectionHandle; + ULONG SectionOffset; + ULONG ViewSize; + PVOID ViewBase; + PVOID TargetViewBase; +} LPC_SECTION_WRITE, *PLPC_SECTION_WRITE; + +typedef struct _LPC_SECTION_READ +{ + ULONG Length; + ULONG ViewSize; + PVOID ViewBase; +} LPC_SECTION_READ, *PLPC_SECTION_READ; + +typedef struct _LPC_MESSAGE +{ + USHORT DataSize; + USHORT MessageSize; + USHORT MessageType; + USHORT VirtualRangesOffset; + CLIENT_ID ClientId; + ULONG MessageId; + ULONG SectionSize; /* CallbackID */ +} LPC_MESSAGE, *PLPC_MESSAGE; + +#define MAX_MESSAGE_DATA (0x130) + +typedef struct _LPC_MAX_MESSAGE +{ + LPC_MESSAGE Header; + BYTE Data[MAX_MESSAGE_DATA]; +} LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE; + +#define PORT_MESSAGE_TYPE(m) (LPC_TYPE)((m).Header.MessageType) + +#endif /* __USE_W32API */ + +typedef struct _LPC_PORT_BASIC_INFORMATION { DWORD Unknown0; DWORD Unknown1; @@ -1676,6 +1735,7 @@ struct _LPC_PORT_BASIC_INFORMATION } LPC_PORT_BASIC_INFORMATION, * PLPC_PORT_BASIC_INFORMATION; + typedef struct _KINTERRUPT { ULONG Vector; diff --git a/reactos/lib/ntdll/dbg/debug.c b/reactos/lib/ntdll/dbg/debug.c index d204ee43f04..02a9d7d48d1 100644 --- a/reactos/lib/ntdll/dbg/debug.c +++ b/reactos/lib/ntdll/dbg/debug.c @@ -1,4 +1,4 @@ -/* $Id: debug.c,v 1.13 2003/12/30 05:10:32 hyperion Exp $ +/* $Id: debug.c,v 1.14 2004/01/06 16:08:02 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -16,7 +16,6 @@ #include #include #include -#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/secur32/lsa.c b/reactos/lib/secur32/lsa.c index 3e43bcd1afe..37dc10f4a1e 100644 --- a/reactos/lib/secur32/lsa.c +++ b/reactos/lib/secur32/lsa.c @@ -1,4 +1,4 @@ -/* $Id: lsa.c,v 1.9 2003/11/17 02:12:50 hyperion Exp $ +/* $Id: lsa.c,v 1.10 2004/01/06 16:08:25 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/reactos/ntoskrnl/include/internal/dbg.h b/reactos/ntoskrnl/include/internal/dbg.h index 87b3d1ec51b..824d33688ff 100644 --- a/reactos/ntoskrnl/include/internal/dbg.h +++ b/reactos/ntoskrnl/include/internal/dbg.h @@ -1,7 +1,6 @@ #ifndef __INCLUDE_INTERNAL_DBG_H #define __INCLUDE_INTERNAL_DBG_H -#include #include #include diff --git a/reactos/ntoskrnl/include/internal/port.h b/reactos/ntoskrnl/include/internal/port.h index f73af613a47..8830fef0dad 100644 --- a/reactos/ntoskrnl/include/internal/port.h +++ b/reactos/ntoskrnl/include/internal/port.h @@ -1,8 +1,6 @@ #ifndef __INCLUDE_INTERNAL_PORT_H #define __INCLUDE_INTERNAL_PORT_H -#include - typedef struct _EPORT_LISTENER { HANDLE ListenerPid; diff --git a/reactos/services/eventlog/logport.c b/reactos/services/eventlog/logport.c index 58fbbd62ba5..dc7bc2c3f3b 100644 --- a/reactos/services/eventlog/logport.c +++ b/reactos/services/eventlog/logport.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: logport.c,v 1.8 2003/11/24 16:41:41 ekohl Exp $ +/* $Id: logport.c,v 1.9 2004/01/06 16:08:46 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -31,7 +31,6 @@ #define NTOS_MODE_USER #include -#include #include #include diff --git a/reactos/subsys/smss/init.c b/reactos/subsys/smss/init.c index a4cd2ce15ce..1176746aa3b 100644 --- a/reactos/subsys/smss/init.c +++ b/reactos/subsys/smss/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.53 2003/11/24 16:15:00 gvg Exp $ +/* $Id: init.c,v 1.54 2004/01/06 16:10:11 ekohl Exp $ * * init.c - Session Manager initialization * @@ -32,7 +32,6 @@ #include #include #include -#include #include #include "smss.h" @@ -520,7 +519,7 @@ SmLoadKnownDlls(VOID) FILE_SYNCHRONOUS_IO_NONALERT | FILE_DIRECTORY_FILE); if (!NT_SUCCESS(Status)) { - DPRINT("NtOpenFile() failed (Status %lx)\n", Status); + DPRINT1("NtOpenFile(%wZ) failed (Status %lx)\n", &DllNtPath, Status); return Status; } diff --git a/reactos/subsys/smss/smapi.c b/reactos/subsys/smss/smapi.c index fca6c8297d9..1a9a58044d2 100644 --- a/reactos/subsys/smss/smapi.c +++ b/reactos/subsys/smss/smapi.c @@ -1,4 +1,4 @@ -/* $Id: smapi.c,v 1.10 2003/11/17 02:12:51 hyperion Exp $ +/* $Id: smapi.c,v 1.11 2004/01/06 16:10:11 ekohl Exp $ * * Reactos Session Manager * @@ -7,7 +7,6 @@ #include #include -#include #include #include "smss.h" diff --git a/reactos/subsys/system/winlogon/winlogon.c b/reactos/subsys/system/winlogon/winlogon.c index 0d22fafe80c..66cff54fa25 100644 --- a/reactos/subsys/system/winlogon/winlogon.c +++ b/reactos/subsys/system/winlogon/winlogon.c @@ -1,4 +1,4 @@ -/* $Id: winlogon.c,v 1.23 2003/12/18 09:51:08 gvg Exp $ +/* $Id: winlogon.c,v 1.24 2004/01/06 16:11:57 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -15,7 +15,6 @@ #include #include #include -#include #include #include "setup.h" diff --git a/reactos/subsys/system/winlogon/wlx.c b/reactos/subsys/system/winlogon/wlx.c index a66eecd8f4d..47d4b099d5b 100644 --- a/reactos/subsys/system/winlogon/wlx.c +++ b/reactos/subsys/system/winlogon/wlx.c @@ -1,4 +1,4 @@ -/* $Id: wlx.c,v 1.2 2003/12/07 00:04:20 weiden Exp $ +/* $Id: wlx.c,v 1.3 2004/01/06 16:11:57 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -15,7 +15,6 @@ #include #include #include -#include #include #include "setup.h"