mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 21:48:19 +00:00
Minor fixes: some more code needed to make it work.
This one actually connects to the PSXSS.EXE process. svn path=/trunk/; revision=2824
This commit is contained in:
parent
c19d6a953f
commit
0c3dba541d
1 changed files with 51 additions and 38 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: csrterm.c,v 1.1 2002/03/17 22:15:39 ea Exp $
|
/* $Id: csrterm.c,v 1.2 2002/04/06 16:00:46 ea Exp $
|
||||||
*
|
*
|
||||||
* PROJECT : ReactOS Operating System / POSIX+ Environment Subsystem
|
* PROJECT : ReactOS Operating System / POSIX+ Environment Subsystem
|
||||||
* DESCRIPTION: CSRTERM - A DEC VT-100 terminal emulator for the PSX subsystem
|
* DESCRIPTION: CSRTERM - A DEC VT-100 terminal emulator for the PSX subsystem
|
||||||
|
@ -58,7 +58,15 @@
|
||||||
/*** GLOBALS *********************************************************/
|
/*** GLOBALS *********************************************************/
|
||||||
|
|
||||||
PRIVATE LPCSTR MyName = "CSRTERM";
|
PRIVATE LPCSTR MyName = "CSRTERM";
|
||||||
PRIVATE CSRTERM_SESSION Session;
|
PRIVATE CSRTERM_SESSION Session =
|
||||||
|
{
|
||||||
|
0, //Identifier
|
||||||
|
{ //ServerPort
|
||||||
|
{0,0,NULL},
|
||||||
|
L"\\"PSX_NS_SUBSYSTEM_DIRECTORY_NAME"\\"PSX_NS_API_PORT_NAME,
|
||||||
|
INVALID_HANDLE_VALUE
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/*** PRIVATE FUNCTIONS ***********************************************/
|
/*** PRIVATE FUNCTIONS ***********************************************/
|
||||||
VOID STDCALL Debug_Print (LPCSTR Format, ...)
|
VOID STDCALL Debug_Print (LPCSTR Format, ...)
|
||||||
|
@ -219,6 +227,7 @@ PRIVATE NTSTATUS STDCALL CreateSessionObjects (DWORD Pid)
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG Id = 0;
|
ULONG Id = 0;
|
||||||
OBJECT_ATTRIBUTES Oa;
|
OBJECT_ATTRIBUTES Oa;
|
||||||
|
LARGE_INTEGER SectionSize = {65536L,0};
|
||||||
|
|
||||||
TRACE;
|
TRACE;
|
||||||
|
|
||||||
|
@ -240,6 +249,7 @@ TRACE;
|
||||||
PSX_NS_SESSION_DIRECTORY_NAME,
|
PSX_NS_SESSION_DIRECTORY_NAME,
|
||||||
Pid
|
Pid
|
||||||
);
|
);
|
||||||
|
OutputDebugStringW(Session.Port.NameBuffer);
|
||||||
RtlInitUnicodeString (& Session.Port.Name, Session.Port.NameBuffer);
|
RtlInitUnicodeString (& Session.Port.Name, Session.Port.NameBuffer);
|
||||||
InitializeObjectAttributes (& Oa, & Session.Port.Name, 0, NULL, NULL);
|
InitializeObjectAttributes (& Oa, & Session.Port.Name, 0, NULL, NULL);
|
||||||
Status = NtCreatePort (& Session.Port.Handle, & Oa, 0, 0, 0x10000);
|
Status = NtCreatePort (& Session.Port.Handle, & Oa, 0, 0, 0x10000);
|
||||||
|
@ -276,13 +286,14 @@ TRACE;
|
||||||
PSX_NS_SESSION_DIRECTORY_NAME,
|
PSX_NS_SESSION_DIRECTORY_NAME,
|
||||||
Pid
|
Pid
|
||||||
);
|
);
|
||||||
|
OutputDebugStringW(Session.Section.NameBuffer);
|
||||||
RtlInitUnicodeString (& Session.Section.Name, Session.Section.NameBuffer);
|
RtlInitUnicodeString (& Session.Section.Name, Session.Section.NameBuffer);
|
||||||
InitializeObjectAttributes (& Oa, & Session.Section.Name, 0, 0, 0);
|
InitializeObjectAttributes (& Oa, & Session.Section.Name, 0, 0, 0);
|
||||||
Status = NtCreateSection (
|
Status = NtCreateSection (
|
||||||
& Session.Section.Handle,
|
& Session.Section.Handle,
|
||||||
0, /* DesiredAccess */
|
SECTION_ALL_ACCESS, /* DesiredAccess */
|
||||||
& Oa,
|
& Oa,
|
||||||
NULL, /* SectionSize OPTIONAL */
|
& SectionSize,
|
||||||
PAGE_READWRITE, /* Protect 4 */
|
PAGE_READWRITE, /* Protect 4 */
|
||||||
SEC_COMMIT, /* Attributes */
|
SEC_COMMIT, /* Attributes */
|
||||||
0 /* FileHandle: 0=pagefile.sys */
|
0 /* FileHandle: 0=pagefile.sys */
|
||||||
|
@ -348,6 +359,8 @@ TRACE;
|
||||||
/*
|
/*
|
||||||
* Try connecting to \POSIX+\SessionPort.
|
* Try connecting to \POSIX+\SessionPort.
|
||||||
*/
|
*/
|
||||||
|
RtlInitUnicodeString (& Session.ServerPort.Name, Session.ServerPort.NameBuffer);
|
||||||
|
OutputDebugStringW(Session.ServerPort.Name.Buffer);
|
||||||
Status = NtConnectPort (
|
Status = NtConnectPort (
|
||||||
& Session.ServerPort.Handle,
|
& Session.ServerPort.Handle,
|
||||||
& Session.ServerPort.Name,
|
& Session.ServerPort.Name,
|
||||||
|
|
Loading…
Reference in a new issue