Index: apitests/ntdll/CMakeLists.txt =================================================================== --- modules/rostests/apitests/ntdll/CMakeLists.txt (revision 58904) +++ modules/rostests/apitests/ntdll/CMakeLists.txt (working copy) @@ -1,6 +1,7 @@ list(APPEND SOURCE LdrEnumResources.c + NtAcceptConnectPort.c NtAllocateVirtualMemory.c NtFreeVirtualMemory.c NtMapViewOfSection.c Index: apitests/ntdll/NtAcceptConnectPort.c =================================================================== --- modules/rostests/apitests/ntdll/NtAcceptConnectPort.c (revision 0) +++ modules/rostests/apitests/ntdll/NtAcceptConnectPort.c (working copy) @@ -0,0 +1,19 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Test for NtAcceptConnectPort + * PROGRAMMER: Thomas Faber + */ + +#define WIN32_NO_STATUS +#include +#include +#include + +START_TEST(NtAcceptConnectPort) +{ + NTSTATUS Status; + + Status = NtAcceptConnectPort(NULL, NULL, NULL, FALSE, NULL, NULL); + ok_hex(Status, STATUS_ACCESS_VIOLATION); +} Index: apitests/ntdll/testlist.c =================================================================== --- modules/rostests/apitests/ntdll/testlist.c (revision 58904) +++ modules/rostests/apitests/ntdll/testlist.c (working copy) @@ -4,6 +4,7 @@ #include extern void func_LdrEnumResources(void); +extern void func_NtAcceptConnectPort(void); extern void func_NtAllocateVirtualMemory(void); extern void func_NtFreeVirtualMemory(void); extern void func_NtMapViewOfSection(void); @@ -25,6 +26,7 @@ const struct test winetest_testlist[] = { { "LdrEnumResources", func_LdrEnumResources }, + { "NtAcceptConnectPort", func_NtAcceptConnectPort }, { "NtAllocateVirtualMemory", func_NtAllocateVirtualMemory }, { "NtFreeVirtualMemory", func_NtFreeVirtualMemory }, { "NtMapViewOfSection", func_NtMapViewOfSection }, Index: ntoskrnl/lpc/complete.c =================================================================== --- ntoskrnl/lpc/complete.c (revision 58910) +++ ntoskrnl/lpc/complete.c (working copy) @@ -64,6 +64,27 @@ ClientView, ServerView); + /* Check if the call comes from user mode */ + if(PreviousMode != KernelMode) + { + /* Enter SEH for probing the parameters */ + _SEH2_TRY + { + ProbeForWriteHandle(PortHandle); + ProbeForRead(ReplyMessage, sizeof(PORT_MESSAGE), sizeof(ULONG)); + + /* The following parameters are optional */ + if(ServerView) ProbeForRead(ServerView, sizeof(PORT_VIEW), sizeof(ULONG)); + if(ClientView) ProbeForRead(ClientView, sizeof(REMOTE_PORT_VIEW), sizeof(ULONG)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* There was an exception, return the exception code */ + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + } + /* Validate the size of the server view */ if ((ServerView) && (ServerView->Length != sizeof(PORT_VIEW))) {