mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
Moved some Nt/Zw functions and types.
svn path=/trunk/; revision=7483
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#ifndef __INCLUDE_NAPI_DBG_H
|
||||
#define __INCLUDE_NAPI_DBG_H
|
||||
|
||||
#include <napi/lpc.h>
|
||||
|
||||
#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 */
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
#ifndef __INCLUDE_NAPI_LPC_H
|
||||
#define __INCLUDE_NAPI_LPC_H
|
||||
|
||||
#ifdef __USE_W32API
|
||||
#include <ddk/ntapi.h>
|
||||
#include <napi/types.h>
|
||||
#endif /* !__USE_W32API */
|
||||
|
||||
#include <ntos/security.h>
|
||||
|
||||
#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 */
|
||||
@@ -5,84 +5,6 @@
|
||||
#error you must not include <napi/npipe.h> directly, include <ddk/ntddk.h> 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user