ReactOS  0.4.14-dev-1279-gc1464a4
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 810 of file console.c.

813 {
815 
816  DPRINT("ConSrvConsoleCtrlEventTimeout Parent ProcessId = %x\n", ProcessData->Process->ClientId.UniqueProcess);
817 
818  /*
819  * Be sure we effectively have a control routine. It resides in kernel32.dll (client).
820  */
821  if (ProcessData->CtrlRoutine == NULL) return Status;
822 
823  _SEH2_TRY
824  {
825  HANDLE Thread = NULL;
826 
827  _SEH2_TRY
828  {
829  Thread = CreateRemoteThread(ProcessData->Process->ProcessHandle, NULL, 0,
830  ProcessData->CtrlRoutine,
831  UlongToPtr(CtrlEvent), 0, NULL);
832  if (NULL == Thread)
833  {
835  DPRINT1("Failed thread creation, Status = 0x%08lx\n", Status);
836  }
837  else
838  {
839  DPRINT("ProcessData->CtrlRoutine remote thread creation succeeded, ProcessId = %x, Process = 0x%p\n",
840  ProcessData->Process->ClientId.UniqueProcess, ProcessData->Process);
842  }
843  }
845  {
847  }
848  _SEH2_END;
849  }
851  {
853  DPRINT1("ConSrvConsoleCtrlEventTimeout - Caught an exception, Status = 0x%08lx\n", Status);
854  }
855  _SEH2_END;
856 
857  return Status;
858 }
#define CloseHandle
Definition: compat.h:406
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:2938
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 
)