mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:25:48 +00:00
PSX: early code for the PSXSS server program. Currently it is a W32 console application,
therefore it is not a proper subsystem, but it will be converted to native as soon as it begins working. It probably does NOT work under ROS. I tested it under NT 4.0 SP 6a. To see what it creates in the system name sapce, run WinObj, and HandleEx. If you run csrterm.exe, it tries to connect to psxss.exe, but then dies because the API to tell psxss to create a PSX process it not implemented yet. PSXDLL.DLL will connect to \POSIX+\ApiPort (initial code in psx/lib/psxdll/misc/init.c is mute). svn path=/trunk/; revision=2841
This commit is contained in:
parent
f6c21b1a91
commit
bb24d01a48
20 changed files with 1787 additions and 9 deletions
|
@ -1,10 +1,10 @@
|
|||
/* $Id: crt0w32.c,v 1.1 2002/01/20 21:24:49 ea Exp $
|
||||
/* $Id: crt0w32.c,v 1.2 2002/04/10 21:30:21 ea Exp $
|
||||
*
|
||||
* PROJECT : ReactOS / POSIX+ personality
|
||||
* FILE : subsys/psx/lib/cr0w32.c
|
||||
* FILE : subsys/psx/lib/crt0w32.c
|
||||
* DESCRIPTION: startup code for POSIX+ applications.
|
||||
* DATE : 2002-01-18
|
||||
* AUTHOR : Emanuele Aliberti <ea@iol.it>
|
||||
* AUTHOR : Emanuele Aliberti <eal@users.sf.net>
|
||||
*/
|
||||
|
||||
extern void __stdcall __PdxInitializeData(int*,char***);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: init.c,v 1.1 2002/02/24 22:14:05 ea Exp $
|
||||
/* $Id: init.c,v 1.2 2002/04/10 21:30:21 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
|
@ -10,10 +10,12 @@
|
|||
*/
|
||||
#define NTOS_MODE_USER
|
||||
#include <ntos.h>
|
||||
#include <psx/lpcproto.h>
|
||||
|
||||
/* DLL GLOBALS */
|
||||
int * errno = NULL;
|
||||
char *** _environ = NULL;
|
||||
HANDLE ApiPort = INVALID_HANDLE_VALUE;
|
||||
/*
|
||||
* Called by startup code in crt0.o, where real
|
||||
* errno and _environ are actually defined.
|
||||
|
@ -23,5 +25,41 @@ VOID STDCALL __PdxInitializeData (int * errno_arg, char *** environ_arg)
|
|||
errno = errno_arg;
|
||||
_environ = environ_arg;
|
||||
}
|
||||
/*
|
||||
* Called by DLL's entry point when reason==PROCESS_ATTACH.
|
||||
*/
|
||||
NTATATUS STDCALL PsxConnectApiPort (VOID)
|
||||
{
|
||||
UNICODE_STRING usApiPortName;
|
||||
LPWSTR wsApiPortName = L"\\"PSX_NS_SUBSYSTEM_DIRECTORY_NAME"\\"PSX_NS_API_PORT_NAME;
|
||||
SECURITY_QUALITY_OF_SERVICE Sqos;
|
||||
ULONG MaxMessageSize = 0;
|
||||
NTSTATUS Status;
|
||||
PSX_CONNECT_PORT_DATA ConnectData;
|
||||
ULONG ConnectDataLength = sizeof ConnectData;
|
||||
|
||||
RtlInitUnicodeString (& usApiPortName, wsApiPortName);
|
||||
RtlZeroMemory (Sqos, sizeof Sqos);
|
||||
ConnectData.ConnectionType = PSX_CONNECTION_TYPE_PROCESS;
|
||||
ConnectData.Version = PSX_LPC_PROTOCOL_VERSION;
|
||||
ConnectData.PortIdentifier = 0;
|
||||
Status = NtConnectPort (
|
||||
& ApiPort,
|
||||
& usApiPortName,
|
||||
& Sqos,
|
||||
NULL,
|
||||
NULL,
|
||||
& MaxMessageSize,
|
||||
& ConnectData,
|
||||
& ConnectDataLength
|
||||
);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* TODO: emit a diagnostic message */
|
||||
return Status;
|
||||
}
|
||||
/* TODO: save returned data */
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
/* EOF */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue