mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 04:41:24 +00:00
Added some additional csrss work
Some fixes to the queueing code Some fixes to the lpc code Fix to section code svn path=/trunk/; revision=913
This commit is contained in:
parent
c54d897571
commit
a8ca53d761
32 changed files with 571 additions and 329 deletions
|
@ -24,12 +24,14 @@ void main(int argc, char* argv[])
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE PortHandle;
|
HANDLE PortHandle;
|
||||||
LPCMESSAGE Request;
|
LPCMESSAGE Request;
|
||||||
|
ULONG ConnectInfoLength;
|
||||||
|
|
||||||
printf("(lpcclt.exe) Lpc client\n");
|
printf("(lpcclt.exe) Lpc client\n");
|
||||||
|
|
||||||
RtlInitUnicodeString(&PortName, L"\\TestPort");
|
RtlInitUnicodeString(&PortName, L"\\TestPort");
|
||||||
|
|
||||||
printf("(lpcclt.exe) Connecting to port\n");
|
printf("(lpcclt.exe) Connecting to port\n");
|
||||||
|
ConnectInfoLength = 0;
|
||||||
Status = NtConnectPort(&PortHandle,
|
Status = NtConnectPort(&PortHandle,
|
||||||
&PortName,
|
&PortName,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -37,7 +39,7 @@ void main(int argc, char* argv[])
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
0);
|
&ConnectInfoLength);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
printf("(lpcclt.exe) Failed to connect\n");
|
printf("(lpcclt.exe) Failed to connect\n");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: shmsrv.c,v 1.2 1999/12/02 20:53:52 dwelch Exp $
|
/* $Id: shmsrv.c,v 1.3 1999/12/30 01:51:36 dwelch Exp $
|
||||||
*
|
*
|
||||||
* FILE : reactos/apps/shm/shmsrv.c
|
* FILE : reactos/apps/shm/shmsrv.c
|
||||||
* AUTHOR: David Welch
|
* AUTHOR: David Welch
|
||||||
|
@ -8,30 +8,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
HANDLE OutputHandle;
|
int main(int argc, char* argv[])
|
||||||
HANDLE InputHandle;
|
|
||||||
|
|
||||||
void debug_printf(char* fmt, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buffer[255];
|
|
||||||
|
|
||||||
va_start(args,fmt);
|
|
||||||
vsprintf(buffer,fmt,args);
|
|
||||||
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID STDCALL ApcRoutine(PVOID Context,
|
|
||||||
PIO_STATUS_BLOCK IoStatus,
|
|
||||||
ULONG Reserved)
|
|
||||||
{
|
|
||||||
printf("(apc.exe) ApcRoutine(Context %x)\n", (UINT) Context);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char* argv[])
|
|
||||||
{
|
{
|
||||||
HANDLE Section;
|
HANDLE Section;
|
||||||
PVOID BaseAddress;
|
PVOID BaseAddress;
|
||||||
|
@ -41,7 +18,6 @@ main(int argc, char* argv[])
|
||||||
Section = CreateFileMappingW (
|
Section = CreateFileMappingW (
|
||||||
(HANDLE) 0xFFFFFFFF,
|
(HANDLE) 0xFFFFFFFF,
|
||||||
NULL,
|
NULL,
|
||||||
// PAGE_EXECUTE_READWRITE, invalid parameter
|
|
||||||
PAGE_READWRITE,
|
PAGE_READWRITE,
|
||||||
0,
|
0,
|
||||||
8192,
|
8192,
|
||||||
|
@ -53,6 +29,7 @@ main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("Mapping view of section\n");
|
||||||
BaseAddress = MapViewOfFile(Section,
|
BaseAddress = MapViewOfFile(Section,
|
||||||
FILE_MAP_ALL_ACCESS,
|
FILE_MAP_ALL_ACCESS,
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: ide.c,v 1.24 1999/12/22 14:48:27 dwelch Exp $
|
/* $Id: ide.c,v 1.25 1999/12/30 01:51:40 dwelch Exp $
|
||||||
*
|
*
|
||||||
* IDE.C - IDE Disk driver
|
* IDE.C - IDE Disk driver
|
||||||
* written by Rex Jolliff
|
* written by Rex Jolliff
|
||||||
|
@ -1384,6 +1384,7 @@ IDEStartIo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
default:
|
default:
|
||||||
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
|
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
|
KeBugCheck(Irp);
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
IoStartNextPacket(DeviceObject, FALSE);
|
IoStartNextPacket(DeviceObject, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -26,7 +26,8 @@ extern "C" {
|
||||||
#define IDE_MAX_BUSY_RETRIES 100
|
#define IDE_MAX_BUSY_RETRIES 100
|
||||||
//#define IDE_MAX_BUSY_RETRIES 100000
|
//#define IDE_MAX_BUSY_RETRIES 100000
|
||||||
#define IDE_MAX_DRQ_RETRIES 10000
|
#define IDE_MAX_DRQ_RETRIES 10000
|
||||||
#define IDE_MAX_CMD_RETRIES 1
|
//#define IDE_MAX_CMD_RETRIES 1
|
||||||
|
#define IDE_MAX_CMD_RETRIES 0
|
||||||
#define IDE_CMD_TIMEOUT 5
|
#define IDE_CMD_TIMEOUT 5
|
||||||
#define IDE_RESET_PULSE_LENGTH 500 /* maybe a little too long */
|
#define IDE_RESET_PULSE_LENGTH 500 /* maybe a little too long */
|
||||||
#define IDE_RESET_BUSY_TIMEOUT 31
|
#define IDE_RESET_BUSY_TIMEOUT 31
|
||||||
|
|
|
@ -61,11 +61,11 @@ BOOLEAN VFATReadSectors(IN PDEVICE_OBJECT pDeviceObject,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Calling IO Driver...\n");
|
DPRINT("Calling IO Driver... with irp %x\n", irp);
|
||||||
status = IoCallDriver(pDeviceObject,
|
status = IoCallDriver(pDeviceObject,
|
||||||
irp);
|
irp);
|
||||||
|
|
||||||
DPRINT("Waiting for IO Operation...\n");
|
DPRINT("Waiting for IO Operation for %x\n", irp);
|
||||||
if (status == STATUS_PENDING)
|
if (status == STATUS_PENDING)
|
||||||
{
|
{
|
||||||
DPRINT("Operation pending\n");
|
DPRINT("Operation pending\n");
|
||||||
|
@ -74,7 +74,7 @@ BOOLEAN VFATReadSectors(IN PDEVICE_OBJECT pDeviceObject,
|
||||||
KernelMode,
|
KernelMode,
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL);
|
NULL);
|
||||||
DPRINT("Getting IO Status...\n");
|
DPRINT("Getting IO Status... for %x\n", irp);
|
||||||
status = ioStatus.Status;
|
status = ioStatus.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ BOOLEAN VFATReadSectors(IN PDEVICE_OBJECT pDeviceObject,
|
||||||
sectorNumber.u.LowPart);
|
sectorNumber.u.LowPart);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
DPRINT("Block request succeeded\n");
|
DPRINT("Block request succeeded for %x\n", irp);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ typedef struct
|
||||||
#define CSRSS_TERMINATE_PROCESS (0x2)
|
#define CSRSS_TERMINATE_PROCESS (0x2)
|
||||||
#define CSRSS_WRITE_CONSOLE (0x3)
|
#define CSRSS_WRITE_CONSOLE (0x3)
|
||||||
#define CSRSS_READ_CONSOLE (0x4)
|
#define CSRSS_READ_CONSOLE (0x4)
|
||||||
#define CSRSS_ALLOC_CONSO (0x5)
|
#define CSRSS_ALLOC_CONSOLE (0x5)
|
||||||
#define CSRSS_FREE_CONSOLE (0x6)
|
#define CSRSS_FREE_CONSOLE (0x6)
|
||||||
#define CSRSS_CONNECT_PROCESS (0x7)
|
#define CSRSS_CONNECT_PROCESS (0x7)
|
||||||
|
|
||||||
|
@ -27,4 +27,15 @@ typedef struct
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
} CSRSS_API_REPLY, *PCSRSS_API_REPLY;
|
} CSRSS_API_REPLY, *PCSRSS_API_REPLY;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ULONG NewProcessId;
|
||||||
|
ULONG Flags;
|
||||||
|
} CSRSS_CREATE_PROCESS_REQUEST, *PCSRSS_CREATE_PROCESS_REQUEST;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* lib/ntdll/csr/api.c
|
||||||
|
*/
|
||||||
|
NTSTATUS CsrConnectToServer(VOID);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
VOID NtInitializeEventImplementation(VOID);
|
VOID NtInitializeEventImplementation(VOID);
|
||||||
|
VOID NtInitializeSemaphoreImplementation(VOID);
|
||||||
NTSTATUS NiInitPort(VOID);
|
NTSTATUS NiInitPort(VOID);
|
||||||
|
|
|
@ -19,6 +19,7 @@ cp apps/args/args.exe $1/reactos/bin
|
||||||
cp apps/bench/bench-thread.exe $1/reactos/bin
|
cp apps/bench/bench-thread.exe $1/reactos/bin
|
||||||
cp apps/cat/cat.exe $1/reactos/bin
|
cp apps/cat/cat.exe $1/reactos/bin
|
||||||
cp subsys/smss/smss.exe $1/reactos/system32
|
cp subsys/smss/smss.exe $1/reactos/system32
|
||||||
|
cp subsys/csrss/csrss.exe $1/reactos/system32
|
||||||
cp subsys/win32k/win32k.sys $1/reactos/system32/drivers
|
cp subsys/win32k/win32k.sys $1/reactos/system32/drivers
|
||||||
cp apps/apc/apc.exe $1/reactos/bin
|
cp apps/apc/apc.exe $1/reactos/bin
|
||||||
cp apps/shm/shmsrv.exe $1/reactos/bin
|
cp apps/shm/shmsrv.exe $1/reactos/bin
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: section.c,v 1.7 1999/11/24 11:51:44 dwelch Exp $
|
/* $Id: section.c,v 1.8 1999/12/30 01:51:37 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -13,9 +13,7 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
HANDLE
|
HANDLE STDCALL CreateFileMappingA (
|
||||||
STDCALL
|
|
||||||
CreateFileMappingA (
|
|
||||||
HANDLE hFile,
|
HANDLE hFile,
|
||||||
LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
|
LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
|
||||||
DWORD flProtect,
|
DWORD flProtect,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: api.c,v 1.1 1999/12/26 15:50:46 dwelch Exp $
|
/* $Id: api.c,v 1.2 1999/12/30 01:51:38 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -9,6 +9,9 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <csrss/csrss.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <ntdll/ntdll.h>
|
#include <ntdll/ntdll.h>
|
||||||
|
@ -19,18 +22,56 @@ static HANDLE WindowsApiPort;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
NTSTATUS CsrClientCallServer(PCSRSS_API_REQUEST Request,
|
||||||
|
PCSRSS_API_REPLY Reply)
|
||||||
|
{
|
||||||
|
LPCMESSAGE LpcRequest;
|
||||||
|
LPCMESSAGE LpcReply;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
LpcRequest.ActualMessageLength = MAX_MESSAGE_DATA;
|
||||||
|
LpcRequest.TotalMessageLength = sizeof(LPCMESSAGE);
|
||||||
|
memcpy(LpcRequest.MessageData, Request, sizeof(CSRSS_API_REQUEST));
|
||||||
|
|
||||||
|
Status = NtRequestWaitReplyPort(WindowsApiPort,
|
||||||
|
&LpcRequest,
|
||||||
|
&LpcReply);
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS CsrConnectToServer(VOID)
|
NTSTATUS CsrConnectToServer(VOID)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING PortName;
|
UNICODE_STRING PortName;
|
||||||
|
ULONG ConnectInfoLength;
|
||||||
|
CSRSS_API_REQUEST Request;
|
||||||
|
CSRSS_API_REPLY Reply;
|
||||||
|
|
||||||
RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
|
RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
|
||||||
|
ConnectInfoLength = 0;
|
||||||
Status = NtConnectPort(&WindowsApiPort,
|
Status = NtConnectPort(&WindowsApiPort,
|
||||||
&PortName,
|
&PortName,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&ConnectInfoLength);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
Request.Type = CSRSS_CONNECT_PROCESS;
|
||||||
|
Status = CsrClientCallServer(&Request,
|
||||||
|
&Reply);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
if (!NT_SUCCESS(Reply.Status))
|
||||||
|
{
|
||||||
|
return(Reply.Status);
|
||||||
|
}
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: startup.c,v 1.13 1999/12/08 12:58:06 ekohl Exp $
|
/* $Id: startup.c,v 1.14 1999/12/30 01:51:38 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -128,6 +128,15 @@ VOID LdrStartup(PPEB Peb,
|
||||||
ZwTerminateProcess(NtCurrentProcess(),STATUS_UNSUCCESSFUL);
|
ZwTerminateProcess(NtCurrentProcess(),STATUS_UNSUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Status = CsrConnectToServer();
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
dprintf("Failed to connect to csrss.exe: expect trouble\n");
|
||||||
|
}
|
||||||
|
|
||||||
// dprintf("Transferring control to image at %x\n",EntryPoint);
|
// dprintf("Transferring control to image at %x\n",EntryPoint);
|
||||||
Status = EntryPoint(Peb);
|
Status = EntryPoint(Peb);
|
||||||
ZwTerminateProcess(NtCurrentProcess(),Status);
|
ZwTerminateProcess(NtCurrentProcess(),Status);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: makefile,v 1.31 1999/12/30 01:33:47 ekohl Exp $
|
# $Id: makefile,v 1.32 1999/12/30 01:51:37 dwelch Exp $
|
||||||
#
|
#
|
||||||
# ReactOS Operating System
|
# ReactOS Operating System
|
||||||
#
|
#
|
||||||
|
@ -23,6 +23,8 @@ endif
|
||||||
|
|
||||||
all: $(DLLTARGET)
|
all: $(DLLTARGET)
|
||||||
|
|
||||||
|
CSR_OBJECTS = csr/api.o
|
||||||
|
|
||||||
DBG_OBJECTS = dbg/brkpoint.o
|
DBG_OBJECTS = dbg/brkpoint.o
|
||||||
|
|
||||||
RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
|
RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
|
||||||
|
@ -46,7 +48,7 @@ STRING_OBJECTS = string/ctype.o string/memccpy.o string/memchr.o \
|
||||||
|
|
||||||
OBJECTS = napi.o ldr/startup.o $(DBG_OBJECTS) $(RTL_OBJECTS) \
|
OBJECTS = napi.o ldr/startup.o $(DBG_OBJECTS) $(RTL_OBJECTS) \
|
||||||
stdio/vsprintf.o $(STDLIB_OBJECTS) $(STRING_OBJECTS) \
|
stdio/vsprintf.o $(STDLIB_OBJECTS) $(STRING_OBJECTS) \
|
||||||
stubs/stubs.o ldr/utils.o $(TARGET).coff
|
stubs/stubs.o ldr/utils.o $(CSR_OBJECTS) $(TARGET).coff
|
||||||
|
|
||||||
ifeq ($(DOSCLI),yes)
|
ifeq ($(DOSCLI),yes)
|
||||||
CLEAN_FILES = napi.o ldr\*.o rtl\*.o stdio\*.o stdlib\*.o string\*.o stubs\*.o \
|
CLEAN_FILES = napi.o ldr\*.o rtl\*.o stdio\*.o stdlib\*.o string\*.o stubs\*.o \
|
||||||
|
|
|
@ -18,7 +18,6 @@ STUB(CsrAllocateMessagePointer)
|
||||||
STUB(CsrCaptureMessageBuffer)
|
STUB(CsrCaptureMessageBuffer)
|
||||||
STUB(CsrCaptureMessageString)
|
STUB(CsrCaptureMessageString)
|
||||||
STUB(CsrCaptureTimeout)
|
STUB(CsrCaptureTimeout)
|
||||||
STUB(CsrClientCallServer)
|
|
||||||
STUB(CsrClientConnectToServer)
|
STUB(CsrClientConnectToServer)
|
||||||
STUB(CsrFreeCaptureBuffer)
|
STUB(CsrFreeCaptureBuffer)
|
||||||
STUB(CsrIdentifyAlertableThread)
|
STUB(CsrIdentifyAlertableThread)
|
||||||
|
|
|
@ -89,6 +89,7 @@ PIRP IoBuildFilesystemControlRequest(ULONG MinorFunction,
|
||||||
}
|
}
|
||||||
|
|
||||||
Irp->UserIosb = IoStatusBlock;
|
Irp->UserIosb = IoStatusBlock;
|
||||||
|
DPRINT("Irp->UserIosb %x\n", Irp->UserIosb);
|
||||||
Irp->UserEvent = UserEvent;
|
Irp->UserEvent = UserEvent;
|
||||||
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
||||||
|
|
||||||
|
@ -155,6 +156,7 @@ PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction,
|
||||||
}
|
}
|
||||||
|
|
||||||
Irp->UserIosb = IoStatusBlock;
|
Irp->UserIosb = IoStatusBlock;
|
||||||
|
DPRINT("Irp->UserIosb %x\n", Irp->UserIosb);
|
||||||
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
||||||
|
|
||||||
StackPtr = IoGetNextIrpStackLocation(Irp);
|
StackPtr = IoGetNextIrpStackLocation(Irp);
|
||||||
|
@ -252,6 +254,7 @@ PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode,
|
||||||
|
|
||||||
Irp->UserEvent = Event;
|
Irp->UserEvent = Event;
|
||||||
Irp->UserIosb = IoStatusBlock;
|
Irp->UserIosb = IoStatusBlock;
|
||||||
|
DPRINT("Irp->UserIosb %x\n", Irp->UserIosb);
|
||||||
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
||||||
|
|
||||||
StackPtr = IoGetNextIrpStackLocation(Irp);
|
StackPtr = IoGetNextIrpStackLocation(Irp);
|
||||||
|
@ -403,6 +406,7 @@ PIRP IoBuildSynchronousFsdRequest(ULONG MajorFunction,
|
||||||
|
|
||||||
Irp->UserEvent = Event;
|
Irp->UserEvent = Event;
|
||||||
Irp->UserIosb = IoStatusBlock;
|
Irp->UserIosb = IoStatusBlock;
|
||||||
|
DPRINT("Irp->UserIosb %x\n", Irp->UserIosb);
|
||||||
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
||||||
|
|
||||||
StackPtr = IoGetNextIrpStackLocation(Irp);
|
StackPtr = IoGetNextIrpStackLocation(Irp);
|
||||||
|
@ -491,6 +495,7 @@ PIRP IoBuildSynchronousFsdRequestWithMdl(ULONG MajorFunction,
|
||||||
|
|
||||||
Irp->UserEvent = Event;
|
Irp->UserEvent = Event;
|
||||||
Irp->UserIosb = IoStatusBlock;
|
Irp->UserIosb = IoStatusBlock;
|
||||||
|
DPRINT("Irp->UserIosb %x\n", Irp->UserIosb);
|
||||||
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
|
||||||
|
|
||||||
StackPtr = IoGetNextIrpStackLocation(Irp);
|
StackPtr = IoGetNextIrpStackLocation(Irp);
|
||||||
|
|
|
@ -199,6 +199,9 @@ VOID IoSecondStageCompletion(PIRP Irp, CCHAR PriorityBoost)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DPRINT("Irp->UserIosb %x &Irp->UserIosb %x\n",
|
||||||
|
Irp->UserIosb,
|
||||||
|
&Irp->UserIosb);
|
||||||
if (Irp->UserIosb!=NULL)
|
if (Irp->UserIosb!=NULL)
|
||||||
{
|
{
|
||||||
*Irp->UserIosb=Irp->IoStatus;
|
*Irp->UserIosb=Irp->IoStatus;
|
||||||
|
|
|
@ -31,16 +31,21 @@ VOID IoStartNextPacketByKey(PDEVICE_OBJECT DeviceObject,
|
||||||
PKDEVICE_QUEUE_ENTRY entry;
|
PKDEVICE_QUEUE_ENTRY entry;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
|
|
||||||
entry = KeRemoveByKeyDeviceQueue(&DeviceObject->DeviceQueue,Key);
|
entry = KeRemoveByKeyDeviceQueue(&DeviceObject->DeviceQueue,
|
||||||
|
Key);
|
||||||
|
|
||||||
if (entry!=NULL)
|
if (entry != NULL)
|
||||||
{
|
{
|
||||||
Irp = CONTAINING_RECORD(entry,IRP,Tail.Overlay.DeviceQueueEntry);
|
Irp = CONTAINING_RECORD(entry,
|
||||||
|
IRP,
|
||||||
|
Tail.Overlay.DeviceQueueEntry);
|
||||||
DeviceObject->CurrentIrp = Irp;
|
DeviceObject->CurrentIrp = Irp;
|
||||||
DeviceObject->DriverObject->DriverStartIo(DeviceObject,Irp);
|
DPRINT("Next irp is %x\n", Irp);
|
||||||
|
DeviceObject->DriverObject->DriverStartIo(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
DPRINT("No next irp\n");
|
||||||
DeviceObject->CurrentIrp = NULL;
|
DeviceObject->CurrentIrp = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,6 +95,8 @@ VOID IoStartPacket(PDEVICE_OBJECT DeviceObject,
|
||||||
BOOLEAN stat;
|
BOOLEAN stat;
|
||||||
KIRQL oldirql;
|
KIRQL oldirql;
|
||||||
|
|
||||||
|
DPRINT("IoStartPacket(Irp %x)\n", Irp);
|
||||||
|
|
||||||
ASSERT_IRQL(DISPATCH_LEVEL);
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
IoAcquireCancelSpinLock(&oldirql);
|
IoAcquireCancelSpinLock(&oldirql);
|
||||||
|
|
|
@ -20,17 +20,7 @@
|
||||||
VOID InsertBeforeEntryInList(PLIST_ENTRY Head, PLIST_ENTRY After,
|
VOID InsertBeforeEntryInList(PLIST_ENTRY Head, PLIST_ENTRY After,
|
||||||
PLIST_ENTRY Entry)
|
PLIST_ENTRY Entry)
|
||||||
{
|
{
|
||||||
if (After->Blink!=NULL)
|
InsertHeadList(After, Entry);
|
||||||
{
|
|
||||||
After->Blink->Flink = Entry;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Head->Flink = Entry;
|
|
||||||
}
|
|
||||||
Entry->Blink = After->Blink;
|
|
||||||
Entry->Flink = After;
|
|
||||||
After->Blink = Entry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN KeInsertByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
|
BOOLEAN KeInsertByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
|
||||||
|
@ -41,6 +31,8 @@ BOOLEAN KeInsertByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
|
||||||
PLIST_ENTRY current;
|
PLIST_ENTRY current;
|
||||||
PKDEVICE_QUEUE_ENTRY entry;
|
PKDEVICE_QUEUE_ENTRY entry;
|
||||||
|
|
||||||
|
DPRINT("KeInsertByKeyDeviceQueue()\n");
|
||||||
|
|
||||||
DeviceQueueEntry->Key=SortKey;
|
DeviceQueueEntry->Key=SortKey;
|
||||||
|
|
||||||
KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl);
|
KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl);
|
||||||
|
@ -59,7 +51,8 @@ BOOLEAN KeInsertByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
|
||||||
if (entry->Key < SortKey)
|
if (entry->Key < SortKey)
|
||||||
{
|
{
|
||||||
InsertBeforeEntryInList(&DeviceQueue->ListHead,
|
InsertBeforeEntryInList(&DeviceQueue->ListHead,
|
||||||
&DeviceQueueEntry->Entry,current);
|
&DeviceQueueEntry->Entry,
|
||||||
|
current);
|
||||||
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
|
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
@ -84,18 +77,12 @@ PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
|
||||||
|
|
||||||
KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl);
|
KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl);
|
||||||
|
|
||||||
if (IsListEmpty(&DeviceQueue->ListHead))
|
|
||||||
{
|
|
||||||
DeviceQueue->Busy=FALSE;
|
|
||||||
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
current = DeviceQueue->ListHead.Flink;
|
current = DeviceQueue->ListHead.Flink;
|
||||||
for(;;)
|
while (current != &DeviceQueue->ListHead)
|
||||||
{
|
{
|
||||||
entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,Entry);
|
entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,Entry);
|
||||||
if (entry->Key < SortKey || current->Flink == NULL)
|
if (entry->Key < SortKey ||
|
||||||
|
current->Flink == &DeviceQueue->ListHead)
|
||||||
{
|
{
|
||||||
RemoveEntryList(current);
|
RemoveEntryList(current);
|
||||||
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
|
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
|
||||||
|
@ -103,6 +90,9 @@ PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
|
||||||
}
|
}
|
||||||
current = current->Flink;
|
current = current->Flink;
|
||||||
}
|
}
|
||||||
|
DeviceQueue->Busy = FALSE;
|
||||||
|
KeReleaseSpinLock(&DeviceQueue->Lock, oldlvl);
|
||||||
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
PKDEVICE_QUEUE_ENTRY KeRemoveDeviceQueue(PKDEVICE_QUEUE DeviceQueue)
|
PKDEVICE_QUEUE_ENTRY KeRemoveDeviceQueue(PKDEVICE_QUEUE DeviceQueue)
|
||||||
|
@ -173,7 +163,8 @@ BOOLEAN KeInsertDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
InsertTailList(&DeviceQueue->ListHead,&DeviceQueueEntry->Entry);
|
InsertTailList(&DeviceQueue->ListHead,
|
||||||
|
&DeviceQueueEntry->Entry);
|
||||||
DeviceQueueEntry->Key=0;
|
DeviceQueueEntry->Key=0;
|
||||||
|
|
||||||
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
|
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: section.c,v 1.20 1999/12/22 14:48:25 dwelch Exp $
|
/* $Id: section.c,v 1.21 1999/12/30 01:51:39 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -58,6 +58,7 @@ PVOID MiTryToSharePageInSection(PSECTION_OBJECT Section,
|
||||||
Address);
|
Address);
|
||||||
MmReferencePage((PVOID)PhysPage);
|
MmReferencePage((PVOID)PhysPage);
|
||||||
KeReleaseSpinLock(&Section->ViewListLock, oldIrql);
|
KeReleaseSpinLock(&Section->ViewListLock, oldIrql);
|
||||||
|
DPRINT("MiTryToSharePageInSection() = %x\n", PhysPage);
|
||||||
return((PVOID)PhysPage);
|
return((PVOID)PhysPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +66,7 @@ PVOID MiTryToSharePageInSection(PSECTION_OBJECT Section,
|
||||||
}
|
}
|
||||||
|
|
||||||
KeReleaseSpinLock(&Section->ViewListLock, oldIrql);
|
KeReleaseSpinLock(&Section->ViewListLock, oldIrql);
|
||||||
|
DPRINT("MiTryToSharePageInSection() finished\n");
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +179,7 @@ NTSTATUS STDCALL NtCreateSection (OUT PHANDLE SectionHandle,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
ObjectAttributes,
|
ObjectAttributes,
|
||||||
MmSectionType);
|
MmSectionType);
|
||||||
|
DPRINT("SectionHandle %x\n", SectionHandle);
|
||||||
if (Section == NULL)
|
if (Section == NULL)
|
||||||
{
|
{
|
||||||
return(STATUS_UNSUCCESSFUL);
|
return(STATUS_UNSUCCESSFUL);
|
||||||
|
@ -195,7 +198,7 @@ NTSTATUS STDCALL NtCreateSection (OUT PHANDLE SectionHandle,
|
||||||
InitializeListHead(&Section->ViewListHead);
|
InitializeListHead(&Section->ViewListHead);
|
||||||
KeInitializeSpinLock(&Section->ViewListLock);
|
KeInitializeSpinLock(&Section->ViewListLock);
|
||||||
|
|
||||||
if (FileHandle != NULL)
|
if (FileHandle != (HANDLE)0xffffffff)
|
||||||
{
|
{
|
||||||
Status = ObReferenceObjectByHandle(FileHandle,
|
Status = ObReferenceObjectByHandle(FileHandle,
|
||||||
FILE_READ_DATA,
|
FILE_READ_DATA,
|
||||||
|
@ -203,7 +206,7 @@ NTSTATUS STDCALL NtCreateSection (OUT PHANDLE SectionHandle,
|
||||||
UserMode,
|
UserMode,
|
||||||
(PVOID*)&Section->FileObject,
|
(PVOID*)&Section->FileObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (Status != STATUS_SUCCESS)
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Delete section object
|
* Delete section object
|
||||||
|
|
|
@ -20,5 +20,6 @@
|
||||||
VOID NtInit(VOID)
|
VOID NtInit(VOID)
|
||||||
{
|
{
|
||||||
NtInitializeEventImplementation();
|
NtInitializeEventImplementation();
|
||||||
|
NtInitializeSemaphoreImplementation();
|
||||||
NiInitPort();
|
NiInitPort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,58 +11,147 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
#include <internal/ob.h>
|
||||||
|
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS ******************************************************************/
|
||||||
|
|
||||||
|
POBJECT_TYPE ExSemaphoreType;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS NtpCreateSemaphore(PVOID ObjectBody,
|
||||||
STDCALL
|
PVOID Parent,
|
||||||
NtCreateSemaphore (
|
PWSTR RemainingPath,
|
||||||
OUT PHANDLE SemaphoreHandle,
|
POBJECT_ATTRIBUTES ObjectAttributes)
|
||||||
|
{
|
||||||
|
|
||||||
|
DPRINT("NtpCreateSemaphore(ObjectBody %x, Parent %x, RemainingPath %w)\n",
|
||||||
|
ObjectBody, Parent, RemainingPath);
|
||||||
|
|
||||||
|
if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL)
|
||||||
|
{
|
||||||
|
return(STATUS_UNSUCCESSFUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Parent != NULL && RemainingPath != NULL)
|
||||||
|
{
|
||||||
|
ObAddEntryDirectory(Parent, ObjectBody, RemainingPath+1);
|
||||||
|
}
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID NtInitializeSemaphoreImplementation(VOID)
|
||||||
|
{
|
||||||
|
UNICODE_STRING TypeName;
|
||||||
|
|
||||||
|
ExSemaphoreType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&TypeName, L"Event");
|
||||||
|
|
||||||
|
ExSemaphoreType->TypeName = TypeName;
|
||||||
|
|
||||||
|
ExSemaphoreType->MaxObjects = ULONG_MAX;
|
||||||
|
ExSemaphoreType->MaxHandles = ULONG_MAX;
|
||||||
|
ExSemaphoreType->TotalObjects = 0;
|
||||||
|
ExSemaphoreType->TotalHandles = 0;
|
||||||
|
ExSemaphoreType->PagedPoolCharge = 0;
|
||||||
|
ExSemaphoreType->NonpagedPoolCharge = sizeof(KSEMAPHORE);
|
||||||
|
ExSemaphoreType->Dump = NULL;
|
||||||
|
ExSemaphoreType->Open = NULL;
|
||||||
|
ExSemaphoreType->Close = NULL;
|
||||||
|
ExSemaphoreType->Delete = NULL;
|
||||||
|
ExSemaphoreType->Parse = NULL;
|
||||||
|
ExSemaphoreType->Security = NULL;
|
||||||
|
ExSemaphoreType->QueryName = NULL;
|
||||||
|
ExSemaphoreType->OkayToClose = NULL;
|
||||||
|
ExSemaphoreType->Create = NtpCreateSemaphore;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS STDCALL NtCreateSemaphore(OUT PHANDLE SemaphoreHandle,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
IN ACCESS_MASK DesiredAccess,
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
IN ULONG InitialCount,
|
IN ULONG InitialCount,
|
||||||
IN ULONG MaximumCount
|
IN ULONG MaximumCount)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
PKSEMAPHORE Semaphore;
|
||||||
|
|
||||||
|
DPRINT("NtCreateSemaphore()\n");
|
||||||
|
Semaphore = ObCreateObject(SemaphoreHandle,
|
||||||
|
DesiredAccess,
|
||||||
|
ObjectAttributes,
|
||||||
|
ExSemaphoreType);
|
||||||
|
KeInitializeSemaphore(Semaphore,
|
||||||
|
InitialCount,
|
||||||
|
MaximumCount);
|
||||||
|
ObDereferenceObject(Semaphore);
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL NtOpenSemaphore(IN HANDLE SemaphoreHandle,
|
||||||
STDCALL
|
|
||||||
NtOpenSemaphore (
|
|
||||||
IN HANDLE SemaphoreHandle,
|
|
||||||
IN ACCESS_MASK DesiredAccess,
|
IN ACCESS_MASK DesiredAccess,
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes
|
IN POBJECT_ATTRIBUTES ObjectAttributes)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
NTSTATUS Status;
|
||||||
|
PKSEMAPHORE Semaphore;
|
||||||
|
|
||||||
|
|
||||||
|
Status = ObReferenceObjectByName(ObjectAttributes->ObjectName,
|
||||||
|
ObjectAttributes->Attributes,
|
||||||
|
NULL,
|
||||||
|
DesiredAccess,
|
||||||
|
ExSemaphoreType,
|
||||||
|
UserMode,
|
||||||
|
NULL,
|
||||||
|
(PVOID*)&Semaphore);
|
||||||
|
if (Status != STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = ObCreateHandle(PsGetCurrentProcess(),
|
||||||
|
Semaphore,
|
||||||
|
DesiredAccess,
|
||||||
|
FALSE,
|
||||||
|
SemaphoreHandle);
|
||||||
|
ObDereferenceObject(Semaphore);
|
||||||
|
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL NtQuerySemaphore(HANDLE SemaphoreHandle,
|
||||||
STDCALL
|
|
||||||
NtQuerySemaphore (
|
|
||||||
HANDLE SemaphoreHandle,
|
|
||||||
CINT SemaphoreInformationClass,
|
CINT SemaphoreInformationClass,
|
||||||
OUT PVOID SemaphoreInformation,
|
OUT PVOID SemaphoreInformation,
|
||||||
ULONG Length,
|
ULONG Length,
|
||||||
PULONG ReturnLength
|
PULONG ReturnLength)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS STDCALL NtReleaseSemaphore(IN HANDLE SemaphoreHandle,
|
||||||
NTSTATUS
|
|
||||||
STDCALL
|
|
||||||
NtReleaseSemaphore (
|
|
||||||
IN HANDLE SemaphoreHandle,
|
|
||||||
IN ULONG ReleaseCount,
|
IN ULONG ReleaseCount,
|
||||||
IN PULONG PreviousCount
|
IN PULONG PreviousCount)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
PKSEMAPHORE Semaphore;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
Status = ObReferenceObjectByHandle(SemaphoreHandle,
|
||||||
|
SEMAPHORE_MODIFY_STATE,
|
||||||
|
ExSemaphoreType,
|
||||||
|
UserMode,
|
||||||
|
(PVOID*)&Semaphore,
|
||||||
|
NULL);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
KeReleaseSemaphore(Semaphore,
|
||||||
|
IO_NO_INCREMENT,
|
||||||
|
ReleaseCount,
|
||||||
|
FALSE);
|
||||||
|
ObDereferenceObject(Semaphore);
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: port.c,v 1.14 1999/12/13 22:04:39 dwelch Exp $
|
/* $Id: port.c,v 1.15 1999/12/30 01:51:40 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -109,14 +109,16 @@ PQUEUEDMESSAGE EiDequeueConnectMessagePort(PEPORT Port)
|
||||||
return(Message);
|
return(Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS EiReplyOrRequestPort(PEPORT Port, PLPCMESSAGE LpcReply,
|
NTSTATUS EiReplyOrRequestPort(PEPORT Port,
|
||||||
ULONG MessageType)
|
PLPCMESSAGE LpcReply,
|
||||||
|
ULONG MessageType,
|
||||||
|
PEPORT Sender)
|
||||||
{
|
{
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
PQUEUEDMESSAGE MessageReply;
|
PQUEUEDMESSAGE MessageReply;
|
||||||
|
|
||||||
MessageReply = ExAllocatePool(NonPagedPool, sizeof(QUEUEDMESSAGE));
|
MessageReply = ExAllocatePool(NonPagedPool, sizeof(QUEUEDMESSAGE));
|
||||||
MessageReply->Sender = Port;
|
MessageReply->Sender = Sender;
|
||||||
|
|
||||||
if (LpcReply != NULL)
|
if (LpcReply != NULL)
|
||||||
{
|
{
|
||||||
|
@ -128,9 +130,9 @@ NTSTATUS EiReplyOrRequestPort(PEPORT Port, PLPCMESSAGE LpcReply,
|
||||||
MessageReply->Message.MessageType = MessageType;
|
MessageReply->Message.MessageType = MessageType;
|
||||||
MessageReply->Message.MessageId = InterlockedIncrement(&EiNextLpcMessageId);
|
MessageReply->Message.MessageId = InterlockedIncrement(&EiNextLpcMessageId);
|
||||||
|
|
||||||
KeAcquireSpinLock(&Port->OtherPort->Lock, &oldIrql);
|
KeAcquireSpinLock(&Port->Lock, &oldIrql);
|
||||||
EiEnqueueMessagePort(Port->OtherPort, MessageReply);
|
EiEnqueueMessagePort(Port, MessageReply);
|
||||||
KeReleaseSpinLock(&Port->OtherPort->Lock, oldIrql);
|
KeReleaseSpinLock(&Port->Lock, oldIrql);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -207,6 +209,8 @@ static NTSTATUS NiInitializePort(PEPORT Port)
|
||||||
Port->OtherPort = NULL;
|
Port->OtherPort = NULL;
|
||||||
Port->QueueLength = 0;
|
Port->QueueLength = 0;
|
||||||
Port->ConnectQueueLength = 0;
|
Port->ConnectQueueLength = 0;
|
||||||
|
InitializeListHead(&Port->QueueListHead);
|
||||||
|
InitializeListHead(&Port->ConnectQueueListHead);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -260,6 +264,7 @@ NTSTATUS STDCALL NtConnectPort (OUT PHANDLE ConnectedPort,
|
||||||
ULONG ConnectInfoLength;
|
ULONG ConnectInfoLength;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
DPRINT("PortName %x\n", PortName);
|
||||||
DPRINT("NtConnectPort(PortName %w)\n", PortName->Buffer);
|
DPRINT("NtConnectPort(PortName %w)\n", PortName->Buffer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -296,17 +301,23 @@ NTSTATUS STDCALL NtConnectPort (OUT PHANDLE ConnectedPort,
|
||||||
/*
|
/*
|
||||||
* Create a request message
|
* Create a request message
|
||||||
*/
|
*/
|
||||||
|
DPRINT("Creating request message\n");
|
||||||
|
|
||||||
Request.ActualMessageLength = ConnectInfoLength;
|
Request.ActualMessageLength = ConnectInfoLength;
|
||||||
Request.TotalMessageLength = sizeof(LPCMESSAGE) + ConnectInfoLength;
|
Request.TotalMessageLength = sizeof(LPCMESSAGE) + ConnectInfoLength;
|
||||||
Request.SharedSectionSize = 0;
|
Request.SharedSectionSize = 0;
|
||||||
|
if (ConnectInfo != NULL && ConnectInfoLength > 0)
|
||||||
|
{
|
||||||
memcpy(Request.MessageData, ConnectInfo, ConnectInfoLength);
|
memcpy(Request.MessageData, ConnectInfo, ConnectInfoLength);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Queue the message to the named port
|
* Queue the message to the named port
|
||||||
*/
|
*/
|
||||||
KeAcquireSpinLock(&NamedPort->Lock, &oldIrql);
|
DPRINT("Queuing message\n");
|
||||||
EiReplyOrRequestPort(NamedPort, &Request, LPC_CONNECTION_REQUEST);
|
|
||||||
KeReleaseSpinLock(&NamedPort->Lock, oldIrql);
|
EiReplyOrRequestPort(NamedPort, &Request, LPC_CONNECTION_REQUEST, OurPort);
|
||||||
|
KeSetEvent(&NamedPort->Event, IO_NO_INCREMENT, FALSE);
|
||||||
|
|
||||||
DPRINT("Waiting for connection completion\n");
|
DPRINT("Waiting for connection completion\n");
|
||||||
|
|
||||||
|
@ -319,6 +330,7 @@ NTSTATUS STDCALL NtConnectPort (OUT PHANDLE ConnectedPort,
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
DPRINT("Received connection completion\n");
|
||||||
KeAcquireSpinLock(&OurPort->Lock, &oldIrql);
|
KeAcquireSpinLock(&OurPort->Lock, &oldIrql);
|
||||||
Reply = EiDequeueMessagePort(OurPort);
|
Reply = EiDequeueMessagePort(OurPort);
|
||||||
KeReleaseSpinLock(&OurPort->Lock, oldIrql);
|
KeReleaseSpinLock(&OurPort->Lock, oldIrql);
|
||||||
|
@ -369,7 +381,7 @@ NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
/*
|
/*
|
||||||
* Create a port object for our side of the connection
|
* Create a port object for our side of the connection
|
||||||
*/
|
*/
|
||||||
if (AcceptIt != 1)
|
if (AcceptIt == 1)
|
||||||
{
|
{
|
||||||
OurPort = ObCreateObject(ServerPortHandle,
|
OurPort = ObCreateObject(ServerPortHandle,
|
||||||
PORT_ALL_ACCESS,
|
PORT_ALL_ACCESS,
|
||||||
|
@ -382,14 +394,15 @@ NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
* Dequeue the connection request
|
* Dequeue the connection request
|
||||||
*/
|
*/
|
||||||
KeAcquireSpinLock(&NamedPort->Lock, &oldIrql);
|
KeAcquireSpinLock(&NamedPort->Lock, &oldIrql);
|
||||||
ConnectionRequest = EiDequeueConnectMessagePort(OurPort);
|
ConnectionRequest = EiDequeueConnectMessagePort(NamedPort);
|
||||||
KeReleaseSpinLock(&NamedPort->Lock, oldIrql);
|
KeReleaseSpinLock(&NamedPort->Lock, oldIrql);
|
||||||
|
|
||||||
if (AcceptIt != 1)
|
if (AcceptIt != 1)
|
||||||
{
|
{
|
||||||
EiReplyOrRequestPort(ConnectionRequest->Sender,
|
EiReplyOrRequestPort(ConnectionRequest->Sender,
|
||||||
LpcMessage,
|
LpcMessage,
|
||||||
LPC_CONNECTION_REFUSED);
|
LPC_CONNECTION_REFUSED,
|
||||||
|
NamedPort);
|
||||||
KeSetEvent(&ConnectionRequest->Sender->Event, IO_NO_INCREMENT, FALSE);
|
KeSetEvent(&ConnectionRequest->Sender->Event, IO_NO_INCREMENT, FALSE);
|
||||||
ExFreePool(ConnectionRequest);
|
ExFreePool(ConnectionRequest);
|
||||||
ObDereferenceObject(NamedPort);
|
ObDereferenceObject(NamedPort);
|
||||||
|
@ -401,7 +414,10 @@ NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
*/
|
*/
|
||||||
OurPort->OtherPort = ConnectionRequest->Sender;
|
OurPort->OtherPort = ConnectionRequest->Sender;
|
||||||
OurPort->OtherPort->OtherPort = OurPort;
|
OurPort->OtherPort->OtherPort = OurPort;
|
||||||
EiReplyOrRequestPort(ConnectionRequest->Sender, LpcMessage, LPC_REPLY);
|
EiReplyOrRequestPort(ConnectionRequest->Sender,
|
||||||
|
LpcMessage,
|
||||||
|
LPC_REPLY,
|
||||||
|
OurPort);
|
||||||
ExFreePool(ConnectionRequest);
|
ExFreePool(ConnectionRequest);
|
||||||
|
|
||||||
ObDereferenceObject(NamedPort);
|
ObDereferenceObject(NamedPort);
|
||||||
|
@ -415,6 +431,8 @@ NTSTATUS STDCALL NtCompleteConnectPort (HANDLE PortHandle)
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PEPORT OurPort;
|
PEPORT OurPort;
|
||||||
|
|
||||||
|
DPRINT("NtCompleteConnectPort(PortHandle %x)\n", PortHandle);
|
||||||
|
|
||||||
Status = ObReferenceObjectByHandle(PortHandle,
|
Status = ObReferenceObjectByHandle(PortHandle,
|
||||||
PORT_ALL_ACCESS,
|
PORT_ALL_ACCESS,
|
||||||
ExPortType,
|
ExPortType,
|
||||||
|
@ -454,6 +472,7 @@ NTSTATUS STDCALL NtListenPort (IN HANDLE PortHandle,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
ConnectMsg);
|
ConnectMsg);
|
||||||
|
DPRINT("Got message (type %x)\n", LPC_CONNECTION_REQUEST);
|
||||||
if (!NT_SUCCESS(Status) ||
|
if (!NT_SUCCESS(Status) ||
|
||||||
ConnectMsg->MessageType == LPC_CONNECTION_REQUEST)
|
ConnectMsg->MessageType == LPC_CONNECTION_REQUEST)
|
||||||
{
|
{
|
||||||
|
@ -478,7 +497,7 @@ NTSTATUS STDCALL NtReplyPort (IN HANDLE PortHandle,
|
||||||
IN PLPCMESSAGE LpcReply)
|
IN PLPCMESSAGE LpcReply)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PEPORT Port
|
PEPORT Port;
|
||||||
|
|
||||||
DPRINT("NtReplyPort(PortHandle %x, LpcReply %x)\n", PortHandle, LpcReply);
|
DPRINT("NtReplyPort(PortHandle %x, LpcReply %x)\n", PortHandle, LpcReply);
|
||||||
|
|
||||||
|
@ -494,8 +513,11 @@ NTSTATUS STDCALL NtReplyPort (IN HANDLE PortHandle,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = EiReplyOrRequestPort(Port, LpcReply, LPC_REPLY);
|
Status = EiReplyOrRequestPort(Port->OtherPort,
|
||||||
KeSetEvent(&Port->Event, IO_NO_INCREMENT, FALSE);
|
LpcReply,
|
||||||
|
LPC_REPLY,
|
||||||
|
Port);
|
||||||
|
KeSetEvent(&Port->OtherPort->Event, IO_NO_INCREMENT, FALSE);
|
||||||
|
|
||||||
ObDereferenceObject(Port);
|
ObDereferenceObject(Port);
|
||||||
|
|
||||||
|
@ -533,8 +555,11 @@ NTSTATUS STDCALL NtReplyWaitReceivePort (IN HANDLE PortHandle,
|
||||||
*/
|
*/
|
||||||
if (LpcReply != NULL)
|
if (LpcReply != NULL)
|
||||||
{
|
{
|
||||||
Status = EiReplyOrRequestPort(Port, LpcReply, LPC_REPLY);
|
Status = EiReplyOrRequestPort(Port->OtherPort,
|
||||||
KeSetEvent(&Port->Event, IO_NO_INCREMENT, FALSE);
|
LpcReply,
|
||||||
|
LPC_REPLY,
|
||||||
|
Port);
|
||||||
|
KeSetEvent(&Port->OtherPort->Event, IO_NO_INCREMENT, FALSE);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -546,11 +571,13 @@ NTSTATUS STDCALL NtReplyWaitReceivePort (IN HANDLE PortHandle,
|
||||||
/*
|
/*
|
||||||
* Want for a message to be received
|
* Want for a message to be received
|
||||||
*/
|
*/
|
||||||
|
DPRINT("Entering wait for message\n");
|
||||||
KeWaitForSingleObject(&Port->Event,
|
KeWaitForSingleObject(&Port->Event,
|
||||||
UserRequest,
|
UserRequest,
|
||||||
UserMode,
|
UserMode,
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL);
|
NULL);
|
||||||
|
DPRINT("Woke from wait for message\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dequeue the message
|
* Dequeue the message
|
||||||
|
@ -598,8 +625,11 @@ NTSTATUS STDCALL NtRequestPort (IN HANDLE PortHandle,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = EiReplyOrRequestPort(Port, LpcMessage, LPC_DATAGRAM);
|
Status = EiReplyOrRequestPort(Port->OtherPort,
|
||||||
KeSetEvent(&Port->Event, IO_NO_INCREMENT, FALSE);
|
LpcMessage,
|
||||||
|
LPC_DATAGRAM,
|
||||||
|
Port);
|
||||||
|
KeSetEvent(&Port->OtherPort->Event, IO_NO_INCREMENT, FALSE);
|
||||||
|
|
||||||
ObDereferenceObject(Port);
|
ObDereferenceObject(Port);
|
||||||
return(Status);
|
return(Status);
|
||||||
|
@ -630,8 +660,11 @@ NTSTATUS STDCALL NtRequestWaitReplyPort(IN HANDLE PortHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Status = EiReplyOrRequestPort(Port, LpcRequest, LPC_REQUEST);
|
Status = EiReplyOrRequestPort(Port->OtherPort,
|
||||||
KeSetEvent(&Port->Event, IO_NO_INCREMENT, FALSE);
|
LpcRequest,
|
||||||
|
LPC_REQUEST,
|
||||||
|
Port);
|
||||||
|
KeSetEvent(&Port->OtherPort->Event, IO_NO_INCREMENT, FALSE);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,7 +109,7 @@ VOID InsertTailList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry)
|
||||||
ListEntry->Blink=Blink;
|
ListEntry->Blink=Blink;
|
||||||
Blink->Flink=ListEntry;
|
Blink->Flink=ListEntry;
|
||||||
ListHead->Blink=ListEntry;
|
ListHead->Blink=ListEntry;
|
||||||
assert( CheckEntry( ListEntry ) );
|
assert(CheckEntry(ListEntry));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID InsertHeadList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry)
|
VOID InsertHeadList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry)
|
||||||
|
|
|
@ -16,6 +16,9 @@ typedef struct
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
PCSRSS_CONSOLE Console;
|
PCSRSS_CONSOLE Console;
|
||||||
|
ULONG HandleTableSize;
|
||||||
|
PVOID* HandleTable;
|
||||||
|
ULONG ProcessId;
|
||||||
} CSRSS_PROCESS_DATA, *PCSRSS_PROCESS_DATA;
|
} CSRSS_PROCESS_DATA, *PCSRSS_PROCESS_DATA;
|
||||||
|
|
||||||
NTSTATUS CsrCreateProcess (PCSRSS_PROCESS_DATA ProcessData,
|
NTSTATUS CsrCreateProcess (PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
@ -48,3 +51,12 @@ VOID PrintString (char* fmt, ...);
|
||||||
|
|
||||||
/* api/wapi.c */
|
/* api/wapi.c */
|
||||||
VOID Thread_Api(PVOID PortHandle);
|
VOID Thread_Api(PVOID PortHandle);
|
||||||
|
|
||||||
|
extern HANDLE CsrssApiHeap;
|
||||||
|
|
||||||
|
/* api/conio.c */
|
||||||
|
VOID CsrInitConsole(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
PCSRSS_CONSOLE Console);
|
||||||
|
|
||||||
|
/* api/process.c */
|
||||||
|
PCSRSS_PROCESS_DATA CsrGetProcessData(ULONG ProcessId);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: conio.c,v 1.1 1999/12/22 14:48:30 dwelch Exp $
|
/* $Id: conio.c,v 1.2 1999/12/30 01:51:42 dwelch Exp $
|
||||||
*
|
*
|
||||||
* reactos/subsys/csrss/api/conio.c
|
* reactos/subsys/csrss/api/conio.c
|
||||||
*
|
*
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
|
||||||
#include "csrss.h"
|
#include <csrss/csrss.h>
|
||||||
#include "api.h"
|
#include "api.h"
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
@ -21,18 +21,41 @@ static HANDLE KeyboardDevice;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
NTSTATUS CsrWriteConsole(PCSRSS_CONIO_PROCESS ProcessData,
|
NTSTATUS CsrAllocConsole(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
PCSRSS_REQUEST Message,
|
PCSRSS_API_REQUEST LpcMessage,
|
||||||
|
PHANDLE ReturnedHandle)
|
||||||
|
{
|
||||||
|
return(STATUS_NOT_IMPLEMENTED);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS CsrFreeConsole(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
PCSRSS_API_REQUEST LpcMessage)
|
||||||
|
{
|
||||||
|
return(STATUS_NOT_IMPLEMENTED);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS CsrReadConsole(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
PCSRSS_API_REQUEST LpcMessage,
|
||||||
|
PULONG CharCount)
|
||||||
|
{
|
||||||
|
return(STATUS_NOT_IMPLEMENTED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS CsrWriteConsole(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
PCSRSS_API_REQUEST Message,
|
||||||
PULONG CharCount)
|
PULONG CharCount)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
PCSRSS_CONSOLE Console;
|
||||||
|
|
||||||
if (ProcessData->Console == NULL)
|
if (ProcessData->Console == NULL)
|
||||||
{
|
{
|
||||||
return(STATUS_UNSUCCESSFUL);
|
return(STATUS_UNSUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
Console = ProcessData->Console;
|
||||||
|
|
||||||
Status = NtWaitForSingleObject(ProcessData->Console->LockMutant,
|
Status = NtWaitForSingleObject(Console->LockMutant,
|
||||||
TRUE,
|
TRUE,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -45,9 +68,9 @@ NTSTATUS CsrWriteConsole(PCSRSS_CONIO_PROCESS ProcessData,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TopLevel == TRUE)
|
if (Console->TopLevel == TRUE)
|
||||||
{
|
{
|
||||||
Status = NtReleaseMutant(ProcessData->Console->LockMutant, NULL);
|
Status = NtReleaseMutant(Console->LockMutant, NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return(Status);
|
return(Status);
|
||||||
|
@ -57,7 +80,7 @@ NTSTATUS CsrWriteConsole(PCSRSS_CONIO_PROCESS ProcessData,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = NtReleaseMutant(ProcessData->Console->LockMutant, NULL);
|
Status = NtReleaseMutant(Console->LockMutant, NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return(Status);
|
return(Status);
|
||||||
|
@ -67,25 +90,9 @@ NTSTATUS CsrWriteConsole(PCSRSS_CONIO_PROCESS ProcessData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PCSRSS_CONIO_PROCESS CsrAllocConioProcess(VOID)
|
VOID CsrInitConsole(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
PCSRSS_CONSOLE Console)
|
||||||
{
|
{
|
||||||
PCSRSS_CONIO_PROCESS ProcessData;
|
|
||||||
|
|
||||||
ThreadData = RtlAllocHeap(NULL, HEAP_ZERO_MEMORY,
|
|
||||||
sizeof(PROCESS_CONIO_THREAD));
|
|
||||||
if (ThreadData == NULL)
|
|
||||||
{
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
ProcessData->Console = NULL;
|
|
||||||
return(ProcessData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID CsrFreeConioProcess(PCSRSS_CONIO_PROCESS ProcessData)
|
|
||||||
{
|
|
||||||
RtlFreeHeap(NULL, 0, ProcessData);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: handle.c,v 1.1 1999/12/26 15:50:53 dwelch Exp $
|
/* $Id: handle.c,v 1.2 1999/12/30 01:51:42 dwelch Exp $
|
||||||
*
|
*
|
||||||
* reactos/subsys/csrss/api/handle.c
|
* reactos/subsys/csrss/api/handle.c
|
||||||
*
|
*
|
||||||
|
@ -16,5 +16,49 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
NTSTATUS CsrCreateObject(PHANDLE Handle,
|
NTSTATUS CsrGetObject(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
HANDLE Handle,
|
||||||
|
PVOID* Object)
|
||||||
|
{
|
||||||
|
*Object = ProcessData->HandleTable[(ULONG)Handle];
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS CsrReleaseObject(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
PVOID Object)
|
PVOID Object)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS CsrInsertObject(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
|
PHANDLE Handle,
|
||||||
|
PVOID Object)
|
||||||
|
{
|
||||||
|
ULONG i;
|
||||||
|
PVOID* NewBlock;
|
||||||
|
|
||||||
|
for (i = 0; i < ProcessData->HandleTableSize; i++)
|
||||||
|
{
|
||||||
|
if (ProcessData->HandleTable[i] == NULL)
|
||||||
|
{
|
||||||
|
ProcessData->HandleTable[i] = Object;
|
||||||
|
*Handle = (HANDLE)((i << 8) | 0x3);
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NewBlock = RtlAllocateHeap(CsrssApiHeap,
|
||||||
|
HEAP_ZERO_MEMORY,
|
||||||
|
(ProcessData->HandleTableSize + 64) *
|
||||||
|
sizeof(HANDLE));
|
||||||
|
if (NewBlock == NULL)
|
||||||
|
{
|
||||||
|
return(STATUS_NO_MORE_MEMORY);
|
||||||
|
}
|
||||||
|
RtlCopyMemory(NewBlock,
|
||||||
|
ProcessData->HandleTable,
|
||||||
|
ProcessData->HandleTableSize * sizeof(HANDLE));
|
||||||
|
ProcessData->HandleTable[i] = Object;
|
||||||
|
*Handle = (HANDLE)((i << 8) | 0x3);
|
||||||
|
ProcessData->HandleTableSize = ProcessData->HandleTableSize + 64;
|
||||||
|
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: process.c,v 1.3 1999/12/22 14:48:30 dwelch Exp $
|
/* $Id: process.c,v 1.4 1999/12/30 01:51:42 dwelch Exp $
|
||||||
*
|
*
|
||||||
* reactos/subsys/csrss/api/process.c
|
* reactos/subsys/csrss/api/process.c
|
||||||
*
|
*
|
||||||
|
@ -15,11 +15,71 @@
|
||||||
|
|
||||||
#include "api.h"
|
#include "api.h"
|
||||||
|
|
||||||
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
static ULONG NrProcess;
|
||||||
|
static PCSRSS_PROCESS_DATA ProcessData[256];
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
PCSRSS_PROCESS_DATA CsrGetProcessData(ULONG ProcessId)
|
||||||
|
{
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
for (i=0; i<NrProcess; i++)
|
||||||
|
{
|
||||||
|
if (ProcessData[i]->ProcessId == ProcessId)
|
||||||
|
{
|
||||||
|
return(ProcessData[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ProcessData[i] = RtlAllocateHeap(CsrssApiHeap,
|
||||||
|
HEAP_ZERO_MEMORY,
|
||||||
|
sizeof(CSRSS_PROCESS_DATA));
|
||||||
|
if (ProcessData[i] == NULL)
|
||||||
|
{
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
ProcessData[i]->ProcessId = ProcessId;
|
||||||
|
return(ProcessData[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS CsrCreateProcess (PCSRSS_PROCESS_DATA ProcessData,
|
NTSTATUS CsrCreateProcess (PCSRSS_PROCESS_DATA ProcessData,
|
||||||
PCSRSS_API_REQUEST LpcMessage)
|
PCSRSS_API_REQUEST LpcMessage)
|
||||||
{
|
{
|
||||||
|
PCSRSS_CREATE_PROCESS_REQUEST Request;
|
||||||
|
PCSRSS_PROCESS_DATA NewProcessData;
|
||||||
|
|
||||||
|
Request = (PCSRSS_CREATE_PROCESS_REQUEST)LpcMessage->Data;
|
||||||
|
|
||||||
|
NewProcessData = CsrGetProcessData(Request->NewProcessId);
|
||||||
|
|
||||||
|
if (NewProcessData == NULL)
|
||||||
|
{
|
||||||
|
return(STATUS_NO_MEMORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Request->Flags & DETACHED_PROCESS)
|
||||||
|
{
|
||||||
|
NewProcessData->Console = NULL;
|
||||||
|
}
|
||||||
|
else if (Request->Flags & CREATE_NEW_CONSOLE)
|
||||||
|
{
|
||||||
|
PCSRSS_CONSOLE Console;
|
||||||
|
|
||||||
|
Console = RtlAllocateHeap(CsrssApiHeap,
|
||||||
|
HEAP_ZERO_MEMORY,
|
||||||
|
sizeof(CSRSS_CONSOLE));
|
||||||
|
CsrInitConsole(ProcessData,
|
||||||
|
Console);
|
||||||
|
NewProcessData->Console = Console;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NewProcessData->Console = ProcessData->Console;
|
||||||
|
}
|
||||||
|
|
||||||
return(STATUS_NOT_IMPLEMENTED);
|
return(STATUS_NOT_IMPLEMENTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,15 +89,9 @@ NTSTATUS CsrTerminateProcess(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
return(STATUS_NOT_IMPLEMENTED);
|
return(STATUS_NOT_IMPLEMENTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS CsrConnectProcess(CSRSS_PROCESS_DATA ProcessData,
|
NTSTATUS CsrConnectProcess(PCSRSS_PROCESS_DATA ProcessData,
|
||||||
PCSRSS_API_REQUEST Request)
|
PCSRSS_API_REQUEST Request)
|
||||||
{
|
{
|
||||||
HANDLE ConsoleHandle;
|
|
||||||
|
|
||||||
ConsoleHandle = ((PULONG)Request.MessageData)[0];
|
|
||||||
|
|
||||||
ProcessData.Console = CsrReferenceConsoleByHandle(ConsoleHandle);
|
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: wapi.c,v 1.1 1999/12/22 14:48:30 dwelch Exp $
|
/* $Id: wapi.c,v 1.2 1999/12/30 01:51:42 dwelch Exp $
|
||||||
*
|
*
|
||||||
* reactos/subsys/csrss/init.c
|
* reactos/subsys/csrss/init.c
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,10 @@
|
||||||
|
|
||||||
#include "api.h"
|
#include "api.h"
|
||||||
|
|
||||||
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
HANDLE CsrssApiHeap;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
static void Thread_Api2(HANDLE ServerPort)
|
static void Thread_Api2(HANDLE ServerPort)
|
||||||
|
@ -25,7 +29,7 @@ static void Thread_Api2(HANDLE ServerPort)
|
||||||
LPCMESSAGE LpcRequest;
|
LPCMESSAGE LpcRequest;
|
||||||
PCSRSS_API_REQUEST Request;
|
PCSRSS_API_REQUEST Request;
|
||||||
CSRSS_API_REPLY Reply;
|
CSRSS_API_REPLY Reply;
|
||||||
CSRSS_PROCESS_DATA ProcessData;
|
PCSRSS_PROCESS_DATA ProcessData;
|
||||||
|
|
||||||
LpcReply = NULL;
|
LpcReply = NULL;
|
||||||
|
|
||||||
|
@ -42,39 +46,48 @@ static void Thread_Api2(HANDLE ServerPort)
|
||||||
|
|
||||||
Request = (PCSRSS_API_REQUEST)LpcRequest.MessageData;
|
Request = (PCSRSS_API_REQUEST)LpcRequest.MessageData;
|
||||||
|
|
||||||
|
ProcessData = CsrGetProcessData(LpcRequest.ClientProcessId);
|
||||||
|
|
||||||
DisplayString(L"Received request\n");
|
DisplayString(L"Received request\n");
|
||||||
|
|
||||||
switch (Request->Type)
|
switch (Request->Type)
|
||||||
{
|
{
|
||||||
case CSRSS_CREATE_PROCESS:
|
case CSRSS_CREATE_PROCESS:
|
||||||
Reply.Status = CsrCreateProcess(&ProcessData, Request);
|
Reply.Status = CsrCreateProcess(ProcessData,
|
||||||
|
Request);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CSRSS_TERMINATE_PROCESS:
|
case CSRSS_TERMINATE_PROCESS:
|
||||||
Reply.Status = CsrTerminateProcess(&ProcessData, Request);
|
Reply.Status = CsrTerminateProcess(ProcessData,
|
||||||
|
Request);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CSRSS_WRITE_CONSOLE:
|
case CSRSS_WRITE_CONSOLE:
|
||||||
Reply.Status = CsrWriteConsole(&ProcessData, Request,
|
Reply.Status = CsrWriteConsole(ProcessData,
|
||||||
|
Request,
|
||||||
&Reply.Count);
|
&Reply.Count);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CSRSS_READ_CONSOLE:
|
case CSRSS_READ_CONSOLE:
|
||||||
Reply.Status = CsrReadConsole(&ProcessData, Request,
|
Reply.Status = CsrReadConsole(ProcessData,
|
||||||
|
Request,
|
||||||
&Reply.Count);
|
&Reply.Count);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CSRSS_NEW_CONSOLE:
|
case CSRSS_ALLOC_CONSOLE:
|
||||||
Reply.Status = CsrAllocConsole(&ProcessData, Request,
|
Reply.Status = CsrAllocConsole(ProcessData,
|
||||||
|
Request,
|
||||||
&Reply.Handle);
|
&Reply.Handle);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CSRSS_FREE_CONSOLE:
|
case CSRSS_FREE_CONSOLE:
|
||||||
Reply.Status = CsrFreeConsole(&ProcessData, Request);
|
Reply.Status = CsrFreeConsole(ProcessData,
|
||||||
|
Request);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CSRSS_CONNECT_PROCESS:
|
case CSRSS_CONNECT_PROCESS:
|
||||||
Reply.Status = CsrConnectProcess(&ProcessData, Request);
|
Reply.Status = CsrConnectProcess(ProcessData,
|
||||||
|
Request);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Reply.Status = STATUS_NOT_IMPLEMENTED;
|
Reply.Status = STATUS_NOT_IMPLEMENTED;
|
||||||
|
@ -99,6 +112,18 @@ void Thread_Api(PVOID PortHandle)
|
||||||
LPCMESSAGE Request;
|
LPCMESSAGE Request;
|
||||||
HANDLE ServerPort;
|
HANDLE ServerPort;
|
||||||
|
|
||||||
|
CsrssApiHeap = RtlCreateHeap(HEAP_GROWABLE,
|
||||||
|
NULL,
|
||||||
|
65536,
|
||||||
|
65536,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
if (CsrssApiHeap == NULL)
|
||||||
|
{
|
||||||
|
PrintString("Failed to create private heap, aborting\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
Status = NtListenPort(PortHandle, &Request);
|
Status = NtListenPort(PortHandle, &Request);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: csrss.c,v 1.3 1999/12/22 14:48:29 dwelch Exp $
|
/* $Id: csrss.c,v 1.4 1999/12/30 01:51:41 dwelch Exp $
|
||||||
*
|
*
|
||||||
* csrss.c - Client/Server Runtime subsystem
|
* csrss.c - Client/Server Runtime subsystem
|
||||||
*
|
*
|
||||||
|
@ -38,17 +38,6 @@ BOOL TerminationRequestPending = FALSE;
|
||||||
BOOL InitializeServer(void);
|
BOOL InitializeServer(void);
|
||||||
|
|
||||||
|
|
||||||
void DisplayString(LPCWSTR Message)
|
|
||||||
{
|
|
||||||
UNICODE_STRING title;
|
|
||||||
|
|
||||||
title.Buffer = (LPWSTR) Message;
|
|
||||||
title.Length = wcslen(title.Buffer) * sizeof (WCHAR);
|
|
||||||
title.MaximumLength = title.Length + sizeof (WCHAR);
|
|
||||||
NtDisplayString(&title);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Native process' entry point */
|
/* Native process' entry point */
|
||||||
|
|
||||||
VOID NtProcessStartup(PPEB Peb)
|
VOID NtProcessStartup(PPEB Peb)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: init.c,v 1.3 1999/12/22 14:48:29 dwelch Exp $
|
/* $Id: init.c,v 1.4 1999/12/30 01:51:41 dwelch Exp $
|
||||||
*
|
*
|
||||||
* reactos/subsys/csrss/init.c
|
* reactos/subsys/csrss/init.c
|
||||||
*
|
*
|
||||||
|
@ -23,63 +23,6 @@
|
||||||
*/
|
*/
|
||||||
static HANDLE ApiPortHandle;
|
static HANDLE ApiPortHandle;
|
||||||
|
|
||||||
#if 0
|
|
||||||
static HANDLE SbApiPortHandle;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/**********************************************************************
|
|
||||||
* NAME
|
|
||||||
* Thread_SbApi
|
|
||||||
*
|
|
||||||
* DESCRIPTION
|
|
||||||
* Handle connection requests from clients to the port
|
|
||||||
* "\Windows\SbApiPort".
|
|
||||||
*/
|
|
||||||
static
|
|
||||||
void
|
|
||||||
Thread_SbApi(void * pPort)
|
|
||||||
{
|
|
||||||
NTSTATUS Status;
|
|
||||||
HANDLE Port;
|
|
||||||
HANDLE ConnectedPort;
|
|
||||||
|
|
||||||
Port = * (HANDLE*) pPort;
|
|
||||||
|
|
||||||
Status = NtListenPort(
|
|
||||||
Port,
|
|
||||||
CSRSS_SBAPI_PORT_QUEUE_SIZE
|
|
||||||
);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Wait for a client to connect
|
|
||||||
*/
|
|
||||||
while (TRUE)
|
|
||||||
{
|
|
||||||
Status = NtAcceptConnectPort(
|
|
||||||
Port,
|
|
||||||
& ConnectedPort
|
|
||||||
);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
if (NT_SUCCESS(NtCompleteConnectPort(ConnectedPort)))
|
|
||||||
{
|
|
||||||
/* dispatch call */
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
/* error: Port.CompleteConnect failed */
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
/* error: Port.AcceptConnect failed */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* NAME
|
* NAME
|
||||||
* InitializeServer
|
* InitializeServer
|
||||||
|
@ -100,7 +43,7 @@ BOOL InitializeServer(void)
|
||||||
UNICODE_STRING PortName;
|
UNICODE_STRING PortName;
|
||||||
|
|
||||||
/* NEW NAMED PORT: \ApiPort */
|
/* NEW NAMED PORT: \ApiPort */
|
||||||
RtlInitUnicodeString(&PortName, L"\\ApiPort");
|
RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
|
||||||
InitializeObjectAttributes(&ObAttributes,
|
InitializeObjectAttributes(&ObAttributes,
|
||||||
&PortName,
|
&PortName,
|
||||||
0,
|
0,
|
||||||
|
@ -113,7 +56,7 @@ BOOL InitializeServer(void)
|
||||||
0);
|
0);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DisplayString(L"Unable to create \\ApiPort (Status %x)\n");
|
PrintString("Unable to create \\ApiPort (Status %x)\n", Status);
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,36 +72,11 @@ BOOL InitializeServer(void)
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DisplayString(L"Unable to create server thread\n");
|
PrintString("Unable to create server thread\n");
|
||||||
NtClose(ApiPortHandle);
|
NtClose(ApiPortHandle);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* NEW NAMED PORT: \SbApiPort */
|
|
||||||
Status = NtCreatePort(
|
|
||||||
&Server.SbApi.Port,
|
|
||||||
& ObAttributes,
|
|
||||||
...
|
|
||||||
);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
NtClose(Server.Api.Port);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
Status = NtCreateThread(
|
|
||||||
& Server.SbApi.Thread,
|
|
||||||
Thread_SbApi,
|
|
||||||
(void*) & Server.SbApi.Port
|
|
||||||
);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
NtClose(Server.Api.Port);
|
|
||||||
NtClose(Server.SbApi.Port);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: makefile,v 1.3 1999/12/22 14:48:29 dwelch Exp $
|
# $Id: makefile,v 1.4 1999/12/30 01:51:41 dwelch Exp $
|
||||||
#
|
#
|
||||||
# CSRSS: Client/server runtime subsystem
|
# CSRSS: Client/server runtime subsystem
|
||||||
#
|
#
|
||||||
|
@ -8,11 +8,11 @@ TARGET=csrss
|
||||||
|
|
||||||
BASE_CFLAGS = -I../../include -I.
|
BASE_CFLAGS = -I../../include -I.
|
||||||
|
|
||||||
OBJECTS_API = api/process.o api/wapi.o
|
OBJECTS_API = api/process.o api/wapi.o api/conio.o
|
||||||
|
|
||||||
OBJECTS_SBAPI =
|
OBJECTS_SBAPI =
|
||||||
|
|
||||||
OBJECTS_MISC = $(TARGET).o init.o $(TARGET).coff
|
OBJECTS_MISC = $(TARGET).o init.o print.o $(TARGET).coff
|
||||||
|
|
||||||
OBJECTS = $(OBJECTS_API) $(OBJECTS_SBAPI) $(OBJECTS_MISC)
|
OBJECTS = $(OBJECTS_API) $(OBJECTS_SBAPI) $(OBJECTS_MISC)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: print.c,v 1.1 1999/12/22 14:48:29 dwelch Exp $
|
/* $Id: print.c,v 1.2 1999/12/30 01:51:41 dwelch Exp $
|
||||||
*
|
*
|
||||||
* smss.c - Session Manager
|
* smss.c - Session Manager
|
||||||
*
|
*
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
|
||||||
#include "csrss.h"
|
#include <csrss/csrss.h>
|
||||||
|
|
||||||
|
|
||||||
VOID DisplayString(LPCWSTR lpwString)
|
VOID DisplayString(LPCWSTR lpwString)
|
||||||
|
@ -40,7 +40,7 @@ VOID DisplayString(LPCWSTR lpwString)
|
||||||
NtDisplayString (&us);
|
NtDisplayString (&us);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID PrintString (char* fmt,. ..)
|
VOID PrintString (char* fmt, ...)
|
||||||
{
|
{
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: init.c,v 1.7 1999/12/24 17:17:51 ekohl Exp $
|
/* $Id: init.c,v 1.8 1999/12/30 01:51:42 dwelch Exp $
|
||||||
*
|
*
|
||||||
* init.c - Session Manager initialization
|
* init.c - Session Manager initialization
|
||||||
*
|
*
|
||||||
|
@ -157,6 +157,7 @@ InitSessionManager (
|
||||||
/* FIXME: Set environment variables from registry */
|
/* FIXME: Set environment variables from registry */
|
||||||
|
|
||||||
/* Load the kernel mode driver win32k.sys */
|
/* Load the kernel mode driver win32k.sys */
|
||||||
|
#if 0
|
||||||
RtlInitUnicodeString (&CmdLineW,
|
RtlInitUnicodeString (&CmdLineW,
|
||||||
L"\\??\\C:\\reactos\\system32\\drivers\\win32k.sys");
|
L"\\??\\C:\\reactos\\system32\\drivers\\win32k.sys");
|
||||||
Status = NtLoadDriver (&CmdLineW);
|
Status = NtLoadDriver (&CmdLineW);
|
||||||
|
@ -165,14 +166,28 @@ InitSessionManager (
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Start the Win32 subsystem (csrss.exe) */
|
|
||||||
#if 0
|
#if 0
|
||||||
|
/* Start the Win32 subsystem (csrss.exe) */
|
||||||
DisplayString (L"SM: Executing csrss.exe\n");
|
DisplayString (L"SM: Executing csrss.exe\n");
|
||||||
RtlInitUnicodeString (&UnicodeString,
|
RtlInitUnicodeString (&UnicodeString,
|
||||||
L"\\??\\C:\\reactos\\system32\\csrss.exe");
|
L"\\??\\C:\\reactos\\system32\\csrss.exe");
|
||||||
|
|
||||||
|
RtlCreateProcessParameters (&Ppb,
|
||||||
|
&UnicodeString,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
Status = RtlCreateUserProcess (&UnicodeString,
|
Status = RtlCreateUserProcess (&UnicodeString,
|
||||||
|
0,
|
||||||
|
Ppb,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
@ -186,6 +201,9 @@ InitSessionManager (
|
||||||
DisplayString (L"SM: Loading csrss.exe failed!\n");
|
DisplayString (L"SM: Loading csrss.exe failed!\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RtlDestroyProcessParameters (Ppb);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start the simple shell (shell.exe) */
|
/* Start the simple shell (shell.exe) */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue