mirror of
https://github.com/reactos/reactos.git
synced 2024-07-03 03:04:22 +00:00
Stubs for some new LPC functions (w2k).
Added some base checking in NtCreatePort's parameters. svn path=/trunk/; revision=1581
This commit is contained in:
parent
17b93d7d9b
commit
7bfcc9b94c
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: connect.c,v 1.3 2001/01/18 15:00:09 dwelch Exp $
|
/* $Id: connect.c,v 1.4 2001/01/29 00:13:21 ea Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -248,5 +248,42 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
return (STATUS_SUCCESS);
|
return (STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* NAME EXPORTED
|
||||||
|
* NtSecureConnectPort@36
|
||||||
|
*
|
||||||
|
* DESCRIPTION
|
||||||
|
* Connect to a named port and wait for the other side to
|
||||||
|
* accept the connection. Possibly verify that the server
|
||||||
|
* matches the ServerSid (trusted server).
|
||||||
|
* Present in w2k+.
|
||||||
|
*
|
||||||
|
* ARGUMENTS
|
||||||
|
* ConnectedPort
|
||||||
|
* PortName
|
||||||
|
* Qos
|
||||||
|
* WriteMap
|
||||||
|
* ServerSid
|
||||||
|
* ReadMap
|
||||||
|
* MaxMessageSize
|
||||||
|
* ConnectInfo
|
||||||
|
* UserConnectInfoLength
|
||||||
|
*
|
||||||
|
* RETURN VALUE
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
NTSTATUS STDCALL
|
||||||
|
NtSecureConnectPort (OUT PHANDLE ConnectedPort,
|
||||||
|
IN PUNICODE_STRING PortName,
|
||||||
|
IN PSECURITY_QUALITY_OF_SERVICE Qos,
|
||||||
|
IN OUT PLPC_SECTION_WRITE WriteMap OPTIONAL,
|
||||||
|
IN PSID ServerSid OPTIONAL,
|
||||||
|
IN OUT PLPC_SECTION_READ ReadMap OPTIONAL,
|
||||||
|
OUT PULONG MaxMessageSize OPTIONAL,
|
||||||
|
IN OUT PVOID ConnectInfo OPTIONAL,
|
||||||
|
IN OUT PULONG UserConnectInfoLength OPTIONAL)
|
||||||
|
{
|
||||||
|
return (STATUS_NOT_IMPLEMENTED);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: create.c,v 1.2 2000/10/22 16:36:51 ekohl Exp $
|
/* $Id: create.c,v 1.3 2001/01/29 00:13:22 ea Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -19,6 +19,45 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
|
static
|
||||||
|
NTSTATUS STDCALL VerifyCreateParameters (
|
||||||
|
IN PHANDLE PortHandle,
|
||||||
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
|
IN ULONG MaxConnectInfoLength,
|
||||||
|
IN ULONG MaxDataLength,
|
||||||
|
IN ULONG Reserved
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (NULL == PortHandle)
|
||||||
|
{
|
||||||
|
return (STATUS_INVALID_PARAMETER_1);
|
||||||
|
}
|
||||||
|
if (NULL == ObjectAttributes)
|
||||||
|
{
|
||||||
|
return (STATUS_INVALID_PARAMETER_2);
|
||||||
|
}
|
||||||
|
if ( (ObjectAttributes->Attributes & OBJ_OPENLINK)
|
||||||
|
|| (ObjectAttributes->Attributes & OBJ_OPENIF)
|
||||||
|
|| (ObjectAttributes->Attributes & OBJ_EXCLUSIVE)
|
||||||
|
|| (ObjectAttributes->Attributes & OBJ_PERMANENT)
|
||||||
|
|| (ObjectAttributes->Attributes & OBJ_INHERIT)
|
||||||
|
// || (ObjectAttributes->Attributes & OBJ_KERNEL_HANDLE)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return (STATUS_INVALID_PORT_ATTRIBUTES);
|
||||||
|
}
|
||||||
|
if (MaxConnectInfoLength > 0x104) /* FIXME: use a macro! */
|
||||||
|
{
|
||||||
|
return (STATUS_INVALID_PARAMETER_3);
|
||||||
|
}
|
||||||
|
if (MaxDataLength > 0x148) /* FIXME: use a macro! */
|
||||||
|
{
|
||||||
|
return (STATUS_INVALID_PARAMETER_4);
|
||||||
|
}
|
||||||
|
/* FIXME: some checking is done also on Reserved */
|
||||||
|
return (STATUS_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NiCreatePort (
|
NiCreatePort (
|
||||||
|
@ -62,6 +101,22 @@ NiCreatePort (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* NAME EXPORTED
|
||||||
|
* NtCreatePort@20
|
||||||
|
*
|
||||||
|
* DESCRIPTION
|
||||||
|
*
|
||||||
|
* ARGUMENTS
|
||||||
|
* PortHandle,
|
||||||
|
* ObjectAttributes,
|
||||||
|
* MaxConnectInfoLength,
|
||||||
|
* MaxDataLength,
|
||||||
|
* Reserved
|
||||||
|
*
|
||||||
|
* RETURN VALUE
|
||||||
|
*
|
||||||
|
*/
|
||||||
EXPORTED
|
EXPORTED
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -77,7 +132,20 @@ NtCreatePort (
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("NtCreatePort() Name %x\n", ObjectAttributes->ObjectName->Buffer);
|
DPRINT("NtCreatePort() Name %x\n", ObjectAttributes->ObjectName->Buffer);
|
||||||
|
|
||||||
|
/* Verify parameters */
|
||||||
|
Status = VerifyCreateParameters (
|
||||||
|
PortHandle,
|
||||||
|
ObjectAttributes,
|
||||||
|
MaxConnectInfoLength,
|
||||||
|
MaxDataLength,
|
||||||
|
Reserved
|
||||||
|
);
|
||||||
|
if (STATUS_SUCCESS != Status)
|
||||||
|
{
|
||||||
|
return (Status);
|
||||||
|
}
|
||||||
|
/* Ask Ob to create the object */
|
||||||
Port = ObCreateObject (
|
Port = ObCreateObject (
|
||||||
PortHandle,
|
PortHandle,
|
||||||
PORT_ALL_ACCESS,
|
PORT_ALL_ACCESS,
|
||||||
|
@ -90,13 +158,61 @@ NtCreatePort (
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = NiInitializePort (Port);
|
Status = NiInitializePort (Port);
|
||||||
Port->MaxConnectInfoLength = 260;
|
Port->MaxConnectInfoLength = 260; /* FIXME: use a macro! */
|
||||||
Port->MaxDataLength = 328;
|
Port->MaxDataLength = 328; /* FIXME: use a macro! */
|
||||||
|
|
||||||
ObDereferenceObject (Port);
|
ObDereferenceObject (Port);
|
||||||
|
|
||||||
return (Status);
|
return (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* NAME EXPORTED
|
||||||
|
* NtCreateWaitablePort@20
|
||||||
|
*
|
||||||
|
* DESCRIPTION
|
||||||
|
* Waitable ports can be connected to with NtSecureConnectPort.
|
||||||
|
* No port interface can be used with waitable ports but
|
||||||
|
* NtReplyWaitReceivePort and NtReplyWaitReceivePortEx.
|
||||||
|
* Present only in w2k+.
|
||||||
|
*
|
||||||
|
* ARGUMENTS
|
||||||
|
* PortHandle,
|
||||||
|
* ObjectAttributes,
|
||||||
|
* MaxConnectInfoLength,
|
||||||
|
* MaxDataLength,
|
||||||
|
* Reserved
|
||||||
|
*
|
||||||
|
* RETURN VALUE
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
EXPORTED
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
NtCreateWaitablePort (
|
||||||
|
OUT PHANDLE PortHandle,
|
||||||
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
|
IN ULONG MaxConnectInfoLength,
|
||||||
|
IN ULONG MaxDataLength,
|
||||||
|
IN ULONG Reserved
|
||||||
|
)
|
||||||
|
{
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
/* Verify parameters */
|
||||||
|
Status = VerifyCreateParameters (
|
||||||
|
PortHandle,
|
||||||
|
ObjectAttributes,
|
||||||
|
MaxConnectInfoLength,
|
||||||
|
MaxDataLength,
|
||||||
|
Reserved
|
||||||
|
);
|
||||||
|
if (STATUS_SUCCESS != Status)
|
||||||
|
{
|
||||||
|
return (Status);
|
||||||
|
}
|
||||||
|
/* TODO */
|
||||||
|
return (STATUS_NOT_IMPLEMENTED);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: reply.c,v 1.4 2001/01/18 15:00:09 dwelch Exp $
|
/* $Id: reply.c,v 1.5 2001/01/29 00:13:22 ea Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -115,10 +115,18 @@ NtReplyPort (IN HANDLE PortHandle,
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* NAME EXPORTED
|
* NAME EXPORTED
|
||||||
*
|
* NtReplyWaitReceivePortEx
|
||||||
|
*
|
||||||
* DESCRIPTION
|
* DESCRIPTION
|
||||||
*
|
* Can be used with waitable ports.
|
||||||
|
* Present only in w2k+.
|
||||||
|
*
|
||||||
* ARGUMENTS
|
* ARGUMENTS
|
||||||
|
* PortHandle
|
||||||
|
* PortId
|
||||||
|
* LpcReply
|
||||||
|
* LpcMessage
|
||||||
|
* Timeout
|
||||||
*
|
*
|
||||||
* RETURN VALUE
|
* RETURN VALUE
|
||||||
*
|
*
|
||||||
|
@ -126,17 +134,18 @@ NtReplyPort (IN HANDLE PortHandle,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
NtReplyWaitReceivePort (HANDLE PortHandle,
|
NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
|
||||||
PULONG PortId,
|
OUT PULONG PortId,
|
||||||
PLPC_MESSAGE LpcReply,
|
IN PLPC_MESSAGE LpcReply,
|
||||||
PLPC_MESSAGE LpcMessage)
|
OUT PLPC_MESSAGE LpcMessage,
|
||||||
|
IN PLARGE_INTEGER Timeout)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PEPORT Port;
|
PEPORT Port;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
PQUEUEDMESSAGE Request;
|
PQUEUEDMESSAGE Request;
|
||||||
|
|
||||||
DPRINT("NtReplyWaitReceivePort(PortHandle %x, LpcReply %x, "
|
DPRINT("NtReplyWaitReceivePortEx(PortHandle %x, LpcReply %x, "
|
||||||
"LpcMessage %x)\n", PortHandle, LpcReply, LpcMessage);
|
"LpcMessage %x)\n", PortHandle, LpcReply, LpcMessage);
|
||||||
|
|
||||||
Status = ObReferenceObjectByHandle(PortHandle,
|
Status = ObReferenceObjectByHandle(PortHandle,
|
||||||
|
@ -147,7 +156,7 @@ NtReplyWaitReceivePort (HANDLE PortHandle,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtReplyWaitReceivePort() = %x\n", Status);
|
DPRINT1("NtReplyWaitReceivePortEx() = %x\n", Status);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +164,7 @@ NtReplyWaitReceivePort (HANDLE PortHandle,
|
||||||
Port->State != EPORT_CONNECTED_SERVER &&
|
Port->State != EPORT_CONNECTED_SERVER &&
|
||||||
LpcReply != NULL)
|
LpcReply != NULL)
|
||||||
{
|
{
|
||||||
DPRINT1("NtReplyWaitReceivePort() = %x (State was %x)\n",
|
DPRINT1("NtReplyWaitReceivePortEx() = %x (State was %x)\n",
|
||||||
STATUS_PORT_DISCONNECTED, Port->State);
|
STATUS_PORT_DISCONNECTED, Port->State);
|
||||||
return(STATUS_PORT_DISCONNECTED);
|
return(STATUS_PORT_DISCONNECTED);
|
||||||
}
|
}
|
||||||
|
@ -174,7 +183,7 @@ NtReplyWaitReceivePort (HANDLE PortHandle,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(Port);
|
ObDereferenceObject(Port);
|
||||||
DPRINT1("NtReplyWaitReceivePort() = %x\n", Status);
|
DPRINT1("NtReplyWaitReceivePortEx() = %x\n", Status);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,7 +200,7 @@ NtReplyWaitReceivePort (HANDLE PortHandle,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtReplyWaitReceivePort() = %x\n", Status);
|
DPRINT1("NtReplyWaitReceivePortEx() = %x\n", Status);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,6 +241,39 @@ NtReplyWaitReceivePort (HANDLE PortHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* NAME EXPORTED
|
||||||
|
* NtReplyWaitReceivePort
|
||||||
|
*
|
||||||
|
* DESCRIPTION
|
||||||
|
* Can be used with waitable ports.
|
||||||
|
*
|
||||||
|
* ARGUMENTS
|
||||||
|
* PortHandle
|
||||||
|
* PortId
|
||||||
|
* LpcReply
|
||||||
|
* LpcMessage
|
||||||
|
*
|
||||||
|
* RETURN VALUE
|
||||||
|
*
|
||||||
|
* REVISIONS
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
NTSTATUS STDCALL
|
||||||
|
NtReplyWaitReceivePort (IN HANDLE PortHandle,
|
||||||
|
OUT PULONG PortId,
|
||||||
|
IN PLPC_MESSAGE LpcReply,
|
||||||
|
OUT PLPC_MESSAGE LpcMessage)
|
||||||
|
{
|
||||||
|
return NtReplyWaitReceivePortEx (
|
||||||
|
PortHandle,
|
||||||
|
PortId,
|
||||||
|
LpcReply,
|
||||||
|
LpcMessage,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* NAME
|
* NAME
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue