ReactOS  0.4.14-dev-98-gb0d4763
console.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _CONSOLE_INIT_INFO
 

Typedefs

typedef struct _CONSOLE_INIT_INFO CONSOLE_INIT_INFO
 
typedef struct _CONSOLE_INIT_INFOPCONSOLE_INIT_INFO
 

Functions

VOID NTAPI ConSrvInitConsoleSupport (VOID)
 
NTSTATUS NTAPI ConSrvInitConsole (OUT PHANDLE NewConsoleHandle, OUT struct _CONSRV_CONSOLE **NewConsole, IN OUT PCONSOLE_INIT_INFO ConsoleInitInfo, IN PCSR_PROCESS ConsoleLeaderProcess)
 
VOID NTAPI ConSrvDeleteConsole (struct _CONSRV_CONSOLE *Console)
 
NTSTATUS ConSrvGetConsole (IN PCONSOLE_PROCESS_DATA ProcessData, OUT struct _CONSRV_CONSOLE **Console, IN BOOLEAN LockConsole)
 
VOID ConSrvReleaseConsole (IN struct _CONSRV_CONSOLE *Console, IN BOOLEAN IsConsoleLocked)
 
BOOLEAN NTAPI ConSrvValidateConsole (OUT struct _CONSRV_CONSOLE **Console, IN HANDLE ConsoleHandle, IN CONSOLE_STATE ExpectedState, IN BOOLEAN LockConsole)
 
NTSTATUS ConSrvConsoleCtrlEventTimeout (IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData, IN ULONG Timeout)
 

Typedef Documentation

◆ CONSOLE_INIT_INFO

◆ PCONSOLE_INIT_INFO

Function Documentation

◆ ConSrvConsoleCtrlEventTimeout()

NTSTATUS ConSrvConsoleCtrlEventTimeout ( IN ULONG  CtrlEvent,
IN PCONSOLE_PROCESS_DATA  ProcessData,
IN ULONG  Timeout 
)

Definition at line 809 of file console.c.

812 {
814 
815  DPRINT("ConSrvConsoleCtrlEventTimeout Parent ProcessId = %x\n", ProcessData->Process->ClientId.UniqueProcess);
816 
817  /*
818  * Be sure we effectively have a control routine. It resides in kernel32.dll (client).
819  */
820  if (ProcessData->CtrlRoutine == NULL) return Status;
821 
822  _SEH2_TRY
823  {
824  HANDLE Thread = NULL;
825 
826  _SEH2_TRY
827  {
828  Thread = CreateRemoteThread(ProcessData->Process->ProcessHandle, NULL, 0,
829  ProcessData->CtrlRoutine,
830  UlongToPtr(CtrlEvent), 0, NULL);
831  if (NULL == Thread)
832  {
834  DPRINT1("Failed thread creation, Status = 0x%08lx\n", Status);
835  }
836  else
837  {
838  DPRINT("ProcessData->CtrlRoutine remote thread creation succeeded, ProcessId = %x, Process = 0x%p\n",
839  ProcessData->Process->ClientId.UniqueProcess, ProcessData->Process);
841  }
842  }
844  {
846  }
847  _SEH2_END;
848  }
850  {
852  DPRINT1("ConSrvConsoleCtrlEventTimeout - Caught an exception, Status = 0x%08lx\n", Status);
853  }
854  _SEH2_END;
855 
856  return Status;
857 }
#define CloseHandle
Definition: compat.h:398
LONG NTSTATUS
Definition: precomp.h:26
_SEH2_TRY
Definition: create.c:4250
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define UlongToPtr(u)
Definition: config.h:106
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
Status
Definition: gdiplustypes.h:24
_SEH2_END
Definition: create.c:4424
static ULONG Timeout
Definition: ping.c:61
NTSTATUS NTAPI RtlGetLastNtStatus(VOID)
Definition: error.c:114
_SEH2_FINALLY
Definition: create.c:4395
#define DPRINT1
Definition: precomp.h:8
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966
HANDLE WINAPI CreateRemoteThread(IN HANDLE hProcess, IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:158

Referenced by ConSrvConsoleCtrlEvent(), and NotifyConsoleProcessForShutdown().

◆ ConSrvDeleteConsole()

VOID NTAPI ConSrvDeleteConsole ( struct _CONSRV_CONSOLE Console)

◆ ConSrvGetConsole()

NTSTATUS ConSrvGetConsole ( IN PCONSOLE_PROCESS_DATA  ProcessData,
OUT struct _CONSRV_CONSOLE **  Console,
IN BOOLEAN  LockConsole 
)

◆ ConSrvInitConsole()

NTSTATUS NTAPI ConSrvInitConsole ( OUT PHANDLE  NewConsoleHandle,
OUT struct _CONSRV_CONSOLE **  NewConsole,
IN OUT PCONSOLE_INIT_INFO  ConsoleInitInfo,
IN PCSR_PROCESS  ConsoleLeaderProcess 
)

◆ ConSrvInitConsoleSupport()

VOID NTAPI ConSrvInitConsoleSupport ( VOID  )

Definition at line 327 of file console.c.

328 {
329  DPRINT("CONSRV: ConSrvInitConsoleSupport()\n");
330 
331  /* Initialize the console list and its lock */
332  ConsoleListSize = 0;
333  ConsoleList = NULL;
335 
336  /* Should call LoadKeyboardLayout */
337 }
static PCONSRV_CONSOLE * ConsoleList
Definition: console.c:32
static ULONG ConsoleListSize
Definition: console.c:31
static RTL_RESOURCE ListLock
Definition: console.c:33
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
NTSYSAPI VOID NTAPI RtlInitializeResource(_In_ PRTL_RESOURCE Resource)

Referenced by CSR_SERVER_DLL_INIT().

◆ ConSrvReleaseConsole()

VOID ConSrvReleaseConsole ( IN struct _CONSRV_CONSOLE Console,
IN BOOLEAN  IsConsoleLocked 
)

◆ ConSrvValidateConsole()

BOOLEAN NTAPI ConSrvValidateConsole ( OUT struct _CONSRV_CONSOLE **  Console,
IN HANDLE  ConsoleHandle,
IN CONSOLE_STATE  ExpectedState,
IN BOOLEAN  LockConsole 
)