/* PRIVATE VARIABLES **********************************************************/
-PDOS_DEVICE_NODE ConIn = NULL, ConOut = NULL;
+PDOS_DEVICE_NODE Con = NULL;
BYTE ExtendedCode = 0;
/* PRIVATE FUNCTIONS **********************************************************/
/* PUBLIC FUNCTIONS ***********************************************************/
-VOID ConDrvInitialize(PDOS_DEVICE_NODE *InputDevice, PDOS_DEVICE_NODE *OutputDevice)
+VOID ConDrvInitialize(VOID)
{
- ConIn = DosCreateDevice(DOS_DEVATTR_STDIN
- | DOS_DEVATTR_CON
- | DOS_DEVATTR_CHARACTER,
- "CONIN$");
- ConOut = DosCreateDevice(DOS_DEVATTR_STDOUT
- | DOS_DEVATTR_CON
- | DOS_DEVATTR_CHARACTER,
- "CONOUT$");
- ASSERT(ConIn != NULL && ConOut != NULL);
-
- ConIn->ReadRoutine = ConDrvReadInput;
- ConIn->InputStatusRoutine = ConDrvInputStatus;
- ConOut->WriteRoutine = ConDrvWriteOutput;
- ConIn->OpenRoutine = ConOut->OpenRoutine = ConDrvOpen;
- ConIn->CloseRoutine = ConOut->CloseRoutine = ConDrvClose;
-
- if (InputDevice) *InputDevice = ConIn;
- if (OutputDevice) *OutputDevice = ConOut;
+ Con = DosCreateDevice(DOS_DEVATTR_STDIN
+ | DOS_DEVATTR_STDOUT
+ | DOS_DEVATTR_CON
+ | DOS_DEVATTR_CHARACTER,
+ "CON");
+
+ Con->ReadRoutine = ConDrvReadInput;
+ Con->InputStatusRoutine = ConDrvInputStatus;
+ Con->WriteRoutine = ConDrvWriteOutput;
+ Con->OpenRoutine = ConDrvOpen;
+ Con->CloseRoutine = ConDrvClose;
}
VOID ConDrvCleanup(VOID)
{
- if (ConIn) DosDeleteDevice(ConIn);
- if (ConOut) DosDeleteDevice(ConOut);
+ if (Con) DosDeleteDevice(Con);
}
{
PDOS_SFT_ENTRY SftEntry;
HANDLE StandardHandles[3];
- PDOS_DEVICE_NODE ConIn = DosGetDevice("CONIN$");
- PDOS_DEVICE_NODE ConOut = DosGetDevice("CONOUT$");
- ASSERT(ConIn != NULL && ConOut != NULL);
+ PDOS_DEVICE_NODE Con = DosGetDevice("CON");
+ ASSERT(Con != NULL);
/* Get the native standard handles */
StandardHandles[0] = GetStdHandle(STD_INPUT_HANDLE);
for (i = 0; i < 3; i++)
{
- PDOS_DEVICE_NODE Device = (i == 0) ? ConIn : ConOut;
-
/* Find the corresponding SFT entry */
if (IsConsoleHandle(StandardHandles[i]))
{
- SftEntry = DosFindDeviceSftEntry(Device);
+ SftEntry = DosFindDeviceSftEntry(Con);
}
else
{
if (IsConsoleHandle(StandardHandles[i]))
{
SftEntry->Type = DOS_SFT_ENTRY_DEVICE;
- SftEntry->DeviceNode = Device;
+ SftEntry->DeviceNode = Con;
/* Call the open routine */
- if (Device->OpenRoutine) Device->OpenRoutine(Device);
+ if (Con->OpenRoutine) Con->OpenRoutine(Con);
}
else
{
CHAR CurrentDirectory[MAX_PATH];
CHAR DosDirectory[DOS_DIR_LENGTH];
LPSTR Path;
- PDOS_DEVICE_NODE ConInDevice, ConOutDevice;
FILE *Stream;
WCHAR Buffer[256];
EmsDrvInitialize();
/* Load the CON driver */
- ConDrvInitialize(&ConInDevice, &ConOutDevice);
+ ConDrvInitialize();
#endif