xref: /reactos/boot/environ/lib/io/display/emscons.c (revision c2c66aff)
1 /*
2  * COPYRIGHT:       See COPYING.ARM in the top level directory
3  * PROJECT:         ReactOS UEFI Boot Library
4  * FILE:            boot/environ/lib/io/display/emscons.c
5  * PURPOSE:         Boot Library Remote Console Routines
6  * PROGRAMMER:      Alex Ionescu (alex.ionescu@reactos.org)
7  */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include "bl.h"
12 
13 /* DATA VARIABLES ************************************************************/
14 
15 /* FUNCTIONS *****************************************************************/
16 
17 NTSTATUS
ConsoleRemoteConstruct(_In_ PBL_REMOTE_CONSOLE RemoteConsole)18 ConsoleRemoteConstruct (
19     _In_ PBL_REMOTE_CONSOLE RemoteConsole
20     )
21 {
22 #ifdef BL_EMS_SUPPORT
23 #error Implement me
24 #else
25     /* We don't support EMS for now */
26     return STATUS_NOT_IMPLEMENTED;
27 #endif
28 }
29 
30 NTSTATUS
ConsoleCreateRemoteConsole(_In_ PBL_TEXT_CONSOLE * TextConsole)31 ConsoleCreateRemoteConsole (
32     _In_ PBL_TEXT_CONSOLE* TextConsole
33     )
34 {
35     PBL_REMOTE_CONSOLE RemoteConsole;
36     NTSTATUS Status;
37 
38     /* Allocate the remote console */
39     RemoteConsole = BlMmAllocateHeap(sizeof(*RemoteConsole));
40     if (!RemoteConsole)
41     {
42         return STATUS_INSUFFICIENT_RESOURCES;
43     }
44 
45     /* Construct it */
46     Status = ConsoleRemoteConstruct(RemoteConsole);
47     if (!NT_SUCCESS(Status))
48     {
49         /* Failed to construct it, delete it */
50         BlMmFreeHeap(RemoteConsole);
51         return Status;
52     }
53 
54     /* Save the global pointer and return a pointer to the text console */
55     DspRemoteInputConsole = RemoteConsole;
56     *TextConsole = &RemoteConsole->TextConsole;
57     return STATUS_SUCCESS;
58 }
59