summaryrefslogtreecommitdiffstats
path: root/private/os2/os2ses
diff options
context:
space:
mode:
Diffstat (limited to 'private/os2/os2ses')
-rw-r--r--private/os2/os2ses/conrqust.c199
-rw-r--r--private/os2/os2ses/event.c4205
-rw-r--r--private/os2/os2ses/event.h203
-rw-r--r--private/os2/os2ses/i386/bekbd.asm778
-rw-r--r--private/os2/os2ses/i386/cfkbd.asm794
-rw-r--r--private/os2/os2ses/i386/dkkbd.asm790
-rw-r--r--private/os2/os2ses/i386/frkbd.asm1153
-rw-r--r--private/os2/os2ses/i386/grkbd.asm768
-rw-r--r--private/os2/os2ses/i386/itkbd.asm1127
-rw-r--r--private/os2/os2ses/i386/jpkbd.asm1482
-rw-r--r--private/os2/os2ses/i386/kbdxlat.asm2470
-rw-r--r--private/os2/os2ses/i386/lakbd.asm788
-rw-r--r--private/os2/os2ses/i386/nlkbd.asm784
-rw-r--r--private/os2/os2ses/i386/nokbd.asm791
-rw-r--r--private/os2/os2ses/i386/pokbd.asm773
-rw-r--r--private/os2/os2ses/i386/sfkbd.asm788
-rw-r--r--private/os2/os2ses/i386/sgkbd.asm788
-rw-r--r--private/os2/os2ses/i386/spkbd.asm786
-rw-r--r--private/os2/os2ses/i386/sukbd.asm785
-rw-r--r--private/os2/os2ses/i386/svkbd.asm785
-rw-r--r--private/os2/os2ses/i386/ukkbd.asm1129
-rw-r--r--private/os2/os2ses/i386/uskbd.asm761
-rw-r--r--private/os2/os2ses/imrqust.c261
-rw-r--r--private/os2/os2ses/kbd.h27
-rw-r--r--private/os2/os2ses/kbddd.inc269
-rw-r--r--private/os2/os2ses/kbdnls.c191
-rw-r--r--private/os2/os2ses/kbdrqust.c4046
-rw-r--r--private/os2/os2ses/kbdtable.c653
-rw-r--r--private/os2/os2ses/kbdxlat.inc164
-rw-r--r--private/os2/os2ses/makefile6
-rw-r--r--private/os2/os2ses/mon.h82
-rw-r--r--private/os2/os2ses/monrqust.c793
-rw-r--r--private/os2/os2ses/mou.h28
-rw-r--r--private/os2/os2ses/mourqust.c235
-rw-r--r--private/os2/os2ses/nls.c349
-rw-r--r--private/os2/os2ses/ntinitss.c1650
-rw-r--r--private/os2/os2ses/ntrqust.c402
-rw-r--r--private/os2/os2ses/os2.c1750
-rw-r--r--private/os2/os2ses/os2.rc155
-rw-r--r--private/os2/os2ses/os2ses.h324
-rw-r--r--private/os2/os2ses/prtrqust.c327
-rw-r--r--private/os2/os2ses/sources90
-rw-r--r--private/os2/os2ses/struc.inc513
-rw-r--r--private/os2/os2ses/tmrqust.c125
-rw-r--r--private/os2/os2ses/trans.c463
-rw-r--r--private/os2/os2ses/trans.h491
-rw-r--r--private/os2/os2ses/util.c899
-rw-r--r--private/os2/os2ses/vio.h83
-rw-r--r--private/os2/os2ses/violvb.c770
-rw-r--r--private/os2/os2ses/vionls.c196
-rw-r--r--private/os2/os2ses/viorqust.c2809
-rw-r--r--private/os2/os2ses/viotty.c1538
52 files changed, 42616 insertions, 0 deletions
diff --git a/private/os2/os2ses/conrqust.c b/private/os2/os2ses/conrqust.c
new file mode 100644
index 000000000..3e2254bb7
--- /dev/null
+++ b/private/os2/os2ses/conrqust.c
@@ -0,0 +1,199 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ conrqust.c
+
+Abstract:
+
+ This module contains the handler for console requests.
+
+Author:
+
+ Avi Nathan (avin) 17-Jul-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#include "os2win.h"
+#include <io.h>
+#include <stdio.h>
+
+
+#if DBG
+BYTE Ow2ConReadFileStr[] = "Ow2ConReadFile";
+BYTE Ow2ConWriteFileStr[] = "Ow2ConWriteFile";
+BYTE Ow2ConCloseHandleStr[] = "Ow2ConCloseHandle";
+BYTE Ow2ConBeepStr[] = "Ow2ConBeep";
+#endif
+
+DWORD
+Ow2ConReadFile(
+ IN HANDLE hFile,
+ IN ULONG Length,
+ OUT PVOID Buffer,
+ OUT PULONG BytesRead
+ )
+{
+ DWORD Rc;
+
+ if (Or2WinReadFile(
+ #if DBG
+ Ow2ConReadFileStr,
+ #endif
+ hFile,
+ Buffer,
+ Length,
+ BytesRead,
+ NULL
+ )) {
+#if DBG
+ if (Length != *BytesRead)
+ {
+ IF_OD2_DEBUG( OS2_EXE )
+ KdPrint(("OS2SES(ConRqust-Ow2ConReadFile): partial data: %lu from %lu\n",
+ *BytesRead, Length));
+ }
+#endif
+ return(NO_ERROR);
+
+ } else {
+
+ Rc = GetLastError();
+
+ if (Rc == ERROR_BROKEN_PIPE) {
+
+ //
+ // This is a special case. It's returned if we're reading
+ // from a pipe, and the other side closed the pipe. In this
+ // case, we simulate a closed file
+ //
+
+ *BytesRead = 0;
+ return(NO_ERROR);
+ }
+
+#if DBG
+ KdPrint(( "OS2SES(ConRqust-Ow2ConReadFile): ReadFile: Rc %lu\n", Rc));
+#endif
+ *BytesRead = 0;
+ return(Rc);
+ }
+}
+
+
+DWORD
+Ow2ConWriteFile(
+ IN HANDLE hFile,
+ IN ULONG Length,
+ IN PVOID Buffer,
+ OUT PULONG BytesWritten
+ )
+{
+ DWORD Rc;
+
+ if (Or2WinWriteFile(
+ #if DBG
+ Ow2ConWriteFileStr,
+ #endif
+ hFile,
+ Buffer,
+ Length,
+ BytesWritten,
+ NULL))
+ {
+#if DBG
+ if (Length != *BytesWritten)
+ {
+ IF_OD2_DEBUG( OS2_EXE )
+ KdPrint(("OS2SES(ConRqust-Ow2ConWriteFile): partial data: %lu from %lu\n",
+ *BytesWritten, Length));
+ }
+#endif
+
+ return(NO_ERROR);
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(( "OS2SES(ConRqust-Ow2ConWriteFile): WriteFile: Rc %lu\n", Rc));
+#endif
+ *BytesWritten = 0;
+ return(Rc);
+ }
+}
+
+
+DWORD
+Ow2ConCloseHandle(
+ IN HANDLE hFile
+ )
+{
+ DWORD Rc;
+
+ if ((hFile == hConsoleOutput) ||
+ (hFile == hConsoleInput))
+ {
+#if DBG
+ KdPrint(("OS2SES(ConRqust-ScCloseHandle): Std-handle\n"));
+#endif
+ return(NO_ERROR);
+ }else
+ {
+ if (Or2WinCloseHandle(
+ #if DBG
+ Ow2ConCloseHandleStr,
+ #endif
+ hFile))
+ {
+ return(NO_ERROR);
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(( "OS2SES(ConRqust-Ow2ConCloseHandle): CloseHandle: Rc %lu\n", Rc));
+#endif
+ return(Rc);
+ }
+ }
+}
+
+
+DWORD
+Ow2ConBeep(
+ IN ULONG dwFreq,
+ IN ULONG dwDuration
+ )
+{
+ DWORD Rc;
+
+ if(Or2WinBeep(
+ #if DBG
+ Ow2ConBeepStr,
+ #endif
+ dwFreq,
+ dwDuration
+ ))
+ {
+ return(NO_ERROR);
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(( "OS2SES(ConRqust-Ow2ConBeep): Beep: Rc %lu\n", Rc));
+#endif
+ return(Rc);
+ }
+}
+
diff --git a/private/os2/os2ses/event.c b/private/os2/os2ses/event.c
new file mode 100644
index 000000000..0095988c8
--- /dev/null
+++ b/private/os2/os2ses/event.c
@@ -0,0 +1,4205 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ Event.c
+
+Abstract:
+
+ This module contains the code of the input event handler. It
+ read input from the input buffer queue and divide the event to 2
+ different queues: Kbd & Mou.
+ It also contains the code of the Kbd & Mou routines of reading
+ events from their queues.
+
+Author:
+
+ Michael Jarus (mjarus) 3-Nov-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#if PMNT
+#include <windows.h>
+#include <wincon.h>
+#include <ntddvdeo.h>
+#include "conapi.h"
+#define PMNT_CONSOLE_INCLUDED // to fix a redefinition in "os2nt.h"
+#endif // PMNT
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#if PMNT
+#ifndef FIELD_OFFSET
+#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
+#endif
+#define INCL_32BIT
+#include "pmnt.h"
+#endif
+
+#define AccentedKey 0x0200 // Key was translated using previous accent.
+#define KeyTypeMask 0x003F // Isolates the Key Type field of DDFlags.
+#define AccentKey 0x0010 // @@ This packet is an accent key
+
+#if PMNT
+/* Hand-shaking events */
+HANDLE hStartHardwareEvent;
+HANDLE hEndHardwareEvent;
+LONG ScreenX = 640L;
+LONG ScreenY = 480L;
+extern PSZ Od2PgmFilePath;
+#endif // PMNT
+
+VOID
+ExitThread(
+ ULONG dwExitCode
+ );
+
+#if PMNT
+DWORD
+NtClose(
+ IN HANDLE Handle
+ );
+#endif // PMNT
+
+VOID Od2ExitGP();
+DWORD MonQueueClose(IN HANDLE hMon);
+
+DWORD
+ReadInputEvent(IN ULONG PeekFlag);
+
+BOOLEAN
+Ow2WriteBackDummyEvent(VOID);
+
+BOOLEAN
+Ow2ClearupDummyEvent(VOID);
+
+DWORD
+Ow2FaultFilter(
+ IN DWORD uFaultFilter,
+ IN PEXCEPTION_POINTERS lpExP);
+
+VOID Ow2DisplayExceptionInfo( VOID );
+
+DWORD
+Ow2GetInputConsoleMode(
+#if DBG
+ PSZ FuncName,
+#endif
+ LPDWORD lpMode
+ );
+
+DWORD
+Ow2SetInputConsoleMode(
+#if DBG
+ PSZ FuncName,
+#endif
+ DWORD dwMode
+ );
+
+CRITICAL_SECTION QueueInputCriticalSection;
+ULONG EventServerThreadSuspend = TRUE;
+ULONG NextEventServerThreadSuspend;
+HANDLE SuspendEvent;
+HANDLE HandsOffEvent;
+HANDLE HandsOnEvent;
+BOOL IgnoreNextMouseEventDueToFocus = FALSE;
+BOOL EventThreadHandsOff = FALSE;
+DWORD Ow2dwInputMode; /* Console Current Input Mode */
+DWORD Ow2dwWinInputMode; /* The desired mode (DefaultWinInputMode | ENABLE_MOUSE_INPUT) */
+
+#if DBG
+BYTE GetOs2MouEventIntoQueueStr[] = "GetOs2MouEventIntoQueue";
+BYTE Ow2GetOs2KbdEventIntoQueueStr[] = "Ow2GetOs2KbdEventIntoQueue";
+BYTE StartEventHandlerForSessionStr[] = "StartEventHandlerForSession";
+BYTE AddConAfterWinProcessStr[] = "AddConAfterWinProcess";
+BYTE RemoveConForWinProcessStr[] = "RemoveConForWinProcess";
+BYTE ReadInputEventStr[] = "ReadInputEvent";
+BYTE StartEventHandlerStr[] = "StartEventHandler";
+BYTE InitQueueStr[] = "InitQueue";
+BYTE InitMouQueueStr[] = "InitMouQueue";
+BYTE EventServerThreadStr[] = "EventServerThread";
+BYTE Ow2MouOnStr[] = "Ow2MouOn";
+BYTE Ow2MouOffStr[] = "Ow2MouOff";
+#endif
+
+#if DBG
+ULONG InternalDebug = 0;
+#define InputModeDebug 0001
+#define InputEventDebug 0002
+#endif
+
+
+PVOID
+StartEventHandlerForSession(VOID)
+{
+ DWORD NewInput = (OS2_DEFAULT_INPUT_MODE /*| ENABLE_MOUSE_INPUT*/);
+
+ EventLoop = TRUE;
+ InitializeCriticalSection(&QueueInputCriticalSection);
+ if (hStdInConsoleType)
+ {
+ hConsoleInput = hConsoleStdIn;
+ } else
+ {
+ hConsoleInput = Or2WinCreateFileW(
+ #if DBG
+ StartEventHandlerForSessionStr,
+ #endif
+ L"CONIN$",
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ|FILE_SHARE_WRITE,
+ NULL, /* &SecurityAttributes */
+ OPEN_EXISTING,
+ 0,
+ NULL
+ );
+
+ if (hConsoleInput == INVALID_HANDLE_VALUE)
+ {
+#if DBG
+ ASSERT1( "StartEvent: unable to create CONIN$", FALSE );
+#endif
+ // return(NULL);
+ }
+ }
+
+ if (!Or2WinGetConsoleMode(
+ #if DBG
+ StartEventHandlerForSessionStr,
+ #endif
+ hConsoleInput,
+ &DefaultWinInputMode
+ ))
+ {
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1( "StartEvent: Can not get CONIN Mode", FALSE );
+ }
+#endif
+ DefaultWinInputMode = WINDOW_DEFAULT_INPUT_MODE;
+ }
+
+ Ow2dwWinInputMode = DefaultWinInputMode /*| ENABLE_MOUSE_INPUT*/;
+ Ow2dwInputMode = DefaultWinInputMode;
+ InputModeFlags = WINDOW_DEFAULT_INPUT_MODE;
+
+ if (Ow2SetInputConsoleMode(
+ #if DBG
+ StartEventHandlerForSessionStr,
+ #endif
+ Ow2dwWinInputMode
+ ))
+ {
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1( "StartEvent: Can not set CONIN Mode", FALSE );
+ } else
+ KdPrint(("OS2SES(StartEvent): Can not set CONIN Mode\n"));
+#endif
+ } else
+ {
+ Ow2dwInputMode = Ow2dwWinInputMode;
+ }
+ InputModeFlags = NewInput;
+
+ HandleHeap = Or2WinHeapCreate(
+ #if DBG
+ StartEventHandlerForSessionStr,
+ #endif
+ 0, // Serialize the heap
+ HANDLE_HEAP_SIZE, // Init size = 64K
+ 0 // Max size is unlimited
+ );
+ if (HandleHeap == NULL)
+ {
+#if DBG
+ ASSERT1( "StartEvent: unable to create heap for event-queue", FALSE );
+#endif
+
+ return(NULL);
+ }
+
+ KbdEventQueueSize = PortMessageHeaderSize + KEYBOARD_QUEUE_SIZE;
+ MouEventQueueSize = PortMessageHeaderSize + MOUSE_QUEUE_SIZE;
+
+ //
+ // Complete window initialization and set SesGrp parameters
+ //
+
+ if( SesGrpInit() || KbdInit() || MouInit() || InitMonitor() || VioInitForSession() ||
+ AnsiInitForSession())
+ {
+ return(NULL);
+ }
+
+ SuspendEvent = Or2WinCreateEventW(
+ #if DBG
+ StartEventHandlerForSessionStr,
+ #endif
+ NULL,
+ FALSE, /* auto reset */
+ FALSE, // not set at creation
+ NULL
+ );
+
+ if (SuspendEvent == NULL)
+ {
+#if DBG
+ ASSERT1( "StartEvent: unable to create event", FALSE );
+#endif
+ return (NULL);
+ }
+
+ HandsOffEvent = Or2WinCreateEventW(
+ #if DBG
+ StartEventHandlerForSessionStr,
+ #endif
+ NULL,
+ FALSE, // auto reset
+ FALSE, // Clear at creation
+ NULL
+ );
+
+ if (HandsOffEvent == NULL)
+ {
+#if DBG
+ ASSERT1( "StartEvent: unable to create HandsOff event", FALSE );
+#endif
+ return (NULL);
+ }
+
+ HandsOnEvent = Or2WinCreateEventW(
+ #if DBG
+ StartEventHandlerForSessionStr,
+ #endif
+ NULL,
+ FALSE, // auto reset
+ TRUE, // Set at creation
+ NULL
+ );
+
+ if (HandsOnEvent == NULL)
+ {
+#if DBG
+ ASSERT1( "StartEvent: unable to create HandsOn event", FALSE );
+#endif
+ return (NULL);
+ }
+ Os2WindowFocus = (ULONG)-1;
+ return ((PVOID)KbdQueue);
+}
+
+
+PVOID
+StartEventHandler(VOID)
+{
+ HandleHeap = Or2WinHeapCreate(
+ #if DBG
+ StartEventHandlerStr,
+ #endif
+ 0, // Serialize the heap
+ HANDLE_HEAP_SIZE, // Init size = 64K
+ 0 // Max size is unlimited
+ );
+
+ if (HandleHeap == NULL)
+ {
+#if DBG
+ ASSERT1( "StartEvent(non root): unable to create heap for event-queue", FALSE );
+#endif
+
+ return(NULL);
+ }
+
+ if (VioInit() || AnsiInit())
+ {
+ return(NULL);
+ }
+
+ return ((PVOID)-1L);
+}
+
+
+DWORD
+InitQueue(IN PKEY_EVENT_QUEUE *ppKbdQueue)
+{
+ PKEY_EVENT_QUEUE pKbdQueue;
+ PBYTE Ptr;
+
+ *ppKbdQueue == NULL;
+
+ Ptr = Or2WinHeapAlloc(
+ #if DBG
+ InitQueueStr,
+ #endif
+ HandleHeap,
+ 0,
+ KbdEventQueueSize
+ );
+
+ if ( Ptr == NULL )
+ {
+#if DBG
+ KdPrint(("OS2SES(Event-InitKbdQueue): unable to allocate handle\n"));
+#endif
+ return ERROR_KBD_NO_MORE_HANDLE;
+ }
+
+ pKbdQueue = (PKEY_EVENT_QUEUE) ( Ptr + PortMessageHeaderSize );
+ RtlZeroMemory(pKbdQueue, sizeof(MON_HEADER));
+ pKbdQueue->MonHdr.MemoryStartAddress = Ptr;
+
+ pKbdQueue->In = pKbdQueue->Out = pKbdQueue->Event;
+ pKbdQueue->End = pKbdQueue->Event + (KEYBOARD_QUEUE_LENGTH-1);
+
+ if (KbdQueue != NULL)
+ {
+ pKbdQueue->Setup = KbdQueue->Setup;
+ pKbdQueue->Cp = KbdQueue->Cp;
+ pKbdQueue->bNlsShift = KbdQueue->bNlsShift;
+ }
+
+ pKbdQueue->Count = 1;
+
+ // add initialization for MON_HDR ( & to sign queue-end)
+
+ InitializeCriticalSection(&pKbdQueue->MonHdr.SyncCriticalSection);
+ pKbdQueue->MonHdr.MonReg.Pos = 3;
+ pKbdQueue->MonHdr.DevType = KbdDevice;
+
+ *ppKbdQueue = pKbdQueue;
+
+ return(FALSE);
+}
+
+
+DWORD
+InitMouQueue(IN PMOU_EVENT_QUEUE *ppMouQueue)
+{
+ PMOU_EVENT_QUEUE pMouQueue;
+ PBYTE Ptr;
+
+ *ppMouQueue = NULL;
+
+ Ptr = Or2WinHeapAlloc(
+ #if DBG
+ InitMouQueueStr,
+ #endif
+ HandleHeap,
+ 0,
+ MouEventQueueSize
+ );
+
+ if ( Ptr == NULL )
+ {
+#if DBG
+ KdPrint(("OS2SES(Event-InitMouQueue): unable to allocate handle\n"));
+#endif
+ return TRUE;
+ }
+
+ pMouQueue = (PMOU_EVENT_QUEUE) ( Ptr + PortMessageHeaderSize );
+ RtlZeroMemory(pMouQueue, sizeof(MON_HEADER));
+ pMouQueue->MonHdr.MemoryStartAddress = Ptr;
+
+ pMouQueue->In = pMouQueue->Out = pMouQueue->Event;
+ pMouQueue->End = pMouQueue->Event + (MOUSE_QUEUE_LENGTH-1);
+
+ // add initialization for MON_HDR ( & to sign queue-end)
+
+ InitializeCriticalSection(&pMouQueue->MonHdr.SyncCriticalSection);
+ pMouQueue->MonHdr.MonReg.Pos = 3;
+ pMouQueue->MonHdr.DevType = MouseDevice;
+
+ *ppMouQueue = pMouQueue;
+
+ return(FALSE);
+}
+
+
+DWORD
+AddConAfterWinProcess()
+{
+ DWORD Rc;
+
+
+ Or2WinEnterCriticalSection(
+ #if DBG
+ AddConAfterWinProcessStr,
+ #endif
+ &QueueInputCriticalSection
+ );
+ EventServerThreadSuspend = NextEventServerThreadSuspend;
+ if(EventServerThreadSuspend)
+ {
+ if(KbdMonQueue->MonHdr.WaitForEvent || MouMonQueue->MonHdr.WaitForEvent)
+ {
+ Or2WinSetEvent(
+ #if DBG
+ AddConAfterWinProcessStr,
+ #endif
+ SuspendEvent
+ );
+ EventServerThreadSuspend = FALSE;
+ }
+ }
+
+ Or2WinLeaveCriticalSection(
+ #if DBG
+ AddConAfterWinProcessStr,
+ #endif
+ &QueueInputCriticalSection
+ );
+
+ if (!Or2WinSetConsoleMode(
+ #if DBG
+ AddConAfterWinProcessStr,
+ #endif
+ hConsoleOutput,
+ SesGrp->OutputModeFlags
+ ))
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("ServeWinWaitThread: SetConsoleMode failed\n",
+ Rc));
+#endif
+ }
+
+ if (Ow2SetInputConsoleMode(
+ #if DBG
+ AddConAfterWinProcessStr,
+ #endif
+ Ow2dwWinInputMode
+ ))
+ {
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1( "AddConAfterWinProcess: Can not set CONIN Mode", FALSE );
+ } else
+ KdPrint(("OS2SES(AddConAfterWinProcess): Can not set CONIN Mode\n"));
+#endif
+ } else
+ {
+ Ow2dwInputMode = Ow2dwWinInputMode;
+ }
+ //
+ // Put EventServerThread back to work
+ //
+ Or2WinSetEvent(
+ #if DBG
+ AddConAfterWinProcessStr,
+ #endif
+ HandsOnEvent
+ );
+
+ return (NO_ERROR);
+}
+
+
+DWORD
+RemoveConForWinProcess()
+{
+ DWORD Rc;
+
+ EventThreadHandsOff = TRUE;
+ Or2WinEnterCriticalSection(
+ #if DBG
+ RemoveConForWinProcessStr,
+ #endif
+ &QueueInputCriticalSection
+ );
+
+ NextEventServerThreadSuspend = TRUE;
+
+ if(KbdMonQueue->MonHdr.WaitForEvent || MouMonQueue->MonHdr.WaitForEvent)
+ {
+ NextEventServerThreadSuspend = FALSE;
+ }
+ EventServerThreadSuspend = FALSE;
+
+ //
+ // Set the suspend event, to release EventServerThread, to
+ // will take hands off the console
+ //
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("RemoveConForWinProcess: SetEvent\n"));
+ }
+#endif
+ Or2WinSetEvent(
+ #if DBG
+ RemoveConForWinProcessStr,
+ #endif
+ SuspendEvent
+ );
+
+ //
+ // Write Back to console in case EventThread is in ReadInput()
+ //
+ Ow2WriteBackDummyEvent();
+
+ Or2WinLeaveCriticalSection(
+ #if DBG
+ RemoveConForWinProcessStr,
+ #endif
+ &QueueInputCriticalSection
+ );
+
+ //
+ // Wait to synchronize with EventServerThread
+ //
+ WaitForSingleObject(HandsOffEvent, INFINITE);
+
+ //
+ // Set default console mode here. We can be sure that EventServerThread will
+ // not change these settings, because it has set HandsOffEvent and going to
+ // wait on HandsOnEvent.
+ //
+
+ if (Rc = Ow2SetInputConsoleMode(
+ #if DBG
+ RemoveConForWinProcessStr,
+ #endif
+ DefaultWinInputMode
+ ))
+ {
+#if DBG
+ KdPrint(("OS2SES(RemoveConForWinProcess): SetConsoleMode(Input) failed \n"));
+#endif
+ }
+
+ if (!Or2WinSetConsoleMode(
+ #if DBG
+ RemoveConForWinProcessStr,
+ #endif
+ hConsoleOutput,
+ SesGrp->DefaultWinOutputMode
+ ))
+ {
+#if DBG
+ KdPrint(("OS2SES(event-RemoveConForWinProcess): SetConsoleMode(Output) failed \n"));
+#endif
+ }
+
+ return (0L);
+}
+
+
+DWORD
+EventServerThread(IN PVOID Parameter)
+{
+ UNREFERENCED_PARAMETER(Parameter);
+
+ try {
+
+restart:
+
+ WaitForSingleObject( HandsOnEvent, INFINITE );
+
+ if (SesGrp->Os2ssLCID != SesGrp->Win32LCID)
+ {
+ if(!Or2WinSetThreadLocale(
+ #if DBG
+ EventServerThreadStr,
+ #endif
+ SesGrp->Os2ssLCID
+ ))
+ {
+ ASSERT1("OS2SS(event): cannot set Thread Locale", FALSE);
+ }
+ }
+
+ EventServerThreadSuspend = TRUE;
+ for ( ; ; )
+ {
+ //SuspendEvent
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("EventServerThread: WaitEvent\n"));
+ }
+#endif
+ //
+ // Wait for an application to ask for Keyboard/Monitor/Mouse
+ //
+ while (WaitForSingleObject( SuspendEvent, INFINITE ));
+
+#if PMNT
+ /*
+ * Terminate EventServerThread for PMNT processes.
+ */
+ if (ProcessIsPMProcess()) {
+ NtClose(EventServerThreadHandle);
+ ExitThread(0L);
+ }
+#endif
+
+ if (EventThreadHandsOff) {
+ EventThreadHandsOff = FALSE;
+ //
+ // RemoveConForWinProcess puts a dummy event to wake this
+ // thread from ReadInputEvent, clear it is there
+ //
+ Ow2ClearupDummyEvent();
+ SetEvent( HandsOffEvent );
+ goto restart;
+ }
+
+ EventServerThreadSuspend = FALSE;
+
+ ReadInputEvent(0L); // read next event
+ if (EventThreadHandsOff) {
+ EventThreadHandsOff = FALSE;
+ //
+ // RemoveConForWinProcess puts a dummy event to wake this
+ // thread from ReadInputEvent, clear it is there
+ //
+ Ow2ClearupDummyEvent();
+ SetEvent( HandsOffEvent );
+ goto restart;
+ }
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+ if (EventThreadHandsOff) {
+ EventThreadHandsOff = FALSE;
+ //
+ // RemoveConForWinProcess puts a dummy event to wake this
+ // thread from ReadInputEvent, clear it is there
+ //
+ Ow2ClearupDummyEvent();
+ SetEvent( HandsOffEvent );
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ goto restart;
+ }
+
+ if(KbdMonQueue->MonHdr.WaitForEvent || MouMonQueue->MonHdr.WaitForEvent ||
+ SesGrp->PauseScreenUpdate )
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("EventServerThread: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ } else
+ {
+ EventServerThreadSuspend = TRUE;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ }
+
+ }
+ //
+ // if Os2Debug is on, and ntsd is attached, it will get the second chance
+ //
+#if DBG
+ except( (Os2Debug ? Ow2FaultFilter(EXCEPTION_CONTINUE_SEARCH, GetExceptionInformation()):
+
+ Ow2FaultFilter(EXCEPTION_EXECUTE_HANDLER, GetExceptionInformation())) ) {
+#else
+ except( Ow2FaultFilter(EXCEPTION_EXECUTE_HANDLER, GetExceptionInformation()) ) {
+#endif
+
+#if DBG
+ KdPrint(("OS2SES: Internal error - Exception occured in EventServerThread\n"));
+#endif
+ Ow2DisplayExceptionInfo();
+ ExitThread(1);
+ }
+ ExitThread(0L);
+ return(0L);
+}
+
+
+DWORD
+ReadInputEvent(IN ULONG PeekFlag)
+/*++
+
+Routine Description:
+
+ This routine get next Input Event from queue and handle it
+ according to the EventType.
+
+Arguments:
+
+ PeekFlag - indicate if should try to peek before read (1)
+ or to wait till next event(0).
+
+Return Value:
+
+ 0 - no event
+
+ -1 - try again (event was ignore or was illegal)
+
+ other (KEY_EVENT, MOUSE_EVENT) - type of the event read and handled
+
+ (WINDOW_BUFFER_SIZE_EVENT, MENU_EVENT, FOCUS_EVENT)
+
+Note:
+
+--*/
+{
+ INPUT_RECORD In;
+ KEYEVENTINFO KbdEvent[3];
+ MOU_MON_PACKAGE MouEvent;
+ DWORD cEvents, Rc, RetCode = 0, i, j, NumKbd;
+ DWORD InConMode;
+ BOOL ReadInputFail = FALSE;
+
+ /*
+ * 1. Set ConsoleInputMode
+ *
+ * This is done if there is other proess performing ReadConsoleInput
+ * from the same win-session (who might change the input mode).
+ * Another reason: when KbdRead(or KbdCharIn) is stopped for a long
+ * period for another processing, the OS2SS won't detect ^C (like
+ * ISQL, bug# 1341, 3/31/93 MJarus).
+ */
+
+ InConMode = WINDOW_DEFAULT_INPUT_MODE;
+ if (Ow2GetInputConsoleMode(
+ #if DBG
+ ReadInputEventStr,
+ #endif
+ &InConMode
+ ))
+ {
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1( "ReadInputEvent: Can not get CONIN Mode", FALSE );
+ }
+#endif
+ }
+
+ Ow2SetInputConsoleMode(
+ #if DBG
+ ReadInputEventStr,
+ #endif
+ InputModeFlags
+ );
+
+ /*
+ * 2. Peek ConsoleInput
+ *
+ * In case ReadInputEvent is called from KbdXxxx, MouXxxx or DosMonXxx
+ * API and there is no data in buffer.
+ * PeekConsoleInput is called before ReadConsoleInput to check if there
+ * is data in the input queue. If no data (and wait is ON) -
+ * EventServerThread will resume to wait for the data and will send reply
+ * to client.
+ */
+
+ if (PeekFlag)
+ {
+ if (!PeekConsoleInputW(
+ hConsoleInput,
+ &In,
+ 1L,
+ &cEvents
+ ))
+ { /* check why, should not happend */
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1("EventServer: unable to peek from CONIN$", FALSE);
+ } else
+ {
+ KdPrint(("OS2SES(EventSever): unable to peek from CONIN$\n"));
+ }
+#endif
+ ReadInputFail = TRUE;
+ RetCode = (DWORD)-1;
+ } else if (cEvents != 1L)
+ {
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ //KdPrint(("OS2SES(EventSever): no data peeked from CONIN$\n"));
+ }
+#endif
+ ReadInputFail = TRUE;
+ //RetCode = 0;
+ }
+
+ if ( ReadInputFail )
+ {
+ Ow2SetInputConsoleMode(
+ #if DBG
+ ReadInputEventStr,
+ #endif
+ InConMode
+ );
+
+ return(RetCode);
+ }
+ }
+
+ /*
+ * 3. Read ConsoleInput
+ *
+ * Wait for InputEvent
+ */
+
+ if (!ReadConsoleInputW(
+ hConsoleInput,
+ &In,
+ 1L,
+ &cEvents
+ ))
+ { /* check why, should not happend */
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1("EventServer: unable to read from CONIN$", FALSE);
+ } else
+ KdPrint(("OS2SES(EventSever): unable to read from CONIN$\n"));
+#endif
+ ReadInputFail = TRUE;
+ RetCode = (DWORD)-1L;
+ } else if (cEvents != 1L)
+ { /* check why, should not happend */
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1( "EventServer: no data read from CONIN$", FALSE );
+ } else
+ KdPrint(("OS2SES(EventSever): no data read from CONIN$\n"));
+#endif
+ ReadInputFail = TRUE;
+ RetCode = (DWORD)-1L;
+ }
+
+ Ow2SetInputConsoleMode(
+ #if DBG
+ ReadInputEventStr,
+ #endif
+ InConMode
+ );
+
+ if ( ReadInputFail )
+ {
+ return(RetCode);
+ }
+
+ /*
+ * 4. Get Time Stamp (needed for KBD and MOUSE events)
+ *
+ * Set RetCode to be the EventType (in case the event
+ * will be handled)
+ *
+ * Handle the Event according its type
+ */
+
+ RetCode = (DWORD)In.EventType;
+
+ if (In.EventType != MOUSE_EVENT)
+ {
+ IgnoreNextMouseEventDueToFocus = FALSE;
+ }
+
+ switch (In.EventType)
+ {
+ case KEY_EVENT :
+ RetCode = (DWORD)-1L;
+ for ( i = In.Event.KeyEvent.wRepeatCount,
+ In.Event.KeyEvent.wRepeatCount = 1 ; i ; i-- )
+ {
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("EventServer(KBD): queue %lx, char %x\n",
+ KbdMonQueue, In.Event.KeyEvent.uChar.AsciiChar));
+ }
+#endif
+
+ /*
+ * update KbdInfo: Kbd-data & time
+ */
+
+ if (!(NumKbd = MapWin2Os2KbdInfo(&(In.Event.KeyEvent),
+ &KbdEvent[0])))
+ {
+ continue;
+ }
+
+ KbdEvent[0].KeyInfo[0].KeyInfo.time = GetTickCount();
+
+ /*
+ * ^Break
+ * ^C for ASCII mode only
+ *
+ */
+
+ if (Rc = CheckForBreakEvent(&KbdEvent[0]))
+ {
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ KdPrint(("Event: CheckForBreakEvent %u, ignore char\n", Rc));
+ }
+#endif
+ if (Rc == 1) // not PopUp
+ {
+ //BUGBUG release Waiting threads
+ }
+
+ continue;
+ }
+
+ /*
+ * write event
+ */
+
+ for ( j = 0 ; j < NumKbd ; j++ )
+ {
+ Rc = (USHORT)PutMonInput(
+ sizeof(KBD_MON_PACKAGE),
+ KbdMonQueue,
+ KbdEvent[0].wRepeatCount,
+ &KbdEvent[j].KeyInfo[0],
+ NULL,
+ NULL);
+
+ if (Rc)
+ {
+ /* BUGBUG=> ? beep */
+ i = 1;
+ break;
+ }
+ RetCode = KEY_EVENT;
+ //RetCode = 0;
+ }
+ }
+ break;
+
+ case MOUSE_EVENT :
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("EventServer(MOU): State %x, Flag %x, Pos %u-%u, queue %lx\n",
+ In.Event.MouseEvent.dwButtonState,
+ In.Event.MouseEvent.dwEventFlags,
+ In.Event.MouseEvent.dwMousePosition.Y,
+ In.Event.MouseEvent.dwMousePosition.X,
+ MouMonQueue));
+ } else IF_OD2_DEBUG( MOU )
+ {
+ KdPrint(("EventServer: State %x, Flag %x, Pos %u-%u\n",
+ In.Event.MouseEvent.dwButtonState,
+ In.Event.MouseEvent.dwEventFlags,
+ In.Event.MouseEvent.dwMousePosition.Y,
+ In.Event.MouseEvent.dwMousePosition.X));
+ }
+#endif
+ //
+ // YS - 6.8.93 overcome the case where the console position is negative
+ //
+ if ( (LONG)(In.Event.MouseEvent.dwMousePosition.X) < 0)
+ {
+ In.Event.MouseEvent.dwMousePosition.X = 0;
+ }
+
+ if ( (LONG)(In.Event.MouseEvent.dwMousePosition.Y) < 0)
+ {
+ In.Event.MouseEvent.dwMousePosition.Y = 0;
+ }
+
+ MouPtrLoc.row = In.Event.MouseEvent.dwMousePosition.Y;
+ MouPtrLoc.col = In.Event.MouseEvent.dwMousePosition.X;
+
+ if(IgnoreNextMouseEventDueToFocus &&
+ In.Event.MouseEvent.dwButtonState &&
+ (In.Event.MouseEvent.dwEventFlags == MOUSE_MOVED))
+ {
+ In.Event.MouseEvent.dwButtonState = 0;
+ }
+
+ IgnoreNextMouseEventDueToFocus = FALSE;
+
+ /*
+ * update MouInfo: Mou-data & time
+ */
+
+ if (!MouNumber ||
+ (MouDevStatus & MOUSE_DISABLED) ||
+ !MapWin2Os2MouEvent(&MouEvent.MouInfo,
+ &In.Event.MouseEvent))
+ {
+ RetCode = (DWORD)-1L;
+ break;
+ }
+
+ MouEvent.MouInfo.time = GetTickCount();
+ /*
+ * write mouse event to queue
+ */
+
+ Rc = (USHORT)PutMonInput(
+ sizeof(MOU_MON_PACKAGE),
+ (PKEY_EVENT_QUEUE)MouMonQueue,
+ 1,
+ (PKBD_MON_PACKAGE)&MouEvent,
+ NULL,
+ NULL);
+
+ if (!Rc && !MouEvent.MouInfo.fs)
+ {
+ /*
+ * Release of last button - add OS2_MOUSE_MOTION
+ */
+
+ MouEvent.MouInfo.fs = OS2_MOUSE_MOTION;
+
+ Rc = (USHORT)PutMonInput(
+ sizeof(MOU_MON_PACKAGE),
+ (PKEY_EVENT_QUEUE)MouMonQueue,
+ 1,
+ (PKBD_MON_PACKAGE)&MouEvent,
+ NULL,
+ NULL);
+ }
+
+ if (Rc)
+ /* BUGBUG=> ? over-write last event */ ;
+
+ break;
+
+ case WINDOW_BUFFER_SIZE_EVENT :
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ KdPrint(("EventServer: window event size %x:%x\n",
+ In.Event.WindowBufferSizeEvent.dwSize.Y,
+ In.Event.WindowBufferSizeEvent.dwSize.X));
+ }
+#endif
+ break;
+
+ case MENU_EVENT :
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ KdPrint(("EventServer: menu event command %x\n",
+ In.Event.MenuEvent.dwCommandId));
+ }
+#endif
+ break;
+
+ case FOCUS_EVENT :
+ if(Os2WindowFocus != (ULONG)In.Event.FocusEvent.bSetFocus)
+ {
+ //if(Os2WindowFocus != (ULONG)-1)
+ {
+ SendNewFocusSet((ULONG)In.Event.FocusEvent.bSetFocus);
+ }
+
+ Os2WindowFocus = (ULONG)In.Event.FocusEvent.bSetFocus;
+ IgnoreNextMouseEventDueToFocus = Os2WindowFocus;
+ }
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ KdPrint(("EventServer: focus event(%u-%s)\n",
+ In.Event.FocusEvent.bSetFocus,
+ (In.Event.FocusEvent.bSetFocus) ? "Set" : "Reset"));
+ }
+#endif
+ break;
+
+ default :
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ KdPrint(("OS2SES(Event): unknown event %x\n",
+ In.EventType));
+ }
+#endif
+ RetCode = (DWORD)-1L;
+ break;
+ }
+ return(RetCode);
+}
+
+
+DWORD
+CheckForBreakEvent(IN PKEYEVENTINFO KbdEvent)
+{
+ DWORD Rc = 0;
+ UCHAR Os2ScanCode = KbdEvent->KeyInfo[0].KeyInfo.chScan;
+ BOOL Os2ControlOn = ( KbdEvent->KeyInfo[0].KeyInfo.fsState & OS2_CONTROL );
+
+ /*
+ * 1. ^Break
+ * ^C for ASCII mode only
+ * 2. Pause
+ * ^S - (not paused)
+ * 3. End-Pause
+ *
+ * return: 0 - character
+ * 1 - ^Break/^C
+ * 2 - ignore (^Break/^C in PopUp, ^S[pause], end_pause)
+ */
+
+ if (( KbdEvent->KeyInfo[0].KeyboardFlag & KBD_KEY_BREAK ) ||
+ ( KbdEvent->KeyInfo[0].KeyInfo.fbStatus & 1 ))
+ {
+ // ignore:
+ // break
+ // shift
+
+ return (0);
+ }
+
+ if ( SesGrp->PauseScreenUpdate )
+ {
+ // Screen is Paused: release (if no ^C or ^BRK) and ignore key (always)
+
+ if ( Os2ScanCode != 0xFF ) // not pause
+ {
+ EnableScreenUpdate();
+ }
+
+ Rc = 2;
+ } else if (( Os2ControlOn && ( Os2ScanCode == 0x1F ) && KbdAsciiMode ) ||
+ ( !Os2ControlOn && ( Os2ScanCode == 0xFF )))
+ {
+ // ^S in ASCII or PAUSE (but not ^)
+
+ DisableScreenUpdate();
+ return (2);
+ }
+
+ if ( !Os2ControlOn )
+ {
+ return (Rc);
+ }
+
+ if (( Os2ScanCode == 0xFF ) || // ^Brk
+ (( Os2ScanCode == 0x2E ) && KbdAsciiMode )) // ^C in ACSII mode
+ {
+
+ if (hPopUpOutput != (HANDLE) NULL ) // PopUp - ignore
+ {
+ return (2);
+ }
+
+#if DBG
+ IF_OD2_DEBUG( CLEANUP )
+ {
+ if ( Os2ScanCode == 0x2E )
+ KdPrint(("Os2: send ^C event to server\n"));
+ else
+ KdPrint(("Os2: send ^Break event to server\n"));
+ }
+#endif
+
+ //EventLoop = FALSE;
+
+ SendSignalToOs2Srv(
+ ( Os2ScanCode == 0x2E) ?
+ XCPT_SIGNAL_INTR : XCPT_SIGNAL_BREAK);
+
+#if DBG
+ IF_OD2_DEBUG( CLEANUP )
+ {
+ KdPrint(("Os2: event was send\n"));
+ }
+#endif
+
+ return (1);
+ }
+
+ if ( Os2ControlOn && KbdAsciiMode && ( Os2ScanCode == 0x19 ) && // ^P in ASCII
+ !( KbdEvent->KeyInfo[0].KeyInfo.fsState & OS2_ALT ))
+ {
+ return (2);
+ }
+
+ return (Rc);
+}
+
+
+DWORD
+GetKeyboardInput( IN ULONG Flag,
+ OUT PKEYEVENTINFO Event,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+ WORD KeyCount = Event->wRepeatCount;
+ DWORD Rc;
+ BOOL IgnoreKey;
+
+ for ( ; EventLoop ; )
+ {
+ if ( KbdQueue->In == KbdQueue->Out )
+ {
+ SaveKbdPortMessegeInfo(KbdQueue->MonHdr.MemoryStartAddress,
+ (PVOID)&KbdRequestSaveArea,
+ pMsg);
+
+ /*
+ * Enter critical Section
+ */
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (KbdQueue->In == KbdQueue->Out)
+ {
+ if (!EventServerThreadSuspend)
+ {
+ goto NoKbdReturn;
+ }
+
+ if (KbdQueue != KbdMonQueue)
+ {
+ goto NoKbdReturn;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ while ((Rc = ReadInputEvent(1L)) && (Rc != (DWORD)KEY_EVENT))
+ {
+ ;
+ }
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (KbdQueue->In == KbdQueue->Out)
+ {
+ if (EventServerThreadSuspend &&
+ ((( Flag & WAIT_MASK) != IO_NOWAIT ) ||
+ SesGrp->PauseScreenUpdate ))
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetKeyboardInput: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+NoKbdReturn:
+ if ((Flag & WAIT_MASK) != IO_NOWAIT)
+ {
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ KdPrint(("GetKeyboardInput: no kbd so wait\n"));
+ }
+#endif
+ KbdQueue->MonHdr.WaitForEvent = TRUE;
+ *pReply = 0;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ return (NO_ERROR);
+ } else if ( SesGrp->PauseScreenUpdate && EventServerThreadSuspend )
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetKeyboardInput 2: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ } else
+ {
+ *Event = *(KbdQueue->Out);
+
+ IgnoreKey = (BOOL)KbdCheckPackage(&Event->KeyInfo[0]);
+
+ if ( IgnoreKey || ( KbdQueue->Out->wRepeatCount <= KeyCount ))
+ {
+ if (KbdQueue->Out == KbdQueue->End)
+ KbdQueue->Out = KbdQueue->Event;
+ else
+ KbdQueue->Out++;
+ } else
+ {
+ KbdQueue->Out->wRepeatCount -= KeyCount;
+ Event->wRepeatCount = KeyCount;
+ }
+
+ if ( !IgnoreKey )
+ {
+ return (1L);
+ }
+ }
+ }
+
+ return (0L);
+}
+
+
+DWORD
+GetOs2MouEvent( IN USHORT WaitFlag,
+ OUT PMOUEVENTINFO Event,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+ DWORD Rc;
+
+ for ( ; EventLoop ; )
+ {
+ if (MouQueue->In == MouQueue->Out)
+ {
+ SavePortMessegeInfo(MouQueue->MonHdr.MemoryStartAddress, pMsg);
+
+ /*
+ * Enter critical Section
+ */
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (MouQueue->In == MouQueue->Out)
+ {
+ if (!EventServerThreadSuspend)
+ {
+ goto NoMouReturn;
+ }
+
+ if (MouQueue != MouMonQueue)
+ {
+ goto NoMouReturn;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ while ((Rc = ReadInputEvent(1L)) && (Rc != (DWORD)MOUSE_EVENT))
+ {
+ ;
+ }
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (MouQueue->In == MouQueue->Out)
+ {
+ if (EventServerThreadSuspend &&
+ (( WaitFlag != MOU_NOWAIT ) ||
+ SesGrp->PauseScreenUpdate ))
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetOs2MouEvent: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+NoMouReturn:
+ if ( WaitFlag != MOU_NOWAIT)
+ {
+ MouQueue->MonHdr.WaitForEvent = TRUE;
+ *pReply = 0;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ return (NO_ERROR);
+ } else if ( SesGrp->PauseScreenUpdate && EventServerThreadSuspend )
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetOs2MouEvent 2: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ } else
+ {
+ *Event = MouQueue->Out->MouInfo;
+
+ if (MouQueue->Out == MouQueue->End)
+ MouQueue->Out = MouQueue->Event;
+ else
+ MouQueue->Out++;
+#if DBG
+ IF_OD2_DEBUG( MOU )
+ {
+ KdPrint(("GetOs2MouEvent: fs %x, Pos %u-%u, Time %u\n",
+ Event->fs, Event->row, Event->col, Event->time ));
+ }
+#endif
+ return (0L);
+ }
+ }
+
+ return (0L);
+}
+
+
+DWORD
+Ow2GetOs2KbdEventIntoQueue()
+{
+ DWORD Rc, NumEvent, ReadDone = FALSE;
+
+ if (!EventServerThreadSuspend)
+ {
+ return (0L);
+ }
+ Or2WinGetNumberOfConsoleInputEvents(
+ #if DBG
+ Ow2GetOs2KbdEventIntoQueueStr,
+ #endif
+ hConsoleInput,
+ &NumEvent
+ );
+ for ( ; NumEvent ; )
+ {
+ while ((Rc = ReadInputEvent(1L)) && (Rc != (DWORD)KEY_EVENT));
+ if (!Rc)
+ {
+ // No more events
+
+ break;
+ }
+ ReadDone = TRUE;
+ Or2WinGetNumberOfConsoleInputEvents(
+ #if DBG
+ Ow2GetOs2KbdEventIntoQueueStr,
+ #endif
+ hConsoleInput,
+ &NumEvent
+ );
+ }
+
+ if ( ReadDone && EventServerThreadSuspend && SesGrp->PauseScreenUpdate )
+ {
+ EnterCriticalSection(&QueueInputCriticalSection);
+ if ( EventServerThreadSuspend && SesGrp->PauseScreenUpdate )
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("Ow2GetOs2KbdEventIntoQueue: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ }
+
+ return (0L);
+}
+
+
+DWORD
+GetOs2MouEventIntoQueue()
+{
+ DWORD Rc, NumEvent, ReadDone = FALSE;
+ PMOU_MON_PACKAGE NextMouIn;
+
+ if (!EventServerThreadSuspend)
+ {
+ return (0L);
+ }
+ Or2WinGetNumberOfConsoleInputEvents(
+ #if DBG
+ GetOs2MouEventIntoQueueStr,
+ #endif
+ hConsoleInput,
+ &NumEvent
+ );
+ for ( ; NumEvent ; )
+ {
+ NextMouIn = (MouMonQueue->In == MouMonQueue->End) ?
+ MouMonQueue->Event :
+ (MouMonQueue->In+1);
+
+ if (NextMouIn == MouQueue->Out)
+ {
+ // QUEUE is full
+
+ break;
+ } else
+ {
+ while ((Rc = ReadInputEvent(1L)) && (Rc != (DWORD)MOUSE_EVENT));
+ if (!Rc)
+ {
+ // No more events
+
+ break;
+ }
+ ReadDone = TRUE;
+ }
+ Or2WinGetNumberOfConsoleInputEvents(
+ #if DBG
+ GetOs2MouEventIntoQueueStr,
+ #endif
+ hConsoleInput,
+ &NumEvent
+ );
+ }
+
+ if ( ReadDone && EventServerThreadSuspend && SesGrp->PauseScreenUpdate )
+ {
+ EnterCriticalSection(&QueueInputCriticalSection);
+ if ( EventServerThreadSuspend && SesGrp->PauseScreenUpdate )
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetOs2MouEventIntoQueue: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ }
+
+ return (0L);
+}
+
+
+DWORD
+GetMonInput(IN USHORT MaxLength, // BUGBUG - not implemented
+ IN PKEY_EVENT_QUEUE KbdMon,
+ IN OUT PMON_RW rwParms,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+ PMOU_EVENT_QUEUE MouMon;
+ PMOU_MON_PACKAGE MouPackage;
+ PKBD_MON_PACKAGE MonPackage;
+ DWORD Rc;
+
+ UNREFERENCED_PARAMETER(MaxLength);
+
+ if (KbdMon->MonHdr.DevType == KbdDevice)
+ {
+ MonPackage = (PKBD_MON_PACKAGE) &(rwParms->ioBuff[0]);
+
+ for ( ; EventLoop ; )
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): enter, queue %lx\n", KbdMon));
+ }
+#endif
+
+ if (KbdMon->LastKeyFlag)
+ {
+ *MonPackage = KbdMon->LastKey.KeyInfo[0];
+ KbdMon->LastKey.wRepeatCount-- ;
+
+ if (KbdMon->LastKey.wRepeatCount == 0)
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): no more last\n"));
+ }
+#endif
+
+ KbdMon->LastKeyFlag = FALSE;
+ }
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): return last\n"));
+ }
+#endif
+
+ return(NO_ERROR);
+ }
+
+ if (KbdMon->In == KbdMon->Out)
+ {
+ SavePortMessegeInfo(KbdMon->MonHdr.MemoryStartAddress, pMsg);
+
+ /*
+ * Enter critical Section
+ */
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (KbdMon->In == KbdMon->Out)
+ {
+ if (!EventServerThreadSuspend)
+ {
+ goto NoMonReturn;
+ }
+
+ if (KbdMon != KbdMonQueue)
+ {
+ goto NoMonReturn;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ while ((Rc = ReadInputEvent(1L)) && (Rc != (DWORD)KEY_EVENT))
+ {
+ ;
+ }
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (KbdMon->In == KbdMon->Out)
+ {
+ if (EventServerThreadSuspend &&
+ ( !rwParms->fWait || SesGrp->PauseScreenUpdate ))
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetMonInput: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+NoMonReturn:
+ if ( !rwParms->fWait )
+ {
+ Rc = NO_ERROR;
+ *pReply = 0;
+ KbdMon->MonHdr.WaitForEvent = TRUE;
+ } else
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput-Kbd): no wait\n"));
+ }
+#endif
+ //Rc = NO_ERROR;
+ Rc = ERROR_MON_BUFFER_EMPTY;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ return (Rc);
+ } else if ( SesGrp->PauseScreenUpdate && EventServerThreadSuspend )
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetMonInput 2: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ } else
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): found package\n"));
+ }
+#endif
+
+ *MonPackage = KbdMon->Out->KeyInfo[0];
+
+ if (KbdMon->Out->wRepeatCount != 1)
+ {
+ /*
+ * decrement count and keep package
+ */
+
+ KbdMon->LastKey = *KbdMon->Out;
+ KbdMon->LastKey.wRepeatCount-- ;
+ KbdMon->LastKey.KeyInfo[0].KeyboardFlag |= KBD_MULTIMAKE;
+ KbdMon->LastKeyFlag = TRUE;
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): package saved as last\n"));
+ }
+#endif
+ }
+
+ /*
+ * update OUT pointer
+ */
+
+ if (KbdMon->Out == KbdMon->End)
+ KbdMon->Out = KbdMon->Event;
+ else
+ KbdMon->Out++;
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): last repeat of package\n"));
+ }
+#endif
+
+ return (NO_ERROR);
+ }
+ }
+
+ } else
+ {
+ MouMon = (PMOU_EVENT_QUEUE) KbdMon;
+ MouPackage = (PMOU_MON_PACKAGE) &(rwParms->ioBuff[0]);
+
+ for ( ; EventLoop ; )
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): enter, queue %lx\n", MouMon));
+ }
+#endif
+
+ if (MouMon->LastMouFlag)
+ {
+ *MouPackage = MouMon->LastEvent;
+ MouMon->LastMouFlag = FALSE;
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): return last\n"));
+ }
+#endif
+
+ return (NO_ERROR);
+ }
+
+ if (MouMon->In == MouMon->Out)
+ {
+ SavePortMessegeInfo(MouMon->MonHdr.MemoryStartAddress, pMsg);
+
+ /*
+ * Enter critical Section
+ */
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (MouMon->In == MouMon->Out)
+ {
+ if (!EventServerThreadSuspend)
+ {
+ goto NoMouseMonReturn;
+ }
+
+ if (MouMon != MouMonQueue)
+ {
+ goto NoMouseMonReturn;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ while ((Rc = ReadInputEvent(1L)) && (Rc != (DWORD)MOUSE_EVENT))
+ {
+ ;
+ }
+
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if (MouMon->In == MouMon->Out)
+ {
+ if (EventServerThreadSuspend &&
+ ( !rwParms->fWait || SesGrp->PauseScreenUpdate ))
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetMonInput-Mou: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+NoMouseMonReturn:
+ if ( !rwParms->fWait )
+ {
+ Rc = NO_ERROR;
+ *pReply = 0;
+ MouMon->MonHdr.WaitForEvent = TRUE;
+ } else
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput-Mouse): no wait\n"));
+ }
+#endif
+ //Rc = NO_ERROR;
+ Rc = ERROR_MON_BUFFER_EMPTY;
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ return (Rc);
+ } else if ( SesGrp->PauseScreenUpdate && EventServerThreadSuspend )
+ {
+#if DBG
+ if (InternalDebug & InputEventDebug)
+ {
+ KdPrint(("GetMonInput-Mou 2: SetEvent\n"));
+ }
+#endif
+ SetEvent( SuspendEvent );
+ }
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+
+ } else
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): found package\n"));
+ }
+#endif
+
+ *MouPackage = *MouMon->Out;
+
+ /*
+ * update OUT pointer
+ */
+
+ if (MouMon->Out == MouMon->End)
+ MouMon->Out = MouMon->Event;
+ else
+ MouMon->Out++;
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(GetMonInput): last repeat of package\n"));
+ }
+#endif
+
+ return (NO_ERROR);
+ }
+ }
+
+ }
+ return(0L);
+}
+
+
+DWORD
+PutMonInput(
+ IN USHORT MaxLength, // BUGBUG - not implemented
+ IN PKEY_EVENT_QUEUE NextKbdMon,
+ IN WORD RepeatCount,
+ IN PKBD_MON_PACKAGE MonPackage,
+ //IN OUT PMON_RW rwParms,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+ /* return non-zero if no place */
+
+ PKEYEVENTINFO NextKbdIn;
+ BOOL FirstEvent;
+ PMOU_MON_PACKAGE MouPackage;
+ //PKBD_MON_PACKAGE MonPackage;
+ PMOU_MON_PACKAGE NextMouIn;
+ PMOU_EVENT_QUEUE NextMouMon;
+
+ UNREFERENCED_PARAMETER(MaxLength);
+ UNREFERENCED_PARAMETER(pMsg);
+ UNREFERENCED_PARAMETER(pReply);
+
+ if (NextKbdMon->MonHdr.DevType == KbdDevice)
+ {
+ //MonPackage = (PKBD_MON_PACKAGE) &(rwParms->ioBuff[0]);
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(PutMonInput): enter, to queue %lx, char %x\n",
+ NextKbdMon, MonPackage->KeyInfo.chChar ));
+ }
+#endif
+
+ if (( NextKbdMon == KbdQueue ) && /* last monitor in queue */
+ (( MonPackage->KeyboardFlag & KeyTypeMask ) == AccentKey ) &&
+ !( MonPackage->KeyboardFlag & AccentedKey ))
+ {
+#if DBG
+ IF_OD2_DEBUG2( MON, KBD )
+ {
+ KdPrint(("OS2SES(PutMonInput): ignore package for DeviceFlag=0x%x\n",
+ MonPackage->DeviceFlag ));
+ }
+#endif
+ return (0L);
+ }
+
+ NextKbdMon->In->KeyInfo[0] = *MonPackage;
+ NextKbdMon->In->wRepeatCount = RepeatCount;
+
+ NextKbdIn = (NextKbdMon->In == NextKbdMon->End) ?
+ NextKbdMon->Event :
+ (NextKbdMon->In+1);
+
+ FirstEvent = (NextKbdMon->In == NextKbdMon->Out);
+
+ if ( NextKbdMon->In == NextKbdMon->Out )
+ {
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if ( NextKbdMon->In == NextKbdMon->Out )
+ {
+ if ( NextKbdMon->MonHdr.WaitForEvent )
+ {
+ if ( NextKbdMon == KbdQueue ) /* last monitor in queue */
+ {
+ KbdHandlePackage(NextKbdMon,
+ MonPackage);
+ } else
+ {
+ NextKbdMon->MonHdr.WaitForEvent = FALSE;
+ NextKbdMon->MonHdr.MonStat = MON_STAT_REG;
+
+ SendMonReply(NextKbdMon->MonHdr.MemoryStartAddress,
+ MonPackage,
+ sizeof(KBD_MON_PACKAGE));
+ }
+
+ } else
+ NextKbdMon->In = NextKbdIn;
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ return (0L);
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ }
+
+ if (NextKbdIn != NextKbdMon->Out)
+ NextKbdMon->In = NextKbdIn;
+ else
+ return(1L);
+ } else
+ {
+ NextMouMon = (PMOU_EVENT_QUEUE) NextKbdMon;
+ MouPackage = (PMOU_MON_PACKAGE) MonPackage;
+ //MouPackage = (PMOU_MON_PACKAGE) &(rwParms->ioBuff[0]);
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ KdPrint(("OS2SES(PutMonInput): enter, to queue %lx, event %x (%x:%x)\n",
+ NextMouMon, MouPackage->MouInfo.fs,
+ MouPackage->MouInfo.row, MouPackage->MouInfo.col ));
+ }
+#endif
+
+ *NextMouMon->In = *MouPackage;
+
+ NextMouIn = (NextMouMon->In == NextMouMon->End) ?
+ NextMouMon->Event :
+ (NextMouMon->In+1);
+
+ if ( NextMouMon->In == NextMouMon->Out )
+ {
+ EnterCriticalSection(&QueueInputCriticalSection);
+
+ if ( NextMouMon->In == NextMouMon->Out )
+ {
+ if ( NextMouMon->MonHdr.WaitForEvent )
+ {
+ NextMouMon->MonHdr.WaitForEvent = FALSE;
+
+ if ( NextMouMon == MouQueue ) /* last monitor in queue */
+ SendMouReply(NextMouMon->MonHdr.MemoryStartAddress,
+ &MouPackage->MouInfo);
+ else
+ {
+ NextMouMon->MonHdr.MonStat = MON_STAT_REG;
+ SendMonReply(NextMouMon->MonHdr.MemoryStartAddress,
+ MouPackage,
+ sizeof(MOU_MON_PACKAGE));
+ }
+
+ } else
+ NextMouMon->In = NextMouIn;
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ return (0L);
+ }
+
+ LeaveCriticalSection(&QueueInputCriticalSection);
+ }
+
+ if (NextMouIn != NextMouMon->Out)
+ NextMouMon->In = NextMouIn;
+ else
+ {
+ if ( NextMouMon == MouQueue ) /* last monitor in queue */
+ {
+ /* no place - throw the oldest info */
+
+ NextMouMon->Out = (NextMouMon->Out == NextMouMon->End) ?
+ NextMouMon->Event :
+ (NextMouMon->Out+1);
+
+ NextMouMon->In = NextMouIn;
+ }
+
+ return(1L);
+ }
+ }
+
+ return(0L);
+
+}
+
+
+VOID
+EventReleaseLPC(
+ IN ULONG ProcessId
+ )
+{
+ PKEY_EVENT_QUEUE CurrentKbdQueue, LastKbdQueue;
+ PMOU_EVENT_QUEUE CurrentMouQueue, LastMouQueue;
+
+ for ( CurrentKbdQueue = KbdMonQueue, LastKbdQueue = NULL ;
+ LastKbdQueue != KbdQueue ;
+ LastKbdQueue = CurrentKbdQueue,
+ CurrentKbdQueue = (PKEY_EVENT_QUEUE)CurrentKbdQueue->MonHdr.NextQueue)
+ {
+ if((CurrentKbdQueue->MonHdr.WaitForEvent) &&
+ (Ow2GetProcessIdFromLPCMessage(
+ CurrentKbdQueue->MonHdr.MemoryStartAddress) == ProcessId))
+ {
+ if(CurrentKbdQueue != KbdQueue)
+ {
+ SendMonReply(CurrentKbdQueue->MonHdr.MemoryStartAddress,
+ NULL,
+ sizeof(KBD_MON_PACKAGE));
+
+ MonQueueClose((HANDLE)CurrentKbdQueue);
+ } else
+ {
+ RtlZeroMemory(
+ &KbdRequestSaveArea.d.KeyInfo,
+ sizeof(KBDKEYINFO));
+
+ SendKbdReply(CurrentKbdQueue->MonHdr.MemoryStartAddress,
+ (PVOID)&KbdRequestSaveArea,
+ NULL,
+ 0);
+ }
+ }
+ }
+
+ for ( CurrentMouQueue = MouMonQueue, LastMouQueue = NULL ;
+ LastMouQueue != MouQueue ;
+ LastMouQueue = CurrentMouQueue,
+ CurrentMouQueue = (PMOU_EVENT_QUEUE)CurrentMouQueue->MonHdr.NextQueue)
+ {
+ if((CurrentMouQueue->MonHdr.WaitForEvent) &&
+ (Ow2GetProcessIdFromLPCMessage(
+ CurrentMouQueue->MonHdr.MemoryStartAddress) == ProcessId))
+ {
+ if(CurrentMouQueue != MouQueue)
+ {
+ SendMonReply(CurrentMouQueue->MonHdr.MemoryStartAddress,
+ NULL,
+ sizeof(MOU_MON_PACKAGE));
+
+ MonQueueClose((HANDLE)CurrentMouQueue);
+ } else
+ {
+ SendMouReply(CurrentMouQueue->MonHdr.MemoryStartAddress,
+ NULL);
+ }
+ }
+ }
+
+ //if ((MouQueue->MonHdr.WaitForEvent) &&
+ // (MouMonQueue == MouQueue ) && /* last monitor in queue */
+ // (Ow2GetProcessIdFromLPCMessage(
+ // MouQueue->MonHdr.MemoryStartAddress) == ProcessId))
+ //{
+ // RtlZeroMemory(
+ // &MouPackage,
+ // sizeof(MOU_MON_PACKAGE));
+ //
+ // SendMouReply(MouQueue->MonHdr.MemoryStartAddress,
+ // &MouPackage);
+ //}
+}
+
+
+VOID
+Ow2MouOn()
+{
+ Ow2dwWinInputMode |= ENABLE_MOUSE_INPUT;
+ InputModeFlags |= ENABLE_MOUSE_INPUT;
+
+ if (!SesGrp->WinProcessNumberInSession)
+ {
+ Ow2SetInputConsoleMode(
+ #if DBG
+ Ow2MouOnStr,
+ #endif
+ Ow2dwInputMode | ENABLE_MOUSE_INPUT
+ );
+ }
+}
+
+
+VOID
+Ow2MouOff()
+{
+ Ow2dwWinInputMode &= ~ENABLE_MOUSE_INPUT;
+ InputModeFlags &= ~ENABLE_MOUSE_INPUT;
+
+ if (!SesGrp->WinProcessNumberInSession)
+ {
+ Ow2SetInputConsoleMode(
+ #if DBG
+ Ow2MouOffStr,
+ #endif
+ Ow2dwInputMode & ~ENABLE_MOUSE_INPUT
+ );
+ }
+}
+
+
+DWORD
+Ow2GetInputConsoleMode(
+#if DBG
+ PSZ FuncName,
+#endif
+ LPDWORD lpMode
+ )
+{
+ BOOL Rc;
+
+ if (SesGrp->WinProcessNumberInSession)
+ {
+ Rc = Or2WinGetConsoleMode(
+#if DBG
+ FuncName,
+#endif
+ hConsoleInput,
+ lpMode
+ );
+#if DBG
+ ASSERT1( "Ow2GetInputConsoleMode: GetConsoleMode fail", Rc );
+#endif
+ if (Rc)
+ {
+ Ow2dwInputMode = *lpMode;
+ } else
+ {
+ return(GetLastError());
+ }
+ } else
+ {
+ *lpMode = Ow2dwInputMode;
+ }
+
+#if DBG
+ if (InternalDebug & InputModeDebug)
+ {
+ KdPrint(("Ow2GetInputConsoleMode, Ow2dwInputMode = %x\n",
+ Ow2dwInputMode));
+ }
+#endif
+ return (NO_ERROR);
+}
+
+
+DWORD
+Ow2SetInputConsoleMode(
+#if DBG
+ PSZ FuncName,
+#endif
+ DWORD dwMode
+ )
+{
+ BOOL Rc;
+
+#if DBG
+ if (InternalDebug & InputModeDebug)
+ {
+ KdPrint(("Ow2SetInputConsoleMode, Ow2dwInputMode = %x, input argument dwMode = %x\n",
+ Ow2dwInputMode, dwMode));
+ }
+#endif
+ if (SesGrp->WinProcessNumberInSession ||
+ (dwMode != Ow2dwInputMode))
+ {
+ Rc = Or2WinSetConsoleMode(
+#if DBG
+ FuncName,
+#endif
+ hConsoleInput,
+ dwMode
+ );
+#if DBG
+ ASSERT1( "Ow2SetInputConsoleMode: SetConsoleMode fail", Rc );
+#endif
+ if (Rc)
+ {
+ Ow2dwInputMode = dwMode;
+ }
+ }
+
+ return (NO_ERROR);
+}
+
+BOOLEAN
+Ow2WriteBackDummyEvent()
+{
+ INPUT_RECORD InputRecord;
+ INPUT_RECORD In;
+ BOOLEAN WriteSucceeded;
+ DWORD RecordsWritten;
+ DWORD cEvents;
+ DWORD PeekSuccess;
+
+ if ((PeekSuccess = PeekConsoleInputW(
+ hConsoleInput,
+ &In,
+ 1L,
+ &cEvents
+ )) && cEvents == 0)
+ {
+ InputRecord.EventType = MENU_EVENT;
+ InputRecord.Event.MenuEvent.dwCommandId = WM_USER+1;
+ WriteSucceeded = WriteConsoleInput(hConsoleInput,
+ &InputRecord, 1, &RecordsWritten);
+ if (!WriteSucceeded || (RecordsWritten != 1)) {
+#if DBG
+ DbgPrint("OS2: Ow2WriteBackDummyEvent - failed to write into input queue\n");
+#endif // DBG
+ return(FALSE);
+ }
+ }
+ else if (!PeekSuccess){
+#if DBG
+ DbgPrint("OS2: Ow2WriteBackDummyEvent - failed to peek input queue\n");
+#endif // DBG
+ return(FALSE);
+ }
+ return(TRUE);
+}
+
+BOOLEAN
+Ow2ClearupDummyEvent()
+{
+ INPUT_RECORD In;
+ DWORD cEvents;
+ DWORD PeekSuccess;
+
+ if ((PeekSuccess = PeekConsoleInputW(
+ hConsoleInput,
+ &In,
+ 1L,
+ &cEvents
+ )) && cEvents == 1)
+ {
+ //
+ // Check if the event in the queue is the special dummy event
+ //
+ if (In.EventType == MENU_EVENT && In.Event.MenuEvent.dwCommandId == (WM_USER+1))
+ {
+ if (!ReadConsoleInputW(
+ hConsoleInput,
+ &In,
+ 1L,
+ &cEvents
+ ))
+ { // check why, should not happen
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1("Ow2ClearupDummyEvent: unable to read from CONIN$", FALSE);
+ } else
+ KdPrint(("OS2SES(Ow2ClearupDummyEvent): unable to read from CONIN$\n"));
+#endif
+ return(FALSE);
+ } else if (cEvents != 1L)
+ { // check why, should not happen
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1( "Ow2ClearupDummyEvent: no data read from CONIN$", FALSE );
+ } else
+ KdPrint(("OS2SES(Ow2ClearupDummyEvent): no data read from CONIN$\n"));
+#endif
+ return(FALSE);
+ }
+ }
+ }
+ else if (!PeekSuccess) {
+ // Peek Failed, check why, should not happen
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ ASSERT1("ClearupDummyEvent: unable to peek from CONIN$", FALSE);
+ } else
+ {
+ KdPrint(("OS2SES(ClearupDummyEvent): unable to peek from CONIN$\n"));
+ }
+#endif
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
+
+
+#if PMNT
+
+APIRET
+MouSetPtrPosPM(
+ PPTRLOC pPtrLoc)
+{
+ if (SetCursorPos(pPtrLoc->col, pPtrLoc->row))
+ return NO_ERROR;
+ else
+ return ERROR_MOUSE_INV_PARMS;
+}
+
+APIRET
+MouGetPtrPosPM(
+ PPTRLOC pPtrLoc)
+{
+ POINT pt;
+
+ if (GetCursorPos(&pt))
+ {
+ pPtrLoc->col = (USHORT)pt.x;
+ pPtrLoc->row = (USHORT)pt.y;
+
+ return NO_ERROR;
+ }
+ else
+ return ERROR_MOUSE_INV_PARMS;
+}
+
+COORD LastMousePosition = {-1, -1};
+BOOLEAN PMNTInFocus = TRUE;
+
+APIRET
+PMNTGetNextEvent(
+ PMNT_INPUT_RECORD *ppm_input_rec)
+{
+ int count;
+ INPUT_RECORD input_rec;
+ static int IgnoreNextMouseEvent = 0;
+ static BOOLEAN firsttime = TRUE;
+
+ if (firsttime)
+ {
+ firsttime = FALSE;
+ // For PM apps, this will cause EventServerThread to actually terminate
+ SetEvent(SuspendEvent);
+ }
+
+ while (1)
+ {
+ int SetNewMousePosition = 0;
+
+ if (!Or2WinReadConsoleInputA(
+ #if DBG
+ ReadInputEventStr,
+ #endif
+ hConsoleInput,
+ &input_rec,
+ 1,
+ &count
+ ))
+ {
+#if 0
+ KdPrint(("PMNTGetNextEvent : Read Console input error = %lx \n",
+ GetLastError()));
+#endif
+ return ERROR_INVALID_PARAMETER;
+ }
+ else
+ {
+ try
+ {
+ switch (input_rec.EventType)
+ {
+ case KEY_EVENT:
+ ppm_input_rec->EventType = PMNT_KEY_EVENT;
+ ppm_input_rec->Event.KeyEvent.bKeyDown =
+ input_rec.Event.KeyEvent.bKeyDown;
+ ppm_input_rec->Event.KeyEvent.wRepeatCount =
+ input_rec.Event.KeyEvent.wRepeatCount;
+ ppm_input_rec->Event.KeyEvent.wVirtualKeyCode =
+ input_rec.Event.KeyEvent.wVirtualKeyCode;
+ ppm_input_rec->Event.KeyEvent.wVirtualScanCode =
+ input_rec.Event.KeyEvent.wVirtualScanCode;
+ //BUGBUG - when/how should we look at unicode ?
+ ppm_input_rec->Event.KeyEvent.uChar.AsciiChar =
+ input_rec.Event.KeyEvent.uChar.AsciiChar;
+ ppm_input_rec->Event.KeyEvent.dwControlKeyState =
+ input_rec.Event.KeyEvent.dwControlKeyState;
+//#if DBG
+// DbgPrint(">>> Key event (%s): Char=%x, Scan=%x, VK=%x\n",
+// (input_rec.Event.KeyEvent.bKeyDown ? "DOWN":" UP "),
+// input_rec.Event.KeyEvent.uChar.AsciiChar,
+// input_rec.Event.KeyEvent.wVirtualScanCode,
+// input_rec.Event.KeyEvent.wVirtualKeyCode);
+//#endif
+ return NO_ERROR;
+
+ case MOUSE_EVENT:
+
+ if (IgnoreNextMouseEvent)
+ {
+ IgnoreNextMouseEvent = 0;
+ break;
+ }
+
+ if (input_rec.Event.MouseEvent.dwMousePosition.X < 0)
+ {
+ input_rec.Event.MouseEvent.dwMousePosition.X = 0;
+ SetNewMousePosition = 1;
+ }
+ else if (input_rec.Event.MouseEvent.dwMousePosition.X
+ >= (ScreenX-1))
+ {
+ input_rec.Event.MouseEvent.dwMousePosition.X =
+ ScreenX - 1;
+ if (input_rec.Event.MouseEvent.dwMousePosition.Y
+ >= (ScreenY-1))
+ input_rec.Event.MouseEvent.dwMousePosition.Y =
+ ScreenY - 1;
+ SetCursorPos(input_rec.Event.MouseEvent.dwMousePosition.X,
+ input_rec.Event.MouseEvent.dwMousePosition.Y);
+ IgnoreNextMouseEvent = 1;
+ }
+
+ if (input_rec.Event.MouseEvent.dwMousePosition.Y < 0)
+ {
+ input_rec.Event.MouseEvent.dwMousePosition.Y = 0;
+ SetNewMousePosition = 1;
+ }
+ else if (input_rec.Event.MouseEvent.dwMousePosition.Y
+ >= (ScreenY-1))
+ {
+ input_rec.Event.MouseEvent.dwMousePosition.Y =
+ ScreenY - 1;
+ if (input_rec.Event.MouseEvent.dwMousePosition.X
+ >= (ScreenX-1))
+ input_rec.Event.MouseEvent.dwMousePosition.X =
+ ScreenX - 1;
+ SetCursorPos(input_rec.Event.MouseEvent.dwMousePosition.X,
+ input_rec.Event.MouseEvent.dwMousePosition.Y);
+ IgnoreNextMouseEvent = 1;
+ }
+
+ if (SetNewMousePosition)
+ {
+ SetNewMousePosition = 0;
+ // Reset the mouse position to be within the screen
+ // boundaries
+ SetCursorPos(input_rec.Event.MouseEvent.dwMousePosition.X,
+ input_rec.Event.MouseEvent.dwMousePosition.Y);
+ break; // No need to generate a mouse event
+ }
+ else
+ {
+ ppm_input_rec->EventType = PMNT_MOUSE_EVENT;
+ ppm_input_rec->Event.MouseEvent.dwMousePosition.X =
+ input_rec.Event.MouseEvent.dwMousePosition.X;
+ ppm_input_rec->Event.MouseEvent.dwMousePosition.Y =
+ input_rec.Event.MouseEvent.dwMousePosition.Y;
+ ppm_input_rec->Event.MouseEvent.dwButtonState =
+ input_rec.Event.MouseEvent.dwButtonState;
+ ppm_input_rec->Event.MouseEvent.dwControlKeyState =
+ input_rec.Event.MouseEvent.dwControlKeyState;
+ ppm_input_rec->Event.MouseEvent.dwEventFlags =
+ input_rec.Event.MouseEvent.dwEventFlags;
+
+ if (PMNTInFocus)
+ {
+ LastMousePosition.X =
+ input_rec.Event.MouseEvent.dwMousePosition.X;
+ LastMousePosition.Y =
+ input_rec.Event.MouseEvent.dwMousePosition.Y;
+ }
+
+ return NO_ERROR;
+ }
+
+ case FOCUS_EVENT:
+ ppm_input_rec->EventType = PMNT_FOCUS_EVENT;
+ ppm_input_rec->Event.FocusEvent.bSetFocus =
+ input_rec.Event.FocusEvent.bSetFocus;
+ return NO_ERROR;
+
+ case WINDOW_BUFFER_SIZE_EVENT:
+#if DBG
+ KdPrint(("PMNTGetNextEvent: WINDOW_BUFFER_SIZE_EVENT\n"));
+#endif
+ break;
+
+ case MENU_EVENT:
+#if DBG
+ KdPrint(("PMNTGetNextEvent: MENU_EVENT\n"));
+ KdPrint((" (command ID=0x%x)\n",
+ input_rec.Event.MenuEvent.dwCommandId));
+#endif
+ if (input_rec.Event.MenuEvent.dwCommandId == WM_USER)
+ {
+ ppm_input_rec->EventType = PMNT_MENU_EVENT;
+ ppm_input_rec->Event.MenuEvent.dwCommandId = 0xdead;
+ return(NO_ERROR);
+ }
+ else if (input_rec.Event.MenuEvent.dwCommandId == (WM_USER+1))
+ {
+ ppm_input_rec->EventType = PMNT_MENU_EVENT;
+ ppm_input_rec->Event.MenuEvent.dwCommandId = 0x1;
+ return(NO_ERROR);
+ }
+ else if (input_rec.Event.MenuEvent.dwCommandId == (WM_USER+2))
+ {
+ ppm_input_rec->EventType = PMNT_MENU_EVENT;
+ ppm_input_rec->Event.MenuEvent.dwCommandId = 0x2;
+ return(NO_ERROR);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ Od2ExitGP();
+ }
+ }
+ } // while(1)
+}
+
+#ifndef CONSOLE_FULLSCREEN_MODE
+#define CONSOLE_FULLSCREEN_MODE 1
+#define CONSOLE_WINDOWED_MODE 2
+
+//BUGBUG !!! Most definitions below are taken from the private API include
+// file of the console ('conapi.h') -> needs to be updated from
+// time to time.
+
+typedef struct _CONSOLE_GRAPHICS_BUFFER_INFO {
+ DWORD dwBitMapInfoLength;
+ LPBITMAPINFO lpBitMapInfo;
+ DWORD dwUsage;
+ HANDLE hMutex;
+ PVOID lpBitMap;
+} CONSOLE_GRAPHICS_BUFFER_INFO, *PCONSOLE_GRAPHICS_BUFFER_INFO;
+
+#define CONSOLE_GRAPHICS_BUFFER 2
+
+BOOL
+SetConsoleDisplayMode(
+ HANDLE hConsoleOutput,
+ DWORD dwFlags,
+ PCOORD lpNewScreenBufferDimensions
+ );
+#endif
+
+typedef struct _BITMAPINFOPAT
+{
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFOPAT;
+
+BITMAPINFOPAT bmiPat =
+{
+ {
+ sizeof(BITMAPINFOHEADER),
+ 640,
+ -480, // For some weird reason, the Console wants a negative value,
+ // otherwise it prints a: "****** Negating biHeight" message.
+ 1,
+ 1,
+ BI_RGB,
+ (640 * 480 / 8),
+ 0,
+ 0,
+ 0,
+ 0
+ },
+
+ { // B G R
+ { 0, 0, 0x0, 0 }
+ }
+};
+
+/******************************************************************************
+ * PMNTGetWin32Hwnd:
+ * Returns the WIN32 HWND of our window.
+ ******************************************************************************/
+ULONG PMNTGetWin32Hwnd(ULONG *pHwnd)
+{
+ try
+ {
+ *pHwnd = (ULONG)Ow2ForegroundWindow;
+ }
+ except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ return NO_ERROR;
+}
+
+static BOOL HWDumpVersion=FALSE;
+
+PVIDEO_HARDWARE_STATE_HEADER videoState;
+
+UCHAR InitStatePortValue[0x30] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0x20, 0, 0xe3, 0, 2, 0, 0xff, 0, 0x10, 0, 0, 0, 0, 0, 4, 0,
+ 0, 0, 0, 0, 0x3f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+UCHAR InitStateBasicSequencer[] = {3,1,0xf,0,6};
+UCHAR InitStateBasicCrtCont[] = {
+0x5f,0x4f,0x50,0x82,0x54,0x80,0xb,0x3e,0,0x40,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0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xf, 0xef, 0, 0, 0, 0,0x2f, 0,0xff,
+ 0xff, 0xff, 0xff, 0,0xff, 0, 0, 0, 0,0xff, 0xff, 0xff, 0xff, 0,0xff, 0,
+ 2, 2, 0,0xff, 0xff, 0, 0, 0, 0,0xff, 0xf, 0xff, 0xf};
+UCHAR InitStateExtendedGraphCont[] = {
+0x10, 0x31, 0xa5, 0x28, 0, 0, 0,0xfb, 0xdf, 0, 0, 0, 0,0x50, 0,0xd6,
+0xa1, 0, 0, 0, 0, 0, 0x1f, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xf, 0xf, 0xf, 0xf, 0xf};
+#endif //0
+
+
+extern BOOLEAN Os2InitializeVDMEvents(VOID);
+extern BOOLEAN Os2WaitForVDMThread(HANDLE hEvent);
+extern VOID Os2VDMThread(PVOID Parameter);
+#ifndef PMNT_DAYTONA
+extern BOOLEAN Os2WaitForVDMThreadReady(VOID);
+extern VOID Os2VDMGetStartThread(PVOID Parameter);
+#endif // not PMNT_DAYTONA
+
+extern VOID DosExit(ULONG ExitAction,ULONG ExitResult);
+
+ULONG
+PMNTSetShutdownPriority(ULONG NewPriority, ULONG DisablePopup)
+{
+ ULONG rc = NO_ERROR;
+
+ if (DisablePopup == 1) // i.e. disable
+ {
+ if (!SetProcessShutdownParameters(
+ NewPriority,
+ 1 // Don't give pop-up when 20 sec are exceeded
+ ))
+ {
+#if DBG
+ DbgPrint("Os2: PMNTSetShutdownPriority(0x%X, %d) failed\n",
+ NewPriority, DisablePopup);
+#endif
+ rc = ERROR_INVALID_PARAMETER;
+ }
+ }
+ else if (DisablePopup == 0) // i.e. enable
+ {
+ if (!SetProcessShutdownParameters(
+ NewPriority,
+ 0 // Give pop-up when 20 sec are exceeded
+ ))
+ {
+#if DBG
+ DbgPrint("Os2: PMNTSetShutdownPriority(0x%X, %d) failed\n",
+ NewPriority, DisablePopup);
+#endif
+ rc = ERROR_INVALID_PARAMETER;
+ }
+ }
+ else // leave unchanged
+ {
+ ULONG tmpPriority, tmpDisable;
+
+ if (!GetProcessShutdownParameters(
+ &tmpPriority,
+ &tmpDisable
+ ))
+ {
+#if DBG
+ DbgPrint("Os2: PMNTSetShutdownPriority(0x%X, %d) failed because of query\n",
+ NewPriority, DisablePopup);
+#endif
+ rc = ERROR_INVALID_PARAMETER;
+ }
+ else
+ {
+ if (!SetProcessShutdownParameters(
+ NewPriority,
+ tmpDisable
+ ))
+ {
+#if DBG
+ DbgPrint("Os2: PMNTSetShutdownPriority(0x%X, %d) failed\n",
+ NewPriority, DisablePopup);
+#endif
+ rc = ERROR_INVALID_PARAMETER;
+ }
+ }
+ }
+ return rc;
+}
+
+//
+//This is a workaround for Unknown Video Adapters
+//It is basically the same as PMNTSetFullScreen of event.c@v52
+//
+void PMNTSetFullScreenDump(void)
+{
+ CONSOLE_GRAPHICS_BUFFER_INFO GraphicsInfo;
+ HANDLE Handle;
+ COORD NewCoord;
+ /* Size of video save block. */
+ DWORD stateLength;
+ CHAR_INFO *textBuffer;
+ COORD textBufferSize; // Dimensions of the shared buffer
+ DWORD ModeFlags;
+ DWORD OldPriorityClass;
+ DWORD OldPriorityThread;
+
+#if DBG
+ DbgPrint("PMNTSetFullScreenDump was called\n");
+#endif
+
+ //
+ // open a new console
+ //
+
+ GraphicsInfo.dwBitMapInfoLength = sizeof(bmiPat);
+ GraphicsInfo.lpBitMapInfo = (LPBITMAPINFO)&bmiPat;
+ GraphicsInfo.dwUsage = DIB_RGB_COLORS;
+
+ // Set some fields according to the display resolution
+ GraphicsInfo.lpBitMapInfo->bmiHeader.biWidth = ScreenX;
+ // For some weird reason, the Console wants a negative value,
+ // otherwise it prints a: "****** Negating biHeight" message.
+ GraphicsInfo.lpBitMapInfo->bmiHeader.biHeight = -ScreenY;
+ GraphicsInfo.lpBitMapInfo->bmiHeader.biSizeImage = ScreenX*ScreenY/8;
+
+ Handle = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ CONSOLE_GRAPHICS_BUFFER,
+ &GraphicsInfo
+ );
+ if (Handle == (HANDLE)-1)
+ {
+#if DBG
+ DbgPrint("CreateConsoleScreenBuffer failed\n");
+#endif
+ return;
+ }
+
+ //
+ // make it current
+ //
+
+ if (!SetConsoleActiveScreenBuffer(Handle))
+ {
+#if DBG
+ DbgPrint("SetConsoleActiveScreenBuffer() failed\n");
+#endif
+ }
+
+ if (!GetConsoleDisplayMode(&ModeFlags))
+ {
+#if DBG
+ DbgPrint("GetConsoleDisplayMode() failed, error=%d\n",
+ GetLastError());
+#endif
+ }
+
+ OldPriorityClass = GetPriorityClass(GetCurrentProcess());
+ OldPriorityThread = GetThreadPriority(GetCurrentThread());
+
+#if DBG
+ if (!OldPriorityClass)
+ {
+ DbgPrint("PMNTSetFullScreen: GetPriorityClass failed, error=%d\n",
+ GetLastError());
+ }
+
+ if (OldPriorityThread == THREAD_PRIORITY_ERROR_RETURN)
+ {
+ DbgPrint("PMNTSetFullScreen: GetThreadPriority failed, error=%d\n",
+ GetLastError());
+ }
+#endif
+
+ if (!SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: SetPriorityClass failed, error=%d\n",
+ GetLastError());
+#endif
+ }
+
+ if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: SetThreadPriority failed, error=%d\n",
+ GetLastError());
+#endif
+ }
+
+ // Is the Console already full-screen ?
+ if ((ModeFlags & CONSOLE_FULLSCREEN) == 0)
+ {
+ INPUT_RECORD input_rec;
+ int count;
+
+ if (!SetConsoleDisplayMode(
+ Handle,
+ CONSOLE_FULLSCREEN_MODE,
+ &NewCoord
+ ))
+ {
+#if DBG
+ DbgPrint("SetConsoleDisplayMode() 0x%x %d failed\n", GetLastError(),
+ GetLastError());
+#endif
+ }
+
+ // The 2 loops below are here because of a Console bug: when one windows
+ // goes full-screen, GDI relinquishes the display and sends a lost focus
+ // message to all windows on the desktop, incl. to the window going
+ // full-screen. The Console is not smart enough to filter out this
+ // spurious event and it passes it on to the Console client in the form
+ // of a negative Console focus event. Then, the window gets a positive
+ // focus event.
+ // There is more: when the full-screen window happens to register itself
+ // as a VDM, the Console actually goes through the usual handshake
+ // involved when loosing/gaining focus, with the 2 hardware events !!!
+ // The PM/NT loop handling these events was created only later. All
+ // Console APIs (such as SetInputConsoleMode) issued from PMSHELL before
+ // the creation of the thread handling the dialog with the Console but
+ // after the spurious focus event resulted in a dead-lock: PMSHELL was
+ // waiting for some answer from the Console, which was waiting for the VDM
+ // (i.e. PMSHELL) to perform the handshake !
+ // Note that the problem didn't appear consistently because it was
+ // dependent on the timing on the WM_FOCUS message(s).
+ //
+ // The 2 loops below wait for these events and discard them.
+ //
+
+ while (1)
+ {
+ if (!Or2WinReadConsoleInputA(
+ #if DBG
+ ReadInputEventStr,
+ #endif
+ hConsoleInput,
+ &input_rec,
+ 1,
+ &count
+ ))
+ {
+ KdPrint(("PMNTSetFullScreent : Read Console input error = %lx \n",
+ GetLastError()));
+ return;
+ }
+
+ if (input_rec.EventType == FOCUS_EVENT)
+ {
+ if (input_rec.Event.FocusEvent.bSetFocus)
+ {
+ // Expected negative focus at that point but go on
+ KdPrint(("PMNTSetFullScreen: positive Focus event ?!?\n"));
+ goto SkipConsoleWait;
+ }
+ else
+ {
+ // Got the first spurious event (negative focus) - go on
+ break;
+ }
+ }
+ else
+ {
+ KdPrint(("PMNTSetFullScreen: ignoring non-focus event (%d)\n",
+ input_rec.EventType));
+ }
+ }
+
+ while (1)
+ {
+ if (!Or2WinReadConsoleInputA(
+ #if DBG
+ ReadInputEventStr,
+ #endif
+ hConsoleInput,
+ &input_rec,
+ 1,
+ &count
+ ))
+ {
+ KdPrint(("PMNTSetFullScreen : Read Console input error = %lx \n"));
+ return;
+ }
+
+ if (input_rec.EventType == FOCUS_EVENT)
+ {
+ if (!input_rec.Event.FocusEvent.bSetFocus)
+ {
+ // Expects positive focus at that point.
+ KdPrint(("PMNTSetFullScreen: negative Focus event ?!?\n"));
+ }
+ else
+ {
+ // Got the 2nd spurious event (positive focus) - go on
+ break;
+ }
+ }
+ }
+ }
+
+SkipConsoleWait:
+
+ // Get rid of any events at that point
+ FlushConsoleInputBuffer(hConsoleInput);
+
+ /*
+ * Register start and end events with the console. These events are used
+ * when gaining or losing control of the hardware.
+ */
+ hStartHardwareEvent = CreateEventW((LPSECURITY_ATTRIBUTES) NULL,
+ FALSE,
+ FALSE,
+ NULL);
+ hEndHardwareEvent = CreateEventW((LPSECURITY_ATTRIBUTES) NULL,
+ FALSE,
+ FALSE,
+ NULL);
+ if ((hStartHardwareEvent == NULL) || (hEndHardwareEvent == NULL))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, Cannot create start or end events\n");
+#endif
+ }
+ /* Poll the event to try and get rid of any console queued sets
+ * This shouldn't be needed (or shouldn't work) but something along
+ * those lines seems to be happening at the moment.
+ */
+ WaitForSingleObject(hStartHardwareEvent, 0);
+
+ if (!SetConsoleKeyShortcuts(
+ TRUE,
+ CONSOLE_ALTENTER,
+ NULL,
+ 0
+ )
+ )
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, SetConsoleKetShortcuts() failed\n");
+#endif
+ }
+
+ textBufferSize.X = 80;
+ textBufferSize.Y = 50;
+ stateLength = sizeof(CHAR_INFO)*80*50;
+
+ if (!RegisterConsoleVDM( TRUE,
+ hStartHardwareEvent,
+ hEndHardwareEvent,
+ (LPWSTR) NULL,
+ (DWORD) 0,
+ &stateLength,
+ (PVOID *) &videoState,
+ (LPWSTR) NULL,
+ (DWORD) 0,
+ textBufferSize,
+ (PVOID *) &textBuffer
+ )
+ )
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, RegisterConsoleVDM() failed\n");
+#endif
+ }
+
+ // Restore process/thread priority class & priority
+ if (!SetPriorityClass(GetCurrentProcess(), OldPriorityClass))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: SetPriorityClass(%d) failed, error=%d\n",
+ OldPriorityClass,
+ GetLastError());
+#endif
+ }
+
+ if (!SetThreadPriority(GetCurrentThread(), OldPriorityThread))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: SetThreadPriority(%d) failed, error=%d\n",
+ OldPriorityThread,
+ GetLastError());
+#endif
+ }
+}
+
+extern ULONG
+Dos16Open(PSZ pszFileName,PUSHORT phf,PUSHORT pusAction,ULONG cbFile,
+ ULONG ulAttribute,ULONG fsOpenFlags,ULONG fsOpenMode,ULONG ulReserved);
+extern ULONG DosClose(IN HFILE FileHandle);
+extern ULONG Dos16Write(HFILE FileHandle,PVOID Buffer,ULONG Length,PUSHORT BytesWritten);
+extern ULONG Dos16Read(ULONG hFile, PVOID pBuffer, ULONG cbRead, PUSHORT pcbActual);
+
+static BOOL VideoDumped = FALSE;
+#define PMNTREGQUERYVALMAX 256
+char PMNTDisplayAdapterName[PMNTREGQUERYVALMAX] = {'\0'};
+LONG PMNTDisplayAdapterLen = 0;
+
+//
+// This routine dumps the videostate buffer into c:\os2\videohw.dmp exists
+//
+
+void PMNTVideoDump(void)
+{
+ ULONG rc;
+ ULONG len;
+ USHORT hfile,Action,cbWritten;
+
+ if (PMNTDisplayAdapterLen == 0)
+ {
+ KdPrint(("PMNTVideoDump: couldn't get current display name - returning"));
+ return;
+ }
+
+ len = sizeof(VIDEO_HARDWARE_STATE_HEADER);
+
+ if (len < videoState->BasicSequencerOffset) len = videoState->BasicSequencerOffset;
+ if (len < videoState->BasicCrtContOffset) len = videoState->BasicCrtContOffset;
+ if (len < videoState->BasicGraphContOffset) len = videoState->BasicGraphContOffset;
+ if (len < videoState->BasicAttribContOffset) len = videoState->BasicAttribContOffset;
+ if (len < videoState->BasicDacOffset) len = videoState->BasicDacOffset;
+ if (len < videoState->BasicLatchesOffset) len = videoState->BasicLatchesOffset;
+ if (len < videoState->ExtendedSequencerOffset) len = videoState->ExtendedSequencerOffset;
+ if (len < videoState->ExtendedCrtContOffset) len = videoState->ExtendedCrtContOffset;
+ if (len < videoState->ExtendedGraphContOffset) len = videoState->ExtendedGraphContOffset;
+ if (len < videoState->ExtendedAttribContOffset) len = videoState->ExtendedAttribContOffset;
+ if (len < videoState->ExtendedDacOffset) len = videoState->ExtendedDacOffset;
+ if (len < videoState->ExtendedValidatorStateOffset) len = videoState->ExtendedValidatorStateOffset;
+ if (len < videoState->ExtendedMiscDataOffset) len = videoState->ExtendedMiscDataOffset;
+ if (len < videoState->Plane1Offset) len = videoState->Plane1Offset;
+
+ if (rc=Dos16Open("C:\\OS2\\VIDEOHW.DMP",
+ &hfile,
+ &Action,
+ 0L,
+ 0L,
+ 0x00000012, /* FILE_TRUNCATE | FILE_CREATE */
+ 0x00000012, /* OPEN_SHARE_DENYREADWRITE | OPEN_ACCESS_READWRITE */
+ 0L))
+ {
+ KdPrint(("PMNTVideoDump: cannot open VIDEOHW.DMP, rc= %d\n",rc));
+ return;
+ }
+
+ if (rc=Dos16Write((ULONG)hfile,
+ PMNTDisplayAdapterName,
+ PMNTDisplayAdapterLen,
+ &cbWritten))
+ {
+ KdPrint(("PMNTVideoDump: cannot write display name to VIDEOHW.DMP, rc= %d\n",rc));
+ DosClose((ULONG)hfile);
+ return;
+ }
+
+ if (rc=Dos16Write((ULONG)hfile,videoState,len,&cbWritten))
+ {
+ KdPrint(("PMNTVideoDump: cannot write to VIDEOHW.DMP, rc= %d\n",rc));
+ DosClose((ULONG)hfile);
+ return;
+ }
+
+ DosClose((ULONG)hfile);
+ KdPrint(("PMNTVideoDump: C:\\OS2\\VIDEOHW.DMP was created\n"));
+ return;
+}
+
+//
+// This routine modifies the videostate buffer in the case that
+// c:\os2\videohw.dmp exists
+// returns TRUE if and only if the file exists and is readable
+//
+
+BOOL PMNTReadVideoDump(void)
+{
+
+ ULONG rc;
+ USHORT hfile,Action,cbRead;
+ CHAR tmp_name_buf[PMNTREGQUERYVALMAX];
+
+ if (PMNTDisplayAdapterLen == 0)
+ return FALSE;
+
+ if (Dos16Open("C:\\OS2\\VIDEOHW.DMP",
+ &hfile,
+ &Action,
+ 0L,
+ 0L,
+ 0x00000001, /* FILE_OPEN */
+ 0x00000020, /* OPEN_SHARE_DENYWRITE */
+ 0L))
+ {
+ // file_not_found is the normal case
+ return(FALSE);
+ }
+
+ if (rc=Dos16Read((ULONG)hfile,
+ tmp_name_buf,
+ PMNTDisplayAdapterLen,
+ &cbRead))
+ {
+ KdPrint(("PMNTReadVideoDump: cannot read VIDEOHW.DMP, rc= %d\n",rc));
+ DosClose((ULONG)hfile);
+ return(FALSE);
+ }
+
+ if (cbRead != PMNTDisplayAdapterLen)
+ {
+ KdPrint(("PMNTReadVideoDump: cannot read enough from VIDEOHW.DMP, cbRead= %d\n",
+ cbRead));
+ DosClose((ULONG)hfile);
+ return(FALSE);
+ }
+
+ if (memcmp(tmp_name_buf, PMNTDisplayAdapterName, PMNTDisplayAdapterLen))
+ {
+ KdPrint(("PMNTReadVideoDump: got name=%s instead of actual name=%s\n",
+ tmp_name_buf, PMNTDisplayAdapterName));
+ DosClose((ULONG)hfile);
+ return(FALSE);
+ }
+
+ if (rc=Dos16Read((ULONG)hfile,videoState,0x0000ffff,&cbRead))
+ {
+ KdPrint(("PMNTReadVideoDump: cannot read VIDEOHW.DMP, rc= %d\n",rc));
+ DosClose((ULONG)hfile);
+ return(FALSE);
+ }
+
+ KdPrint(("PMNTReadVideoDump() modified videoState from C:\\OS2\\VIDEOHW.DMP\n"));
+
+ DosClose((ULONG)hfile);
+ return(TRUE);
+}
+
+//
+// This routine modifies the videostate buffer in the case of
+// a QVision Adapter
+//
+void PMNTChkQVision(void)
+{
+ char *ptr,*ptr_base;
+
+ if (!(strstr(PMNTDisplayAdapterName,"\\qv\\")))
+ {
+ // Not QVision
+ return;
+ }
+
+ KdPrint(("This machine uses QVision Video Adapter\n"));
+
+ videoState->Length = 0x9c;
+ videoState->PortValue[0x1e] = 0x57;
+ videoState->BasicSequencerOffset = 0x9c;
+ videoState->BasicCrtContOffset = 0xa1;
+ videoState->BasicGraphContOffset = 0xba;
+ videoState->BasicAttribContOffset= 0xc3;
+ videoState->BasicDacOffset = 0xd8;
+ videoState->BasicLatchesOffset = 0x3d8;
+#if 0
+ videoState->ExtendedSequencerOffset = 0x3dc;
+ videoState->ExtendedCrtContOffset = 0x3dc;
+ videoState->ExtendedGraphContOffset = 0x429;
+ videoState->ExtendedAttribContOffset= 0x48a;
+ videoState->ExtendedDacOffset = 0x48a;
+ videoState->ExtendedValidatorStateOffset = 0x0;
+ videoState->ExtendedMiscDataOffset = 0x0;
+
+ videoState->PlaneLength = 0x10000;
+ videoState->Plane1Offset = 0x95a;
+ videoState->Plane2Offset = 0x1095a;
+ videoState->Plane3Offset = 0x2095a;
+ videoState->Plane4Offset = 0x3095a;
+ videoState->VGAStateFlags = 0x0;
+ videoState->DIBOffset = 0x0;
+ videoState->DIBBitsPerPixel = 0x0;
+ videoState->DIBXResolution = 0x0;
+ videoState->DIBYResolution = 0x0;
+ videoState->DIBXlatOffset = 0x0;
+ videoState->DIBXlatLength = 0x0;
+#endif //0
+
+ ptr_base = (char *)( videoState);
+
+ ptr = ptr_base + videoState->BasicSequencerOffset;
+ memcpy(ptr,InitStateBasicSequencer,sizeof(InitStateBasicSequencer));
+
+ ptr = ptr_base + videoState->BasicCrtContOffset;
+ memcpy(ptr,InitStateBasicCrtCont,sizeof(InitStateBasicCrtCont));
+
+ ptr = ptr_base + videoState->BasicGraphContOffset;
+ memcpy(ptr,InitStateBasicGraphCont,sizeof(InitStateBasicGraphCont));
+
+ ptr = ptr_base + videoState->BasicAttribContOffset;
+ memcpy(ptr,InitStateBasicAttribCont,sizeof(InitStateBasicAttribCont));
+
+ ptr = ptr_base + videoState->BasicDacOffset;
+ memcpy(ptr,InitStateBasicDac,sizeof(InitStateBasicDac));
+
+ ptr = ptr_base + videoState->BasicLatchesOffset;
+ memcpy(ptr,InitStateBasicLatches,sizeof(InitStateBasicLatches));
+#if 0
+ ptr = ptr_base + videoState->ExtendedCrtContOffset;
+ memcpy(ptr,InitStateExtendedCrtCont,sizeof(InitStateExtendedCrtCont));
+ ptr = ptr_base + videoState->ExtendedGraphContOffset;
+ memcpy(ptr,InitStateExtendedGraphCont,sizeof(InitStateExtendedGraphCont));
+#endif //0
+
+ return;
+}
+
+//
+// This routine reads the name of the display driver into a buffer
+//
+void PMNTReadDisplayAdapterName(void)
+{
+ char VideoKeyName[] = "HARDWARE\\DEVICEMAP\\VIDEO";
+ char VideoValName[] = "\\Device\\Video0";
+
+ LONG ValType,rc;
+ HKEY hKey;
+
+ if (rc = RegOpenKeyEx(
+ HKEY_LOCAL_MACHINE,VideoKeyName,(DWORD)0,KEY_QUERY_VALUE,&hKey))
+ {
+ KdPrint(("PMNTReadDisplayAdapterName: RegOpenKeyEx() failed rc = %d\n",rc));
+ PMNTDisplayAdapterLen = 0;
+ return;
+ }
+
+ PMNTDisplayAdapterLen = PMNTREGQUERYVALMAX;
+
+ if (rc = RegQueryValueEx(
+ hKey,VideoValName,NULL,&ValType,
+ PMNTDisplayAdapterName,
+ &PMNTDisplayAdapterLen))
+ {
+ KdPrint(("PMNTReadDisplayAdapterName: RegQueryValEx() failed rc = %d\n",rc));
+ PMNTDisplayAdapterLen = 0;
+ RegCloseKey(hKey);
+ return;
+ }
+
+ RegCloseKey(hKey);
+
+ KdPrint(("This machine uses %s Video Adapter\n",
+ PMNTDisplayAdapterName));
+
+ return;
+}
+
+PMNTSetFocus(HWND FocusHwnd)
+{
+ BOOLEAN rc;
+
+// Code below doesn't work when the PM window which has been clicked on (which
+// is closing itself) causes PMShell to be selected (next in focus chain)
+#if 0
+ HWND tmp;
+
+ tmp = GetForegroundWindow();
+
+ // Try to ignore FOCUS event which arrives after we already set the focus
+ // on PMShell (for example, for the second spurious FOCUS event sent by
+ // the Console)
+ if (tmp == FocusHwnd)
+ {
+ return NO_ERROR;
+ }
+#endif //0
+
+#if DBG
+ DbgPrint("PMNTSetFocus: passing handle=%x\n", FocusHwnd);
+#endif
+
+ rc = SetForegroundWindow(FocusHwnd);
+
+ // PatrickQ 4/26/96: CBA fix, don't call OpenIcon if the
+ // SetForegroundWindow call failed. This prevents the PMShell window from
+ // being in a restored state when we attempt this code while a screen such
+ // as CTRL-ALT-DEL is on the desktop
+ if (!rc)
+ {
+#if DBG
+ DbgPrint("SetForegroundWindow failed, rc=0\n");
+#endif
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ rc = OpenIcon(FocusHwnd);
+// rc = ShowWindow(FocusHwnd, SW_SHOWMAXIMIZED);
+ if (!rc)
+ {
+#if DBG
+ DbgPrint("OpenIcon failed, rc=0\n");
+#endif
+ return ERROR_INVALID_PARAMETER;
+ }
+ else
+ return NO_ERROR;
+}
+
+void PMNTSetFullScreen(USHORT Register)
+{
+ CONSOLE_GRAPHICS_BUFFER_INFO GraphicsInfo;
+ HANDLE Handle;
+ COORD NewCoord;
+ /* Size of video save block. */
+ DWORD stateLength;
+ /* Video save block pointer. */
+ CHAR_INFO *textBuffer;
+ COORD textBufferSize; // Dimensions of the shared buffer
+ DWORD ModeFlags;
+ int i;
+ HANDLE ThreadHandle;
+ ULONG Tid;
+
+#if DBG
+ DbgPrint("PMNTSetFullScreen was called\n");
+#endif
+
+ if (Register)
+ {
+ // Create PMNTVDMEvent event objects
+ if (!Os2InitializeVDMEvents())
+ {
+#if DBG
+ DbgPrint("Os2: PMNTSetFullScreen, ERROR - Os2InitializeVDMEvents() failed\n");
+#endif // DBG
+ printf("Os2: PMNTSetFullScreen, ERROR - Os2InitializeVDMEvents() failed\n");
+ DosExit(0, 0);
+ }
+
+ PMNTReadDisplayAdapterName();
+
+ if (Register == 2)
+ {
+ HWDumpVersion = TRUE;
+ PMNTSetFullScreenDump();
+ return;
+ }
+ }
+ else // !Register
+ {
+ /**********************************************************************
+ * Un-register VDM: called by PMSHELL as part of its exit-list
+ **********************************************************************/
+ textBufferSize.X = 80;
+ textBufferSize.Y = 50;
+ stateLength = sizeof(CHAR_INFO)*80*50;
+
+ if (!RegisterConsoleVDM( FALSE,
+ hStartHardwareEvent,
+ hEndHardwareEvent,
+ (LPWSTR) NULL,
+ (DWORD) 0,
+ &stateLength,
+ (PVOID *) &videoState,
+ (LPWSTR) NULL,
+ (DWORD) 0,
+ textBufferSize,
+ (PVOID *) &textBuffer
+ )
+ )
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, UnRegisterConsoleVDM() failed\n");
+#endif
+ }
+ return;
+ }
+
+ //
+ // open a new console
+ //
+
+ GraphicsInfo.dwBitMapInfoLength = sizeof(bmiPat);
+ GraphicsInfo.lpBitMapInfo = (LPBITMAPINFO)&bmiPat;
+ GraphicsInfo.dwUsage = DIB_RGB_COLORS;
+
+ // Set some fields according to the display resolution
+ GraphicsInfo.lpBitMapInfo->bmiHeader.biWidth = ScreenX;
+ // For some weird reason, the Console wants a negative value,
+ // otherwise it prints a: "****** Negating biHeight" message.
+ GraphicsInfo.lpBitMapInfo->bmiHeader.biHeight = -ScreenY;
+ GraphicsInfo.lpBitMapInfo->bmiHeader.biSizeImage = ScreenX*ScreenY/8;
+
+ Handle = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ CONSOLE_GRAPHICS_BUFFER,
+ &GraphicsInfo
+ );
+ if (Handle == (HANDLE)-1)
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, CreateConsoleScreenBuffer() failed, error=0x%x\n",
+ GetLastError());
+#endif
+ printf("PMSS: Internal error, CreateConsoleScreenBuffer() failed, error=0x%x\n",
+ GetLastError());
+ DosExit(0, 0);
+ return;
+ }
+
+ //
+ // make it current
+ //
+
+ if (!SetConsoleActiveScreenBuffer(Handle))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, SetConsoleActiveScreenBuffer() failed, error=0x%x\n",
+ GetLastError());
+#endif
+ printf("PMSS: Internal error, SetConsoleActiveScreenBuffer() failed, error=0x%x\n",
+ GetLastError());
+ DosExit(0, 0);
+ return;
+ }
+
+ if (!SetConsoleKeyShortcuts(
+ TRUE,
+ CONSOLE_ALTENTER,
+ NULL,
+ 0
+ )
+ )
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, SetConsoleKetShortcuts() failed, error=0x%x\n",
+ GetLastError());
+#endif
+ }
+
+ if (!GetConsoleDisplayMode(&ModeFlags))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, GetConsoleDisplayMode() failed, error=0x%x\n",
+ GetLastError());
+#endif
+ printf("PMSS: Internal error, GetConsoleDisplayMode() failed, error=0x%x\n",
+ GetLastError());
+ DosExit(0, 0);
+ return;
+ }
+
+ // Is the Console already full-screen ?
+ if ((ModeFlags & CONSOLE_FULLSCREEN) != 0)
+ {
+#if DBG
+ DbgPrint("Os2: PMNTSetFullScreen, ERROR - trying to run PMShell from full-screen session !\n");
+#endif // DBG
+ SetConsoleKeyShortcuts(
+ TRUE,
+ 0,
+ NULL,
+ 0);
+ Ow2PMShellErrorPopup(Od2PgmFilePath, ERROR_PMSHELL_FULLSCREEN);
+ DosExit(0, 0);
+ return;
+ }
+
+ /*
+ * Register start and end events with the console. These events are used
+ * when gaining or losing control of the hardware.
+ */
+ hStartHardwareEvent = CreateEventW((LPSECURITY_ATTRIBUTES) NULL,
+ FALSE,
+ FALSE,
+ NULL);
+ hEndHardwareEvent = CreateEventW((LPSECURITY_ATTRIBUTES) NULL,
+ FALSE,
+ FALSE,
+ NULL);
+ if ((hStartHardwareEvent == NULL) || (hEndHardwareEvent == NULL))
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, Cannot create start or end events\n");
+#endif
+ printf("PMSS: Internal error, cannot create start or end events\n");
+ DosExit(0, 0);
+ return;
+ }
+ /* Poll the event to try and get rid of any console queued sets
+ * This shouldn't be needed (or shouldn't work) but something along
+ * those lines seems to be happening at the moment.
+ */
+ WaitForSingleObject(hStartHardwareEvent, 0);
+
+ // Get rid of any events at that point
+ FlushConsoleInputBuffer(hConsoleInput);
+
+ textBufferSize.X = 80;
+ textBufferSize.Y = 50;
+ stateLength = sizeof(CHAR_INFO)*80*50;
+
+ if (!RegisterConsoleVDM( TRUE,
+ hStartHardwareEvent,
+ hEndHardwareEvent,
+ (LPWSTR) NULL,
+ (DWORD) 0,
+ &stateLength,
+ (PVOID *) &videoState,
+ (LPWSTR) NULL,
+ (DWORD) 0,
+ textBufferSize,
+ (PVOID *) &textBuffer
+ ) ||
+ (!stateLength)
+ )
+ {
+#if DBG
+ DbgPrint("PMNTSetFullScreen: ERROR, RegisterConsoleVDM() failed, error=0x%x\n",
+ GetLastError());
+#endif
+ printf("PMSS: Internal error, RegisterConsoleVDM() failed\n");
+ // Restore Console state
+ SetConsoleKeyShortcuts(
+ TRUE,
+ 0,
+ NULL,
+ 0);
+ DosExit(0, 0);
+ return;
+ }
+
+ // Set values for PortValue[]
+ for (i=0; i<0x30; i++)
+ videoState->PortValue[i] = InitStatePortValue[i];
+
+ // Initial value for AttribIndexDataState
+ videoState->AttribIndexDataState = 1;
+
+ if (!PMNTReadVideoDump())
+ {
+ PMNTChkQVision();
+ }
+
+ ThreadHandle = CreateThread( NULL,
+ 0,
+ (LPTHREAD_START_ROUTINE)Os2VDMThread,
+ NULL,
+ 0,
+ &Tid);
+
+ if (!ThreadHandle)
+ {
+#if DBG
+ DbgPrint("OS2: PMNTSetFullScreen, fail to CreateThread, error %d\n",GetLastError());
+#endif
+ }
+ else
+ {
+ DWORD Status;
+ Status = NtClose(ThreadHandle);
+#if DBG
+ if (!(Status >= 0))
+ {
+ DbgPrint("PMNTSetFullScreen: NtClose(%x) failed, status=%x\n",
+ ThreadHandle, Status);
+ }
+#endif // DBG
+ }
+
+ if (!SetConsoleDisplayMode(
+ Handle,
+ CONSOLE_FULLSCREEN_MODE,
+ &NewCoord
+ ))
+ {
+#if DBG
+ DbgPrint("SetConsoleDisplayMode() 0x%x %d failed\n", GetLastError(),
+ GetLastError());
+#endif
+ }
+
+ // Work-around for cases where the Console doesn't make us full-screen
+ PMNTSetFocus(Ow2ForegroundWindow);
+
+ // Wait for Os2VDMThread() to get events from the Console signifying we
+ // went full-screen
+ Os2WaitForVDMThread(0);
+
+#if DBG
+ DbgPrint("Os2: PMNTSetFullScreen returning\n");
+#endif
+}
+
+/******************************************************************************
+* PMNTCloseWindow:
+*
+* Minimize the current window. This function is called when switching from
+* one of the CMD windows representing a PM app to the PMShell window.
+*
+******************************************************************************/
+
+PMNTCloseWindow()
+{
+ if (ProcessIsPMShell())
+ {
+ DWORD Dummy;
+
+
+#if DBG
+ DbgPrint("PMNTCloseWindow\n");
+#endif
+
+ // Special case: minimize PMShell window
+ if (!VDMConsoleOperation(
+ 1, //VDM_HIDE_WINDOW
+ (LPVOID)&Dummy))
+ {
+#if DBG
+ DbgPrint("PMNTCloseWindow: VDMConsoleOperation() 1 failed, error=0x%x\n",
+ GetLastError());
+#endif
+ return ERROR_INVALID_PARAMETER;
+ }
+ ShowWindow(Ow2ForegroundWindow, SW_HIDE);
+ if (!VDMConsoleOperation(
+ 1, //VDM_HIDE_WINDOW
+ (LPVOID)&Dummy))
+ {
+#if DBG
+ DbgPrint("PMNTCloseWindow: VDMConsoleOperation() 2 failed, error=0x%x\n",
+ GetLastError());
+#endif
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ return NO_ERROR;
+ }
+
+#if 0
+ The code below results in setting the window size to the size of an icon.
+ This is done so that double-clicking on such a window next time
+ produces the smallest possible transient restored window.
+ Unfortunately, this is not feasible because the current CMD window may be
+ a CMD window which the user expects to get back unharmed after the PM app
+ terminates (i.e. we shouldn't change its size) !
+
+ static int FirstTime = 0;
+
+ if (FirstTime < 2)
+ {
+ if (!SetWindowPos(
+ Ow2ForegroundWindow,
+ HWND_TOP,
+ 0, // X (ignored)
+ 0, // Y (ignored)
+ GetSystemMetrics(SM_CXICON), // CX
+ GetSystemMetrics(SM_CYICON), // CY
+ SWP_NOMOVE))
+ {
+#if DBG
+ DbgPrint("SetWindowPos failed, rc=%d\n",
+ GetLastError());
+#endif
+ }
+
+ FirstTime++;
+ }
+#endif //0
+
+#if DBG
+ DbgPrint("PMNTCloseWindow: passing handle=%x\n", Ow2ForegroundWindow);
+#endif
+
+ // PatrickQ 4/26/96: Upon closing the current window, take the opportunity
+ // to correct situations where we remember a 0 Ow2ForeGroundWindow
+ // because, for example, the PM app was started when a CTRL-ALT-DEL screen
+ // was active. This change is prompted by the CBA problem when starting
+ // PM apps while screen is locked
+ if (Ow2ForegroundWindow == 0)
+ {
+ // Re-acquire Ow2ForegroundWindow
+ Ow2ForegroundWindow = GetForegroundWindow();
+ }
+
+ if (!CloseWindow(Ow2ForegroundWindow))
+ {
+#if DBG
+ DbgPrint("CloseWindow failed, rc=%d\n",
+ GetLastError());
+#endif
+ }
+
+ return NO_ERROR;
+}
+
+VOID
+PMNTGetFullScreen(
+ ULONG Operation
+ )
+{
+#ifdef JAPAN
+ DWORD dwNlsMode;
+#endif // JAPAN
+#ifndef PMNT_DAYTONA
+ HANDLE ThreadHandle = NULL;
+ ULONG Tid;
+#endif // PMNT_DAYTONA
+ ULONG rc;
+
+ switch (Operation)
+ {
+ case 1: // Wait till we must loose focus
+#if DBG
+ DbgPrint("PMNTGetFullScreen(1): waiting for notification of lost focus\n");
+#endif
+#ifdef JAPAN // MSKK [ShigeO] Aug 18, 1993
+ //
+ // Disable Win32 IME on PM desktop
+ //
+ if(!GetConsoleNlsMode(hConsoleInput, &dwNlsMode)) {
+#if DBG
+ DbgPrint("GetConsoleNlsMode() 0x%x %d failed\n", GetLastError(), GetLastError());
+#endif
+ } else {
+#if DBG
+ DbgPrint("PMNTGetFullScreen: We are calling SetConsoleNlsMode\n");
+#endif
+ if(!SetConsoleNlsMode(hConsoleInput, dwNlsMode | NLS_IME_DISABLE)) {
+#if DBG
+ DbgPrint("SetConsoleNlsMode() 0x%x %d failed\n", GetLastError(), GetLastError());
+#endif
+ }
+ }
+#endif // JAPAN
+ if (rc = WaitForSingleObject(hStartHardwareEvent, INFINITE))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(1): WaitForSingleObject(hStartHardwareEvent, INFINITE) failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+#if DBG
+ DbgPrint("PMNTGetFullScreen(1): got notification of lost focus, returning\n");
+#endif
+ PMNTInFocus = FALSE;
+ return;
+ case 2: // Notify Console it can take the focus away from us
+#if DBG
+ DbgPrint("PMNTGetFullScreen(2): sending event to console\n");
+#endif
+ if (!SetEvent(hEndHardwareEvent))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(2): SetEvent(hEndHardwareEvent) #1 failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+#if DBG
+ DbgPrint("PMNTGetFullScreen(2): about to wait#2\n");
+#endif
+
+ if (rc = WaitForSingleObject(hStartHardwareEvent, INFINITE))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(2): WaitForSingleObject(hStartHardwareEvent, INFINITE) failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+
+#if DBG
+ DbgPrint("PMNTGetFullScreen(2): wait#2 succeeded\n");
+#endif
+
+ if (!SetEvent(hEndHardwareEvent))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(2): SetEvent(hEndHardwareEvent) #2 failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+#if DBG
+ DbgPrint("PMNTGetFullScreen(2): SetEvent(hEndHardwareEvent#2) succeeded, returning\n");
+#endif
+ return;
+ case 3: // Wait till we gain focus
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): waiting for notification of gain focus\n");
+#endif
+ if (rc = WaitForSingleObject(hStartHardwareEvent, INFINITE))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): WaitForSingleObject(hStartHardwareEvent, INFINITE) #1 failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): wait#1 succeeded (got focus)\n");
+#endif
+
+#if 0
+ {
+ ULONG offset;
+ int i;
+
+ DbgPrint("------------------------------------------------------\n");
+ DbgPrint("Hardware state header:\n");
+ DbgPrint("- Length=%x\n", videoState->Length);
+ DbgPrint("- PortValues:\n");
+ for (i=0; i<0x30; i++)
+ DbgPrint(" %d: %x\n", i, videoState->PortValue[i]);
+ DbgPrint("- AttribIndexDataState=%x\n", videoState->AttribIndexDataState);
+ DbgPrint("- BasicSequencerOffset=%x\n", videoState->BasicSequencerOffset);
+ for (offset = videoState->BasicSequencerOffset, i=0;
+ offset < videoState->BasicCrtContOffset;
+ offset++,i++)
+ {
+ if (!(i % 16))
+ DbgPrint("\n %2x: ", i);
+ DbgPrint("%2x ", *(BYTE *)((ULONG)videoState + offset));
+ }
+ DbgPrint("\n");
+ DbgPrint("- BasicCrtContOffset=%x\n", videoState->BasicCrtContOffset);
+ for (offset = videoState->BasicCrtContOffset, i=0;
+ offset < videoState->BasicGraphContOffset;
+ offset++,i++)
+ {
+ if (!(i % 16))
+ DbgPrint("\n %2x: ", i);
+ DbgPrint("%2x ", *(BYTE *)((ULONG)videoState + offset));
+ }
+ DbgPrint("\n");
+ DbgPrint("- BasicGraphContOffset=%x\n", videoState->BasicGraphContOffset);
+ for (offset = videoState->BasicGraphContOffset, i=0;
+ offset < videoState->BasicAttribContOffset;
+ offset++,i++)
+ {
+ if (!(i % 16))
+ DbgPrint("\n %2x: ", i);
+ DbgPrint("%2x ", *(BYTE *)((ULONG)videoState + offset));
+ }
+ DbgPrint("\n");
+ DbgPrint("- BasicAttribContOffset=%x\n", videoState->BasicAttribContOffset);
+ for (offset = videoState->BasicAttribContOffset, i=0;
+ offset < videoState->BasicDacOffset;
+ offset++,i++)
+ {
+ if (!(i % 16))
+ DbgPrint("\n %2x: ", i);
+ DbgPrint("%2x ", *(BYTE *)((ULONG)videoState + offset));
+ }
+ DbgPrint("\n");
+ DbgPrint("- BasicDacOffset=%x\n", videoState->BasicDacOffset);
+ for (offset = videoState->BasicDacOffset, i=0;
+ offset < videoState->BasicLatchesOffset;
+ offset++,i++)
+ {
+ if (!(i % 16))
+ DbgPrint("\n %2x: ", i);
+ DbgPrint("%2x ", *(BYTE *)((ULONG)videoState + offset));
+ }
+ DbgPrint("\n");
+ DbgPrint("- BasicLatchesOffset=%x\n", videoState->BasicLatchesOffset);
+ for (offset = videoState->BasicLatchesOffset, i=0;
+ offset < min(videoState->ExtendedSequencerOffset,0);
+ offset++,i++)
+ {
+ if (!(i % 16))
+ DbgPrint("\n %2x: ", i);
+ DbgPrint("%2x ", *(BYTE *)((ULONG)videoState + offset));
+ }
+ DbgPrint("\n");
+ DbgPrint("- ExtendedSequencerOffset=%x\n", videoState->ExtendedSequencerOffset);
+ DbgPrint("- ExtendedCrtContOffset=%x\n", videoState->ExtendedCrtContOffset);
+ DbgPrint("- ExtendedGraphContOffset=%x\n", videoState->ExtendedGraphContOffset);
+ DbgPrint("- ExtendedAttribContOffset=%x\n", videoState->ExtendedAttribContOffset);
+ DbgPrint("- ExtendedDacOffset=%x\n", videoState->ExtendedDacOffset);
+ DbgPrint("- ExtendedValidatorStateOffset=%x\n", videoState->ExtendedValidatorStateOffset);
+ DbgPrint("- ExtendedMiscDataOffset=%x\n", videoState->ExtendedMiscDataOffset);
+ DbgPrint("- PlaneLength=%x\n", videoState->PlaneLength);
+ DbgPrint("- Plane1Offset=%x\n", videoState->Plane1Offset);
+ DbgPrint("- Plane2Offset=%x\n", videoState->Plane2Offset);
+ DbgPrint("- Plane3Offset=%x\n", videoState->Plane3Offset);
+ DbgPrint("- Plane4Offset=%x\n", videoState->Plane4Offset);
+ DbgPrint("- VGAStateFlags=%x\n", videoState->VGAStateFlags);
+ DbgPrint("- DIBOffset=%x\n", videoState->DIBOffset);
+ DbgPrint("- DIBBitsPerPixel=%x\n", videoState->DIBBitsPerPixel);
+ DbgPrint("- DIBXResolution=%x\n", videoState->DIBXResolution);
+ DbgPrint("- DIBYResolution=%x\n", videoState->DIBYResolution);
+ DbgPrint("- DIBXlatOffset=%x\n", videoState->DIBXlatOffset);
+ DbgPrint("- DIBXlatLength=%x\n", videoState->DIBXlatLength);
+ DbgPrint("------------------------------------------------------\n");
+ }
+#endif // 0
+
+ if (HWDumpVersion)
+ {
+ // Workaround for unknown video adapters
+ // Dump videoState into c:\os2\videohw.dmp
+ if (!VideoDumped)
+ {
+ VideoDumped=TRUE;
+ PMNTVideoDump();
+ }
+ }
+
+#ifndef PMNT_DAYTONA
+ // Create a thread that will wait on the StartHardware event before
+ // we release the Console. This will prevent the Console from
+ // setting the event twice without letting us sense it twice
+
+ ThreadHandle = CreateThread( NULL,
+ 0,
+ (LPTHREAD_START_ROUTINE)Os2VDMGetStartThread,
+ NULL,
+ 0,
+ &Tid);
+
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): Create Os2VDMGetStartThread(), handle = %x\n", ThreadHandle);
+#endif
+ Sleep(50L); // Sleep 50 miliseconds to make sure the above thread is
+ // waiting on the event
+ if (ThreadHandle)
+ {
+ DWORD Status;
+ Status = NtClose(ThreadHandle);
+#if DBG
+ if (!(Status >= 0))
+ {
+ DbgPrint("PMNTGetFullScreen(3): NtClose(%x) failed, status=%x\n",
+ ThreadHandle, Status);
+ }
+#endif // DBG
+ if (!Os2WaitForVDMThreadReady())
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): Os2WaitForVDMThread isn't useful, ThreadHandle = NULL\n");
+#endif // DBG
+ ThreadHandle = NULL;
+ }
+#if DBG
+ else
+ DbgPrint("PMNTGetFullScreen(3): Os2VDMGetStartThread is ready\n");
+#endif
+ }
+#if DBG
+ else
+ {
+ DbgPrint("PMNTGetFullScreen(3): CreateThread for Os2VDMGetStartThread failed, error=%x\n",
+ GetLastError());
+ }
+#endif // DBG
+#endif // not PMNT_DAYTONA
+
+ // Restore PM/NT mouse position
+ if (LastMousePosition.X != -1)
+ SetCursorPos(LastMousePosition.X,
+ LastMousePosition.Y);
+
+ if (!SetEvent(hEndHardwareEvent))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): SetEvent(hEndHardwareEvent) #1 failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): about to wait#2\n");
+#endif
+
+#ifndef PMNT_DAYTONA
+ if (ThreadHandle != NULL)
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): waiting for Os2VDMGetStartThread()\n");
+#endif
+ // Wait for Os2VDMGetStartThread() to get events from the
+ // Console signifying we went full-screen
+ if (!Os2WaitForVDMThread(0))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): Os2WaitForVDMThread failed, return\n");
+#endif
+ return;
+ }
+ }
+ else
+ {
+ if (rc = WaitForSingleObject(hStartHardwareEvent, INFINITE))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): WaitForSingleObject(hStartHardwareEvent, INFINITE) #2 failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+ }
+#else // PMNT_DAYTONA
+ if (rc = WaitForSingleObject(hStartHardwareEvent, INFINITE))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): WaitForSingleObject(hStartHardwareEvent, INFINITE) #2 failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+ if (!SetEvent(hEndHardwareEvent))
+ {
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): SetEvent(hEndHardwareEvent) #2 failed, error=%x\n",
+ GetLastError());
+#endif
+ return;
+ }
+
+#endif // PMNT_DAYTONA
+
+#if DBG
+ DbgPrint("PMNTGetFullScreen(3): returning\n");
+#endif
+ PMNTInFocus = TRUE;
+ return;
+ default:
+#if DBG
+ DbgPrint("PMNTGetFullScreen: bad command %d\n", Operation);
+#endif
+ return;
+ }
+}
+
+BOOLEAN
+Ow2WriteBackCloseEvent()
+{
+ INPUT_RECORD InputRecord;
+ BOOLEAN WriteSucceeded;
+ DWORD RecordsWritten;
+
+ if (!ProcessIsPMProcess()) {
+ return(FALSE);
+ }
+ InputRecord.EventType = MENU_EVENT;
+ InputRecord.Event.MenuEvent.dwCommandId = WM_USER;
+ WriteSucceeded = WriteConsoleInput(hConsoleInput,
+ &InputRecord, 1, &RecordsWritten);
+ if (!WriteSucceeded || (RecordsWritten != 1)) {
+#if DBG
+ DbgPrint("OS2: Ow2WriteBackCloseEvent - failed to write into input queue\n");
+#endif // DBG
+ return(FALSE);
+ }
+ return(TRUE);
+}
+
+#endif // PMNT
diff --git a/private/os2/os2ses/event.h b/private/os2/os2ses/event.h
new file mode 100644
index 000000000..055f7007a
--- /dev/null
+++ b/private/os2/os2ses/event.h
@@ -0,0 +1,203 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ Event.h
+
+Abstract:
+
+ Prototypes for functions & macros in in event.c
+
+Author:
+
+ Michael Jarus (mjarus) 5-Nov-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#include "monitor.h"
+
+/*
+ * event to sync access to monitor chain
+ */
+
+HANDLE MonitorEvent;
+
+/*
+ * abort flag indicator
+ */
+
+BOOL EventLoop;
+
+/*
+ * state for the monitor queue: open, reg & read
+ */
+
+#define MON_STAT_OPEN 0
+#define MON_STAT_REG 1
+#define MON_STAT_READ 2
+
+/*
+ * Last keyboard pressed: for KBD_MULTIMAKE bit of monitor
+ */
+
+WORD KbdLastKey;
+BOOL KbdLastKeyDown;
+KBDREQUEST KbdRequestSaveArea;
+BOOL KbdAsciiMode;
+PTRLOC MouPtrLoc;
+
+/*
+ * Monitor Header for all devices
+ * ------------------------------
+ * 0. Save ares for proposed relpies (pointed by MemoryStartAddress)
+ *
+ * 1. device type
+ * 2. MonReg info (exclude the MONITOR_SPECIEL) & the MONITOR_SPECIEL
+ * 3. Status of monitor (as define above)
+ * 4. flag to indicate if there is waiting request on empty queue
+ * 5. handle of semaphore to sync between direct MonRead & ReadThread
+ * 6. pointer for next MonReg for the same MonOpen
+ * 7. pointer for the next MonReg in the device
+ */
+
+typedef struct _MON_HEADER
+{
+// UCHAR ReadPortMessage[32]; // BUGBUG
+// UCHAR WritePortMessage[32]; // BUGBUG
+ MONDEVNUMBER DevType;
+ MON_REG MonReg;
+ ULONG Flag; // 1 - for MONITOR_SPECIEL Position
+ USHORT MonStat;
+ ULONG WaitForEvent;
+ CRITICAL_SECTION SyncCriticalSection;
+ PVOID MemoryStartAddress;
+ struct _MON_HEADER *NextMon;
+ struct _MON_HEADER *NextQueue;
+} MON_HEADER, *PMON_HEADER;
+
+typedef struct _KEYEVENTINFO
+{
+ WORD wRepeatCount;
+ KBD_MON_PACKAGE KeyInfo[1];
+} KEYEVENTINFO, *PKEYEVENTINFO;
+
+/*
+ * Queue for all devices
+ * ---------------------
+ * 1. Monitor header
+ * 2. Semaphore to wait on for first data (when empty)
+ * 3. In/Out/End pointer to data for Read/Write/Queue-End
+ * 4. Info - depends on the device
+ * 5. LastData which was not used and flag for it
+ * 6. Data records
+ */
+
+typedef struct _KEY_EVENT_QUEUE
+{
+ MON_HEADER MonHdr;
+ PKEYEVENTINFO In;
+ PKEYEVENTINFO Out;
+ PKEYEVENTINFO End;
+ KBDINFO Setup;
+ UCHAR bNlsShift;
+ USHORT Count;
+ USHORT Cp;
+ BOOL LastKeyFlag;
+ KEYEVENTINFO LastKey;
+ KEYEVENTINFO Event[1];
+} KEY_EVENT_QUEUE, *PKEY_EVENT_QUEUE;
+
+PKEY_EVENT_QUEUE KbdQueue, PhyKbdQueue, KbdMonQueue, MonQueue, LastKbdMon;
+
+typedef struct _MOU_EVENT_QUEUE
+{
+ MON_HEADER MonHdr;
+ // semaphore to wait on
+ PMOU_MON_PACKAGE In;
+ PMOU_MON_PACKAGE Out;
+ PMOU_MON_PACKAGE End;
+ BOOL LastMouFlag;
+ MOU_MON_PACKAGE LastEvent;
+ MOU_MON_PACKAGE Event[1];
+} MOU_EVENT_QUEUE, *PMOU_EVENT_QUEUE;
+
+PMOU_EVENT_QUEUE MouQueue, MouMonQueue, LastMouMon;
+
+#define HANDLE_HEAP_SIZE 64*1024 // Initial size of heap is 64K
+
+#define KEYBOARD_QUEUE_LENGTH 257
+#define KEYBOARD_QUEUE_SIZE (sizeof(KEY_EVENT_QUEUE) + sizeof(KEYEVENTINFO) * (KEYBOARD_QUEUE_LENGTH-1))
+
+#define MOUSE_QUEUE_LENGTH 11
+#define MOUSE_QUEUE_SIZE (sizeof(MOU_EVENT_QUEUE) + sizeof(MOU_MON_PACKAGE) * (MOUSE_QUEUE_LENGTH-1))
+
+/*
+ * flags for GetKeyboardInput
+ */
+
+#define WAIT_MASK 0x01
+#define ENABLE_KEY_DOWN 0x02
+#define ENABLE_NON_ASCII_KEY 0x04
+#define ENABLE_LN_EDITOR_KEY 0x08
+#define ENABLE_KEYS_ON_KEY 0x10
+
+DWORD KbdInit(IN VOID);
+DWORD MouInit(IN VOID);
+DWORD InitMonitor(IN VOID);
+DWORD InitVio(IN VOID);
+
+DWORD InitQueue(IN PKEY_EVENT_QUEUE *pKbdQueue);
+DWORD InitMouQueue(IN PMOU_EVENT_QUEUE *pMouQueue);
+
+DWORD CheckForBreakEvent(IN PKEYEVENTINFO KbdEvent);
+DWORD GetOs2MouEvent(IN USHORT WaitFlag, OUT PMOUEVENTINFO Event,
+ IN PVOID pMsg, OUT PULONG pReply);
+DWORD GetKeyboardInput(IN ULONG Flag, OUT PKEYEVENTINFO Event,
+ IN PVOID pMsg, OUT PULONG pReply);
+DWORD KbdHandlePackage(IN PKEY_EVENT_QUEUE NextKbdMon,
+ IN PKBD_MON_PACKAGE MonPackage);
+DWORD KbdCheckPackage(IN PKBD_MON_PACKAGE KbdPackage);
+
+/*
+ * Read/Write Monitor event from/to the device queue
+ */
+
+DWORD GetMonInput(IN USHORT MaxLength,
+ IN PKEY_EVENT_QUEUE KbdMon,
+ IN OUT PMON_RW rwParms,
+ IN PVOID pMsg,
+ OUT PULONG pReply);
+
+DWORD PutMonInput(IN USHORT MaxLength,
+ IN PKEY_EVENT_QUEUE KbdMon,
+ IN WORD RepeatCount,
+ //IN OUT PMON_RW rwParms,
+ IN PKBD_MON_PACKAGE MonPackage,
+ IN PVOID pMsg,
+ OUT PULONG pReply);
+
+DWORD MapWin2Os2KbdInfo(IN PKEY_EVENT_RECORD WinKey,
+ OUT PKEYEVENTINFO Os2Key);
+
+DWORD NewKbdQueue(IN PKEY_EVENT_QUEUE NewKbdQueue);
+
+USHORT MouNumber;
+USHORT MouLastEvent;
+DWORD MouEventMask;
+ULONG MouDevStatus;
+
+#ifdef DBCS
+// MSKK Jun.15.1992 KazuM
+// MSKK Aug.10.1992 V-AKihiS
+ULONG MapWinToOs2KbdNlsChar(IN PKEY_EVENT_RECORD WinKey,
+ OUT PKBD_MON_PACKAGE Os2KeyInfo);
+#endif
+
diff --git a/private/os2/os2ses/i386/bekbd.asm b/private/os2/os2ses/i386/bekbd.asm
new file mode 100644
index 000000000..24f464713
--- /dev/null
+++ b/private/os2/os2ses/i386/bekbd.asm
@@ -0,0 +1,778 @@
+;; SCCSID = @(#)bekbd.asm 12.2 89/04/07
+;MJ- Page 58,132
+ Title BEKBD - Translate Table Structure for CP/DOS 1.1
+ Name BEKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: BEKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Belgium *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Change Activity: *
+;* *
+;* PTM 3567 - Add support for e-circumflex for AT keyboards, *
+;* (reference FRKBD.ASM). pjr *
+;* *
+;* PTM 5609 - Add superscript n to 437 EN scan code 41 decimal.pjr*
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK BEKBD; **
+;** RELOC BEKBD.EXE BEKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+Public _Ow2BE437001 ;***************
+_Ow2BE437001 Label Byte ;Beginning of the table. BE 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,1,1,1,1,0,0,AT,Len1,'BE','120'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 0, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '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"AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'i',8Ch,'e',88h,'o',93h,'u',96h,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2BE437001
+
+;******************************************************************************
+
+Public _Ow2BE437011 ;***************
+_Ow2BE437011 Label Byte ;Beginning of the table. BE 437 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,1,1,0,1,0,0,EN,Len2,'BE','120'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 7Ch, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '2', '@', 0, 0 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '4', 0, 0, 0 ; 5 ' 4
+ KeyDef 4, 0,0,0,0,0,0,0, '(', '5', 0, 0, 0 ; 6 ( 5
+ KeyDef 4, 0,0,0,0,0,0,0, 15h, '6', '^', 0, 0 ; 7 15h 6
+ KeyDef 4, 0,0,0,0,0,0,0, 8Ah, '7', 0, 0, 0 ; 8 8Ah 7
+ KeyDef 4, 0,0,0,0,0,0,0, '!', '8', 0, 0, 0 ; 9 ! 8
+ KeyDef 4, 0,0,0,0,0,0,0, 87h, '9', '{', 0, 0 ; 10 87h 9
+ KeyDef 4, 0,0,0,0,0,0,0, 85h, '0', '}', 0, 0 ; 11 85h 0
+ KeyDef 4, 0,0,0,0,0,0,0, ')',0F8h, 0, 0, 0 ; 12 ) F8h
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 13 - _
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 16 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 17 z Z
+ KeyDef 1, 1,1,1,1,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+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, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <0FEh,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <0FEh,26,0,0,0,40,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'~',53,0,0,0,53,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2BE437011
+
+;******************************************************************************
+
+Public _Ow2BE850000 ;***************
+_Ow2BE850000 Label Byte ;Beginning of the table. BE 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,1,0,1,1,0,0,AT,Len3,'BE','120'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 0, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '2', '@', 0, 0 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '4', 0, 0, 0 ; 5 ' 4
+ KeyDef 4, 0,0,0,0,0,0,0, '(', '5', 0, 0, 0 ; 6 ( 5
+ KeyDef 4, 0,0,0,0,0,0,0, 0F5h, '6', '^', 0, 0 ; 7 F5h 6
+ KeyDef 4, 0,0,0,0,0,0,0, 8Ah, '7', 0, 0, 0 ; 8 8Ah 7
+ KeyDef 4, 0,0,0,0,0,0,0, '!', '8', 0, 0, 0 ; 9 ! 8
+ KeyDef 4, 0,0,0,0,0,0,0, 87h, '9', 0, 0, 0 ; 10 87h 9
+ KeyDef 4, 0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 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2BE850000
+
+;******************************************************************************
+
+Public _Ow2BE850010 ;***************
+_Ow2BE850010 Label Byte ;Beginning of the table. BE 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,1,0,0,1,0,0,EN,Len4,'BE','120'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 7Ch, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '2', '@', 0, 0 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,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, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 108 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt<'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <0EFh,40,0,0,0,40,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',0B5h,'E',90h,'I',0D6h,'O',0E0h,'U',0E9h,'y',0ECh,'Y',0EDh,' ',0EFh>
+
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'~',53,0,0,0,53,'a',0C6h,'o',0E4h,'n',0A4h,'A',0C7h,'O',0E5h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2BE850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/cfkbd.asm b/private/os2/os2ses/i386/cfkbd.asm
new file mode 100644
index 000000000..7a457ef91
--- /dev/null
+++ b/private/os2/os2ses/i386/cfkbd.asm
@@ -0,0 +1,794 @@
+;; SCCSID = @(#)cfkbd.asm 12.1 88/03/18
+; Page 58,132
+ Title CFKBD - Translate Table Structure for CP/DOS 1.1
+ Name CFKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: CFKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Canadian French *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Change Activity: *
+;* *
+;* Added L/R angle quotes to Enhanced kbd scan *
+;* codes 2Fh and 30h, and the degree symbol to scan *
+;* code 31h for code pages 863 and 850 (PTM 186). pjr *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK CFKBD; **
+;** RELOC CFKBD.EXE CFKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+Public _Ow2CF863001 ;******
+_Ow2CF863001 Label Byte ;Beginning of the table. CF 863 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 863,1,0,0,0,1,0,0,0,0,AT,Len1,'CF','058'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!',0F1h, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '/', 9Ch, 0, 0 ; 4 3 /
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 9Bh, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 98h, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '?',0AAh, 0, 0 ; 7 6 ?
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&',0A0h, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*',0FDh, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(',0A6h, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')',0ACh, 0, 0 ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_',0ABh, 0, 0 ; 12 - _
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+',0ADh, 0, 0 ; 13 = +
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 1,0,1,1,1,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0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0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',84h,'E',92h,'I',0A8h,'O',99h,'U',9Eh,1,'^',' ','^'>
+
+AccEnt <0A5h,27,29,27,0,27,'c',87h,'C',80h,2,0A5h,' ',0A5h>
+
+AccEnt <0A4h,27,29,27,0,0,'e',89h,'i',8Bh,'u',81h,'E',94h,'I',95h,'U',9Ah,3,0A4h,' ',0A4h>
+
+AccEnt <'`',40,0,0,0,40,'a',85h,'e',8Ah,'u',97h,'A',8Eh,'E',91h,'U',9Dh,4,'`',' ','`'>
+
+AccEnt <0A1h,53,0,0,0,0,'e',82h,'o',0A2h,'u',0A3h,'E',90h,5,0A1h,' ',0A1h>
+
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2CF863001
+
+;******************************************************************************
+
+Public _Ow2CF863011 ;******
+_Ow2CF863011 Label Byte ;Beginning of the table. CF 863 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 863,0,0,1,0,1,0,0,0,0,EN,Len2,'CF','058'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!',0F1h, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '/', 9Ch, 0, 0 ; 4 3 /
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 9Bh, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 98h, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '?',0AAh, 0, 0 ; 7 6 ?
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&',0A0h, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*',0FDh, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,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0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',84h,'E',92h,'I',0A8h,'O',99h,'U',9Eh,1,'^',' ','^'>
+
+AccEnt <0A5h,27,29,27,0,27,'c',87h,'C',80h,2,0A5h,' ',0A5h>
+
+AccEnt <0A4h,27,29,27,0,0,'e',89h,'i',8Bh,'u',81h,'E',94h,'I',95h,'U',9Ah,3,0A4h,' ',0A4h>
+
+AccEnt <'`',40,0,0,0,40,'a',85h,'e',8Ah,'u',97h,'A',8Eh,'E',91h,'U',9Dh,4,'`',' ','`'>
+
+AccEnt <0A1h,53,0,0,0,0,'e',82h,'o',0A2h,'u',0A3h,'E',90h,5,0A1h,' ',0A1h>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2CF863011
+
+;*****************************************************************************
+
+Public _Ow2CF850000 ;******
+_Ow2CF850000 Label Byte ;Beginning of the table. CF 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,1,0,0,0,0,0,0,0,0,AT,Len3,'CF','058'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8,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0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,1,'^',' ','^'>
+
+AccEnt <0F7h,27,29,27,0,27,'c',87h,'C',80h,2,0F7h,' ',0F7h>
+
+AccEnt <0F9h,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,3,0F9h,' ',0F9h>
+
+AccEnt <'`',40,0,0,0,40,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,4,'`',' ','`'>
+
+;AccEnt #5
+db 0EFh,53, 0,0, 0,0
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh
+db 5,0EFh, ' ',0EFh, 0,0, 0,0, 0,0, 0,0
+db 0,0, 0,0
+
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2CF850000
+
+;*****************************************************************************
+
+Public _Ow2CF850010 ;******
+_Ow2CF850010 Label Byte ;Beginning of the table. CF 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,0,0,0,EN,Len4,'CF','058'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!',0F1h, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '/', 9Ch, 0, 0 ; 4 3 /
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$',0BDh, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%',0CFh, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '?',0AAh, 0, 0 ; 7 6 ?
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '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0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,1,'^',' ','^'>
+
+AccEnt <0F7h,27,29,27,0,27,'c',87h,'C',80h,2,0F7h,' ',0F7h>
+
+AccEnt <0F9h,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,3,0F9h,' ',0F9h>
+
+AccEnt <'`',40,0,0,0,40,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,4,'`',' ','`'>
+
+;AccEnt #5
+db 0EFh,53, 0,0, 0,0
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh
+db 5,0EFh, ' ',0EFh, 0,0, 0,0, 0,0, 0,0
+db 0,0, 0,0
+
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2CF850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/dkkbd.asm b/private/os2/os2ses/i386/dkkbd.asm
new file mode 100644
index 000000000..d8304d115
--- /dev/null
+++ b/private/os2/os2ses/i386/dkkbd.asm
@@ -0,0 +1,790 @@
+;; SCCSID = @(#)dkkbd.asm 12.2 89/02/16
+ Page 58,132
+ Title DKKBD - Translate Table Structure for CP/DOS 1.1
+ Name DKKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: DKKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Denmark *
+;* *
+;* *
+;* Status: OS/2 Version 1.2 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Changes: *
+;* Added AltAcChar of 0/27 for Accent 3 in EN 850. PTM *
+;* 5674. pjr *
+;* *
+;* Fixed stand-alone acute accent for codepage 865. PTR *
+;* 3081. wak *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK DKKBD; **
+;** RELOC DKKBD.EXE DKKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+;AltPadMap Label Byte
+Public _Ow2DK865001 ;***************
+_Ow2DK865001 Label Byte ;Beginning of the table. DK 865 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 865,1,0,0,0,1,0,1,0,0,AT,Len1,'DK','159'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4',0AFh, '$', 0, 0 ; 5 4 monetary
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', '^', 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '&', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '*', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', '(', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', ')', 0, 0 ; 11 0 =
+ KeyDef 21, 0,0,0,0,0,0,0, '+', '?', '_', '-', 0 ; 12 + ?
+ KeyDef 21, 0,0,0,0,0,0,0, 1, 2, '+', '=', 0 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 1,1,1,1,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 0, 0 ; 19 r R
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, 0, 0 ; 20 t T
+ KeyDef 1, 0,0,1,0,0,0,0, 'y', 'Y', 0, 0, 0 ; 21 y Y
+ KeyDef 1, 1,1,1,1,0,0,0, 'u', 'U', 0, 0, 0 ; 22 u U
+ KeyDef 1, 1,1,1,1,0,0,0, 'i', 'I', 0, 0, 0 ; 23 i I
+ KeyDef 1, 1,1,1,1,0,0,0, 'o', 'O', 0, 0, 0 ; 24 o O
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, 0, 0 ; 25 p P
+ KeyDef 3, 0,0,0,0,0,0,0, 86h, 8Fh, '{', '[', 0 ; 26 a A (overcircle)
+ KeyDef 21, 0,0,0,0,0,0,0, 3, 4, '}', ']', 0 ; 27 diaresis circumflex
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 91h, 92h, ':', ';', 0 ; 39 oE dipthong
+ KeyDef 3, 0,0,0,0,0,0,0, 9Bh, 9Dh, '"', "'", 0 ; 40 o O (slash)
+ KeyDef 21, 0,0,0,0,0,0,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 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0FEh,13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <0FEh,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2DK865001
+
+;******************************************************************************
+
+Public _Ow2DK865011 ;***************
+_Ow2DK865011 Label Byte ;Beginning of the table. DK 865 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 865,0,0,1,0,1,0,1,0,0,EN,Len2,'DK','159'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4',0AFh, '$', 0, 0 ; 5 4 monetary symbol
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', ']', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', '}', 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, '+', '?', 0, 0, 0 ; 12 + ?
+ KeyDef 11, 0,0,0,0,0,0,0, 1, 2, 7Ch, 0, 1 ; 13 acute grave
+ KeyDef 8, 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0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0FEh,13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <0FEh,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2DK865011
+
+;*****************************************************************************
+
+Public _Ow2DK850000 ;***************
+_Ow2DK850000 Label Byte ;Beginning of the table. DK 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,1,0,0,0,0,0,1,0,0,AT,Len3,'DK','159'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4',0CFh, '$', 0, 0 ; 5 4 $
+ KeyDef 4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', '[', 0 ; 26 a A (overcircle)
+ KeyDef 21, 0,0,0,0,0,0,0, 3, 4, '}', ']', 0 ; 27 diaresis circumflex
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 91h, 92h, ':', ';', 0 ; 39 aE dipthong
+ KeyDef 3, 0,0,0,0,0,0,0, 9Bh, 9Dh, '"', "'", 0 ; 40 o O (slash)
+ KeyDef 21, 0,0,0,0,0,0,0, '<', '>', 7Ch, '\', 0 ; 41 < >
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 21, 0,0,0,0,0,0,0, "'", '*', '~', '`', 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 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,0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2DK850000
+
+;*****************************************************************************
+
+Public _Ow2DK850010 ;***************
+_Ow2DK850010 Label Byte ;Beginning of the table. DK 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'DK','159'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4',0CFh, '$', 0, 0 ; 5 4 monetary symbol
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', ']', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', '}', 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, '+', '?', 0, 0, 0 ; 12 + ?
+ KeyDef 11, 0,0,0,0,0,0,0, 1, 2, 7Ch, 0, 1 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ Key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 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,27,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'a',0C6h,'n',0A4h,'o',0E4h,'A',0C7h,'N',0A5h,'O',0E5h,' ','~'>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2DK850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/frkbd.asm b/private/os2/os2ses/i386/frkbd.asm
new file mode 100644
index 000000000..62d3e8b83
--- /dev/null
+++ b/private/os2/os2ses/i386/frkbd.asm
@@ -0,0 +1,1153 @@
+;; SCCSID = @(#)frkbd.asm 12.3 89/06/30
+ Page 58,132
+ Title FRKBD - Translate Table Structure for CP/DOS 1.1
+ Name FRKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: FRKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for France *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Change Activity: *
+;* *
+;* PTM 3317 - Changed Char1 for Scan Code 40d from A3h (accent *
+;* acute) to 97h (accent grave) for the 437 EN and *
+;* 850 EN keyboard tables. pjr *
+;* *
+;* PTM 3567 - Add support for e circumflex to all tables. pjr *
+;* *
+;* PTM 5609 - Add superscript n to 437 EN scan code 41 decimal.pjr*
+;* *
+;* lt (10/9/87) - changed decimal point to comma on DEL key *
+;* for 120 layout && PTM 883 *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK FRKBD; **
+;** RELOC FRKBD.EXE FRKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+;AltPadMap Label Byte
+; db 7,8,9,-1
+
+Public _Ow2FR437001 ;***************
+_Ow2FR437001 Label Byte ;Beginning of the table. FR 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,1,1,1,1,0,1,AT,Len1,'FR','189'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 0, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '2', '@', 0, 0 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0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b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2FR437001
+
+;******************************************************************************
+
+Public _Ow2FR437011 ;***************
+_Ow2FR437011 Label Byte ;Beginning of the table. FR 437 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,1,1,0,1,0,1,EN,Len2,'FR','189'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 0, 0, 0 ; 2 & 1
+ KeyDef 3, 0,0,1,0,0,0,0, 82h, '2', 3, 0, 3 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '4', '{', 0, 0 ; 5 ' 4
+ KeyDef 4, 0,0,0,0,0,0,0, '(', '5', '[', 0, 0 ; 6 ( 5
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '6', '|', 0, 0 ; 7 - 6
+ KeyDef 3, 0,0,0,1,0,0,0, 8Ah, '7', 4, 0, 4 ; 8 8Ah 7
+ KeyDef 4, 0,0,0,0,0,0,0, '_', '8', '\', 0, 0 ; 9 _ 8
+ KeyDef 4, 0,0,0,0,0,0,0, 87h, '9', '^', 0, 0 ; 10 87h 9
+ KeyDef 4, 0,0,0,0,0,0,0, 85h, '0', '@', 0, 0 ; 11 85h 0
+ KeyDef 4, 0,0,0,0,0,0,0, ')', 'ø', ']', 0, 0 ; 12 ) ø
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+', '}', 0, 0 ; 13 = +
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 1,1,0,1,0,0,0, 'a', 'A', 0, 0, 0 ; 16 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 17 z Z
+ KeyDef 1, 1,1,0,1,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 0, 0 ; 19 r R
+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, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'~',53,0,0,0,53,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2FR437011
+
+
+;******************************************************************************
+
+Public _Ow2FR437111 ;**************************
+_Ow2FR437111 Label Byte ;Beginning of the table. FR 437 EN Kbd New Std
+ ;**************************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,1,1,0,1,0,1,EN,Len3,'FR','120'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 7Ch, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '2', '@', 0, 0 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '4', 0, 0, 0 ; 5 ' 4
+ KeyDef 4, 0,0,0,0,0,0,0, '(', '5', 0, 0, 0 ; 6 ( 5
+ KeyDef 4, 0,0,0,0,0,0,0, 15h, '6', '^', 0, 0 ; 7  6
+ KeyDef 4, 0,0,0,0,0,0,0, 8Ah, '7', 0, 0, 0 ; 8 8Ah 7
+ KeyDef 4, 0,0,0,0,0,0,0, '!', '8', 0, 0, 0 ; 9 ! 8
+ KeyDef 4, 0,0,0,0,0,0,0, 87h, '9', '{', 0, 0 ; 10 87h 9
+ KeyDef 4, 0,0,0,0,0,0,0, 85h, '0', '}', 0, 0 ; 11 85h 0
+ KeyDef 4, 0,0,0,0,0,0,0, ')', 'ø', 0, 0, 0 ; 12 ) ø
+ KeyDef 4, 0,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 KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <0FEh,40,0,0,0,40,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'~',53,0,0,0,53,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2FR437111
+
+
+;******************************************************************************
+
+Public _Ow2FR850000 ;***************
+_Ow2FR850000 Label Byte ;Beginning of the table. FR 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,1,0,1,1,0,1,AT,Len4,'FR','189'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 0, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '2', '@', 0, 0 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '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 0, 0, 0 ; 108 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2FR850000
+
+;******************************************************************************
+
+Public _Ow2FR850010 ;***************
+_Ow2FR850010 Label Byte ;Beginning of the table. FR 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,1,0,0,1,0,1,EN,Len5,'FR','189'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 0, 0, 0 ; 2 & 1
+ KeyDef 3, 0,0,1,0,0,0,0, 82h, '2', 3, 0, 3 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '4', '{', 0, 0 ; 5 ' 4
+ KeyDef 4, 0,0,0,0,0,0,0, '(', '5', '[', 0, 0 ; 6 ( 5
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '6',07Ch, 0, 0 ; 7 - 6
+ KeyDef 3, 0,0,0,1,0,0,0, 8Ah, '7', 4, 0, 4 ; 8 8Ah 7
+ KeyDef 4, 0,0,0,0,0,0,0, '_', '8', '\', 0, 0 ; 9 _ 8
+ KeyDef 4, 0,0,0,0,0,0,0, 87h, '9', '^', 0, 0 ; 10 87h 9
+ KeyDef 4, 0,0,0,0,0,0,0, 85h, '0', '@', 0, 0 ; 11 85h 0
+ KeyDef 4, 0,0,0,0,0,0,0, ')', 'ø', ']', 0, 0 ; 12 ) ø
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+', '}', 0, 0 ; 13 = +
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 16 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 17 z Z
+ KeyDef 1, 1,1,0,1,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 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 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'~',53,0,0,0,53,'a',0C6h,'o',0E4h,'n',0A4h,'A',0C7h,'O',0E5h,'N',0A5h,' ','~'>
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len5 EQU $ - _Ow2FR850010
+
+;******************************************************************************
+
+Public _Ow2FR850011 ;*************************
+_Ow2FR850011 Label Byte ;Beginning of the table. FR 850 EN Kbd New Std
+ ;*************************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,1,0,0,1,0,1,EN,Len6,'FR','120'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '&', '1', 7Ch, 0, 0 ; 2 & 1
+ KeyDef 4, 0,0,0,0,0,0,0, 82h, '2', '@', 0, 0 ; 3 82h 2
+ KeyDef 4, 0,0,0,0,0,0,0, '"', '3', '#', 0, 0 ; 4 " 3
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '4', 0, 0, 0 ; 5 ' 4
+ KeyDef 4, 0,0,0,0,0,0,0, '(', '5', 0, 0, 0 ; 6 ( 5
+ KeyDef 4, 0,0,0,0,0,0,0, 0F5h, '6', '^', 0, 0 ; 7  6
+ KeyDef 4, 0,0,0,0,0,0,0, 8Ah, '7', 0, 0, 0 ; 8 8Ah 7
+ KeyDef 4, 0,0,0,0,0,0,0, '!', '8', 0, 0, 0 ; 9 _ 8
+ KeyDef 4, 0,0,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, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'^',26,27,26,0,26,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <0EFh,40,0,0,0,40,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',0B5h,'E',90h,'I',0D6h,'O',0E0h,'U',0E9h,'y',0ECh,'Y',0EDh,' ',0EFh>
+
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'~',53,0,0,0,53,'a',0C6h,'o',0E4h,'n',0A4h,'A',0C7h,'O',0E5h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len6 EQU $ - _Ow2FR850011
+
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/grkbd.asm b/private/os2/os2ses/i386/grkbd.asm
new file mode 100644
index 000000000..eb4101961
--- /dev/null
+++ b/private/os2/os2ses/i386/grkbd.asm
@@ -0,0 +1,768 @@
+;; SCCSID = @(#)grkbd.asm 12.1 88/03/18
+ Page 58,132
+ Title GRKBD - Translate Table Structure for CP/DOS 1.1
+ Name GRKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: GRKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Germany *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK GRKBD; **
+;** RELOC GRKBD.EXE GRKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+ db 7,8,9,-1
+ db 4,5,6,-1
+
+Public _Ow2GR437001 ;***************
+_Ow2GR437001 Label Byte ;Beginning of the table. GR 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,1,0,0,AT,Len1,'GR','129'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 15h, 0, 0, 0 ; 4 3 15h
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 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,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2GR437001
+
+;******************************************************************************
+
+Public _Ow2GR437011 ;***************
+_Ow2GR437011 Label Byte ;Beginning of the table. GR 437 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,1,1,0,1,0,0,EN,Len2,'GR','129'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,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'
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2GR437011
+
+;******************************************************************************
+
+Public _Ow2GR850000 ;***************
+_Ow2GR850000 Label Byte ;Beginning of the table. GR 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,1,0,0,AT,Len3,'GR','129'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3',0F5h, 0, 0, 0 ; 4 3 F5h
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', 0, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', 0, 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, 0E1h, '?', 0, 0, 0 ; 12 E1h ?
+ KeyDef 11, 0,0,0,0,0,0,0, 1, 2, 0, 0, 1 ; 13 (accents)
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1,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,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0EFh,13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',0B5h,'E',90h,'I',0D6h,'O',0E0h,'U',0E9h,' ',0EFh>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2GR850000
+
+;******************************************************************************
+
+Public _Ow2GR850010 ;***************
+_Ow2GR850010 Label Byte ;Beginning of the table. GR 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,1,0,0,1,0,0,EN,Len4,'GR','129'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"',0FDh, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3',0F5h,0FCh, 0, 0 ; 4 3 F5h
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', ']', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,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 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0EFh,13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',0B5h,'E',90h,'I',0D6h,'O',0E0h,'U',0E9h,' ',0EFh>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2GR850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/itkbd.asm b/private/os2/os2ses/i386/itkbd.asm
new file mode 100644
index 000000000..3d77bb37e
--- /dev/null
+++ b/private/os2/os2ses/i386/itkbd.asm
@@ -0,0 +1,1127 @@
+; SCCSID = @(#)itkbd.asm 12.1 88/03/18
+ Page 58,132
+ Title ITKBD - Translate Table Structure for CP/DOS 1.1
+ Name ITKBD
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: ITKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Italy *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Changes: *
+;* *
+;* wak (10/9/87) - corrected EN,850,141 && PTM 802 *
+;* lt (10/9/87) - changed decimal point to comma on DEL key *
+;* for 142 layout && PTM 883 *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK ITKBD; **
+;** RELOC ITKBD.EXE ITKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+ db 4,5,6,-1
+ db 1,2,3
+
+Public _Ow2IT437001 ;***************
+_Ow2IT437001 Label Byte ;Beginning of the table. IT 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,1,AT,Len1,'IT','141'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', 0, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0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113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2IT437001
+
+;****************************************************************************
+
+Public _Ow2IT437011 ;***************
+_Ow2IT437011 Label Byte ;Beginning of the table. IT 437 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,0,0,1,EN,Len2,'IT','141'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 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, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2IT437011
+
+
+;****************************************************************************
+
+Public _Ow2IT437111 ;***********************
+_Ow2IT437111 Label Byte ;Beginning of the table. IT 437 EN Kbd New Std
+ ;***********************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,0,0,1,EN,Len3,'IT','142'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, '#', 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 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0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 67 F9
+ KeyDef 6, 0,0,0,0,0,0,0, 10, 0, 0, 0, 0 ; 68 F10
+ KeyDef 15, 0,0,0,0,0,0,0, 20h, 20h, 20h, 0, 0 ; 69 NumLock
+ KeyDef 17, 0,0,0,0,0,0,0, 10h, 10h, 10h, 0, 0 ; 70 ScrollLock
+ KeyDef 7, 0,0,0,0,0,0,0, 0, '7', 0, 0, 0 ; 71 Home 7
+ KeyDef 7, 0,0,0,0,0,0,0, 1, '8', 0, 0, 0 ; 72 'Up' 8
+ KeyDef 7, 0,0,0,0,0,0,0, 2, '9', 0, 0, 0 ; 73 PgUp 9
+ KeyDef 7, 0,0,0,0,0,0,0, 3, '-', 0, 0, 0 ; 74 - (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 4, '4', 0, 0, 0 ; 75 'Left'4
+ KeyDef 7, 0,0,0,0,0,0,0, 5, '5', 0, 0, 0 ; 76 5
+ KeyDef 7, 0,0,0,0,0,0,0, 6, '6', 0, 0, 0 ; 77'Right'6
+ KeyDef 7, 0,0,0,0,0,0,0, 7, '+', 0, 0, 0 ; 78 + (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 8, '1', 0, 0, 0 ; 79 End 1
+ KeyDef 7, 0,0,0,0,0,0,0, 9, '2', 0, 0, 0 ; 80 'Down'2
+ KeyDef 7, 0,0,0,0,0,0,0, 10, '3', 0, 0, 0 ; 81 PgDn 3
+ KeyDef 7, 0,0,0,0,0,0,0, 11, '0', 0, 0, 0 ; 82 Ins 0
+ KeyDef 7, 0,0,0,0,0,0,0, 12, ',', 0, 0, 0 ; 83 Del .
+ KeyDef 10, 0,0,0,0,0,0,0, 0, 80h, 80h, 0, 0 ; 84 SysReq
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 85 (undefined)
+ KeyDef 2, 0,0,0,0,0,0,0, '<', '>', 0, 0, 0 ; 86 < >
+ KeyDef 6, 0,0,0,0,0,0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ef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <> ; Grave accent (see scan code 43)
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2IT437111
+
+
+;****************************************************************************
+
+Public _Ow2IT850000 ;***************
+_Ow2IT850000 Label Byte ;Beginning of the table. IT 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,0,0,1,AT,Len4,'IT','141'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0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"AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2IT850000
+
+;****************************************************************************
+
+Public _Ow2IT850010 ;***************
+_Ow2IT850010 Label Byte ;Beginning of the table. IT 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,0,0,1,EN,Len5,'IT','141'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,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KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <> ; Grave accent (see scan code 43)
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len5 EQU $ - _Ow2IT850010
+
+
+;****************************************************************************
+
+Public _Ow2IT850011 ;***********************
+_Ow2IT850011 Label Byte ;Beginning of the table. IT 850 EN Kbd New Std
+ ;***********************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,0,0,1,EN,Len6,'IT','142'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, '#', 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', ']', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', '}', 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '?', 0, 0, 0 ; 12 ' ?
+ KeyDef 4, 0,0,0,0,0,0,0, 8Dh, '^', 0, 0, 0 ; 13 8Dh ^
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', '@', 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 0,0,0,0,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 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,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len6 EQU $ - _Ow2IT850011
+
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/jpkbd.asm b/private/os2/os2ses/i386/jpkbd.asm
new file mode 100644
index 000000000..a5e54c118
--- /dev/null
+++ b/private/os2/os2ses/i386/jpkbd.asm
@@ -0,0 +1,1482 @@
+;; SCCSID = @(#)jpkbd.asm 5.3 88/08/03
+; Page 58,132
+
+; Feb.28 : KazuM
+; MS OS/2-J BAK Final version
+
+ Title JPKBD - Translate Table Structure for OS/2 1.1
+ Name JPKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: JPKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Japan. *
+;* *
+;* Status: OS/2 Version 1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Changes: *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK JPKBD; **
+;** RELOC JPKBD.EXE JPKBD.TBL **
+;** **
+;***********************************************************************
+
+ifdef JAPAN
+.386p ; V-AkihiS
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+Public _Ow2JP932011AX ;******
+_Ow2JP932011AX Label Byte ;Begging of the table. JP 932 AX Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 932,0,0,0,0,1,0,0,0,0,JP_OEM,Len1,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 27, 27 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 'Ç', 'Ç' ; 2 1 ! Ç
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 'Ì', 'Ì' ; 3 2 @ Ì
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, '±', '§' ; 4 3 # ± §
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, '³', '©' ; 5 4 $ ³ ©
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, '´', 'ª' ; 6 5 % ´ ª
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 'µ', '«' ; 7 6 ^ µ «
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 'Ô', '¬' ; 8 7 & Ô ¬
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 'Õ', '­' ; 9 8 * Õ ­
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 'Ö', '®' ; 10 9 ( Ö ®
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 'Ü', '¦' ; 11 0 ) Ü ¦
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 'Î', 'Î' ; 12 - _ Î
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+', 0, 'Í', 'Í' ; 13 = + Í
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 8, 127 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 9, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 'À', 'À' ; 16 q Q À
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 'Ã', 'Ã' ; 17 w W Ã
+ KeyDef 1, 0,0,0,0,0,0,0, 'e', 'E', 0, '²', '¨' ; 18 e E ² ¨
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, '½', '½' ; 19 r R ½
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, '¶', '¶' ; 20 t T ¶
+ KeyDef 1, 0,0,0,0,0,0,0, 'y', 'Y', 0, 'Ý', 'Ý' ; 21 y Y Ý
+ KeyDef 1, 0,0,0,0,0,0,0, 'u', 'U', 0, 'Å', 'Å' ; 22 u U Å
+ KeyDef 1, 0,0,0,0,0,0,0, 'i', 'I', 0, 'Æ', 'Æ' ; 23 i I Æ
+ KeyDef 1, 0,0,0,0,0,0,0, 'o', 'O', 0, '×', '×' ; 24 o O ×
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, '¾', '¾' ; 25 p P ¾
+ KeyDef 4, 0,0,0,0,0,0,0, '[', '{', 0, 'Þ', 'Þ' ; 26 [ { Þ
+ KeyDef 4, 0,0,0,0,0,0,0, ']', '}', 0, 'ß', '¢' ; 27 ] } ß ¢
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 13, 10 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 0,0,0,0,0,0,0, 'a', 'A', 0, 'Á', 'Á' ; 30 a A Á
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 'Ä', 'Ä' ; 31 s S Ä
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, '¼', '¼' ; 32 d D ¼
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 'Ê', 'Ê' ; 33 f F Ê
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, '·', '·' ; 34 g G ·
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, '¸', '¸' ; 35 h H ¸
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 'Ï', 'Ï' ; 36 j J Ï
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 'É', 'É' ; 37 k K É
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 'Ø', 'Ø' ; 38 l L Ø
+ KeyDef 4, 0,0,0,0,0,0,0, ';', ':', 0, 'Ú', 'Ú' ; 39 ; : Ú
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '"', 0, '¹', '¹' ; 40 ' " ¹
+ KeyDef 4, 0,0,0,0,0,0,0, '`', '~', 0, 'Ñ', '£' ; 41 ` ~ Ñ £
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, '\', '|', 0, '°', '°' ; 43 \ | °
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 'Â', '¯' ; 44 z Z Â ¯
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, '»', '»' ; 45 x X »
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, '¿', '¿' ; 46 c C ¿
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 'Ë', 'Ë' ; 47 v V Ë
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 'º', 'º' ; 48 b B º
+ KeyDef 1, 0,0,0,0,0,0,0, 'n', 'N', 0, 'Ð', 'Ð' ; 49 n N Ð
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 'Ó', 'Ó' ; 50 m M Ó
+ KeyDef 4, 0,0,0,0,0,0,0, ',', '<', 0, 'È', '¤' ; 51 , < È
+ KeyDef 4, 0,0,0,0,0,0,0, '.', '>', 0, 'Ù', '¡' ; 52 . > Ù ¡
+ KeyDef 4, 0,0,0,0,0,0,0, '/', '?', 0, 'Ò', '¥' ; 53 / ? Ò ¥
+ KeyDef 12, 0,0,0,0,0,0,0, 1, 0, 0, 0, 0 ; 54 Shift(R)
+ KeyDef 9, 0,0,0,0,0,0,0, '*', 114, 0, 0, 0 ; 55 * PrtSc
+ KeyDef 14, 0,0,0,0,0,0,0, 8, 2, 8, 0, 0 ; 56 Alt
+ KeyDef 4, 0,0,0,0,0,0,0, ' ', ' ', 0, ' ', ' ' ; 57 Space
+ KeyDef 16, 0,0,0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, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 21, 0,0,0,0,0,0,0, 0a7h,0a8h,0a9h,0aah, 0 ; 121 henkan
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 (undefined)
+ KeyDef 21, 0,0,0,0,0,0,0, 0abh,0ach,0adh,0aeh, 0 ; 123 mu-henkan
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 (undefined)
+ KeyDef 21, 0,0,0,0,0,0,0, 03ah,03ah, 0, 0, 0 ; 125 3xBox Kanji
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 (undefined)
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2JP932011AX
+
+;******************************************************************************
+
+Public _Ow2JP437011AX ;******
+_Ow2JP437011AX Label Byte ;Beginning of the table. JP 437 AX Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,0,JP_OEM,Len2,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 0, 0 ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_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; 115 \ | Kana RO
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 (undefined)
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 4, 0,0,0,0,0,0,0, ' ', ' ', 0, 0, 0 ; 121 Space (Xfer)
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 (undefined)
+ KeyDef 4, 0,0,0,0,0,0,0, ' ', ' ', 0, 0, 0 ; 123 Space (Nfer)
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 (undefined)
+ KeyDef 21, 0,0,0,0,0,0,0, 03ah,03ah, 0, 0, 0 ; 125 3xBox Kanji
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 (undefined)
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2JP437011AX
+
+;*****************************************************************************
+
+
+Public _Ow2JP932011IBM101 ;******
+_Ow2JP932011IBM101 Label Byte ;Begging of the table. JP 932 101 Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 932,0,0,0,0,1,0,0,0,0,JP_OEM,Len3,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 27, 27 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 'Ç', 'Ç' ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 'Ì', 'Ì' ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, '±', '§' ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, '³', '©' ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, '´', 'ª' ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 'µ', '«' ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 'Ô', '¬' ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 'Õ', '­' ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 'Ö', '®' ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 'Ü', '¦' ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 'Î', 'Î' ; 12 - _
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+', 0, 'Í', 'Í' ; 13 = +
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 8, 127 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 9, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 'À', 'À' ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 'Ã', 'Ã' ; 17 w W
+ KeyDef 1, 0,0,0,0,0,0,0, 'e', 'E', 0, '²', '¨' ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, '½', '½' ; 19 r R
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, '¶', '¶' ; 20 t T
+ KeyDef 1, 0,0,0,0,0,0,0, 'y', 'Y', 0, 'Ý', 'Ý' ; 21 y Y
+ KeyDef 1, 0,0,0,0,0,0,0, 'u', 'U', 0, 'Å', 'Å' ; 22 u U
+ KeyDef 1, 0,0,0,0,0,0,0, 'i', 'I', 0, 'Æ', 'Æ' ; 23 i I
+ KeyDef 1, 0,0,0,0,0,0,0, 'o', 'O', 0, '×', '×' ; 24 o O
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, '¾', '¾' ; 25 p P
+ KeyDef 4, 0,0,0,0,0,0,0, '[', '{', 0, 'Þ', 'Þ' ; 26 [ {
+ KeyDef 4, 0,0,0,0,0,0,0, ']', '}', 0, 'ß', '¢' ; 27 ] }
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 13, 10 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 0,0,0,0,0,0,0, 'a', 'A', 0, 'Á', 'Á' ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 'Ä', 'Ä' ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, '¼', '¼' ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 'Ê', 'Ê' ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, '·', '·' ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, '¸', '¸' ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 'Ï', 'Ï' ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 'É', 'É' ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 'Ø', 'Ø' ; 38 l L
+ KeyDef 4, 0,0,0,0,0,0,0, ';', ':', 0, 'Ú', 'Ú' ; 39 ; :
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '"', 0, '¹', '¹' ; 40 ' "
+ KeyDef 4, 0,0,0,0,0,0,0, '`', '~', 0, 'Ñ', '£' ; 41 ` ~
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, '\', '|', 0, '°', '°' ; 43 \ |
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 'Â', '¯' ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, '»', '»' ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, '¿', '¿' ; 46 c C
+ KeyDef 1, 0,0,0,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0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2JP932011IBM101
+
+;*****************************************************************************
+
+
+Public _Ow2JP437011IBM101 ;******
+_Ow2JP437011IBM101 Label Byte ;Beginning of the table. JP 437 101 Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 932,0,0,0,0,1,0,0,0,0,JP_OEM,Len4,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '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0,0,0,0,0, 0, 0, 0, 0, 0 ; 108 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2JP437011IBM101
+
+;*****************************************************************************
+
+
+Public _Ow2JP932011IBM002 ;******
+_Ow2JP932011IBM002 Label Byte ;Begging of the table. JP 932 IBM02 Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 932,0,0,0,0,1,0,0,0,0,JP_OEM,Len5,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 27, 27 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 'Ç', 'Ç' ; 2 1 ! Ç
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 'Ì', 'Ì' ; 3 2 " Ì
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, '±', '§' ; 4 3 # ± §
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, '³', '©' ; 5 4 $ ³ ©
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, '´', 'ª' ; 6 5 % ´ ª
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 'µ', '«' ; 7 6 & µ «
+ KeyDef 4, 0,0,0,0,0,0,0, '7', "'", 0, 'Ô', '¬' ; 8 7 ' Ô ¬
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 'Õ', '­' ; 9 8 ( Õ ­
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 'Ö', '®' ; 10 9 ) Ö ®
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '~', 0, 'Ü', '¦' ; 11 0 ~ Ü ¦
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '=', 0, 'Î', 'Î' ; 12 - = Î
+ KeyDef 4, 0,0,0,0,0,0,0, '^', '_', 0, 'Í', 'Í' ; 13 ^ _ Í
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 8, 127 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 9, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 'À', 'À' ; 16 q Q À
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 'Ã', 'Ã' ; 17 w W Ã
+ KeyDef 1, 0,0,0,0,0,0,0, 'e', 'E', 0, '²', '¨' ; 18 e E ² ¨
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, '½', '½' ; 19 r R ½
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, '¶', '¶' ; 20 t T ¶
+ KeyDef 1, 0,0,0,0,0,0,0, 'y', 'Y', 0, 'Ý', 'Ý' ; 21 y Y Ý
+ KeyDef 1, 0,0,0,0,0,0,0, 'u', 'U', 0, 'Å', 'Å' ; 22 u U Å
+ KeyDef 1, 0,0,0,0,0,0,0, 'i', 'I', 0, 'Æ', 'Æ' ; 23 i I Æ
+ KeyDef 1, 0,0,0,0,0,0,0, 'o', 'O', 0, '×', '×' ; 24 o O ×
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, '¾', '¾' ; 25 p P ¾
+ KeyDef 4, 0,0,0,0,0,0,0, '[', '{', 0, 'ß', '¢' ; 26 [ { ß ¢
+ KeyDef 4, 0,0,0,0,0,0,0, ']', '}', 0, 'Ñ', '£' ; 27 ] } Ñ £
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 13, 10 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 0,0,0,0,0,0,0, 'a', 'A', 0, 'Á', 'Á' ; 30 a A Á
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 'Ä', 'Ä' ; 31 s S Ä
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, '¼', '¼' ; 32 d D ¼
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 'Ê', 'Ê' ; 33 f F Ê
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, '·', '·' ; 34 g G ·
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, '¸', '¸' ; 35 h H ¸
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 'Ï', 'Ï' ; 36 j J Ï
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 'É', 'É' ; 37 k K É
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 'Ø', 'Ø' ; 38 l L Ø
+ KeyDef 4, 0,0,0,0,0,0,0, ';', '+', 0, 'Ú', 'Ú' ; 39 ; + Ú
+ KeyDef 4, 0,0,0,0,0,0,0, ":", '*', 0, '¹', '¹' ; 40 : * ¹
+ KeyDef 4, 0,0,0,0,0,0,0, '@', '`', 0, 'Þ', 'Þ' ; 41 @ ` Þ
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, '\', '|', 0, '°', '°' ; 43 \ | °
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 'Â', '¯' ; 44 z Z Â ¯
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, '»', '»' ; 45 x X »
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, '¿', '¿' ; 46 c C ¿
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 'Ë', 'Ë' ; 47 v V Ë
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 'º', 'º' ; 48 b B º
+ KeyDef 1, 0,0,0,0,0,0,0, 'n', 'N', 0, 'Ð', 'Ð' ; 49 n N Ð
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 'Ó', 'Ó' ; 50 m M Ó
+ KeyDef 4, 0,0,0,0,0,0,0, ',', '<', 0, 'È', '¤' ; 51 , < È
+ KeyDef 4, 0,0,0,0,0,0,0, '.', '>', 0, 'Ù', '¡' ; 52 . > Ù ¡
+ KeyDef 4, 0,0,0,0,0,0,0, '/', '?', 0, 'Ò', '¥' ; 53 / ? Ò ¥
+ KeyDef 12, 0,0,0,0,0,0,0, 1, 0, 0, 0, 0 ; 54 Shift(R)
+ KeyDef 9, 0,0,0,0,0,0,0, '*', 114, 0, 0, 0 ; 55 * PrtSc
+ KeyDef 14, 0,0,0,0,0,0,0, 8, 2, 8, 0, 0 ; 56 Alt
+ KeyDef 4, 0,0,0,0,0,0,0, ' ', ' ', 0, ' ', ' ' ;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
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len5 EQU $ - _Ow2JP932011IBM002
+
+;*****************************************************************************
+
+Public _Ow2JP437011IBM002 ;******
+_Ow2JP437011IBM002 Label Byte ;Begging of the table. JP 437 IBM02 Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,0,JP_OEM,Len6,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', "'", 0, 0, 0 ; 8 7 '
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '~', 0, 0, 0 ; 11 0 ~
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '=', 0, 0, 0 ; 12 - =
+ KeyDef 4, 0,0,0,0,0,0,0, '^', '_', 0, 0, 0 ; 13 ^ _
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 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, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len6 EQU $ - _Ow2JP437011IBM002
+
+;*****************************************************************************
+
+Public _Ow2JP932011IBMA01 ;******
+_Ow2JP932011IBMA01 Label Byte ;Begging of the table. JP 932 106 Kbd
+ ;****************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 932,0,0,0,0,1,0,0,0,0,JP_OEM,Len7,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 27, 27 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 'Ç', 'Ç' ; 2 1 ! Ç
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 'Ì', 'Ì' ; 3 2 " Ì
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, '±', '§' ; 4 3 # ± §
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, '³', '©' ; 5 4 $ ³ ©
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, '´', 'ª' ; 6 5 % ´ ª
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 'µ', '«' ; 7 6 & µ «
+ KeyDef 4, 0,0,0,0,0,0,0, '7', "'", 0, 'Ô', '¬' ; 8 7 ' Ô ¬
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 'Õ', '­' ; 9 8 ( Õ ­
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 'Ö', '®' ; 10 9 ) Ö ®
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '~', 0, 'Ü', '¦' ; 11 0 ~ Ü ¦
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '=', 0, 'Î', 'Î' ; 12 - = Î
+ KeyDef 4, 0,0,0,0,0,0,0, '^', '_', 0, 'Í', 'Í' ; 13 ^ _ Í
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 8, 127 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 9, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 'À', 'À' ; 16 q Q À
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 'Ã', 'Ã' ; 17 w W Ã
+ KeyDef 1, 0,0,0,0,0,0,0, 'e', 'E', 0, '²', '¨' ; 18 e E ² ¨
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, '½', '½' ; 19 r R ½
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, '¶', '¶' ; 20 t T ¶
+ KeyDef 1, 0,0,0,0,0,0,0, 'y', 'Y', 0, 'Ý', 'Ý' ; 21 y Y Ý
+ KeyDef 1, 0,0,0,0,0,0,0, 'u', 'U', 0, 'Å', 'Å' ; 22 u U Å
+ KeyDef 1, 0,0,0,0,0,0,0, 'i', 'I', 0, 'Æ', 'Æ' ; 23 i I Æ
+ KeyDef 1, 0,0,0,0,0,0,0, 'o', 'O', 0, '×', '×' ; 24 o O ×
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, '¾', '¾' ; 25 p P ¾
+ KeyDef 4, 0,0,0,0,0,0,0, '@', '`', 0, 'Þ', 'Þ' ; 26 @ ` Þ
+ KeyDef 4, 0,0,0,0,0,0,0, '[', '{', 0, 'ß', '¢' ; 27 [ { ß ¢
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 13, 10 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 0,0,0,0,0,0,0, 'a', 'A', 0, 'Á', 'Á' ; 30 a A Á
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 'Ä', 'Ä' ; 31 s S Ä
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, '¼', '¼' ; 32 d D ¼
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 'Ê', 'Ê' ; 33 f F Ê
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, '·', '·' ; 34 g G ·
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, '¸', '¸' ; 35 h H ¸
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 'Ï', 'Ï' ; 36 j J Ï
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 'É', 'É' ; 37 k K É
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 'Ø', 'Ø' ; 38 l L Ø
+ KeyDef 4, 0,0,0,0,0,0,0, ';', '+', 0, 'Ú', 'Ú' ; 39 ; + Ú
+ KeyDef 4, 0,0,0,0,0,0,0, ":", '*', 0, '¹', '¹' ; 40 : * ¹
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 41 (undefined)
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, ']', '}', 0, 'Ñ', '£' ; 43 ] } Ñ £
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 'Â', '¯' ; 44 z Z Â ¯
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, '»', '»' ; 45 x X »
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, '¿', '¿' ; 46 c C ¿
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 'Ë', 'Ë' ; 47 v V Ë
+ KeyD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 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 4, 0,0,0,0,0,0,0, '\', '_', 0, 'Û', 'Û' ; 115 \ _ Û
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 (undefined)
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 4, 0,0,0,0,0,0,0, '\', '|', 0, '°', '°' ; 125 \ | °
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len7 EQU $ - _Ow2JP932011IBMA01
+
+;*****************************************************************************
+
+Public _Ow2JP437011IBMA01 ;******
+_Ow2JP437011IBMA01 Label Byte ;Begging of the table. JP 437 106 Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+; cp a b c d e f g h i kb l cc cs oem id oem key
+; | | | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,0,JP_OEM,Len8,'JP','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0,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c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len8 EQU $ - _Ow2JP437011IBMA01
+
+_TEXT ends
+endif
+ END
diff --git a/private/os2/os2ses/i386/kbdxlat.asm b/private/os2/os2ses/i386/kbdxlat.asm
new file mode 100644
index 000000000..5f282b9be
--- /dev/null
+++ b/private/os2/os2ses/i386/kbdxlat.asm
@@ -0,0 +1,2470 @@
+; SCCSID = @(#)kbdxlat.asm 12.21 89/07/25
+;OS2SS- Page 58,132
+
+;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+;$$
+;$$ Module: kbdxlat.asm Version: 1.2 ABIOS
+;$$
+;$$ History: This module was derived from the 1.2 AT source code.
+;$$ ABIOS changes were made according to the deltas between
+;$$ the 1.1 ABIOS and 1.1 AT drivers. The 1.1 ABIOS driver
+;$$ was done by John Nels Fuller (Wyse). The 1.2 ABIOS
+;$$ driver was done by Alan J. Cotterman (NCR).
+;$$
+;$$ Notes: Wherever possible the original 1.2 AT code is preserved.
+;$$ All changes are marked with ";$$".
+;$$
+;$$ The only modification to this module is in testing for
+;$$ keyboard type. References to "IDFlags" have been
+;$$ replaced with tests of the contents of "KbdHWIDs".
+;$$
+;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+
+ Title KBDXLAT - Translation Process
+ Name KBDXLAT
+;***********************************************************************
+;** **
+;** Keyboard Device Driver Scan Code Translation **
+;** **
+;** **
+;** This file contains the scan code to character translation process **
+;** code. The code in this file is only called once by KBDDD and is **
+;** not accessed by anyone else. So the entire translation process **
+;** can be replaced by replacing the routine in this file. The data **
+;** that is only used by the code in this file is in the file **
+;** KBDXDATA.ASM and it too would be replaced if this code is to be **
+;** replaced. **
+;** **
+;** 6/22/93 MJarus line with os2ss were modified by os2ss. **
+;***********************************************************************
+.386p ;OS2SS-.286
+.sall
+.xcref
+;@@ The following files are included, but xlist'd out:
+
+.xlist
+ Include struc.inc ;Structured assembly macros.
+ Include kbddd.inc ;Keyboard Device Driver structures & equates.
+ Include kbdxlat.inc ;Translation structures & equates.
+.list
+
+ Extrn _Ow2MiscFlags:Byte ; 704,747,771,931,1188 (EnhancedKbd)
+ Extrn _Ow2MiscFlags3:Byte ; 1089,1154,1166,...(AltPacket SecAltNumPad PauseLatch E0Packet)
+ Extrn _Ow2KCBShFlgs:Word ; 2299
+ Extrn _Ow2KbdHWIDs:Word ;$$ Extrn IDFlags:Word
+ ;Extrn OtherFlags:Byte ; (Test OtherFlags,InterruptTime) moved to [EDI]
+ ;Extrn AltTable:Byte ; 275
+ ;Extrn AltPadMap:Byte ; 562
+ ;Extrn CtlPadMap:Byte ; 601
+ ;Extrn NewExtSC:Byte ; only CheckExtended()
+ ;Extrn NewExtSCLen:ABS ; only CheckExtended()
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+AltPadMap Label Byte
+ db 7,8,9,-1
+ db 4,5,6,-1
+ db 1,2,3
+ db 0,-1
+
+CtlPadMap Label Byte
+; db 119,-1,132,-1
+; db 115,-1,116,-1
+; db 117,-1,118
+; db -1,-1
+ db 119,141,132,142 ;@@ Keypad 7, 8, 9, - (PTM 5024)
+ db 115,143,116,144 ;@@ Keypad 4, 5, 6, + (PTM 5024)
+ db 117,145,118 ;@@ Keypad 1, 2, 3 (PTM 5024)
+ db 146,147 ;@@ Keypad 0, . (PTM 5024)
+
+;*****
+;* Translation for keypresses on AlphaKeys with Alt pressed. This
+;* translation is ALWAYS indexed by the Char1 value less 96 (which
+;* is ascii "a"). The translation value is the scan code that
+;* would come in on a regular PC keyboard (or PC/AT keyboard in
+;* compatability mode).
+;*****
+AltTable Label Byte
+; a, b, c, d, e, f, g, h, i, j, k, l, m
+ db 30,48,46,32,18,33,34,35,23,36,37,38,50 ;
+; n, o, p, q, r, s, t, u, v, w, x, y, z
+ db 49,24,25,16,19,31,20,22,47,17,45,21,44 ;
+
+NewExtSC LABEL BYTE
+
+;@@ ALT+
+;@@ [ ] ; ' ` \ , . / Tab
+ db 1Ah,1Bh,27h,28h,29h,2Bh,33h,34h,35h,0Fh
+
+NewExtSCLen equ $-NewExtSC ;@@ Used by interrupt handler.
+
+Even ;Make sure we're an even number of bytes. *
+; *
+; *
+;*** END OF THE TRANSLATION TABLE **********************************
+
+
+;OS2SS-...
+; ULONG
+; Ow2KbdXlate(
+; ULONG ScanCode,
+; PKBD_XLATE_VARS pFlagArea,
+; PKBD_MON_PACKAGE pMonitorPack,
+; PVOID pTransTable
+; );
+
+Public _Ow2KbdXlate@16
+_Ow2KbdXlate@16 Proc ;------------------------------------------------------\
+
+ push ebp
+ mov ebp,esp
+ sub esp,8 ; for local arguments
+ push ebx
+ push ecx
+ push edx
+ push edi
+ push esi
+
+;
+; now:
+;
+; ebp-8 Pointer to DD of XlateTable entry for this scan code.
+; ebp-4 Pointer to DD holding Offset of top of XlateTable
+;
+; ebp+0 old ebp
+; ebp+4 Return Address
+; ebp+8 ScanCode
+; ebp+12 pFlagArea
+; ebp+16 pMonitorPack
+; ebp+20 pTransTable
+;
+
+ mov eax, [ebp+8]
+ mov edi, [ebp+12]
+ mov esi, [ebp+16]
+ mov ebx, [ebp+20]
+; cmp ebx,0
+; jnz HaveTable
+; ; if no translate table
+; mov ebx,Offset XlateTable ; set the default one
+;
+;HaveTable:
+ call KbdXlate
+ mov al,0 ; Error ?
+ jnc EndXlate ; yes - no packet
+ test [esi].DDFlags,MultiMake
+ jnz EndXlate ; ignore multiple make of toggle key
+ test [edi].XPSGFlags, PrevAccent
+ jnz EndXlate ; ignore accent char till next keystroke
+ mov ah,byte ptr [esi].DDFlags
+ and ah,KeyTypeMask
+ cmp ah,UndefKey ; Is this key undefined?
+ je EndXlate ; yes - ignore
+ cmp byte Ptr [esi+KeyPacketLen].MonFlags,-1 ; do we have two packets?
+ mov al,1 ; assume not
+ jnz EndXlate
+ mov al,2 ; 2 packets
+
+EndXlate:
+ and eax,0FFh ; returns in al number of packets
+ pop esi
+ pop edi
+ pop edx
+ pop ecx
+ pop ebx
+ mov esp,ebp
+ pop ebp
+ ret 16
+
+_Ow2KbdXlate@16 Endp ;-------------------------------------------------------/
+
+KbdXlate Proc ;------------------------------------------------------\
+
+;***********************************************************************
+;* *
+;* Subroutine Name: KbdXlate *
+;* *
+;* Descriptive Name: Keyboard Scan Code Translation *
+;* *
+;* Function: This routine translates the scan code received from *
+;* the keyboard and places it in the Monitor Key Packet. *
+;* It also sets all flags that are based on the scan code *
+;* received. *
+;* *
+;* Entry Point: KbdXlate Linkage: Near *
+;* *
+;* Input: AL=Raw Scan Code EDI = Ptr to translation flag area *
+;* ESI = Ptr to Monitor KeyPacket *
+;* EBX = Ptr to Translate Table *
+;* *
+;* Exit-Normal: Monitor Key Packet filled in *
+;* AL=Raw scan code if translation successful *
+;* *
+;* Exit-Error: If found a break of a shift key that had seen no *
+;* make, returns 0 and CX hold the unexpected shift bits. *
+;* *
+;* Effects: All regs except SI, DI and the Seg regs may be altered *
+;* Key Packet filled in *
+;* *
+;* Internal References: *
+;* Routines: UnPauseChk *
+;* AccCheckout *
+;* *
+;* External References: *
+;* Routines: None. *
+;* *
+;* *
+;***********************************************************************
+ Or Byte Ptr [ESI].MonFlags,NotInserted ;OS2SS-Key isn't monitor inserted.
+ And [EDI].XlateFlags,Not NormalAlt ;OS2SS-@@ Turn flag off to start
+ Mov AH,AL ;Copy scan code into AH
+ Or AH,AH ;Check if key break bit in
+ .If <s> ;If it is
+ Or [ESI].DDFlags,KeyBreak ;OS2SS-Set Flag
+ And AH,Not BreakBit ;Clear the break bit from the scan code
+ .Endif ;Endif key break bit on
+
+ Mov DL,AL ;OS2SS-Now calculate...
+ And EDX,07Fh ;OS2SS-...the index into...
+ Dec EDX ;OS2SS- ...XlateTable for...
+ IMul EDX,KDefLen ;OS2SS- ...this scan code.
+ Add EDX,KDefs ;OS2SS-Point past header to keydefs.
+ Add EDX,EBX ;OS2SS-Add offset into table.
+ Mov [EBP-8],EDX ;OS2SS-Save Pointer to XlateTable entry for this scan code.
+ Mov [EBP-4],EBX ;OS2SS-Put table start offset on the stack.
+ Mov BX,[EDX].XlateOp ;OS2SS-Get Xlate Operation word.
+ And EBX,ActionMask ;OS2SS-Isolate translate action field.
+
+ Mov [ESI].Key.Scan,AH ;OS2SS-Put scan code in key packet
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-@@ Check if saw E0 prefix last time
+ .If <nz> ;If we did
+ Or [ESI].DDFlags,SecondaryKey ;OS2SS-@@ Indicate so.
+ ;@@ PTM 4359
+ .If <AL eq 53> ;@@ If this is '/' on Numpad
+ Test [ESI].Key.Shift,AltFlag ;OS2SS-@@ PTM 5024
+ .If <nz> ;@@ If ALT Key is down
+ Mov [ESI].Key.Scan,0A4h ;OS2SS-@@ Set extended scan code
+ .Else ;@@ Else no Alt down
+ Test [ESI].Key.Shift,CtlFlag ;OS2SS-@@ Check if Ctl key down
+ .If <nz> ;@@ If it is
+ Mov [ESI].Key.Scan,095h ;OS2SS-@@ Set extended scan code
+ .Else ;@@ Else no Alt or Ctl key down
+ Mov [ESI].Key.Char,'/' ;OS2SS-@@ then it is always '/' regardless
+ Mov [ESI].Key.Scan,OtherKey ;OS2SS-@@ and the scan code is EO
+ .Endif ;@@ Endif Ctl key down
+ .Endif ;@@ End PTM 5024
+ Jmp EndActionCase ;@@ of country/code page.
+ .Endif
+ .Endif
+
+ ;From now on, ES:EDX (;OS2SS-)points to the Xlate table entry. If running in
+ ;3xBox(;OS2SS-can't be), that pointer may have been created by a LOADALL, so don't
+ ;allow interrupts, nor change Seg Regs. Also, the beginning offset
+ ;of the translate table itself is on the top of stack.
+
+ Mov CX,Word Ptr [EDX+2] ;OS2SS-@@ Get Char1 and Char2 values.
+ Mov DX,[ESI].Key.Shift ;OS2SS-Get the current shift status from Key.
+
+ .If <BX ne 7> AND ;@@ If not a padkey clear possible Alt-nnn entry.
+ .If <BX ne 14> ;@@ Don't clear on Alt key, either.
+ Mov [EDI].XAltKeyPad,0 ;OS2SS-@@ Clear Alt-nnn entry.
+ .Endif
+ Mov AL,CL ;Copy Char1 for use later.
+ .If <BX gt MaxAct> ;@@ Was the action number too big?
+ Jmp NoXlate ;Yes, so don't try to translate.
+ .Endif
+ Shl BX,2 ;Make action number an offset.
+ Add EBX,Offset XJumpTable ;OS2SS-@@ Point to processor address.
+ Jmp [EBX] ;OS2SS-Go translate.
+
+ ;Following is the branch table for the various actions that
+ ;can be performed on a keystroke. Processing re-merges at the
+ ;bottom of this CASE structure, at label "EndActionCase".
+
+Public NoXlate, AlphaKey, SpecKey, SpecKeyC, SpecKeyA, SpecKeyCA
+Public FuncKey, PadKey, SpecCtlKey, PrtScr, SysReq, AccentKeyType
+Public ShiftKeys, ToggleKey, AltKey, NumLock, CapsLock, ScrollLock
+Public XShiftKey, XToggleKey, SpecKeyCS, SpecKeyAS
+Even
+XJumpTable:
+ dd NoXlate ;0 Invalid action code, no translate done.
+ dd AlphaKey ;1 Alphabetical character key.
+ dd SpecKey ;2 Special non-alpha key, no CAPSLOCK or ALT.
+ dd SpecKeyC ;3 Special non-alpha key, with CAPSLOCK.
+ dd SpecKeyA ;4 Special non-alpha key, with ALT.
+ dd SpecKeyCA ;5 Special non-alpha key, w/CAPSLOCK and ALT.
+ dd FuncKey ;6 Function keys.
+ dd PadKey ;7 Numeric keypad keys.
+ dd SpecCtlKey ;8 Keys that do special things with CTL.
+ dd PrtScr ;9 The print screen key.
+ dd SysReq ;A The system request key.
+ dd AccentKeyType ;B A key that affects the NEXT key (dead key).
+ dd ShiftKeys ;C The LSHIFT, RSHIFT, and CTL keys.
+ dd ToggleKey ;D General Toggle key.
+ dd AltKey ;E The ALT key.
+ dd NumLock ;F The NUMLOCK key.
+ dd CapsLock ;10 The CAPSLOCK key.
+ dd ScrollLock ;11 The SCROLL LOCK key.
+ dd XShiftKey ;12 Extended shift key (for DBCS use).
+ dd XToggleKey ;13 Extended toggle key (for DBCS use).
+ dd SpecKeyCS ;14 Special key for NLS support.
+ dd SpecKeyAS ;15 Special key for NLS support.
+
+; On entering the following routines, the following regs are set:
+;
+; CL = Char1 and CH = Char2 (both from XlateTable entry)
+; DX = ShiftFlags (same as in Key CharData record)
+; AL = Char1 also AH = Received scan code (Breakbit cleared)
+;OS2SS- ESI = Pointer to Key Packet
+;OS2SS- EDI = Pointer to current PSG
+;OS2SS- [EBP-8] = Pointer to XlateTable entry for this scan code.
+;OS2SS- [EBP-4] = Pointer to Offset of top of XlateTable
+;
+; Also, Key.Scan = AH and Key.Char = 0 on entry to the routines.
+
+AlphaKey: ;Alphabetical character key.
+ifdef JAPAN
+; MSKK Aug.15.1993 V-AkihiS
+; Support SBCS katakana
+ Test [ESI].Key.DShift, Katakana ;OS2SS Check if Katakana or not
+ .If <nz>
+ Mov EBX,[EBP-8] ;OS2SS-
+ Mov AL,[EBX].Char4 ;OS2SS-Get Char4 and Char5 values.
+ Mov CX,Word Ptr [EBX+5] ;OS2SS-
+ .Endif
+endif
+ Test DL,AltFlag ;Check if Alt key is pressed.
+ .If <nz> ;Is it?
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ Xor EBX,EBX ;OS2SS-Yes, so make Char1 an offset.
+ Mov BL,AL ;OS2SS-Now make it the base.
+ Mov AH,[AltTable+EBX-"a"] ;OS2SS-Fetch Alt-[] mapped code.
+ Mov [ESI].Key.Scan,AH ;OS2SS-Put in Key record.
+ Xor AL,AL ;Set `extended char' code.
+ .Endif
+ Jmp NewLbl1
+ .Endif ;OS2SS- (A2053)## Endif Alt is down.
+ ;OS2SS- .Else
+ Test DL,CtlFlag ;Else, check if Ctl key is pressed.
+ ;@@ for this KCB
+ ;@@ PTM 5992 - Begin
+ .If <nz> OR ;@@ Is it OR?
+ Test [EDI].XHotKeyShift,CtlFlag ;OS2SS-@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ .If <nz> ;&& translations are independent.
+ ;@@ PTM 5992 - End
+ ;Check limit on char1 value!
+ Sub AL,"a"-1 ;Yes, so convert Char1 to control code.
+ .If <CL eq 'c'> ;Is this Ctrl-C?
+ ;@@ Tell dd it's the PSUEDO-BREAK KEY.
+ Or [ESI].DDFlags,PSBreakKey ;OS2SS-
+ Jmp NoPauseCheck ;@@ Do not check if paused, Ctl-C
+ ;@@ has priority over resuming output
+ .ElseIf <CL eq 'p'> ;Is this Ctrl-P?
+ ;@@ Tell dd it's PSUEDO-PRTECHO KEY.
+ Or [ESI].DDFlags,PSPrintEchoKey ;OS2SS-
+ Jmp NoPauseCheck ;@@ Do not check if paused, Ctl-P
+ ;@@ has priority over resuming output
+ .ElseIf <CL eq 's'> ;Is this Ctrl-S?
+ ;1.3-## PTR b790266
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-1.3-## Make sure it isn't key break
+ .If <z> AND ;1.3-## If zero, then its a make
+ .If <[EDI].XInputMode eq 0> ;OS2SS-@@ Right, are we in cooked mode?
+ ;@@ Yes, tell dd it's PSUEDO-PAUSE KEY.
+ Or [ESI].DDFlags,PSPauseKey ;OS2SS-
+ .Endif
+ .Endif
+ .Else ;Check for regular shifts/capslock.
+ifdef JAPAN
+; MSKK Aug.15.1993 V-AkihiS
+; When Mode is katakana, CapsLock has no affect on this key.
+ Test [ESI].Key.DShift, Katakana ;OS2SS Check if Katakana or not
+ .If <nz> ;OS2SS
+ Mov BL,0 ;OS2SS indicate that CapsTogl has no
+ ;OS2SS affect on this key.
+ .Else
+ Mov BL, CapsTogl ;OS2SS Set indicator that CapsLock and
+ ;OS2SS ShiftLock affect key.
+ .Endif
+else
+ Mov BL, CapsTogl ;## Set indicator that CapsLock and
+ ;## ShiftLock affect key.
+endif
+ Call CapsCheck ;## Determine the shifting of the char.
+ .Endif ;## Endif Ctrl or Interrupt time.
+ ;OS2SS- .Endif ;## Endif Alt is down.
+NewLbl1: ;OS2SS-
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+
+NoPauseCheck:
+ Mov [ESI].Key.Char,AL ;OS2SS-Put xlated character into Key rec.
+ ;&& PTM 2217 BEGIN:
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-&& Check if this a break or make.
+ .If <z> ;&& If it isn't then go and check accent.
+ ;@@ PTM 6860 - Begin
+ Call AccCheckout ;Go check if accent combo going on.
+ ;@@ PTM 6860 - End
+ .Endif ;&& Endif this is a make.
+ ;&& PTM 2217 END:
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+
+SpecKey: ;Special non-alpha key, no CAPSLOCK or ALT.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;Check if Alt key is pressed.
+ .If <nz> ;Is it?
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-## Check if it's the AltGraph
+ .If <z> ;## If alt key is AltGraph
+ ;## which is undefined for this key
+ Mov [ESI].Key.Char,AL ;OS2SS-## put it in CDR
+ Call AccCheckout ;## Go check if acc. combo going on.
+ Jmp EndActionCase ;## Go to bottom of Xlate Action
+ .Endif ;## case table
+ Jmp NoXlate ;## then Key combo is undefined
+ .Endif ;@@ Endif Alt Key down
+ ;## PTM 2287: BEGIN
+ Mov EBX,[EBP-8] ;OS2SS-## Put it in BX
+ Test [EBX].XTFlags1,ShiftLock ;OS2SS-## Check if SHIFTLOCK keyboard.
+ .If <nz> ;## If it is
+ Mov BL,CapsTogl ;## Indicate a CAPSLOCK check.
+ .Endif ;## PTM 2287: END
+ Test DL, CtlFlag ;## Check if Ctrl key down.
+ .If <nz> ;## If so ...
+ Call SKCtlCheck ;## check if char has special
+ ;## control code.
+ .Else ;## Else Ctrl key not down,
+ Mov BL,0 ;1.3-@@ PTR B713838 Clear ShifLock Flag
+ Call CapsCheck ;## Check for shifting.
+ .Endif ;## Endif Ctrl down.
+ Mov [ESI].Key.Char,AL ;OS2SS-## Put Char in Key rec.
+ Call AccCheckout ;## PTR B705184
+ Jmp EndActionCase ;## Go to bottom of Xlate Action.
+
+SpecKeyC: ;Special non-alpha key, with CAPSLOCK.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;Check if Alt key is pressed.
+ .If <nz> ;Is it?
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ Mov EBX,[EBP-8] ;OS2SS-
+ .If <[EBX].Char4 eq 0> ;OS2SS-@@ then check if char 4 is 0
+ ;@@ PTM 5024 - Begin
+ Call CheckExtended ;@@ See if new extended code
+ ;@@ is defined
+ .If <c> ;## If it is defined.
+ Call AccCheckout ;## Go check if acc. combo going on.
+ Jmp EndActionCase ;## Go to bottom of Xlate Action
+ .Endif ;@@ PTM 5024 - End
+ Jmp NoXlate ;## the key combo is undefined
+ .Else ;@@ else if char 4 isn't 0
+ Mov AL,[EBX].Char4 ;OS2SS-@@ then use it
+ .Endif ;@@ Endif Char 4 is 0
+ .Endif ;@@ Endif Alt key is normal Alt.
+ Jmp SpecAccent ;@@ Go check if this is an accent
+ .Endif ;@@ Endif Alt Key down
+ Test DL, CtlFlag ;## Check if Ctrl key down.
+ .If <nz> ;## If so ...
+ Call SKCtlCheck ;## check if char has special
+ ;## control code.
+ .Else ;## Else Ctrl is not down.
+ ;## PTR B704944 CapsCheck in Else
+ Mov BL,CapsTogl ;Indicate check CAPSLOCK.
+ Call CapsCheck ;## Check for shifting.
+ .Endif
+
+SpecAccent:
+ .If <AL b 8> ;@@ Indicate this is unprocessed
+ Or [ESI].DDFlags,AccentKey ;OS2SS-@@ accent.
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-@@ Check for the key BREAK.
+ .If <z> ;@@ Is it?
+ And [EDI].XPSGFlags,Not PrevAccent ;OS2SS-@@ No, clear previous
+ ;@@ accent number.
+ Or Byte Ptr [EDI].XPSGFlags,AL ;OS2SS-&& Save accent number
+ ;&& for the next key.
+ .Endif
+ Jmp EndActionCase ;## Go to bottom of Xlate Action case table.
+ .Endif
+ Mov [ESI].Key.Char,AL ;OS2SS-## Put Char in Key rec.
+ Call AccCheckout ;## PTR B705184
+ Jmp EndActionCase ;@@ Go to bottom of Xlate Action case table.
+
+SpecKeyA: ;Special non-alpha key, with ALT.
+ifdef JAPAN
+; MSKK Aug.15.1993 V-AkihiS
+; Support SBCS katakana
+ Test [ESI].Key.DShift, Katakana ;OS2SS Check if Katakana or not
+ .If <nz>
+ Mov EBX,[EBP-8] ;OS2SS-
+ Mov AL,[EBX].Char4 ;OS2SS-Get Char4 and Char5 values.
+ Mov CX,Word Ptr [EBX+5] ;OS2SS-
+ .Endif
+endif
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ ;## PTM 2287: BEGIN
+ Mov EBX,[EBP-8] ;OS2SS-## Put it in BX
+ Test [EBX].XTFlags1,ShiftLock ;OS2SS-## Check if SHIFTLOCK keyboard.
+ .If <nz> ;## If it is
+ Mov BL,CapsTogl ;## Indicate a CAPSLOCK check.
+ .Endif ;## PTM 2287: END
+ Test DL, AltFlag ;## Check if Alt is down,
+ .If <nz> ;## If it is...
+ Call SKAltCheck ;## Check for extended code.
+ .Else ;## If it is not down,
+ .if <bit dl nz CtlFlag> ;## PTM 3327 start
+ Call SKCtlCheck ;## Check for spec. Ctrl code.
+ .else
+ Mov BL,0 ;1.3-@@ PTR B713838 Clear ShifLock Flag
+ Call CapsCheck ;## Check for Shifting.
+ .endif ;## PTM 3327 end
+ Mov [ESI].Key.Char,AL ;OS2SS-## Put Char in Key rec.
+ .Endif ;## Endif Alt is down.
+ Call AccCheckout ;## PTM 3126 fix stand alone accent
+ Jmp EndActionCase ;## Go to bottom of Xlate Action.
+
+SpecKeyCA: ;Special non-alpha key, w/CAPSLOCK and ALT.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Mov BL,CapsTogl ;Indicate check CAPSLOCK.
+ Test DL, AltFlag ;## Check if Alt is down,
+ .If <nz> ;## If it is...
+ Call SKAltCheck ;## Check for extended code.
+ .Else ;## If it is not down,
+ Call CapsCheck ;## Check for Shifting.
+ Test DL, CtlFlag ;## Check if Ctrl is down,
+ .If <nz> ;## If it is then...
+ Call SKCtlCheck ;## Check for spec. Ctrl code.
+ .Endif ;## Endif Ctrl is down.
+ .Endif ;## Endif Alt is down.
+ Mov [ESI].Key.Char,AL ;OS2SS-## Put Char in Key rec.
+ Jmp EndActionCase ;## Go to bottom of Xlate Action.
+
+FuncKey: ;Function keys.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;Check Alt Key.
+ .If <nz> ;Is it down?
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ .If <CL gt 10> ;Yes, so check if F11 or F12.
+ Add CL,128 ;If so, extended code is 139 or 140
+ .Else
+ Add CL,103 ;Extended code is range 104-113.
+ .Endif ;@@
+ .Else ;@@ Else ALt key was Atl-Graph
+ ;@@ PTM 6860 - Begin
+ Mov [ESI].Key.Char,AL ;OS2SS-@@ Move char 3 to key packet
+ Mov CL,[ESI].Key.Scan ;OS2SS-@@ Move scan to CL
+ ;@@ PTM 6860 - End
+ .Endif ;@@ Endif Alt or AltGraph check
+ .Else ;@@ Endif no Alt key down
+ Test DL,CtlFlag ;Check Ctl Key.
+ .If <nz> ;Is it down?
+ .If <CL gt 10> ;Yes, so check if F11 or F12.
+ Add CL,126 ;If so, extended code is 137 or 138.
+ .Else
+ Add CL,93 ;Extended code is range 94-103.
+ .Endif
+ .Else
+ Test DL,RShiftFlag+LShiftFlag ;Check Shift Keys.
+ .If <nz> ;Is one down?
+ .If <CL gt 10> ;Yes, so check if F11 or F12.
+ Add CL,124 ;If so, extended code is 135 or 136.
+ .Else
+ Add CL,83 ;Extended code is range 84-93.
+ .Endif
+ .Else ;Else this is a non-shifted FKey.
+ .If <CL gt 10> ;Check if F11 or F12.
+ Add CL,122 ;If so, extended code is 133 or 134.
+ .Else
+ Add CL,58 ;Extended code is range 59-68.
+ .Endif
+ .Endif
+ .Endif
+ .Endif
+ Mov [ESI].Key.Scan,CL ;OS2SS-Put code in CharData rec.
+ ;@@ PTM 6860 - Begin
+ Call AccCheckout ;Go check if accent combo going on.
+ ;@@ PTM 6860 - End
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+
+
+PadKey: ;Numeric keypad keys.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Xor EBX,EBX ;OS2SS-Clear for use later.
+ Test DL,AltFlag ;Check if Alt key down.
+ .If <nz> NEAR ;Are we entering Alt-nnn?
+ ;Maybe. First check for reboot request.
+ .If <CL eq 12> AND ;@@ And is current key mapped to Del?
+ ;@@ PTM 6350 - Begin
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-@@ Check if this a break
+ .If <z> AND ;@@ If it isn't (only reboot on make of Del)
+ ;@@ PTM 6350 - End
+ Test DL,CtlFlag ;Maybe. First check for reboot request.
+ .If <nz> OR ;Is Ctl down too
+ ;@@ for this KCB OR
+ ;@@ PTM 5992 - Begin
+ Test [EDI].XHotKeyShift,CtlFlag ;OS2SS-@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ .If <nz> ;&& translations are independent.
+ ;@@ PTM 5992 - End
+ ;@@ Tell dd it's the REBOOT KEY.
+ ;OS2SS-BUGBUG shouldn't get here
+ Or [ESI].DDFlags,RebootKey ;OS2SS-@@
+ Jmp EndActionCase ;Quit now.
+ .Endif
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ ;@@ PTM 5024 - BEGIN
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-@@ Check if secondary key
+ .If <nz> ;@@ If it is
+ Add [ESI].Key.Scan,50h ;OS2SS-@@ Make scan extended code
+ Mov [ESI].Key.Char,0 ;OS2SS-@@ Make char extended code
+ .Else ;@@ Else primary pad key
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check if is a key break.
+ .If <z> ;Is it?
+ Mov BL,CL ;No, so make Char1 value the index.
+ Mov CL,[EBX+AltPadMap] ;OS2SS-Get numeric value of the key.
+ Or CL,CL ;Check if value is -1.
+ .If <s> ;Is it.
+ Mov [EDI].XAltKeyPad,0 ;OS2SS-@@ Not numeric, reset.
+ .If <AH eq 83> ;@@ If this is DEL key
+ Jmp NoXlate ;@@ No extended value, undefined
+ .Else ;@@ Else extended char
+ Jmp EndActionCase ;@@ Mark char defined
+ .Endif ;@@ Endif Extended Char exists
+ .Else
+ Mov AL,10 ;Else multiply old...
+ Mul [EDI].XAltKeyPad ;OS2SS-@@ ...accumulator by 10.
+ Add AL,CL ;And add new key.
+ Mov [EDI].XAltKeyPad,AL ;OS2SS-@@ Save modified accum.
+ Jmp NoXlate ;Mark keystroke undefined
+ .Endif
+ .Else ;@@ PTM 6860 - Begin Else a break
+ Jmp NoXlate ;@@ Mark keystroke undefined
+ .Endif
+ .Endif ;@@ Endif primary or secondary key
+ ;@@ End PTM 5024
+ .Else ;@@
+ Mov [ESI].Key.Char,AL ;OS2SS-@@ Put Char into Key rec.
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-@@ Check if G keyboard dup key.
+ .If <nz> ;@@ Is it?
+ Mov [ESI].Key.Scan,OtherKey ;OS2SS-@@ Yes, so mark it so.
+ .Endif ;@@
+ .Endif ;@@ Endif normal ALT
+ .Else NEAR ;No Alt key down.
+ ;@@ PTM 5024
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-@@ Check if secondary key
+ .If <nz> ;@@ If it is
+ Mov AL,OtherKey ;@@ Set Char to E0
+ .Else ;@@ Else regular pad key
+ Xor AL,AL ;@@ Set Char to "extended"
+ .Endif ;@@ End PTM 5024
+ Test DL,CtlFlag ;Check if Ctl key down.
+ .If <nz> ;Is it?
+ Mov BL,CL ;Yes, so make Char1 value the index.
+ Mov AH,[EBX+CtlPadMap] ;OS2SS-Get extended value of the key.
+ Mov [ESI].Key.Scan,AH ;OS2SS-Set extended code for this key.
+ .Else ;Not Alt- or Ctl-, so figure out Num status.
+ .If <CL eq 3> OR ;Is this the minus key?
+ .If <CL eq 7> ;Or is this the plus key?
+ Mov AL,CH ;Yes, so use Char2 regarless of shifts.
+ .Else
+ Test DL,RShiftFlag+LShiftFlag ;Check for shift key.
+ .If <nz> ;Is one down?
+ Or BL,NumTogl ;Yes, so set NumLock bit.
+ .Endif
+ And DL,NumTogl ;Clear all shift bits but NumLock.
+ Xor DL,BL ;Flip it if shift key was down.
+ .If <nz> ;Is the case Num Lock?
+ Mov AL,CH ;Yes, so use Char2.
+ .Endif
+ ;@@ PTM 7358 - Begin
+ .If <z> OR ;@@ If we should not shift
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-@@ if G keyboard dup key.
+ .If <nz> ;@@ If it is
+ .If <CL eq 11> ;Is this the Ins key?
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Yes check if key BREAK.
+ .If <nz> ;Is it?
+ And [EDI].ToggleFlags,Not InsKeyDown ;OS2SS-@@ Yes clear latch.
+ .Else ;Not Ins Key Break.
+ Test [EDI].ToggleFlags,InsKeyDown ;OS2SS-@@ Check if seen Ins.
+ .If <z> ;Have we?
+ Or [EDI].ToggleFlags,InsKeyDown ;OS2SS-@@ No, so set latch.
+ Xor Byte Ptr [ESI].Key.Shift,InsTogl ;OS2SS-Toggle in CDR
+ .Else ;Otherwise this is a repeat of the make.
+ Or [ESI].DDFlags,MultiMake ;OS2SS-So indicate so.
+ .Endif
+ .Endif
+ .Endif
+ .Endif ;@@ Endif we should set/clear insert toggle
+ ;@@ PTM 7358 - End
+ .Endif
+ .Endif
+ Mov [ESI].Key.Char,AL ;OS2SS-Put character value in Key rec.
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-Check if G keyboard dup key.
+ .If <nz> ;Is it?
+ Mov [ESI].Key.Char,OtherKey ;OS2SS-Yes, so mark it so.
+ .Endif
+ .Endif ;Endif Alt key down or not check
+ ;@@ PTM 6860 - Begin
+ Call AccCheckout ;Go check if accent combo going on.
+ ;@@ PTM 6860 - End
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+
+
+SpecCtlKey: ;Keys that do special things with CTL.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;Check if Alt key down.
+ .If <nz> ;Is it?
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ ;@@ PTM 5024 - Begin
+ Xor AL,AL ;@@ Set Char to be extended
+ .If <AH eq 1Ch> AND ;@@ If this is the Enter key
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-
+ .If <nz> ;@@ on the pad keys
+ ;&& PTM 1270 - Don't overwrite scan
+ Mov [ESI].Key.Scan,0A6h ;OS2SS-@@ Set extended code
+ .Endif
+ .Endif ;@@ PTM 5024 End
+
+ Jmp SetCharField ;&& PTM 1520 now go set char field
+ .Endif
+ ;&& PTM 1270 - Begin
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-@@ Check if G keyboard dup key.
+ .If <nz> ;@@ Is it?
+ Mov [ESI].Key.Scan,OtherKey ;OS2SS-@@ Yes, so mark it so.
+ .Endif
+ Test DL,CtlFlag ;Check if Ctl key down.
+ .If <nz> ;Is it?
+ Mov AL,CH ;Yes, so use Char2.
+ .Endif
+ SetCharField: ;&& PTM 1520 Alt should have
+ ;&& precedence when Ctrl and Alt
+ ;&& are down.
+
+ Mov [ESI].Key.Char,AL ;OS2SS-Put Char into Key rec.
+ ;&& PTM 1270 - End
+ ;@@ PTM 6860 - Begin
+ Call AccCheckout ;Go check if accent combo going on.
+ ;@@ PTM 6860 - End
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+
+;OS2SS-BUGBUG-shouldn't get here
+PrtScr: ;The print screen key.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;Check if Alt key down.
+ .If <nz> ;Is it?
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-@@ Check if secondary key
+ .If <nz> OR ;@@ If it is OR...
+ Test _Ow2MiscFlags,EnhancedKbd ;@@ Check if enhanced kbd
+ .If <z> OR ;@@ OR...If it's a regular kbd
+;$$
+;$$ 'IDFlags' does not exist in the 1.2 ABIOS
+;$$ version. We need to get this information from KbdHWIDs.
+;$$
+
+;$$ Test IDFlags, SuperSport ;## Check if it is a 122 kbd
+
+ .If < _Ow2KbdHWIDs e 0AB85h > ;$$ If it is a 122 kbd
+ Test DL,CtlFlag ;@@ Check if Ctl key is down
+ .If <nz> OR ;@@ If it is
+ ;@@ for this KCB
+ ;@@ PTM 5992 - Begin
+ Test [EDI].XHotKeyShift,CtlFlag ;OS2SS-@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ .If <nz> ;&& translations are independent.
+ ;@@ PTM 5992 - End
+ Or [ESI].DDFlags,PrintFlushKey ;OS2SS-@@ Indicate this is FlushPrtbuf
+ Jmp EndActionCase ;@@ Go to bottom of Xlate Action
+ ;@@ case table.
+ .Endif
+ Jmp NoXlate ;Else that's undefined for this key.
+ ;@@ PTM 5024 begin
+ .Else ;@@ Else it Pad Key * on G kbd
+ Xor AL,AL ;@@ Set extended code
+ .Endif ;@@ Endif PrtScr or *
+ .Else NEAR ;@@ Else no Alt key down
+ Test DL,CtlFlag ;Check if Ctl key down.
+ ;@@ for this KCB
+ ;@@ PTM 5992 - Begin
+ .If <nz> OR ;@@ Is it OR?
+ Test [EDI].XHotKeyShift,CtlFlag ;OS2SS-@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ ;@@ PTM 5992 - End
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-@@ Check if secondary key
+ .If <nz> OR ;@@ If it is OR...
+ Test _Ow2MiscFlags,EnhancedKbd ;@@ Check if enhanced kbd
+ .If <z> OR ;@@ OR...If it's a regular kbd
+;$$
+;$$ 'IDFlags' does not exist in the 1.2 ABIOS
+;$$ version. We need to get this information from KbdHWIDs.
+;$$
+
+;$$ Test IDFlags, SuperSport ;## Check if it is a 122 kbd
+
+ .If < _Ow2KbdHWIDs e 0AB85h > ;$$ If it is a 122 kbd
+ Xor AL,AL ;Yes so set extended code...
+ Mov [ESI].Key.Scan,CH ;OS2SS-...for the Ctl-PrSc combination.
+ Or [ESI].DDFlags,PrintEchoKey ;OS2SS-@@ Tell dd it's the PRINT
+ ;@@ ECHO KEY.
+ ;@@ PTM 5024 - Begin
+ .Else ;@@ Else its the keypad *
+ Xor AL,AL ;@@ so set extended code...
+ Mov [ESI].Key.Scan,96h ;OS2SS-@@ for scan and char
+ .Endif ;@@ PTM 5024 - end
+ .Else ;@@ Else Ctrl key not down.
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-@@ Check if secondary key
+ .If <nz> OR ;@@ If it is OR...
+ Test DL,RShiftFlag+LShiftFlag ;@@ Check if a shift flag down.
+ .If <nz> AND ;@@ If a shift key is down AND...
+ Test _Ow2MiscFlags,EnhancedKbd ;@@ Check if enhanced kbd
+ .If <z> OR ;@@ AND...If it's a regular kbd
+
+;$$ Test IDFlags, SuperSport ;## Check if it is a 122 kbd
+;$$
+;$$ 'IDFlags' does not exist in the 1.2 ABIOS
+;$$ version. We need to get this information from KbdHWIDs.
+;$$
+ .If < _Ow2KbdHWIDs e 0AB85h > ;$$ If it is a 122 kbd
+
+ Xor AL,AL ;Yes, so clear char code.
+ Or [ESI].DDFlags,PrtScrKey ;OS2SS-@@ Tell dd it's PRINT SCREEN KEY.
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check for the key BREAK.
+ .If <nz> ;Is it?
+ And [EDI].XlateFlags,Not PSKeyDown ;OS2SS-@@ Yes, clear PS Key latch
+ .Else
+ Test [EDI].XlateFlags,PSKeyDown ;OS2SS-@@ Check if seen PS key yet.
+ .If <z> ;Have we?
+ Or [EDI].XlateFlags,PSKeyDown ;OS2SS-@@ No, set latch saying have.
+ .Else ;Otherwise this is a repeat of the make.
+ Or [ESI].DDFlags,MultiMake ;OS2SS-So indicate so.
+ .Endif ;Endif no PS key yet check
+ .Endif ;Endif Key break or not check
+ .Else ;@@ PTM 2606: Shift keys not
+ ;@@ down or not enhanced kbd.
+ Test [ESI].DDFlags, KeyBreak ;OS2SS-@@ If this is a break of the
+ .If < nz > ;@@ PrtScr key,
+ And [EDI].XlateFlags,Not PSKeyDown ;OS2SS-@@ Ensure latch is
+ ;@@ cleared.
+ .Endif ;@@ Endif PrtScr break.
+ .Endif ;Endif shift key down
+ .Endif ;Endif Ctl down or not check
+ .Endif ;@@ Endif Alt key down check
+ Mov [ESI].Key.Char,AL ;OS2SS-Put character in Key rec.
+ ;@@ PTM 6860 - Begin
+ Call AccCheckout ;Go check if accent combo going on.
+ ;@@ PTM 6860 - End
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+
+
+AccentKeyType: ;A key that affects the NEXT key (dead key).
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;Check if ALT down.
+ .If <nz> ;Is one?
+ Or [EDI].XlateFlags,Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ check if it was Altgraph key
+ .If <z> ;@@ If it was AltGraph key
+ .If <CL a 7> ;@@ If char 3 wasn't accent
+ Mov [ESI].Key.Char,CL ;OS2SS-@@ Put char in CDR
+ Mov [ESI].Key.Scan,AH ;OS2SS-@@ Put scan in CDR
+ Call AccCheckOut ;@@ Go check if accent combo (p6860)
+ Jmp EndActionCase ;@@ And quit now
+ .Else ;@@ Else char3 was an accent or 0
+ .If <CL eq 0> ;@@ If Char 3 was 0
+ Jmp NoXlate ;@@ Mark Key packet undefined
+ .Else ;@@ Else it was an accent
+ Xor BH,BH ;@@ Flag no shift check
+ Jmp ShiftAccent
+ .Endif ;@@ Endif Char3 was 0 or not
+ .Endif ;@@ Endif Char3 accent or not
+ .Endif ;@@ Endif Altgraph key down
+ .Endif ;@@ Endif ANY Alt key down
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> OR ;@@ If alt key is normal Alt
+ Test DL,CtlFlag
+ .If <nz> ;@@ OR CTL key is down
+ Mov EBX,[EBP-8] ;OS2SS-
+ Mov CL,[EBX].Char5 ;OS2SS-@@ Get accent entry index
+ ;@@ for CTL or ALT character
+ XOR EBX,EBX ;OS2SS-
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ Mov EBX,AltAcChar ;OS2SS-@@ So get Alt-Accent offset.
+ .Endif
+ Test DL,CtlFlag
+ .If <nz> ;@@ If its the CTL key
+ Mov EBX,CtlAcChar ;OS2SS-@@ So get Ctl-Accent offset.
+ .Endif
+ And ECX,0FFh ;OS2SS-Make accent number a word.
+ Dec ECX ;OS2SS-Accent 1 is offset zero.
+ IMul ECX,AccEntryLen ;OS2SS-Set offset of accent table entry.
+ Add ECX,Accents ;OS2SS-Add offset of accent entries.
+ Add ECX,EBX ;OS2SS-@@ Add offset for Ctl or Alt
+ ;@@ accent
+ Add ECX,[EBP-4] ;OS2SS-Point into translate table.
+ Mov EBX,ECX ;OS2SS-Put pointer in base reg.
+ Mov BX,Word Ptr [EBX] ;OS2SS-Fetch char and scan.
+ Or BX,BX ;Check if a Scan/Char mapping for this key.
+ .If <z> ;Is there?
+ Jmp NoXlate ;No, so go mark untranslated.
+ .Endif ;Else, use the mapping.
+ Mov Word Ptr [ESI].Key.Char,BX ;OS2SS-Put them into Key.
+ ;@@ PTM 6860
+ Call AccCheckout ;Go check if accent combo going on
+ Jmp EndActionCase ;Quit now.
+ .Endif
+ ;## PTR B700738 Move 0 into BL to
+ Mov BL,0 ;## indicate that CapsTogl has no
+ ;## affect on this key.
+ Call CapsCheck ;## Determine shifting of character.
+
+ShiftAccent: ;@@ Merge here for accent process
+ .If <nz> ;@@ If we should shift
+ Mov CL,CH
+ .Endif
+ .If <CL a 7> ;@@ Is translate table entry
+ ;@@ actually a character
+ Mov [ESI].Key.Char,CL ;OS2SS-@@ Put character in CDR
+
+ .IF <bit [ESI].DDFlags z KeyBreak> ;OS2SS-## PTM 3324 start
+ Call AccCheckOut ;@@ Go check if accent combo
+ .ENDIF ;## PTM 3324 end
+
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+
+ .Else ;@@ Else actually an accent
+ Or CL,CL ;@@ check if accent defined.
+ .If <z> ;@@ Is it?
+ Jmp NoXlate ;@@ No, so go mark undefined.
+ .Endif
+ Xor CH,CH ;Make accent number a word.
+ Mov BX,[EDI].XPSGFlags ;OS2SS-&& Get the translation flags
+ And BX,PrevAccent ;&& Clear all bits but previous
+ ;&& accent number (in BL)
+ Mov AL,CL ;@@ Save accent number
+ .If <BL eq CL> AND ;@@ If this is same accent number
+ ;@@ as last time AND
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-@@ Check if this is a BREAK
+ .If <z> AND ;@@ AND it is not a break
+
+ Mov EBX,[EBP-8] ;OS2SS-
+ Mov BX,[EBX].XlateOp ;OS2SS-@@ Get accent flags
+ Mov CL,7 ;@@ Set highest accent number
+ Sub CL,AL ;@@ Subtract actual accent number
+ Shl BX,CL ;@@ Put accent flag in high bit
+ .If <s> ;@@ AND if an accent is defined
+ Mov DX,[ESI].Key.Shift ;OS2SS-@@ Get the current shift status from Key.
+ Call AccCheckOut ;@@ Go process this key
+ .Endif
+ ;Indicate this is an unprocessed accent.
+ Or [ESI].DDFlags,AccentKey ;OS2SS-@@
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check for the key BREAK.
+ .If <z> NEAR ;Is it?
+ And [EDI].XPSGFlags,Not PrevAccent ;OS2SS-@@ No, clear prev accent
+ Or Byte Ptr [EDI].XPSGFlags,AL ;OS2SS-&& Save accent number for next
+ ;&& key.
+ .Endif
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+ .Endif ;@@
+SysReq: ;The system request key.
+
+ ;@@ PTM 4247 - the PrtScr key on an Enhanced Keyboard
+ ;@@ sends the SysReq scan code if the Alt Key is down
+ ;@@ which it must be for the Print Buffer flush key combo
+ ;@@ (Ctl-Alt-PrtScr). Therefore we must check for it here.
+
+ Test _Ow2MiscFlags,EnhancedKbd ;@@ Check if enhanced kbd
+ .If <nz> AND ;@@ If it is AND....
+ Test [ESI].DDFlags,KeyBreak ;@@ Check if this is a break
+ .If <z> AND ;@@ ...AND If it's NOT (a make)
+ Test DL,AltFlag ;@@ Check if Alt key down.
+ .If <nz> AND ;@@ If it is AND....
+ Test DL,CtlFlag ;@@ Check if Ctl key is down
+ ;@@ for this KCB
+ ;@@ PTM 5992 - Begin
+ .If <nz> OR ;@@ Is it OR?
+ Test [EDI].XHotKeyShift,CtlFlag ;OS2SS-@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz> ;@@ PTM 5992 - End
+ ;@@ No, so make sure this shift key's flag is set.
+ Or [ESI].Key.Shift,CX ;OS2SS-
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ Or [EDI].XHotKeyShift,CX ;OS2SS-@@ Also set in hot key shift state
+ .Endif
+ ;@@ Indicate this is Flush Prt buf
+ Or [ESI].DDFlags,PrintFlushKey ;OS2SS-
+ Jmp EndActionCase ;@@ Go to bottom of Xlate Action
+ ;@@ case table.
+ .Else ;@@ Else (PTM 4990)
+ Or [ESI].DDFlags,SysReqKey ;OS2SS-@@ Indicate this is SysReq key
+ .Endif
+
+
+ShiftKeys: ;The LSHIFT, RSHIFT, and CTL keys.
+AltKey: ;And the ALT key.
+ Test [EDI].XlateFlags,E1Prefix ;OS2SS-@@ CHeck if scan code proceeded
+ .If <nz> AND ;@@ by E1, if so AND
+ Test CX,CtlFlag ;@@ check if this is Ctrl key
+ .If <nz> ;@@ AND if it is Ctrl
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-@@ Check if this is a break
+ .If <z> ;@@ if it is not
+ Or [EDI].XlateFlags,PseudoCtl ;OS2SS-@@ Flag this as not actually
+ ;@@ a Ctrl key but a code
+ ;@@ sent by Enhanced Kbd
+ .Endif
+ Jmp NoXlate ;@@ Mark key packet undefined
+ .Endif
+ ;&& PTM 3002 BEGIN:
+ ;&& Setup alternate shift bits
+ ;&& before checking for MultiMake.
+ Mov EBX,[EBP-8] ;OS2SS-Put XlateTable offset into a base reg.
+ Mov AH,[EBX].Char3 ;OS2SS-Get alternate shift bits from entry.
+ Mov EBX,[EBP-4] ;OS2SS-
+ Mov BX,[EBX].XTFlags1 ;OS2SS-@@ Get the XT header flags
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-Check if G keyboard dup key.
+ .If <nz> ;Is it?
+ Test CX,RShiftFlag+LShiftFlag ;@@ Is the key a shift key
+ .If <nz> ;@@ If so....
+
+ ;@@ If it is then this is coming from a "G" keyboard secondary
+ ;@@ pad key, and NUMLOCK is on. This combination sends
+ ;@@ the following scan codes: E0, left shift make, E0,
+ ;@@ pad key make, E0, pad key break, E0, left shift break.
+ ;@@ In this case, we don't want to change the shift flags
+ ;@@ anywhere.
+
+ Jmp NoXlate ;@@ Mark key packet undefined
+
+ .Endif ;@@ Endif shift key
+
+ Xchg CH,AH ;Yes, so swap shift bit mask with alternate.
+ .Endif ;&& PTM 3002 END:
+ ;@@ PTM 6446 - BEGIN
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-@@ Check if this is a MAKE
+ .If <z> ;@@ If it is
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz> AND
+ Test Byte Ptr [EDI].XHotKeyShift+1,CH ;OS2SS-@@ Check if this key down
+ ;@@ In the system already
+ ;@@ for Ctl and Alt
+ .If <nz> OR ;@@ If it is OR
+ Test CX,RShiftFlag+LShiftFlag ;@@ Is the key a shift key
+ .If <nz> AND ;@@ If so AND....
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-@@ And if this is NOT a secondary
+ .If <z> AND ;@@ shift key code sent by a pad
+ ;@@ key (PTM 7506)
+ Test Byte Ptr [EDI].XHotKeyShift,CL ;OS2SS-@@ Check if this key down
+ .If <nz> ;@@ If it is
+ ;@@ In the system already
+ ;@@ PTM 3138 BEGIN: Flag as shift
+ ;@@ key also, do not put in KIB.
+ Or [ESI].DDFlags,MultiMake+ShiftMask ;OS2SS-@@ Indicate so and do not
+ ;@@ update shift state.
+ ;@@ PTM 3138 END:
+ Jmp EndActionCase ;@@ Complete translation
+ .Endif ;@@ Endif this is a multimake
+ .Endif ;@@ Endif this is a key make
+ ;@@ PTM 6446 - END
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check if this is key break.
+ .If <nz> AND ;If it is AND...
+ Test DX,CX ;And is a key make pending for this shift flag?
+ .If <z> ;If not, this key belongs in another SG.
+ Xor AL,AL ;Indicate not our keystroke.
+ ClC ;Differentiate from other key-break return above.
+ Ret ;Quit now.
+ .Endif
+ Test CX,RShiftFlag+LShiftFlag+SysRqFlag ;Is the key other...
+ .If <nz> ;...than Ctl or Alt?
+ And [EDI].XlateFlags,NOT DumpKeyOnce ;OS2SS-@@ Cancel Dump sequence.
+ .Endif
+ Or [ESI].DDFlags,ShiftMask ;OS2SS-@@ Indicate this is a shift key.
+ Test BX,ShiftLock ;@@ ShiftLock keyboard?
+ .If <nz> AND ;Is it shift lock and...
+ Test BX,ShiftToggle ;@@ ShiftToggle Kbd?
+ .If <z> AND ;@@ Is it NOT shift toggle and..
+ Test CL,RShiftFlag+LShiftFlag ;...is this key one of..
+ .If <nz> AND ; ...two shift keys?
+ Test [ESI].DDFlags,KeyBreak ;Check for the key BREAK.
+ .If <z> ;If not, make sure ShiftLock is off.
+ And DL,Not CapsTogl ;Turn it off.
+
+ ;@@ Turn it off in the interrupt driven shift state for
+ ;@@ hot keys also
+
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ And Byte Ptr [EDI].XHotKeyShift+1,Not CapsTogl ;OS2SS-
+ .Endif
+ .Endif
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check for the key BREAK.
+ .If <z> ;Is it?
+ Test CX,DX ;@@ No, its a MAKE
+ .If <nz> ;@@ So check if we've seen it
+ Or [ESI].DDFlags,MultiMake ;@@ If we have, indicate so.
+ .Endif ;@@ Endif Multimake
+ Or DX,CX ;No, so make sure this shift key's flag is set.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ Or [EDI].XHotKeyShift,CX ;OS2SS-@@ Also set in hot key shift state
+ .Endif
+ jmp NewLbl2
+ .Endif ;OS2SS- (A2053)## Endif Alt is down.
+ ;OS2SS- .Else ;Else process key-break.
+ .If <AL eq AltFlag> ;Check is this the AltKey?
+ Xor AL,AL ;@@ Clear out a reg
+ Xchg AL,[EDI].XAltKeyPad ;OS2SS-@@ Swap with the ALT-nnn accumulator.
+ Or AL,AL ;Check if any accumulation going on.
+ .If <nz> ;Was there?
+ Mov [ESI].Key.Char,AL ;OS2SS-Yes so make a Char from total.
+ Mov [ESI].Key.Scan,0 ;OS2SS-And make the scan code zero.
+ ;## PTR AK00370
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-## If this isn't an AltPad seq.
+ .If <z> ;## with right (secondary) Alt key.
+ And [ESI].DDFlags,Not (KeyBreak+KeyTypeMask) ;OS2SS-Fix flags.
+ .Endif ;## Endif right Alt key.
+ ;## PTR AK00370
+ Or _Ow2MiscFlags3,AltPacket ;&& DCR 1713 : Indicate that
+ ;&& we will send two packets.
+ ;@@ PTM 6860 - Begin
+ Call AccCheckout ;@@ check if accent combo going on.
+ ;@@ PTM 6860 - End
+ .Endif ;Endif accumulation going on
+ .Endif ;@@ Endif this was an ALT key
+ Mov BX,CX ;Save shift key values
+ Not CX ;Make shift flags into a mask.
+ ;@@ PTM 3905 - Topview does not send cursor key scan codes through
+ ;@@ and if this is a Ferrari keyboard, we only get E0s from the
+ ;@@ secondary cursor keys. Then if the left ALT is pressed
+ ;@@ to remove the popup, we think the ALT make was actually
+ ;@@ the right alt make because it was preceded by an E0 from a
+ ;@@ cursor key. And the break does not clear things up.
+
+ Test BL,RShiftFlag+LShiftFlag ;...is this key one of..
+ .If <z> ; ...two shift keys?
+ Test DH,BH ;@@ Check if this key is actually
+ ;@@ the one that's down
+ .If <z> ;@@ If it isn't
+ And DH,CL ;@@ Clear bit for key actually down
+ .Else ;@@ Else we've got the right key
+ And DH,CH ;Clear upper byte shift flag for this shift key.
+ .Endif
+ Test DH,AH ;Check if other shift key is down.
+ .If <z> ;Is primary or secondary shift key still down?
+ And DL,CL ;No, so clear lower byte shift flag.
+ .Endif
+
+ ;@@ PTM 4075 - A system wide word for the shift state
+ ;@@ must be maintained that is only modified by interrupts
+ ;@@ and is only used for Hot Key Checking
+
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent. ;&& translations are independent.
+ .If <nz>
+ Push EDX ;OS2SS-@@ Save new key packet shift
+ Mov DX,[EDI].XHotKeyShift ;OS2SS-@@ Get hot key shift state
+ Test DH,BH ;@@ Check if this key is actually
+ ;@@ the one that's down
+ .If <z> ;@@ If it isn't
+ And DH,CL ;@@ Clear bit for key actually down
+ .Else ;@@ Else we've got the right key
+ And DH,CH ;Clear upper byte shift flag for this shift
+ .Endif
+ Test DH,AH ;Check if other shift key is down.
+ .If <z> ;Is primary or secondary shift key still down?
+ And DL,CL ;No, so clear lower byte shift flag.
+ .Endif
+ Mov [EDI].XHotKeyShift,DX ;OS2SS-
+ Pop EDX ;OS2SS-
+ .Endif
+ .Else
+ And DL,CL ;No, so clear lower byte shift flag.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ And Byte Ptr [EDI].XHotKeyShift,CL ;OS2SS-
+ .Endif
+ .Endif
+ ;OS2SS- .Endif
+NewLbl2: ;OS2SS-
+ Mov [ESI].Key.Shift,DX ;OS2SS-Also save in Key rec.
+
+ Test _Ow2MiscFlags3,AltPacket ;&& DCR 1713 BEGIN: Check to see if an
+ ;&& Alt-Num operation was completed.
+ .If <nz> ;&& If so then..
+ ;## PTR AK00370: BEGIN
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-## If this is an AltPad seq.
+ .If <z> ;## with Left (normal) Alt key.
+ Call AltPadPacket ;&& setup second of two packets for
+ ;&& Alt-Numpad sequence.
+ .Else ;## Else this is an AltPad seq. with
+ ;## the right (secondary) Alt key.
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-## If this is a break for the right
+ .If <nz> ;## Alt key then...
+ Or _Ow2MiscFlags3, SecAltNumPad ;## Flag that we will have to send an
+ .Endif ;## accumulation packet after break
+ ;## of the Alt key in Int Handler.
+ .Endif ;## PTR AK00370: END
+ .Endif ;&& DCR 1713: END
+ ;## AltPadPacket is only called for
+ ;## AltNumPad seq. with left Alt. key.
+ ;## PTR AK00370: END
+
+ Jmp EndActionCase ;Go to bottom of Xlate Action case table.
+
+ScrollLock: ;The SCROLL LOCK key.
+ ;@@ This is special case of ToggleKeys because of Ctl-Break.
+ ;@@ On an Enhanced keyboard, the Ctl-Break sends the following
+ ;@@ set of scan codes:
+ ;@@ Ctrl make-E0-ScrollLock make-E0-ScrollLock break-Ctrl break
+ ;@@ so we must check if it was an AT keyboard or preceded by EO
+ ;@@ before identifying it as Ctl-Break.
+
+ And [EDI].XlateFlags,NOT DumpKeyOnce ;OS2SS-@@ Cancel Dump sequence.
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-@@ Check if secondary key
+ .If <nz> OR ;@@ If it is OR...
+ Test _Ow2MiscFlags,EnhancedKbd ;@@ Check if enhanced kbd
+ .If <z> OR ;@@ OR...If it's a regular kbd
+;$$
+;$$ 'IDFlags' does not exist in the 1.2 ABIOS
+;$$ version. We need to get this information from KbdHWIDs.
+;$$
+
+;$$ Test IDFlags, SuperSport ;## Check if it is a 122 kbd
+
+ .If < _Ow2KbdHWIDs e 0AB85h > ;$$ If it is a 122 kbd
+
+ Test DL,CtlFlag ;Check if Ctl also pressed.
+ ;@@ for this KCB
+ ;@@ PTM 5992 - Begin
+ .If <nz> OR ;@@ Is it OR?
+ Test [EDI].XHotKeyShift,CtlFlag ;OS2SS-@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ ;@@ PTM 5992 - End
+ Mov [ESI].Key.Scan,0 ;OS2SS-Set Ctl-Break extended code.
+ ;Tell dev driver it's the BREAK KEY.
+ Or [ESI].DDFlags,BreakKey ;OS2SS-@@
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check if this is the key break.
+ .If <nz> ;If so, clear Scroll Lock down bit in Packet & PSG.
+ And Byte Ptr [ESI].Key.Shift+1,Not (ScrollFlag ShR 8)
+ ;OS2SS-@@ Clear bit in hot key shift status also
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ And Byte Ptr [EDI].XHotKeyShift+1,Not (ScrollFlag ShR 8) ;OS2SS-
+ .Endif
+ .Else ;Set Scroll Lock down bit in packet & PSG.
+ Or Byte Ptr [ESI].Key.Shift+1,(ScrollFlag ShR 8)
+ ;OS2SS-@@ Set bit in hot key shift status also
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ Or Byte Ptr [EDI].XHotKeyShift+1,(ScrollFlag ShR 8) ;OS2SS-
+ .Endif
+ .Endif
+ Jmp EndActionCase ;@@ PTM 4106: Leave translation.
+ .Else ;Not Ctl-Break, fall thru to ToggleKey processing.
+ Jmp ToggleKey ;@@
+ .Endif
+ .Else ;Not Ctl-Break, fall thru to ToggleKey processing.
+ Jmp ToggleKey ;@@
+ .Endif
+NumLock: ;The NUMLOCK key.
+ ;@@ We must check if this is the Enhanced keyboard
+ ;@@ which will emulate Ctrl being down (PseudoCtl Flag
+ ;@@ will be set) for the PAUSE key or an AT kbd w/ Ctl down.
+
+ Test [EDI].XlateFlags,PseudoCtl ;OS2SS-@@ Check if secondary kbd
+ ;@@ emuating the Ctl key
+ .If <nz> OR ;@@ If it is OR...
+ ;## PTM 3128 BEGIN:
+ .If <_Ow2KbdHWIDs ne FERRARI_P> AND ;## If it's not an 88/89 AND
+ .If <_Ow2KbdHWIDs ne FERRARI_G> AND ;## If it's not a 101/102 AND
+ .If <BX ne JAGUAR> AND ;1.3-## If it's not a 122 Key JAGUAR
+ ;## PTM 3128 END:
+ Test DL,CtlFlag ;@@ Check if Ctl also pressed.
+ ;@@ for this KCB
+ ;@@ PTM 5992 - Begin
+ .If <nz> OR ;@@ Is it OR?
+ Test [EDI].XHotKeyShift,CtlFlag ;OS2SS-@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ ;@@ PTM 5992 - End
+ ;@@ PTM 4004:
+ Test DL, AltFlag ;@@ Check for Alt key down.
+ .If < z > ;@@ No alt key, process Ctl-NumLk,
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-@@ Check if this is a key break
+ .If <nz>
+ And [EDI].XlateFlags,Not PseudoCtl ;OS2SS-@@ Clear flag
+
+ Test _Ow2MiscFlags3,PauseLatch ;&& PTM 2344 BEGIN: If the NumLock
+ ;&& make preceded the Ctrl make
+ .If <z> ;&& then this is not the break of
+ ;&& of a Pause. Therefore do not
+ ;&& throw the key away. Treat it
+ Jmp ToggleKey ;&& as a normal shift break.
+ .Endif ;&& Endif this was not the Pause.
+ And _Ow2MiscFlags3,Not PauseLatch ;&& Reset the Pause sequence flag.
+ ;&& PTM 2344 END:
+
+ Jmp NoXlate ;@@ Mark Key Packet undefined
+ .Else ;@@ Else it's a make scan code
+ Or [ESI].DDFlags,PauseKey ;OS2SS-@@ So tell dd it's the PAUSE KEY.
+ Or _Ow2MiscFlags3,PauseLatch ;&& PTM 2344: Flag the make of the
+ ;&& NumLock to be used as a latch.
+ Jmp EndActionCase ;@@ Completed translation
+ .Endif ;@@ Endif key break or not
+ .Else ;&& PTM 2383: Else Alt is down
+ And [EDI].XlateFlags,Not PseudoCtl ;OS2SS-@@ Clear flag
+ Test DL,CtlFlag ;&& so test if Ctrl is also down.
+ .If <z> ;&& If Ctrl is not down then the
+ Jmp NoXlate ;&& key sequence Alt-Pause Key
+ ;&& is undefined.
+ .Endif ;&& Endif Ctrl is down with Alt.
+ .Endif ;@@ End alt key down check. PTM 4004
+ .Endif
+ Test DL,CtlFlag ;Check if Ctl also pressed.
+ ;@@ for this KCB
+ ;@@ PTM 5992 - Begin
+ .If <nz> OR ;@@ Is it OR?
+ Test [EDI].XHotKeyShift,CtlFlag ;@@ Also check in interrupt shift
+ ;@@ state
+ .If <nz> AND ;@@ Is it being held down at all
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ ;@@ PTM 5992 - End
+ Test DL,AltFlag ;Yes, check Alt key also.
+ .If <nz> ;Is it?
+ Test [EDI].XlateFlags,DumpKeyOnce ;OS2SS-@@ Yes check if second time.
+ .If <nz> ;Is it?
+ Or [ESI].DDFlags,DumpKey ;OS2SS-@@ So tell dd it's the DUMP KEY.
+ .Else
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check if this's key break.
+ .If <nz> ;Is it?
+ Or [EDI].XlateFlags,DumpKeyOnce ;OS2SS-@@ Yes indicate seen once.
+ .Endif
+ .Endif
+ .Endif
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check if this's the key break.
+ .If <nz> ;If so, clear Num Lock down bit in Packet & PSG.
+ And Byte Ptr [ESI].Key.Shift+1,Not (NumFlag ShR 8)
+ ;@@ Clear bit in hot key shift status also
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ And Byte Ptr [EDI].XHotKeyShift+1,Not (NumFlag ShR 8) ;OS2SS-
+ .Endif
+ Test [EDI].XlateFlags,DumpKeyOnce ;OS2SS-@@ PTM 7078 - Begin
+ .If <z> ;@@ If this wasn't the dump key
+ Or [ESI].DDFlags,ShiftMask ;OS2SS-@@ PTM 6937
+ ;@@ Indicate this is a shift key.
+ .Endif ;@@ PTM 7078 - End
+
+ Test _Ow2MiscFlags3,PauseLatch ;&& PTM 2344 BEGIN: If the NumLock
+ ;&& make preceded the Ctrl make
+ .If <z> ;&& then this is not the break of
+ ;&& of a Pause. Therefore do not
+ ;&& throw the key away. Treat it
+ Jmp ToggleKey ;&& as a normal shift break.
+ .Endif ;&& Endif this was not the Pause.
+ And _Ow2MiscFlags3,Not PauseLatch ;&& Reset the Pause sequence flag.
+ ;&& PTM 2344 END:
+
+ .Else ;Set Num Lock down bit in packet & PSG.
+ Or Byte Ptr [ESI].Key.Shift+1,(NumFlag ShR 8) ;OS2SS-
+ ;@@ Set bit in hot key shift status also
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ Or Byte Ptr [EDI].XHotKeyShift+1, (NumFlag ShR 8) ;OS2SS-
+ .Endif
+ Test [EDI].XlateFlags,DumpKeyOnce ;OS2SS-@@ PTM 7078 - Begin
+ .If <z> ;@@ If this wasn't the dump key
+ Or [ESI].DDFlags,ShiftMask ;OS2SS-@@ PTM 6937
+ ;@@ Indicate this is a shift key.
+ .Endif ;@@ PTM 7078 - End
+ Or _Ow2MiscFlags3,PauseLatch ;&& PTM 2344: Flag the make of the
+ ;&& NumLock to be used as a latch.
+ .Endif
+ .Else NEAR ;Not Ctl-Numlock, fall thru to common Toggle key check.
+
+CapsLock: ;The CapsLock key itself.
+ToggleKey: ;Or any general Toggle key.
+ Mov EBX,[EBP-8] ;OS2SS-Get translate table offset.
+ Test [ESI].DDFlags,SecondaryKey ;OS2SS-Check if G kbd dup key.
+ .If <nz> ;Is it?
+ Mov CH,[EBX].Char3 ;OS2SS-Yes, so get mask for that key.
+ .Endif
+ And [EDI].XlateFlags,NOT DumpKeyOnce ;OS2SS-@@ Cancel Dump sequence.
+ Mov EBX,[EBP-4] ;OS2SS-Get translate table offset.
+ Or [ESI].DDFlags,ShiftMask ;OS2SS-@@ Indicate this is a shift key.
+ Test Word Ptr [EBX+XTFlags1],ShiftLock ;OS2SS-ShiftLock type?
+ .If <nz> AND ;Is it shift lock and...
+ Test Word Ptr [EBX+XTFlags1],ShiftToggle ;OS2SS-@@ ShiftLock Toggle?
+ .If <z> AND ;@@ Is it shift lock latch and...
+ .If <AL eq CapsTogl> ;...is it the CapsLock key?
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check for the key BREAK.
+ .If <z> ;If not, set ShiftLock on.
+ Or [ESI].Key.Shift,CX ;OS2SS-And in the Key rec.
+ ;@@ Set bit in hot key shift status also
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ Or [EDI].XHotKeyShift,CX ;OS2SS-
+ .Endif
+ .Else ;On key-break, only clear DOWN bit.
+ Not CX ;Make shift bits a mask.
+ And Byte Ptr [ESI].Key.Shift+1,CH ;OS2SS-And in the Key rec.
+ ;@@ Clear bit in hot key shift status also
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ And Byte Ptr [EDI].XHotKeyShift+1,CH ;OS2SS-
+ .Endif
+ .Endif
+ .Else ;This is not a shift-lock keyboard.
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Check for the key BREAK.
+ .If <nz> ;Is it?
+ Not CX ;Yes, so make shift bits a mask.
+ And Byte Ptr [ESI].Key.Shift+1,CH ;OS2SS-And in the Key rec.
+
+ ;@@ Clear bit in hot key shift status also
+
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ And Byte Ptr [EDI].XHotKeyShift+1,CH ;OS2SS-
+ .Endif
+ And [EDI].ToggleFlags,CL ;OS2SS-@@ Clear latch for this key.
+ .Else
+ Or Byte Ptr [ESI].Key.Shift+1,CH ;OS2SS-And in the Key rec.
+
+ ;@@ Set bit in hot key shift status also
+
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ Or Byte Ptr [EDI].XHotKeyShift+1,CH ;OS2SS-
+ .Endif
+ Test [EDI].ToggleFlags,CL ;OS2SS-@@ Check if seen this key yet.
+ .If <z> ;Have we?
+ Or [EDI].ToggleFlags,CL ;OS2SS-@@ No so set latch saying we have.
+ Xor Byte Ptr [ESI].Key.Shift,CL ;OS2SS-And in the Key rec.
+ ;@@ Set Latch in hot key shift status also
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-&& PTM 3191: Make sure KBDXlate
+ ;&& translations are independent.
+ .If <nz>
+ Xor Byte Ptr [EDI].XHotKeyShift,CL
+ .Endif
+ .Else ;Otherwise this is a repeat of the make.
+ Or [ESI].DDFlags,MultiMake ;OS2SS-So indicate so.
+ .Endif
+ .Endif
+ .Endif
+ .Endif ;Endif from NumLock plus Ctl test above.
+ Jmp EndActionCase ;Go bottom of Xlate Action case table.
+
+SpecKeyCS: ;@@ Special key for NLS support.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;@@ Check if Alt key down.
+ .If <nz> ;@@ Is it?
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ ;@@ PTM 5024 - Begin
+ Call CheckExtended ;@@ See if new extended code
+ ;@@ is defined
+ .If <c> ;## If it is ...
+ Jmp EndActionCase ;## the key combo is defined
+ .Endif ;## Endif there was one defined
+ Jmp NoXlate ;## get out now.
+ .Endif ;## Endif normal Alt.
+ Jmp SKCSEnd ;##
+ .Else NEAR ;@@ Else no Alt key down
+ Test DL,RShiftFlag+LShiftFlag ;@@ Is a shift key down
+ Mov EBX,[EBP-8] ;OS2SS-Get translate table offset.
+ .If <nz> ;@@ Yes so,
+ Test DL,CapsTogl ;@@ See if capslock is on
+ .If <nz> ;@@ If it is
+ Mov AL,[EBX].Char5 ;OS2SS-@@ Use character 5
+ .Else ;@@ If it is not then...
+ Mov AL,CH ;@@ Use char 2
+ .Endif ;@@ Endif CapsLock is on.
+ .Else NEAR ;@@ Else no shift key down
+ Test DL,CapsTogl ;@@ See if capslock is on
+ .If <nz> ;@@ If it is
+ Mov AL,[EBX].Char4 ;OS2SS-@@ Use character 4
+ .Endif
+ .Endif ;## Endif shift key down.
+ Test DL, CtlFlag ;## Check if Ctrl is down,
+ .If <nz> ;## If it is then...
+ Call SKCtlCheck ;## Check for spec. Ctrl code.
+ .Endif ;## Endif Ctrl is down.
+ .Endif ;## Endif Alt is down.
+SKCSEnd:
+ .If <AL b 8> AND ;## If this was an accent key index
+ .If <AL a 0> ;##
+ Or [ESI].DDFlags,AccentKey ;OS2SS-## Indicate this is an
+ ;## unprocessed accent.
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-## Check for the key BREAK.
+ .If <z> ;## Is it?
+ And [EDI].XPSGFlags,Not PrevAccent;OS2SS-## No, clear prev accent num
+ Or Byte Ptr [EDI].XPSGFlags,AL ;OS2SS-## Save accent num for next key
+ .Endif
+ .Else ;## Else this is not an accent table entry
+ Mov [ESI].Key.Char,AL ;OS2SS-## Put character into key packet
+ Call AccCheckOut ;## Check for valid accent
+ .Endif ;## Endif this is an accent index.
+ Jmp EndActionCase ;## Go to bottom of Xlate Action case table.
+
+SpecKeyAS: ;@@ Special key for NLS support.
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <nz> ;@@
+ Call UnPauseChk ;Go check if in pause state.
+ .Endif ;@@
+ Test DL,AltFlag ;@@ Check if Alt key down.
+ .If <nz> ;@@ Is it?
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ Mov EBX,[EBP-8] ;OS2SS-Get translate table offset.
+ Mov AL,[EBX].Char4 ;OS2SS-@@ Use char4
+ Mov [ESI].Key.Scan,AL ;OS2SS-@@ Put it in the scan code field to
+ Jmp SpecKeyEnd ;@@ Go to merge
+ .Endif
+ .Else ;@@ Else no Alt key down
+ Test DL,RShiftFlag+LShiftFlag ;@@ Is a shift key down
+ .If <nz> ;@@ Yes so,
+ Mov AL,CH ;@@ Use char 2
+ Jmp SpecKeyEnd ;@@ Go to merge
+ .Endif ;@@ Else no shift key down
+ .Endif ;## Endif Alt key down.
+ Test DL, CtlFlag ;## Check if Ctrl is down
+ .If <nz> ;## If it is then...
+ Call SKCtlCheck ;## Check for special control code.
+ .Endif ;## Endif Ctrl is down
+
+SpecKeyEnd:
+ .If <AL b 8> AND ;@@ If this was an accent key index
+ .If <AL a 0>
+ Or [ESI].DDFlags,AccentKey ;OS2SS-@@ Indicate this is an
+ ;@@ unprocessed accent.
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-@@ Check for the key BREAK.
+ .If <z> ;@@ Is it?
+ And [EDI].XPSGFlags,Not PrevAccent ;OS2SS-## No, clear prev accent num
+ Or Byte Ptr [EDI].XPSGFlags,AL ;OS2SS-## Save accent num for next key
+ .Endif
+ .Else ;## Else this is not an accent table entry
+ Mov [ESI].Key.Char,AL ;OS2SS-## Put character into key packet
+ Call AccCheckOut ;## Check for vaild accent.
+ .Endif ;## Endif this is an accent table entry.
+ Jmp EndActionCase ;## Go to bottom of Xlate Action case table.
+
+XShiftKey: ;Extended shift key (for DBCS use).
+XToggleKey: ;Extended toggle key (for DBCS use).
+
+NoXlate: ;Invalid action code, no translate done.
+ And [EDI].XlateFlags,NOT DumpKeyOnce ;OS2SS-@@ Cancel Dump sequence.
+ Or [ESI].DDFlags,UndefKey ;OS2SS-@@ Mark this key undefined.
+
+
+EndActionCase: ;*** This is the end of the Xlate Action case table ***.
+
+ Test [ESI].DDFlags, UndefKey ;OS2SS-## DCR 357: BEGIN
+ .If <z> AND ;## This logic tests to see if the
+ Test _Ow2MiscFlags3, AltPacket ;## current keypacket is for an
+ .If <z> ;## extended keystroke or not.
+ Mov BL,[ESI].Key.Char ;OS2SS-## If it is then bit 1 of the Status
+ .If <BL eq 0> OR ;## field in the keypacket is turned
+ Test [EDI].XlateFlags, SecPrefix ;OS2SS-## on.
+ .If <nz> ;##
+ Or [ESI].Key.Status, EXTENDEDCODE ;OS2SS-## Turn the bit on in the Status.
+ .Endif ;##
+ .Endif ;## DCR 357: END
+ ;## PTR B702484: BEGIN
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ ;## create an extra packet for the E0.
+ .If <nz> AND ;## PTR B702484: END
+ Test [EDI].XlateFlags,SecPrefix ;OS2SS-&& PTM 2382: Test to see if an E0 or E1
+ ;&& came before this packet.
+ .If <nz> AND ;&& If E0 or E1 did precede then,
+ Test [EDI].XlateFlags, E1Prefix ;OS2SS-&& Check to see if it was an E0.
+ .If <z> ;&& If it was the E0 then,
+ Or _Ow2MiscFlags3, E0Packet ;&& signal an E0 packet coming up.
+ Call MakeE0Packet ;&& Call MakeE0Packet to manufacture an
+ ;&& extra packet to precede this one.
+ .Endif ;&& Endif an E0 preceded this packet.
+
+
+ Mov BX,[ESI].DDFlags ;OS2SS-&& PTM 965 - Always zero out
+ .If <BX eq ShiftMask> OR ;&& char and scan fields for
+ .If <BX eq ShiftMask+KeyBreak> OR ;&& shift packets
+ .If <BX eq ShiftMask+SecondaryKey> OR
+ .If <BX eq ShiftMask+KeyBreak+SecondaryKey>
+ Mov Word Ptr [ESI].Key.Char, 0 ;OS2SS-@@ PTM 2244: Zero out Character/
+ ;@@ Scan Code fields in CharData
+ ;@@ Record for Japan compatability.
+ And [ESI].Key.Status, NOT EXTENDEDCODE
+ ;OS2SS-## DCR 357: Do NOT indicate that this
+ ;## is an extended scan instead of
+ ;## an E0 char., if this is a shift pac.
+ Test [EDI].XInputMode,SHIFTREPORT ;OS2SS-&& (P13303) Are we in Shift rep. mode?
+ .If <nz> ;@@ If so......
+ Or [ESI].Key.Status,1 ;OS2SS-@@ Flag as shift report packet
+ .Endif ;@@ Endif Shift Report
+ .Endif ;@@ Endif Shift Report
+ And [EDI].XlateFlags,Not SecPrefix+E1Prefix ;OS2SS-Clear indicator.
+ Mov AL,Byte Ptr [ESI].MonFlags+1 ;OS2SS-Get the original scan code back.
+ Stc ;OS2SS-
+ Ret
+
+KbdXlate Endp ;-------------------------------------------------------/
+
+Public CapsCheck
+CapsCheck Proc ;-----------------------------------------------------\
+;************** START OF SPECIFICATIONS ********************************
+;* *
+;* Subroutine Name: CapsCheck *
+;* *
+;* Descriptive Name: Check IF character should be shifted *
+;* *
+;* Function: This routine checks IF a characer should be shifted. *
+;* It checks IF CapsLock, ShiftLock or the shift key *
+;* effect this key. IF the char should be shifted, *
+;* then it places Char2 in AL. *
+;* *
+;* Notes: *
+;* *
+;* Entry Point: CapsCheck Linkage: Near *
+;* *
+;* Input: AL = CHAR1 from translate table *
+;* CH = CHAR2 from translate table *
+;* DX = ShiftFlags *
+;* AH = Scan code w/ break bit cleared *
+;* BX = SHIFTLOCK & CAPSLOCK effect indicators *
+;* *
+;* Exit-Normal: AL = ASCII character after shift checking *
+;* *
+;* Exit-Error: None *
+;* *
+;* Effects: AX, BX, registers, carry flag changed. *
+;* *
+;* Internal References: *
+;* Routines: None *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+
+ Xor BH,BH ;## Prepare a byte.
+ Test DL,RShiftFlag+LShiftFlag ;## Check if Shift key down.
+ .If <nz> ;## Is one of them?
+ Or BH,CapsTogl ;## Yes, so prepare to check Capslock.
+ .Endif ;## Endif a shift key is down
+ And DL,BL ;## Isolate Capslock flag.
+ Push EBX ;OS2SS-## Save BX for now
+ Mov EBX,[EBP-4] ;OS2SS-## And put it in BX
+ Test [EBX].XTFlags1,ShiftLock ;OS2SS-## Check if Shiftlock kbd
+ Pop EBX ;OS2SS-## Restore BX
+ .If <nz> ;## If it is then...
+ Test BL, CapsTogl ;## Check if shift lock effects key type.
+ .If <nz> ;## If it does then...
+ Or BH,DL ;## either Capslock, Shift,
+ ;## or both will cause shifting
+ .Else ;## If it does not
+ Or BH,BH ;## fix the zero flag.
+ .Endif ;## Endif shift lock effects key type.
+ .Else ;## Else its a CapsLock kbd
+ Test BL, CapsTogl ;## Check if CapsLock effects key type.
+ .If <nz> ;## If it does then...
+ Xor BH,DL ;## Add Capslock & ShiftFlag to decide state.
+ .Else ;## If it does not
+ Or BH,BH ;## fix the zero flag.
+ .Endif ;## Endif CapsLock effects key type.
+ .Endif ;## Endif shift lock keyboard.
+ .If <nz> ;## Should key be capitalized?
+ Mov AL,CH ;## Yes, so use Char2.
+ .Endif ;##
+ Ret
+
+CapsCheck Endp ;-------------------------------------------------------/
+
+Public SKCtlCheck
+SKCtlCheck Proc ;-----------------------------------------------------\
+;************** START OF SPECIFICATIONS ********************************
+;* *
+;* Subroutine Name: SKCtlCheck *
+;* *
+;* Descriptive Name: Check IF character has special control code *
+;* *
+;* Function: This routine checks IF a character or scan code has a *
+;* special control code associated with it. *
+;* IF it does then it sets the appropriate ASCII/scan *
+;* codes. *
+;* *
+;* Notes: Ctl key is already known to be down *
+;* *
+;* Entry Point: SKCtlCheck Linkage: Near *
+;* *
+;* Input: AH = Scan code w/ break bit cleared *
+;* *
+;* Exit-Normal: AL = ASCII character after special control code check *
+;* *
+;* Exit-Error: None *
+;* *
+;* Effects: AX *
+;* *
+;* Internal References: *
+;* Routines: None *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+
+ .If <AH eq 3> ;@@ Is this Ctl-2?
+ Xor AL,AL ;@@ Yes, so set extended code.
+ .ElseIf <AH eq 7> ;@@ Is this Ctl-6?
+ Mov AL,30 ;@@ Yes, so set ASCII "RS" code.
+ ;@@ PTR B702484 and PTM 5024 - Begin
+ .ElseIf <AH eq 15> ;@@ Is this Ctl-Tab?
+ Xor AL,AL ;@@ Yes, so set extended code.
+ Mov [ESI].Key.Scan,94h ;OS2SS-@@ Yes, so set extended code.
+ ;@@ PTR B702484 and PTM 5024 - End
+ .ElseIf <AH eq 26> ;@@ Is this Ctl-[?
+ Mov AL,27 ;@@ Yes, so set "Esc" code.
+ .ElseIf <AH eq 27> ;@@ Is this Ctl-]?
+ Mov AL,29 ;@@ Yes, so set ASCII "GS" code.
+ .ElseIf <AH eq 43> ;@@ Is this Ctl-\?
+ Mov AL,28 ;@@ Yes, so set ASCII "FS" code.
+ .ElseIf <AL eq "-"> ;@@ Is this Ctl-dash?
+ Mov AL,31 ;@@ Yes, so set ASCII "US" code.
+ ;1.3-## PTR 4862 BEGIN:
+ .ElseIf <AH eq 12> ;1.3-## Is this the key for scan code 12.
+ Mov AL,31 ;1.3-## Yes, so set ASCII "US" code.
+ ;1.3-## PTR 4862 END.
+ .ElseIf <AL eq " "> ;@@ Is this the space key?
+ ;Value in AL is correct. ;@@ Yes, so leave as is.
+ .Else ;@@ If here, combo is undefined.
+ Mov AL, -1 ;@@ Go mark Undefined.
+ Or [ESI].DDFlags,UndefKey ;OS2SS-## PTR B702142 Mark this key undefined.
+ .Endif ;@@
+ Ret ;@@ Endif Ctl key down check
+
+SKCtlCheck Endp ;-------------------------------------------------------/
+
+Public SKAltCheck
+SKAltCheck Proc ;-----------------------------------------------------\
+;************** START OF SPECIFICATIONS ********************************
+;* *
+;* Subroutine Name: SKAltCheck *
+;* *
+;* Descriptive Name: Check IF character has extended code *
+;* *
+;* Function: This routine checks IF a characer or scan code has a *
+;* special extended code associated with it. *
+;* IF it does then it sets the appropriate ASCII/scan *
+;* codes. *
+;* *
+;* Notes: Alt key is already known to be down *
+;* *
+;* Entry Point: SKAltCheck Linkage: Near *
+;* *
+;* Input: DI = Per Session Data Area Address *
+;* SI = Key Packet Address *
+;* DX = ShiftFlags *
+;* AH = Scan code w/ break bit cleared *
+;* *
+;* Exit-Normal: AL = ASCII character after special control code check *
+;* *
+;* Exit-Error: None *
+;* *
+;* Effects: AX, BX, registers, carry flag changed. *
+;* *
+;* Internal References: *
+;* Routines: AltGraphCheck CheckExtended *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+
+ And [EDI].XlateFlags,Not Use3Index ;OS2SS-@@ Use Char3 if AltGraph
+ Call AltGraphCheck ;@@ Process if AltGraph
+ Test [EDI].XlateFlags,NormalAlt ;OS2SS-@@ Check if it's not the AltGraph
+ .If <nz> ;@@ If alt key is normal Alt
+ .If <AL eq " "> ;@@ Is this the space key?
+ Mov [ESI].Key.Char,AL ;OS2SS-@@ Yes, so leave as is.
+ ;@@ PTM 5024 - Begin
+ .Else ;@@ Set extended code for others
+ Call CheckExtended ;@@ Go check if this is new extended
+ ;@@ scan code
+ .If <nc> ;@@ If it is, everything is set up
+ ;@@ otherwise it's old so
+ Add AH,118 ;@@ calculate extended code.
+ Mov [ESI].Key.Scan,AH ;OS2SS-@@ Put extended code in Key rec.
+ .Endif
+ ;@@ PTM 5024 - End
+ .Endif
+ .Else ;@@ else it was AltGraph
+ Mov [ESI].Key.Char,AL ;OS2SS-@@ Yes, so leave as is.
+ .Endif ;@@ Endif UNDEFINED or normal ALT
+ Ret
+
+SKAltCheck Endp ;-----------------------------------------------------/
+
+Public AccCheckOut
+AccCheckout Proc ;-----------------------------------------------------\
+;***********************************************************************
+;* *
+;* Subroutine Name: AccCheckout *
+;* *
+;* Descriptive Name: Check and Process Valid Accents *
+;* *
+;* Function: This routine is called from KbdXlate and checks if an *
+;* accent key was hit prior to the current key. If so, *
+;* a check is made to see if the key is affected by that *
+;* accent and if it is *
+;* the value specified by the accent table entry is put in *
+;* the key packet and control returns to KbdXlate. *
+;* If the key is not affected by that accent, then it is *
+;* put in a seperate keypacket and control returns to *
+;* KbdXlate to process the current key. *
+;* *
+;* Entry Point: AccCheckout Linkage: Near *
+;* *
+;* Input: Beginning offset of translate table on the stack *
+;* *
+;* Exit-Normal: Monitor Key Packet filled in *
+;* *
+;* Exit-Error: N/A *
+;* *
+;* Effects: BX *
+;* *
+;* Internal References: *
+;* Routines: BadAccent *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+
+
+ ;Check if last key seen was an accent key.
+ Push EBX ;OS2SS-@@ Save BX
+ Mov BX,[EDI].XPSGFlags ;OS2SS-&& Get flags from PSG.
+ And BX,PrevAccent ;&& Isolate previous accent number
+ ;&& field.
+ .If <nz> NEAR ;Was there one?
+ Push EDI ;OS2SS-Yes, save index reg for now.
+
+ ;Translate table offset now four words back on the stack.
+
+ And EBX,0FFh ;OS2SS-Clear upper byte of accent number.
+ Mov EDI,EBX ;OS2SS-Put accent number in index reg.
+ Dec EDI ;OS2SS-Accent entry 1 has offset zero.
+ IMul EDI,AccEntryLen ;OS2SS-Set offset of correct accent table entry.
+ Add EDI,Accents ;OS2SS-Set offset within overall translate table.
+ Add EDI,[EBP-4] ;OS2SS-Add offset of translate table itself.
+ Push ECX ;OS2SS-And save...
+ Push EDX ;OS2SS-..other regs.
+ Mov EDX,[EBP-8] ;OS2SS-Get Xlate Operation word.
+ Mov DX,[EDX].XlateOp ;OS2SS-Get Xlate Operation word.
+ Mov CL,7 ;Set # of bits to highest accent no.
+ Sub CL,BL ;Subtract actual accent number.
+ Mov EBX,EDI ;OS2SS-Save accent table entry offset.
+ Or DX,DX ;## PTM 2329: Make sure that if the max. number
+ ;## of accents are used that the flags bits are
+ ;## correctly for DX.
+ Shl DX,CL ;Shift Accent Flags left by calculated count.
+ .If <ns> ;So is this key affected by the previous accent?
+ Mov ECX,[EBP-4] ;OS2SS-@@ Get the XT header
+ Mov CX,[ECX].XTFlags1 ;OS2SS-@@ Get the XT header flags.
+ Mov EDI,[ESP+8] ;OS2SS- Restore OtherFlag index.
+ Call BadAccent ;No! Go take care of things.
+ .Else ;Accent flags say this key is accented.
+ Pop EDX ;OS2SS-Restore shift flags for now.
+ Push EDX ;OS2SS-But leave them saved.
+ Push EAX ;OS2SS-Save AX for now.
+ Mov AL,[ESI].Key.Char ;OS2SS-@@ PTM 6860
+ Mov ECX,20 ;OS2SS-Set max pairs in Accent table entry.
+ Add EDI,AcMap1 ;Point to first pair in accent table entry.
+TLoop: ;Top of loop looking for current scan code in accent table entry.
+ Mov DX,[EDI] ;OS2SS-Pick up next pair.
+ .If <DX eq 0> ;@@ PTM 6860 - Begin If we are at the end
+ ;@@ of the list
+ Mov ECX,1 ;OS2SS-@@ Set end of loop condition
+ .ElseIf <AL eq DL> ;@@ Else Have we found a match?
+ Jmp Short XLoop ;Yes, so exit from loop.
+ .Endif
+ Add EDI,2 ;Increment our pointer.
+ Loop TLoop ;Repeat.
+XLoop: Or CX,CX ;Check if no match before end of entry.
+ .If <z> ;Is that true?
+ Mov ECX,[EBP-4] ;OS2SS-@@ Get the XT header
+ Mov CX,[ECX].XTFlags1 ;OS2SS-@@ Get the XT header flags.
+ Mov EDI,[ESP+12] ;OS2SS- Restore OtherFlag index.
+ Call BadAccent ;No! Go take care of things.
+ .Else ;Else we found our accented character value!
+ Mov [ESI].Key.Char,DH ;OS2SS-Put it in CharData rec.
+; Mov [ESI].Key.Scan,0 ;OS2SS-Zero scan code for accented chars.
+ Or [ESI].DDFlags,AccentedKey ;OS2SS-Indicate accent affected key.
+ .Endif
+ Pop EAX ;Restore AX.
+ .Endif
+ Pop EDX ;Restore the...
+ Pop ECX ;..altered regs.
+ Pop EDI ;Restore PSG index.
+ And [EDI].XPSGFlags,Not PrevAccent ;OS2SS-@@ Clear previous accent field.
+ .Endif
+ Pop EBX ;@@ Restore BX
+ Test [ESI].DDFlags,AccentedKey ;OS2SS-Check if accent affected key.
+ .If <nz> OR ;Did it?
+ .If <[ESI].DDFlags e BadKeyCombo> ;OS2SS-@@ check if this was an invalid combo?
+ Pop EBX ;OS2SS-Throw away original return address.
+ Jmp EndActionCase ;And quit now.
+ .Endif
+ Ret ;Else return.
+
+AccCheckout Endp ;-----------------------------------------------------/
+
+Public BadAccent
+BadAccent Proc ;------------------------------------------------------\
+
+;***********************************************************************
+;* *
+;* Subroutine Name: BadAccent *
+;* *
+;* Descriptive Name: Process an Accent that does Not Apply to a Char *
+;* *
+;* Function: Set up a KeyPacket that must be passed as a standalone *
+;* character *
+;* *
+;* Entry Point: BadAccent Linkage: Near *
+;* *
+;* Input: SI = @ of KeyPacket *
+;* Empty KeyPacket2 immediately follows KeyPacket *
+;* ES:BX = @ of Accent Table Entry for accent to pass *
+;* CX = Translate Table Header Flags *
+;* *
+;* Exit-Normal: Monitor Key Packet filled in *
+;* *
+;* Exit-Error: N/A *
+;* *
+;* Effects: CX *
+;* *
+;* Internal References: *
+;* Routines: CopyPacket *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+ Push ESI ;OS2SS-
+ Push EDI ;OS2SS-
+ Test CX,AccentPass ;@@ Check if key packets should be passed
+ .If <z> OR ;@@ If not... OR
+ Test [EDI].OtherFlags,InterruptTime ;OS2SS-@@ If it's interrupt time
+ .If <z> ;@@ Tell Int Handler to beep
+ Mov [ESI].DDFlags,BadKeyCombo ;OS2SS-@@ or strategy proc to return invalid parm.
+ .Else ;@@ Else key packets should be passed
+ Call CopyPacket ;&& PTM 2382: Make a copy of the first
+ ;&& packet into the extra packet.
+
+ ;Now ESI has incremented to point to KeyPacket2.
+ Mov Byte Ptr [ESI].MonFlags+1,0 ;OS2SS-Zero the original scan code field.
+ Mov [ESI].DDFlags,AccentedKey+AccentKey ;OS2SS-@@ Indicate printable accent char.
+ Mov CX,[EBX] ;OS2SS-Get char/scan to pass from accent entry.
+ Mov Word Ptr [ESI].Key.Char,CX ;OS2SS-Put in KeyPacket2.
+ Mov Byte Ptr [ESI].MonFlags,-1 ;OS2SS-Tell KBDDD to pass two packets.
+ .Endif
+ Pop EDI
+ Pop ESI
+ Ret
+
+BadAccent Endp ;------------------------------------------------------/
+
+Public AltPadPacket
+AltPadPacket Proc ;---------------------------------------------\
+
+;***********************************************************************
+;* *
+;* Subroutine Name: AltPadPacket *
+;* *
+;* Descriptive Name: Set up a KeyPacket for the Break of the Alt Key *
+;* *
+;* Function: A monitor packet is set up so that on Alt-Numpad *
+;* sequences the break of the Alt key is not lost. *
+;* *
+;* Entry Point: AltPadPacket Linkage: Near *
+;* *
+;* Input: SI = @ of KeyPacket *
+;* Empty KeyPacket2 immediately follows KeyPacket *
+;* *
+;* Exit-Normal: Monitor Key Packet filled in *
+;* *
+;* Exit-Error: N/A *
+;* *
+;* Effects: None, Registers are preserved. *
+;* *
+;* Internal References: *
+;* Routines: CopyPacket *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+ ;&& DCR 1713 BEGIN:
+ Push ESI ;OS2SS-&& Save the registers
+ Push EDI ;OS2SS-&& that we will use here
+ Push ECX ;OS2SS-&& to duplicate the first packet.
+ Call CopyPacket ;&& PTM 2382: Make a copy of the first
+ ;&& packet into the extra packet.
+
+ ;&& Now ESI has been incremented to point to KeyPacket2.
+
+ Or [ESI].DDFlags,ShiftMask+KeyBreak ;OS2SS-&& Indicate that this is shift packet.
+ Mov word ptr [ESI].Key.Char,0 ;OS2SS-&& Zero out the original char field.
+ Mov Byte Ptr [ESI].MonFlags,-1 ;OS2SS-&& Tell KBDDD to pass two packets.
+ Pop ECX ;OS2SS-&& Restore registers.
+ Pop EDI ;OS2SS-&&
+ Test [EDI].XInputMode,SHIFTREPORT ;OS2SS-&& Are we in shift report mode ?
+ .If <nz> ;&& If so then...
+ Or [ESI].Key.Status,1 ;OS2SS-&& flag this as a shift report packet.
+ .Endif ;&& Endif a shift report packet.
+ Pop ESI ;OS2SS-&&
+ Ret ;&& DCR 1713 END:
+
+AltPadPacket Endp ;------------------------------------------------------/
+
+Public MakeE0Packet
+MakeE0Packet Proc ;---------------------------------------------\
+
+;***********************************************************************
+;* *
+;* Subroutine Name: MakeE0Packet *
+;* *
+;* Descriptive Name: Set up a KeyPacket for the E0 scan code *
+;* *
+;* Function: A monitor packet is set up for the E0 scan code packet *
+;* that should have preceded the current scan code. *
+;* *
+;* Note: This routine added for CP111 PTM 2382. An E0 keypacket *
+;* is now manufactured and passed in combination with the *
+;* packet that follows the E0 scan code. This change was *
+;* made in order to ensure that the E0 packet would always *
+;* end up in the correct screen group. *
+;* *
+;* Entry Point: MakeE0Packet Linkage: Near *
+;* *
+;* Input: SI = @ of KeyPacket *
+;* Empty KeyPacket2 immediately follows KeyPacket *
+;* *
+;* Exit-Normal: Monitor Key Packet filled in *
+;* *
+;* Exit-Error: N/A *
+;* *
+;* Effects: None, Registers are preserved. *
+;* *
+;* Internal References: *
+;* Routines: CopyPacket *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+ ;&& PTM 2382 BEGIN:
+ Push ESI ;OS2SS-&& Save the registers
+ Push EDI ;OS2SS-&& that we will use here
+ Push ECX ;OS2SS-&& to duplicate the first packet.
+
+ Call CopyPacket ;&& PTM 2382: Make a copy of the first
+ ;&& packet into the extra packet.
+
+ ;&& Now ESI has been incremented to point to KeyPacket2.
+
+ Mov Byte Ptr [ESI].MonFlags,0 ;OS2SS-&& Init monitor flags low byte to zero.
+ Mov Byte Ptr [ESI].MonFlags+1,OtherKey ;OS2SS-&& Put Scan Code in MonFlags high byte.
+ Mov [ESI].DDFlags, 0 ;OS2SS-&& Clear the flag bits for new packet.
+ Or [ESI].DDFlags, SecPrefixCode ;OS2SS-&& Indicate this is a secondary prefix.
+ Mov CX, [_Ow2KCBShFlgs] ;&& Get the saved Shift Flags.
+ Mov [ESI].Key.Shift,CX ;OS2SS-&& Put Shift Flags in packet.
+ Mov [ESI].Key.Char,0 ;OS2SS-&& Zero out the original char field.
+ Mov [ESI].Key.Scan,0 ;OS2SS-&& Zero out the original Scan field.
+
+ Mov Byte Ptr [ESI].MonFlags,-1 ;OS2SS-&& Tell KBDDD to pass two packets.
+
+ Pop ECX ;OS2SS-&& Restore registers.
+ Pop EDI ;OS2SS-&&
+ Pop ESI ;OS2SS-&&
+ Ret ;&& PTM 2382 END:
+
+MakeE0Packet Endp ;------------------------------------------------------/
+
+Public CopyPacket
+CopyPacket Proc ;-----------------------------------------------------\
+;***********************************************************************
+;* *
+;* Subroutine Name: CopyPacket *
+;* *
+;* Descriptive Name: Copy KeyPacket1 to KeyPacket2 *
+;* *
+;* Function: This routine is called from BadAccent, AltPadPacket, *
+;* and MakeE0Packet. It's purpose is to duplicate the *
+;* first keypacket to the extra keypacket which follows *
+;* the first. This is done so that the Interrupt Handler *
+;* can pass both keypackets on the same interrupt. *
+;* *
+;* Entry Point: CopyPacket Linkage: Near *
+;* *
+;* Input: SI = @ of KeyPacket *
+;* Empty KeyPacket2 immediately follows KeyPacket *
+;* *
+;* Exit-Normal: Monitor Key Packet copyed *
+;* *
+;* Exit-Error: N/A *
+;* *
+;* Effects: *
+;* *
+;* Internal References: *
+;* Routines: None *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+
+ Mov ECX,KeyPacketLen ;OS2SS-&& Set length of packets.
+ Mov EDI,ESI ;OS2SS-&& Point to...
+ Add EDI,ECX ;OS2SS-&& ...KeyPacket2.
+CopyLoop: ;&& Loop copying packet.
+ Mov CH,[ESI] ;OS2SS-&& Get byte from first packet.
+ Mov [EDI],CH ;OS2SS-&& Put in Packet2.
+ Xor CH,CH ;&& Fix counter reg.
+ Inc ESI ;OS2SS-&& Increment source ptr.
+ Inc EDI ;OS2SS-&& Increment dest ptr.
+ Loop CopyLoop ;&& Repeat for all bytes.
+ Ret
+
+CopyPacket Endp ;------------------------------------------------------/
+
+
+Public UnPauseChk
+UnPauseChk Proc ;-----------------------------------------------------\
+;***********************************************************************
+;* *
+;* Subroutine Name: UnPauseChk *
+;* *
+;* Descriptive Name: Check For Key to End Pause Mode *
+;* *
+;* Function: Checks if key signalled the end of Pause mode. *
+;* If it did, this routine resets the flag and *
+;* returns to the the end of KbdXlate. Otherwise *
+;* it just returns *
+;* *
+;* Entry Point: UnPauseChk Linkage: Near *
+;* *
+;* Input: None *
+;* *
+;* Exit-Normal: Nothing affected *
+;* *
+;* Exit-Error: N/A *
+;* *
+;* Effects: Nothing *
+;* *
+;* Internal References: *
+;* Routines: None *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+
+ And [EDI].XlateFlags,NOT DumpKeyOnce ;OS2SS-@@ If here, also cancels Dump sequence.
+ Test [EDI].XPSGFlags,NowPaused ;OS2SS-@@ Check if in paused state.
+ .If <nz> AND ;Are we?
+ Test [ESI].DDFlags,KeyBreak ;OS2SS-Yes, and is this a key Make?
+ .If <z> ;Is it?
+ And [ESI].DDFlags, NOT KeyTypeMask ;OS2SS-&& PTM 3940: Indicate Wake-Up key.
+ Or [ESI].DDFlags,WakeUpKey ;OS2SS-&& PTM 3940:
+ Pop ECX ;OS2SS-Purge return address.
+ Jmp EndActionCase ;That's all.
+ .Endif
+ Ret
+
+UnPauseChk Endp ;-----------------------------------------------------/
+
+Public AltGraphCheck
+AltGraphCheck Proc ;@@ ------------------------------------------\
+;@@ B
+;************** START OF SPECIFICATIONS ********************************
+;* *
+;* Subroutine Name: AtlGraphCheck *
+;* *
+;* Descriptive Name: Process an Alt-Graph character input *
+;* *
+;* Function: This routine processes a key type that is affected *
+;* by Alt-Graph if an Alt key is down. If the Alt key *
+;* down is not the Alt-Graph key or the Alt-Graph combo, *
+;* it will set the carry and return. *
+;* *
+;* Notes: Upon entry to this routine, an Alt key is known to be *
+;* down *
+;* *
+;* Entry Point: AltGraphCheck Linkage: Near *
+;* *
+;* Input: DI = Per Session Data Area Address *
+;* SI = Key Packet Address *
+;* ES = Translate Table Selector *
+;* SS:SP+2 = Offset of translate table *
+;* BP = Offset of scan code entry in translate table *
+;* DX = ShiftFlags *
+;* CharToUse = Which character to use if Alt-Graph is down *
+;* *
+;* Exit-Normal: Carry set = process as normal Alt key down *
+;* Carry clear = key has been processed *
+;* AL= ASCII character to use *
+;* OR *
+;* CharToUse = UNDEFINED *
+;* Exit-Error: None *
+;* *
+;* Effects: AX, registers, carry flag changed. *
+;* *
+;* Internal References: *
+;* Routines: None *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+;@@ E
+ Push EBX ;OS2SS-
+ Push ESI ;OS2SS-
+ Mov EBX, [EBP-8] ;OS2SS-Pointer to XlateTable entry for this scan code.
+ Mov ESI, [EBP-4] ;OS2SS-Pointer to XlateTable top
+
+ .If <[EBX].Char3 eq 0> ;OS2SS-@@ If Char 3 is 0
+ Or [EDI].XlateFlags,NormalAlt ;OS2SS-@@ indicate that only Normal ALT is down
+ .Else NEAR ;@@ Else Alt-Graph character is defined
+ Mov AL,[EBX].Char3 ;OS2SS-@@ Get Char3 from translate table
+ .If <[ESI].XTKbdType eq ATKbd> ;OS2SS-@@ If an AT kbd translate table
+ Test [ESI].XTFlags1,ShftAlt ;OS2SS-@@ check if we should use Shift-Alt as
+ .If <nz> ;@@ as the Alt-Graph combo, if so...
+ Test DL,RShiftFlag+LShiftFlag ;@@ Check if a shift key is down
+ .If <nz> ;@@ If it is
+ And [EDI].XlateFlags,Not NormalAlt ;OS2SS-@@ specify to caller
+ ;@@ that it's Alt-Graph
+ Test [EDI].XlateFlags,Use3Index ;OS2SS-@@ if we're supposed to use it
+ .If <nz> ;@@ as an index
+ Mov CL,AL
+ Xor AL,AL
+ .Endif
+ .Else ;@@ supposed to use Shift-Alt combo, but shift isn't down
+ Mov AL,[EBX].Char1 ;OS2SS-@@ Restore Char1
+ Or [EDI].XlateFlags,NormalAlt ;OS2SS-@@ indicate that only Normal ALT is down
+ .Endif ;@@ Endif shift key down check
+ .Else ;@@ Shift-Alt is not Alt-Graph combo, so it is Ctl-Alt
+ Test DL,CtlFlag ;@@ Check if a ctl key is down
+ .If <nz> ;@@ If it is
+ And [EDI].XlateFlags,Not NormalAlt ;OS2SS-@@ specify to caller
+ ;@@ that it's Alt-Graph
+ Test [EDI].XlateFlags,Use3Index ;OS2SS-@@ if we're supposed to use it
+ .If <nz> ;@@ as an index
+ Mov CL,AL
+ Xor AL,AL
+ .Endif
+ .Else ;@@ supposed to use Ctl-Alt combo, but Ctl isn't down
+ Or [EDI].XlateFlags,NormalAlt ;OS2SS-@@ indicate only Normal ALT is down
+ Mov AL,[EBX].Char1 ;OS2SS-@@ Restore Char1
+ .Endif ;@@ Endif Ctlt key down check
+ .Endif ;@@ Endif Shift-Alt is Alt-Graph combo or not check
+ .Else ;@@ Else it's an Enhanced Keyboard
+ Test [ESI].XTFlags1,AltGrafL ;OS2SS-@@ check if we should use Left Alt key
+ .If <nz> ;@@ as the Alt-Graph key, if so...
+ Test DX,LAltFlag ;@@ Check if left Alt key is down
+ .If <nz> ;@@ If it is
+ And [EDI].XlateFlags,Not NormalAlt ;OS2SS-@@ specify to caller
+ ;@@ that it's Alt-Graph
+ Test [EDI].XlateFlags,Use3Index ;OS2SS-@@ if we're supposed to use it
+ .If <nz> ;@@ as an index
+ Mov CL,AL
+ Xor AL,AL
+ .Endif
+ .Else ;@@ supposed to use Left Alt key, but it isn't the one down
+ Or [EDI].XlateFlags,NormalAlt ;OS2SS-@@ indicate that only
+ ;@@ Normal ALT is down
+ Mov AL,[EBX].Char1 ;OS2SS-@@ Restore Char1
+ .Endif ;@@ Endif Left Alt key down check
+ .Else ;@@ Left Alt Key is not Alt-Graph key, so check if it is Right
+
+ Test [ESI].XTFlags1,AltGrafR ;OS2SS-@@ check if we should use Right Alt key
+ .If <nz> ;@@ as the Alt-Graph key, if so...
+ Test DX,RAltFlag ;@@ Check if right Alt Key is down
+ .If <nz> ;@@ If it is
+ And [EDI].XlateFlags,Not NormalAlt ;OS2SS-@@ specify that it's Alt-Graph
+ Test [EDI].XlateFlags,Use3Index ;OS2SS-@@ if we're supposed to use it
+ .If <nz> ;@@ as an index
+ Mov CL,AL
+ Xor AL,AL
+ .Endif
+ .Else ;@@ supposed to use Right Alt Key, but it isn't down
+ Or [EDI].XlateFlags,NormalAlt ;OS2SS-@@ indicate that only Normal
+ Mov AL,[EBX].Char1 ;@@ Restore Char1
+ .Endif ;@@ Endif Right Alt Key down check
+ .Else ;@@ Else Alt-Graph is neither Left nor Right Alt Key
+ Or [EDI].XlateFlags,NormalAlt ;OS2SS-@@ indicate that only Normal
+ Mov AL,[EBX].Char1 ;@@ Restore Char1
+ .Endif ;@@ Endif Right key is Alt-Graph or not check
+ .Endif ;@@ Endif Left ALt key is Alt-Graph or not check
+ .Endif ;@@ Endif At or Enhanced Keyboard
+ .Endif ;@@ Endif Char 3 is 0 or not
+ Pop ESI ;OS2SS-
+ Pop EBX ;OS2SS-
+ Ret
+
+AltGraphCheck Endp ;@@-------------------------------------------/
+
+Public CheckExtended
+CheckExtended Proc ;@@ ------------------------------------------\
+;@@ B
+;************** START OF SPECIFICATIONS ********************************
+;* *
+;* Subroutine Name: CheckExtended *
+;* *
+;* Descriptive Name: Checks for extended codes. *
+;* *
+;* Function: This routine checks if a scan code has an associated *
+;* extended scan code that goes with it. If it does, *
+;* it sets the appropriate fields (scan & char) in the *
+;* key packet and returns. *
+;* *
+;* Notes: Upon entry to this routine, an Alt key is known to be *
+;* down *
+;* *
+;* Entry Point: CheckExtended Linkage: Near *
+;* *
+;* Input: DI = Per Session Data Area Address *
+;* SI = Key Packet Address *
+;* DX = ShiftFlags *
+;* AH = Scan code w/ break bit cleared *
+;* *
+;* Exit-Normal: Carry set = Key has new extended code associated w/ it *
+;* Carry clear = Key does not have new extended code *
+;* *
+;* Exit-Error: None *
+;* *
+;OS2SS- Effects: AX, registers, carry flag changed. *
+;* *
+;* Internal References: *
+;* Routines: None *
+;* *
+;* External References: *
+;* Routines: None *
+;* *
+;***********************************************************************
+ Push EBX ;OS2SS-
+ ;@@ PTM 5024 - BEGIN
+ Mov EBX, Offset NewExtSC ;OS2SS-@@ Get the offset of the table that
+ ;@@ contains the scan codes that have new
+ ;@@ extended codes associated with them
+ Mov CX,0 ;@@ Start at beginning of table
+ .While <CX ne NewExtSCLen> ;@@ While we haven't searched entire table
+ .If <AH eq [EBX]> ;OS2SS-@@ If we found the scan code
+ Mov [ESI].Key.Char,0 ;OS2SS-@@ Say its an extended
+ Mov CX,NewExtSCLen ;@@ Set end of loop condition
+ Mov EBX,0 ;OS2SS-@@ Set found indicator
+ .Else ;@@ Else this isn't the scan code
+ Inc CX ;@@ Increment loop counter
+ Inc EBX ;OS2SS-@@ Increment pointer into table
+ .Endif ;@@ Endif found scan code we're looking for
+ .EndWhile ;@@ EndWhile we haven't searched entire table
+ .If <EBX eq 0> ;OS2SS-@@ If we found the scan code
+ .If <AH eq 0Fh> ;@@ If it's the tab key
+ Mov [ESI].Key.Scan,0A5h ;OS2SS-@@ Set extended code for tab key
+ .Endif ;@@ Endif it's the tab key
+ Stc ;@@ Tell caller extended char. exists.
+ .Else ;@@ Else we didn't find Scan code in table
+ Clc ;@@ tell caller
+ .Endif ;@@
+ Pop EBX ;OS2SS-
+ Ret ;@@
+ ;@@ PTM 5024 - END
+;@@ E
+CheckExtended Endp ;@@-------------------------------------------/
+
+_TEXT ends
+ End
diff --git a/private/os2/os2ses/i386/lakbd.asm b/private/os2/os2ses/i386/lakbd.asm
new file mode 100644
index 000000000..74ee8d807
--- /dev/null
+++ b/private/os2/os2ses/i386/lakbd.asm
@@ -0,0 +1,788 @@
+;; SCCSID = @(#)lakbd.asm 12.1 88/03/18
+ Page 58,132
+ Title LAKBD - Translate Table Structure for CP/DOS 1.1
+ Name LAKBD
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: LAKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Latin America *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Change Activity: *
+;* *
+;* PTM 3114 - Changed incorrect AccEnt definition of I-Acute *
+;* in the 850 AT table (from DEh to D6h). pjr *
+;* *
+;* PTM 3378 - Moved definition of L3 '@' char from scan code 2 *
+;* to scan code 3 in the 437 AT table. pjr *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK LAKBD; **
+;** RELOC LAKBD.EXE LAKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+ db 1,2,3
+ db 0,-1
+
+Public _Ow2LA437001 ;***************
+_Ow2LA437001 Label Byte ;Beginning of the table. LA 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,1,0,0,AT,Len1,'LA','171'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1',0ADh, 0, 0, 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; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",26,27,26,0,26,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <0FEh,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'`',27,29,27,0,27,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2LA437001
+
+;*****************************************************************************
+
+Public _Ow2LA437011 ;***************
+_Ow2LA437011 Label Byte ;Beginning of the table. LA 437 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,1,0,0,EN,Len2,'LA','171'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 FAh
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', 0, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', 0, 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '?', '\', 0, 0 ; 12 ' ?
+ KeyDef 4, 0,0,0,0,0,0,0, 0A8h,0ADh, 0, 0, 0 ; 13 A8h ADh
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0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0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",26,27,26,0,26,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <0FEh,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',40,0,0,0,40,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2LA437011
+
+;*****************************************************************************
+
+Public _Ow2LA850000 ;***************
+_Ow2LA850000 Label Byte ;Beginning of the table. LA 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,1,0,0,AT,Len3,'LA','171'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1',0ADh, 0, 0, 0 ; 2 1 ADh
+ KeyDef 4, 0,0,0,0,0,0,0, '2',0A8h, '@', 0, 0 ; 3 2 A8h
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '/', 0, 0, 0 ; 7 6 /
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0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
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0EFh,26,27,26,0,26,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',0B5h,'E',90h,'I',0D6h,'O',0E0h,'U',0E9h,' ',0EFh>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'`',27,29,27,0,27,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2LA850000
+
+;*****************************************************************************
+
+Public _Ow2LA850010 ;***************
+_Ow2LA850010 Label Byte ;Beginning of the table. LA 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'LA','171'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 FAh
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', 0, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', 0, 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '?', '\', 0, 0 ; 12 ' ?
+ KeyDef 4, 0,0,0,0,0,0,0, 0A8h,0ADh, 0, 0, 0 ; 13 A8h ADh
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', '@', 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 1,1,1,1,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 0, 0 ; 19 r R
+ K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 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,26, 27,26, 0,26
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh
+db ' ',0EFh, 0,0, 0,0, 0,0, 0,0, 0,0
+db 0,0, 0,0
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',40,0,0,0,40,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'`',43,28,43,0,43,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2LA850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/nlkbd.asm b/private/os2/os2ses/i386/nlkbd.asm
new file mode 100644
index 000000000..3a1c1daf5
--- /dev/null
+++ b/private/os2/os2ses/i386/nlkbd.asm
@@ -0,0 +1,784 @@
+;; SCCSID = @(#)nlkbd.asm 10.3 87/06/12
+ Page 58,132
+ Title NLKBD - Translate Table Structure for CP/DOS 1.1
+ Name NLKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: NLKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for the Netherlands *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Changes: *
+;* *
+;* 2/13/87 - Corrected 850 AT LED key keydefs per PTM 2270. pjr *
+;* *
+;* 3/13/87 - PTM 3234: Corrected "bracket" key problem in *
+;* Enhanced keyboards (unshifted/shifted reversed). pjr *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK NLKBD; **
+;** RELOC NLKBD.EXE NLKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+ db 0,-1
+
+Public _Ow2NL437001 ;***************
+_Ow2NL437001 Label Byte ;Beginning of the table. NL 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,0,AT,Len1,'NL','143'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 0, 0 ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 12 - _
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '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, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2NL437001
+
+;******************************************************************************
+
+Public _Ow2NL437011 ;***************
+_Ow2NL437011 Label Byte ;Beginning of the table. NL 437 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,1,0,0,EN,Len2,'NL','143'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!',0FBh, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"',0FDh, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#',0FCh, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$',0ACh, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%',0ABh, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&',0F3h, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '_', 9Ch, 0, 0 ; 8 7 _
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '{', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', '}', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', "'", 0,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 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'~',13,0,0,0,131,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <0F7h,13,0,0,0,131,'c',87h,'C',80h,' ',0F7h>
+
+AccEnt <0F9h,26,27,26,0,26,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',26,27,26,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <"'",40,0,0,0,40,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',40,0,0,0,0,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <>
+
+Len2 EQU $ - _Ow2NL437011
+
+;*****************************************************************************
+
+Public _Ow2NL850000 ;***************
+_Ow2NL850000 Label Byte ;Beginning of the table. NL 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,0,0,0,AT,Len3,'NL','143'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!',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of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2NL850000
+
+;*****************************************************************************
+
+Public _Ow2NL850010 ;***************
+_Ow2NL850010 Label Byte ;Beginning of the table. NL 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'NL','143'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ K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0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'~',13,0,0,0,131,'a',0C6h,'n',0A4h,'o',0E4h,'A',0C7h,'N',0A5h,'O',0E5h,' ','~'>
+
+AccEnt <0F7h,13,0,0,0,131,'c',87h,'C',80h,' ',0F7h>
+
+AccEnt <0F9h,26,27,26,0,26,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',26,27,26,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+;AccEnt #5
+db 0EFh,40, 0,0, 0,40
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh
+db ' ',0EFh, 0,0, 0,0, 0,0, 0,0, 0,0
+db 0,0, 0,0
+
+AccEnt <'`',40,0,0,0,0,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <>
+
+Len4 EQU $ - _Ow2NL850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/nokbd.asm b/private/os2/os2ses/i386/nokbd.asm
new file mode 100644
index 000000000..88dbcf3c0
--- /dev/null
+++ b/private/os2/os2ses/i386/nokbd.asm
@@ -0,0 +1,791 @@
+;; SCCSID = @(#)nokbd.asm 12.1 88/03/18
+ Page 58,132
+ Title NOKBD - Translate Table Structure for CP/DOS 1.1
+ Name NOKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: NOKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Norway *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK NOKBD; **
+;** RELOC NOKBD.EXE NOKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+;CtlPadMap Label Byte
+Public _Ow2NO865001 ;***************
+_Ow2NO865001 Label Byte ;Beginning of the table. NO 865 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 865,1,0,0,0,1,0,1,0,0,AT,Len1,'NO','155'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, '#', 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', '^', 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '&', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '*', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', '(', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', ')', 0, 0 ; 11 0 =
+ KeyDef 21, 0,0,0,0,0,0,0, '+', '?', '_', '-', 0 ; 12 + ?
+ KeyDef 21, 0,0,0,0,0,0,0, 1, 2, '+', '=', 0 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+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,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 9Bh, 9Dh, ':', ';', 0 ; 39 o O (slash)
+ KeyDef 3, 0,0,0,0,0,0,0, 91h, 92h, '"', "'", 0 ; 40 aE dipthong
+ KeyDef 21, 0,0,0,0,0,0,0, '<', '>', 7Ch, '\', 0 ; 41 < >
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 21, 0,0,0,0,0,0,0, "'", '*', '~', '`', 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, 0, 0 ; 46 c C
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 0, 0 ; 47 v V
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 0, 0 ; 48 b B
+ KeyDef 1, 0,0,0,0,0,0,0, 'n', 'N', 0, 0, 0 ; 49 n N
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 0, 0 ; 50 m M
+ KeyDef 4, 0,0,0,0,0,0,0, ',', ';', '<', 0, 0 ; 51 , ;
+ KeyDef 4, 0,0,0,0,0,0,0, '.', ':', '>', 0, 0 ; 52 . :
+ KeyDef 21, 0,0,0,0,0,0,0, '-', '_', '?', '/', 0 ; 53 - _
+ KeyDef 12, 0,0,0,0,0,0,0, 1, 0, 0, 0, 0 ; 54 Shift(R)
+ KeyDef 9, 0,0,0,0,0,0,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 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <0FEh,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2NO865001
+
+;******************************************************************************
+
+Public _Ow2NO865011 ;***************
+_Ow2NO865011 Label Byte ;Beginning of the table. NO 865 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 865,0,0,1,0,1,0,1,0,0,EN,Len2,'NO','155'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4',0AFh, '$', 0, 0 ; 5 4 monetary symbol
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&',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 F10
+ KeyDef 15, 0,0,0,0,0,0,0, 20h, 20h, 20h, 0, 0 ; 69 NumLock
+ KeyDef 17, 0,0,0,0,0,0,0, 10h, 10h, 10h, 0, 0 ; 70 ScrollLock
+ KeyDef 7, 0,0,0,0,0,0,0, 0, '7', 0, 0, 0 ; 71 Home 7
+ KeyDef 7, 0,0,0,0,0,0,0, 1, '8', 0, 0, 0 ; 72 'Up' 8
+ KeyDef 7, 0,0,0,0,0,0,0, 2, '9', 0, 0, 0 ; 73 PgUp 9
+ KeyDef 7, 0,0,0,0,0,0,0, 3, '-', 0, 0, 0 ; 74 - (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 4, '4', 0, 0, 0 ; 75 'Left'4
+ KeyDef 7, 0,0,0,0,0,0,0, 5, '5', 0, 0, 0 ; 76 5
+ KeyDef 7, 0,0,0,0,0,0,0, 6, '6', 0, 0, 0 ; 77'Right'6
+ KeyDef 7, 0,0,0,0,0,0,0, 7, '+', 0, 0, 0 ; 78 + (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 8, '1', 0, 0, 0 ; 79 End 1
+ KeyDef 7, 0,0,0,0,0,0,0, 9, '2', 0, 0, 0 ; 80 'Down'2
+ KeyDef 7, 0,0,0,0,0,0,0, 10, '3', 0, 0, 0 ; 81 PgDn 3
+ KeyDef 7, 0,0,0,0,0,0,0, 11, '0', 0, 0, 0 ; 82 Ins 0
+ KeyDef 7, 0,0,0,0,0,0,0, 12, ',', 0, 0, 0 ; 83 Del ,
+ KeyDef 10, 0,0,0,0,0,0,0, 0, 80h, 80h, 0, 0 ; 84 SysReq
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 85 (undefined)
+ KeyDef 2, 0,0,0,0,0,0,0, '<', '>', 0, 0, 0 ; 86 < >
+ KeyDef 6, 0,0,0,0,0,0,0, 11, 0, 0, 0, 0 ; 87 F11
+ KeyDef 6, 0,0,0,0,0,0,0, 12, 0, 0, 0, 0 ; 88 F12
+ KeyD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 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+
+
+; Accent #3
+db 0FEh,27, 29,27, 0,27
+db 'a',84h, 'e',89h, 'i',8Bh , 'o',94h
+db 'u',81h, 'y',98h, 'A',8Eh, 'O',99h, 'U',9Ah
+db 0,0, 0,0, 0,0, 0,0, 0,0
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2NO865011
+
+;*****************************************************************************
+
+Public _Ow2NO850000 ;***************
+_Ow2NO850000 Label Byte ;Beginning of the table. NO 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,1,0,0,0,0,0,1,0,0,AT,Len3,'NO','155'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, '#', 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', '^', 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '&', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '*', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', '(', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', ')', 0, 0 ; 11 0 =
+ KeyDef 21, 0,0,0,0,0,0,0, '+', '?', '_', '-', 0 ; 12 + ?
+ KeyDef 21, 0,0,0,0,0,0,0, 1, 2, '+', '=', 0 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 1,1,1,1,0,0,0, 'e', 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; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 9Bh, 9Dh, ':', ';', 0 ; 39 o O (slash)
+ KeyDef 3, 0,0,0,0,0,0,0, 91h, 92h, '"', "'", 0 ; 40 aE dipthong
+ KeyDef 21, 0,0,0,0,0,0,0, '<', '>', 7Ch, '\', 0 ; 41 < >
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 21, 0,0,0,0,0,0,0, "'", '*', '~', '`', 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, 0, 0 ; 46 c C
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 0, 0 ; 47 v V
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 0, 0 ; 48 b B
+ KeyDef 1, 0,0,0,0,0,0,0, 'n', 'N', 0, 0, 0 ; 49 n N
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 0, 0 ; 50 m M
+ KeyDef 4, 0,0,0,0,0,0,0, ',', ';', '<', 0, 0 ; 51 , ;
+ KeyDef 4, 0,0,0,0,0,0,0, '.', ':', '>', 0, 0 ; 52 . :
+ KeyDef 21, 0,0,0,0,0,0,0, '-', '_', '?', '/', 0 ; 53 - _
+ KeyDef 12, 0,0,0,0,0,0,0, 1, 0, 0, 0, 0 ; 54 Shift(R)
+ KeyDef 9, 0,0,0,0,0,0,0, '*', 114, 0, 0, 0 ; 55 * PrtSc
+ KeyDef 14, 0,0,0,0,0,0,0, 8, 2, 8, 0, 0 ; 56 Alt
+ KeyDef 4, 1,1,1,1,0,0,0, ' ', ' ', 0, 0, 0 ; 57 Space
+ KeyDef 16, 0,0,0,0,0,0,0, 40h, 40h, 40h, 0, 0 ; 58 CapsL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0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2NO850000
+
+;*****************************************************************************
+
+Public _Ow2NO850010 ;***************
+_Ow2NO850010 Label Byte ;Beginning of the table. NO 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'NO','155'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4',0CFh, '$', 0, 0 ; 5 4 monetary symbol
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 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ef 6, 0,0,0,0,0,0,0, 10, 0, 0, 0, 0 ; 68 F10
+ KeyDef 15, 0,0,0,0,0,0,0, 20h, 20h, 20h, 0, 0 ; 69 NumLock
+ KeyDef 17, 0,0,0,0,0,0,0, 10h, 10h, 10h, 0, 0 ; 70 ScrollLock
+ KeyDef 7, 0,0,0,0,0,0,0, 0, '7', 0, 0, 0 ; 71 Home 7
+ KeyDef 7, 0,0,0,0,0,0,0, 1, '8', 0, 0, 0 ; 72 'Up' 8
+ KeyDef 7, 0,0,0,0,0,0,0, 2, '9', 0, 0, 0 ; 73 PgUp 9
+ KeyDef 7, 0,0,0,0,0,0,0, 3, '-', 0, 0, 0 ; 74 - (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 4, '4', 0, 0, 0 ; 75 'Left'4
+ KeyDef 7, 0,0,0,0,0,0,0, 5, '5', 0, 0, 0 ; 76 5
+ KeyDef 7, 0,0,0,0,0,0,0, 6, '6', 0, 0, 0 ; 77'Right'6
+ KeyDef 7, 0,0,0,0,0,0,0, 7, '+', 0, 0, 0 ; 78 + (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 8, '1', 0, 0, 0 ; 79 End 1
+ KeyDef 7, 0,0,0,0,0,0,0, 9, '2', 0, 0, 0 ; 80 'Down'2
+ KeyDef 7, 0,0,0,0,0,0,0, 10, '3', 0, 0, 0 ; 81 PgDn 3
+ KeyDef 7, 0,0,0,0,0,0,0, 11, '0', 0, 0, 0 ; 82 Ins 0
+ KeyDef 7, 0,0,0,0,0,0,0, 12, ',', 0, 0, 0 ; 83 Del ,
+ KeyDef 10, 0,0,0,0,0,0,0, 0, 80h, 80h, 0, 0 ; 84 SysReq
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 85 (undefined)
+ KeyDef 2, 0,0,0,0,0,0,0, '<', '>', 0, 0, 0 ; 86 < >
+ KeyDef 6, 0,0,0,0,0,0,0, 11, 0, 0, 0, 0 ; 87 F11
+ KeyDef 6, 0,0,0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 KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'a',0C6h,'n',0A4h,'o',0E4h,'A',0C7h,'N',0A5h,'O',0E5h,' ','~'>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2NO850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/pokbd.asm b/private/os2/os2ses/i386/pokbd.asm
new file mode 100644
index 000000000..70da908fc
--- /dev/null
+++ b/private/os2/os2ses/i386/pokbd.asm
@@ -0,0 +1,773 @@
+;; SCCSID = @(#)pokbd.asm 12.1 88/03/18
+ Page 58,132
+ Title POKBD - Translate Table Structure for CP/DOS 1.1
+ Name POKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: POKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Portugal *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK POKBD; **
+;** RELOC POKBD.EXE POKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+;CtlPadMap Label Byte
+; db 119,-1,132,-1
+Public _Ow2PO860001 ;***************
+_Ow2PO860001 Label Byte ;Beginning of the table. PO 860 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 860,0,0,0,0,1,0,0,0,0,AT,Len1,'PO','163'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8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0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2PO860001
+
+;******************************************************************************
+
+Public _Ow2PO860011 ;***************
+_Ow2PO860011 Label Byte ;Beginning of the table. PO 860 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 860,0,0,1,0,1,0,1,0,0,EN,Len2,'PO','163'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 15h, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', ']', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', '}', 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '?', 0, 0, 0 ; 12 ' ?
+ KeyDef 4, 0,0,0,0,0,0,0, 0AEh,0AFh, 0, 0, 0 ; 13 . /
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 0,1,1,0,1,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 0, 0 ; 19 r R
+ KeyDef 1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0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0FEh,26,27,26,0,26,'u',81h,'U',9Ah>
+
+AccEnt <"'",27,29,27,0,27,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',86h,'E',90h,'I',8Bh,'O',9Fh,'U',96h,' ',"'">
+
+AccEnt <"`",27,29,27,0,0,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',91h,'E',92h,'I',98h,'O',0A9h,'U',9Dh,' ',"`">
+
+AccEnt <'~',43,28,43,0,43,'a',84h,'o',94h,'n',0A4h,'A',8Eh,'O',99h,'N',0A5h,' ','~'>
+
+AccEnt <'^',43,28,43,0,0,'a',83h,'e',88h,'o',93h,'A',8Fh,'E',89h,'O',8Ch,' ','^'>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2PO860011
+
+;*****************************************************************************
+
+Public _Ow2PO850000 ;***************
+_Ow2PO850000 Label Byte ;Beginning of the table. PO 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,0,0,0,AT,Len3,'PO','163'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0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0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2PO850000
+
+;*****************************************************************************
+
+Public _Ow2PO850010 ;***************
+_Ow2PO850010 Label Byte ;Beginning of the table. PO 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'PO','163'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$',0F5h, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0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ef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0F9h,26,27,26,0,26,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+; AccEnt #2
+db 0EFh,27, 29,27, 0,27
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh
+db ' ',0EFh, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <"`",27,29,27,0,0,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ',"`">
+
+AccEnt <'~',43,28,43,0,43,'a',0C6h,'o',0E4h,'n',0A4h,'A',0C7h,'O',0E5h,'N',0A5h,' ','~'>
+
+AccEnt <'^',43,28,43,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2PO850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/sfkbd.asm b/private/os2/os2ses/i386/sfkbd.asm
new file mode 100644
index 000000000..8c3af0ea3
--- /dev/null
+++ b/private/os2/os2ses/i386/sfkbd.asm
@@ -0,0 +1,788 @@
+;; SCCSID = @(#)sfkbd.asm 12.1 88/03/18
+ Page 58,132
+ Title SFKBD - Translate Table Structure for CP/DOS 1.1
+ Name SFKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: SFKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Swiss French *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK SFKBD; **
+;** RELOC SFKBD.EXE SFKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+; db 119,-1,132,-1
+; db 115,-1,116,-1
+Public _Ow2SF437001 ;***************
+_Ow2SF437001 Label Byte ;Beginning of the table. SF 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,1,1,0,AT,Len1,'SF','150F'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '+', 0, 0, 0 ; 2 1 +
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 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ccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",12,0,0,0,130,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <22h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2SF437001
+
+;******************************************************************************
+
+Public _Ow2SF437011 ;***************
+_Ow2SF437011 Label Byte ;Beginning of the table. SF 437 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,1,1,0,EN,Len2,'SF','150F'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '+',0B3h, 0, 0 ; 2 1 +
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '*', '#', 0, 0 ; 4 3 *
+ KeyDef 4, 0,0,0,0,0,0,0, '4', 87h, 0, 0, 0 ; 5 4 c cedilla
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&',0AAh, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', 7Ch, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 9Bh, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', 0, 0, 0 ; 11 0 =
+ KeyDef 11, 0,0,0,0,0,0,0, "'", '?', 1, 0, 1 ; 12 ' ?
+ KeyDef 11, 0,0,0,0,0,0,0, 2, 3, 4, 0, 2 ; 13 circumflex grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1,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, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",12,0,0,0,130,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <22h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2SF437011
+
+;*****************************************************************************
+
+Public _Ow2SF850000 ;***************
+_Ow2SF850000 Label Byte ;Beginning of the table. SF 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,1,1,0,AT,Len3,'SF','150F'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '+', 0, 0, 0 ; 2 1 +
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '*', '#', 0, 0 ; 4 3 *
+ KeyDef 4, 0,0,0,0,0,0,0, '4', 87h,0F8h, 0, 0 ; 5 4 c cedilla
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%',0F5h, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 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,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,12, 0,0, 0,130
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'a',0C6h,'n',0A4h,'o',0E4h,'A',0C7h,'N',0A5h,'O',0E5h,' ','~'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2SF850000
+
+;*****************************************************************************
+
+Public _Ow2SF850010 ;***************
+_Ow2SF850010 Label Byte ;Beginning of the table. SF 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,1,0,EN,Len4,'SF','150F'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '+', 7Ch, 0, 0 ; 2 1 +
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '*', '#', 0, 0 ; 4 3 *
+ KeyDef 4, 0,0,0,0,0,0,0, '4', 87h, 0, 0, 0 ; 5 4 c cedilla
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&',0AAh, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/',0DDh, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(',0BDh, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', 0, 0, 0 ; 11 0 =
+ KeyDef 11, 0,0,0,0,0,0,0, "'", '?', 1, 0, 1 ; 12 ' ?
+ KeyDef 11, 0,0,0,0,0,0,0, 2, 3, 4, 0, 2 ; 13 circumflex grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0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, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,12, 0,0, 0,130
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'a',0C6h,'n',0A4h,'o',0E4h,'A',0C7h,'N',0A5h,'O',0E5h,' ','~'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2SF850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/sgkbd.asm b/private/os2/os2ses/i386/sgkbd.asm
new file mode 100644
index 000000000..52d04e206
--- /dev/null
+++ b/private/os2/os2ses/i386/sgkbd.asm
@@ -0,0 +1,788 @@
+;; SCCSID = @(#)sgkbd.asm 12.2E%
+ Page 58,132
+ Title SGKBD - Translate Table Structure for CP/DOS 1.2
+ Name SGKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: SGKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Swiss German *
+;* *
+;* *
+;* Status: OS/2 Version 1.2 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK SGKBD; **
+;** RELOC SGKBD.EXE SGKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+; db 115,-1,116,-1
+; db 117,-1,118
+Public _Ow2SG437001 ;***************
+_Ow2SG437001 Label Byte ;Beginning of the table. SG 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,1,1,0,AT,Len1,'SG','150G'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '+', 0, 0, 0 ; 2 1 +
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '*', '#', 0, 0 ; 4 3 *
+ KeyDef 4, 0,0,0,0,0,0,0, '4', 87h,0F8h, 0, 0 ; 5 4 c cedilla
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 15h, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', 7Ch, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0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0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",12,0,0,0,130,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <22h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2SG437001
+
+;******************************************************************************
+
+Public _Ow2SG437011 ;***************
+_Ow2SG437011 Label Byte ;Beginning of the table. SG 437 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,1,1,0,EN,Len2,'SG','150G'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0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, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",12,0,0,0,130,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h>
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <22h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2SG437011
+
+;*****************************************************************************
+
+Public _Ow2SG850000 ;***************
+_Ow2SG850000 Label Byte ;Beginning of the table. SG 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,1,1,0,AT,Len3,'SG','150G'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '+', 0, 0, 0 ; 2 1 +
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '*', '#', 0, 0 ; 4 3 *
+ KeyDef 4, 0,0,0,0,0,0,0, '4', 87h,0F8h, 0, 0 ; 5 4 c cedilla
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%',0F5h, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', 7Ch, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', 0, 0, 0 ; 11 0 =
+ KeyDef 11, 0,0,0,0,0,0,0, "'", '?', 1, 0, 1 ; 12 ' ?
+ KeyDef 11, 0,0,0,0,0,0,0, 2, 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+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,12, 0,0, 0,130
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'a',0C6h,'n',0A4h,'o',0E4h,'A',0C7h,'N',0A5h,'O',0E5h,' ','~'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2SG850000
+
+;*****************************************************************************
+
+Public _Ow2SG850010 ;***************
+_Ow2SG850010 Label Byte ;Beginning of the table. SG 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,1,0,EN,Len4,'SG','150G'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '+', 7Ch, 0, 0 ; 2 1 +
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '*', '#', 0, 0 ; 4 3 *
+ KeyDef 4, 0,0,0,0,0,0,0, '4', 87h, 0, 0, 0 ; 5 4 c cedilla
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&',0AAh, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/',0DDh, 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(',0BDh, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', 0, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', 0, 0, 0 ; 11 0 =
+ KeyDef 11, 0,0,0,0,0,0,0, "'", '?', 1, 0, 1 ; 12 ' ?
+ KeyDef 11, 0,0,0,0,0,0,0, 2, 3, 4, 0, 2 ; 13 circumflex grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 1,1,1,0,1,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 0, 0 ; 19 r R
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, 0,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, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,12, 0,0, 0,130
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'^',13,0,0,0,131,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'~',13,0,0,0,131,'a',0C6h,'n',0A4h,'o',0E4h,'A',0C7h,'N',0A5h,'O',0E5h,' ','~'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2SG850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/spkbd.asm b/private/os2/os2ses/i386/spkbd.asm
new file mode 100644
index 000000000..ac49ff1fa
--- /dev/null
+++ b/private/os2/os2ses/i386/spkbd.asm
@@ -0,0 +1,786 @@
+;; SCCSID = @(#)spkbd.asm 10.2 87/06/07
+ Page 58,132
+ Title SPKBD - Translate Table Structure for CP/DOS 1.1
+ Name SPKBD
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: SPKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Spain *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Change history: *
+;* *
+;* PTM 3020: Corrected small o circumflex in accent entry for *
+;* the 437 Enhanced table. pjr *
+;* *
+;* PTM 3317: Moved '@' Char3 value from scan code 2 to scan 3 *
+;* on the 437 AT table. pjr *
+;* *
+;* PTM 3625: Changed I-grave (DEh) to I-acute (D6h) in AT 850 *
+;* table AccEnt #1. pjr *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK SPKBD; **
+;** RELOC SPKBD.EXE SPKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+; db 117,-1,118
+; db -1,-1
+
+Public _Ow2SP437001 ;***************
+_Ow2SP437001 Label Byte ;Beginning of the table. SP 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,1,0,0,AT,Len1,'SP','172'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1',0ADh, 0, 0, 0 ; 2 1 ADh
+ KeyDef 4, 0,0,0,0,0,0,0, '2',0A8h, '@', 0, 0 ; 3 2 A8h
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '/', 0, 0, 0 ; 7 6 /
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ Key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; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",26,27,26,0,26,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <0FEh,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'`',27,29,27,0,27,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2SP437001
+
+;*****************************************************************************
+
+Public _Ow2SP437011 ;***************
+_Ow2SP437011 Label Byte ;Beginning of the table. SP 437 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,1,0,0,EN,Len2,'SP','172'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 7Ch, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 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, 'o', 'O', 0, 0, 0 ; 24 o O
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, 0, 0 ; 25 p P
+ KeyDef 11, 0,0,0,0,0,0,0, 1, 2, '[', 0, 1 ; 26 grave circumflex
+ KeyDef 4, 0,0,0,0,0,0,0, '+', '*', ']', 0, 0 ; 27 + *
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 0A4h,0A5h, 0, 0, 0 ; 39 n N (tilde)
+ KeyDef 11, 0,0,0,0,0,0,0, 3, 4, '{', 0, 3 ; 40 acute diaresis
+ KeyDef 4, 0,0,0,0,0,0,0, 0A7h,0A6h, '\', 0, 0 ; 41 A7h A6h
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 3, 0,0,0,0,0,0,0, 87h, 80h, '}', 0, 0 ; 43 c C (cedilla)
+ KeyDef 1, 0,0,0,0,0,0,0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f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'`',26,27,26,0,26,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <'^',26,27,26,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <"'",40,0,0,0,40,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <0FEh,40,0,0,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2SP437011
+
+;*****************************************************************************
+
+Public _Ow2SP850000 ;***************
+_Ow2SP850000 Label Byte ;Beginning of the table. SP 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,1,0,0,AT,Len3,'SP','172'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1',0ADh, 0, 0, 0 ; 2 1 ADh
+ KeyDef 4, 0,0,0,0,0,0,0, '2',0A8h, '@', 0, 0 ; 3 2 A8h
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '/', 0, 0, 0 ; 7 6 /
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 0, 0 ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 12 - _
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+', 0, 0, 0 ; 13 = +
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0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,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <0EFh,26,27,26,0,26,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',0B5h,'E',90h,'I',0D6h,'O',0E0h,'U',0E9h,' ',0EFh>
+
+AccEnt <0F9h,26,27,26,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'`',27,29,27,0,27,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2SP850000
+
+;*****************************************************************************
+
+Public _Ow2SP850010 ;***************
+_Ow2SP850010 Label Byte ;Beginning of the table. SP 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'SP','172'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 7Ch, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3',0FAh, '#', 0, 0 ; 4 3 FAh
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6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0, 0, 0 ; 68 F10
+ KeyDef 15, 0,0,0,0,0,0,0, 20h, 20h, 20h, 0, 0 ; 69 NumLock
+ KeyDef 17, 0,0,0,0,0,0,0, 10h, 10h, 10h, 0, 0 ; 70 ScrollLock
+ KeyDef 7, 0,0,0,0,0,0,0, 0, '7', 0, 0, 0 ; 71 Home 7
+ KeyDef 7, 0,0,0,0,0,0,0, 1, '8', 0, 0, 0 ; 72 'Up' 8
+ KeyDef 7, 0,0,0,0,0,0,0, 2, '9', 0, 0, 0 ; 73 PgUp 9
+ KeyDef 7, 0,0,0,0,0,0,0, 3, '-', 0, 0, 0 ; 74 - (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 4, '4', 0, 0, 0 ; 75 'Left'4
+ KeyDef 7, 0,0,0,0,0,0,0, 5, '5', 0, 0, 0 ; 76 5
+ KeyDef 7, 0,0,0,0,0,0,0, 6, '6', 0, 0, 0 ; 77'Right'6
+ KeyDef 7, 0,0,0,0,0,0,0, 7, '+', 0, 0, 0 ; 78 + (on pad)
+ KeyDef 7, 0,0,0,0,0,0,0, 8, '1', 0, 0, 0 ; 79 End 1
+ KeyDef 7, 0,0,0,0,0,0,0, 9, '2', 0, 0, 0 ; 80 'Down'2
+ KeyDef 7, 0,0,0,0,0,0,0, 10, '3', 0, 0, 0 ; 81 PgDn 3
+ KeyDef 7, 0,0,0,0,0,0,0, 11, '0', 0, 0, 0 ; 82 Ins 0
+ KeyDef 7, 0,0,0,0,0,0,0, 12, '.', 0, 0, 0 ; 83 Del .
+ KeyDef 10, 0,0,0,0,0,0,0, 0, 80h, 80h, 0, 0 ; 84 SysReq
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 85 (undefined)
+ KeyDef 2, 0,0,0,0,0,0,0, '<', '>', 0, 0, 0 ; 86 < >
+ KeyDef 6, 0,0,0,0,0,0,0, 11, 0, 0, 0, 0 ; 87 F11
+ KeyDef 6, 0,0,0,0,0,0,0, 12, 0, 0, 0, 0 ; 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 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <'`',26,27,26,0,26,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <'^',26,27,26,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <0EFh,40,0,0,0,40,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'A',0B5h,'E',90h,'I',0D6h,'O',0E0h,'U',0E9h,' ',0EFh>
+
+AccEnt <0F9h,40,0,0,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2SP850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/sukbd.asm b/private/os2/os2ses/i386/sukbd.asm
new file mode 100644
index 000000000..fd4051224
--- /dev/null
+++ b/private/os2/os2ses/i386/sukbd.asm
@@ -0,0 +1,785 @@
+;; SCCSID = @(#)sukbd.asm 12.1 88/03/18
+ Page 58,132
+ Title SUKBD - Translate Table Structure for CP/DOS 1.1
+ Name SUKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: SUKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Finland *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK SUKBD; **
+;** RELOC SUKBD.EXE SUKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+; db -1,-1
+ db 119,141,132,142 ;@@ Keypad 7, 8, 9, - (PTM 5024)
+Public _Ow2SU437001 ;***************
+_Ow2SU437001 Label Byte ;Beginning of the table. SU 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,1,0,0,0,1,0,1,0,0,AT,Len1,'SU','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4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 0, 0, 0 ; 24 o O
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, 0, 0 ; 25 p P
+ KeyDef 3, 0,0,0,0,0,0,0, 86h, 8Fh, '{', '[', 0 ; 26 a A (overcircle)
+ KeyDef 21, 0,0,0,0,0,0,0, 3, 4, '}', ']', 0 ; 27 diaresis circumflex
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, ':', ';', 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, '"', "'", 0 ; 40 a A (diaresis)
+ KeyDef 21, 0,0,0,0,0,0,0, '<', '>', 7Ch, '\', 0 ; 41 < >
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 21, 0,0,0,0,0,0,0, "'", '*', '~', '`', 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 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1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <0FEh,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2SU437001
+
+;******************************************************************************
+
+Public _Ow2SU437011 ;***************
+_Ow2SU437011 Label Byte ;Beginning of the table. SU 437 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,1,0,0,EN,Len2,'SU','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', 0, '$', 0, 0 ; 5 4 monetary symbol
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', ']', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', '}', 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, '+', '?', '\', 0, 0 ; 12 + ?
+ KeyDef 11, 0,0,0,0,0,0,0, 1, 2, 0, 0, 1 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,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K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, 0, 0, 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, 0, 0, 0 ; 40 a A (diaresis)
+ KeyDef 4, 0,0,0,0,0,0,0, 15h,0ABh, 0, 0, 0 ; 41 section one-half
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '*', 0, 0, 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, 0, 0 ; 46 c C
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 0, 0 ; 47 v V
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 0, 0 ; 48 b B
+ KeyDef 1, 0,0,0,0,1,0,0, 'n', 'N', 0, 0, 0 ; 49 n N
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 0, 0 ; 50 m M
+ KeyDef 4, 0,0,0,0,0,0,0, ',', ';', 0, 0, 0 ; 51 , ;
+ KeyDef 4, 0,0,0,0,0,0,0, '.', ':', 0, 0, 0 ; 52 . :
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 53 - _
+ KeyDef 12, 0,0,0,0,0,0,0, 1, 0, 0, 0, 0 ; 54 Shift(R)
+ KeyDef 9, 0,0,0,0,0,0,0, '*', 114, 0, 0, 0 ; 55 * PrtSc
+ KeyDef 14, 0,0,0,0,0,0,0, 8, 2, 8, 0, 0 ; 56 Alt
+ KeyDef 4, 1,1,0,1,1,0,0, ' ', ' ', 0, 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+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <0FEh,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2SU437011
+
+;*****************************************************************************
+
+Public _Ow2SU850000 ;***************
+_Ow2SU850000 Label Byte ;Beginning of the table. SU 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,1,0,0,0,0,0,1,0,0,AT,Len3,'SU','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, '#', 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', '^', 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '&', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '*', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', '(', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', ')', 0, 0 ; 11 0 =
+ KeyDef 21, 0,0,0,0,0,0,0, '+', '?', '_', '-', 0 ; 12 + ?
+ KeyDef 21, 0,0,0,0,0,0,0, 1, 2, '+', '=', 0 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 1,1,1,1,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 0, 0 ; 19 r R
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, 0, 0 ; 20 t T
+ KeyDef 1, 1,0,1,0,0,0,0, 'y', 'Y', 0, 0, 0 ; 21 y Y
+ KeyDef 1, 1,1,1,1,0,0,0, 'u', 'U', 0, 0, 0 ; 22 u U
+ KeyDef 1, 1,1,1,1,0,0,0, 'i', 'I', 0, 0, 0 ; 23 i I
+ KeyDef 1, 1,1,1,1,0,0,0, 'o', 'O', 0, 0, 0 ; 24 o O
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, 0, 0 ; 25 p P
+ KeyDef 3, 0,0,0,0,0,0,0, 86h, 8Fh, '{', '[', 0 ; 26 a A (overcircle)
+ KeyDef 21, 0,0,0,0,0,0,0, 3, 4, '}', ']', 0 ; 27 diaresis circumflex
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, ':', ';', 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, '"', "'", 0 ; 40 a A (diaresis)
+ KeyDef 21, 0,0,0,0,0,0,0, '<', '>', 7Ch, '\', 0 ; 41 < >
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 21, 0,0,0,0,0,0,0, "'", '*', '~', '`', 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, 0, 0 ; 46 c C
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 0, 0 ; 47 v V
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 0, 0 ; 48 b B
+ KeyDef 1, 0,0,0,0,0,0,0, 'n', 'N',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0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2SU850000
+
+;*****************************************************************************
+
+Public _Ow2SU850010 ;***************
+_Ow2SU850010 Label Byte ;Beginning of the table. SU 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'SU','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4',0CFh, '$', 0, 0 ; 5 4 monetary symbol
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '{', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '[', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', ']', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', '}', 0, 0 ; 11 0 =
+ KeyDef 4, 0,0,0,0,0,0,0, '+', '?', '\', 0, 0 ; 12 + ?
+ KeyDef 11, 0,0,0,0,0,0,0, 1, 2, 0, 0, 1 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ Key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0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, 0, 0, 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, 0, 0, 0 ; 40 a A (diaresis)
+ KeyDef 4, 0,0,0,0,0,0,0, 0F5h,0ABh, 0, 0, 0 ; 41 section one-half
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '*', 0, 0, 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, 0, 0 ; 46 c C
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 0, 0 ; 47 v V
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 0, 0 ; 48 b B
+ KeyDef 1, 0,0,0,0,1,0,0, 'n', 'N', 0, 0, 0 ; 49 n N
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 0, 0 ; 50 m M
+ KeyDef 4, 0,0,0,0,0,0,0, ',', ';', 0, 0, 0 ; 51 , ;
+ KeyDef 4, 0,0,0,0,0,0,0, '.', ':', 0, 0, 0 ; 52 . :
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 53 - _
+ KeyDef 12, 0,0,0,0,0,0,0, 1, 0, 0, 0, 0 ; 54 Shift(R)
+ KeyDef 9, 0,0,0,0,0,0,0, '*', 114, 0, 0, 0 ; 55 * PrtSc
+ KeyDef 14, 0,0,0,0,0,0,0, 8, 2, 8, 0, 0 ; 56 Alt
+ KeyDef 4, 1,1,1,1,1,0,0, ' ', ' ', 0, 0, 0 ; 57 Space
+ KeyDef 16, 0,0,0,0,0,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 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'n',0A4h,'N',0A5h,' ','~'>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2SU850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/svkbd.asm b/private/os2/os2ses/i386/svkbd.asm
new file mode 100644
index 000000000..d79bd5426
--- /dev/null
+++ b/private/os2/os2ses/i386/svkbd.asm
@@ -0,0 +1,785 @@
+;; SCCSID = @(#)svkbd.asm 12.1 88/03/18
+ Page 58,132
+ Title SVKBD - Translate Table Structure for CP/DOS 1.1
+ Name SVKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: SVKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for Sweden *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK SVKBD; **
+;** RELOC SVKBD.EXE SVKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+ db 119,141,132,142 ;@@ Keypad 7, 8, 9, - (PTM 5024)
+ db 115,143,116,144 ;@@ Keypad 4, 5, 6, + (PTM 5024)
+Public _Ow2SV437001 ;***************
+_Ow2SV437001 Label Byte ;Beginning of the table. SV 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,1,0,0,0,1,0,1,0,0,AT,Len1,'SV','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, '#', 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', '^', 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '&', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '*', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', '(', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', ')', 0, 0 ; 11 0 =
+ KeyDef 21, 0,0,0,0,0,0,0, '+', '?', '_', '-', 0 ; 12 + ?
+ KeyDef 21, 0,0,0,0,0,0,0, 1, 2, '+', '=', 0 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 ; 17 w W
+ KeyDef 1, 1,1,1,1,0,0,0, 'e', 'E', 0, 0, 0 ; 18 e E
+ KeyDef 1, 0,0,0,0,0,0,0, 'r', 'R', 0, 0, 0 ; 19 r R
+ KeyDef 1, 0,0,0,0,0,0,0, 't', 'T', 0, 0, 0 ; 20 t T
+ KeyDef 1, 0,0,1,0,0,0,0, 'y', 'Y', 0, 0, 0 ; 21 y Y
+ KeyDef 1, 1,1,1,1,0,0,0, 'u', 'U', 0, 0, 0 ; 22 u U
+ KeyDef 1, 1,1,1,1,0,0,0, 'i', 'I', 0, 0, 0 ; 23 i I
+ KeyDef 1, 1,1,1,1,0,0,0, 'o', 'O', 0, 0, 0 ; 24 o O
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, 0, 0 ; 25 p P
+ KeyDef 3, 0,0,0,0,0,0,0, 86h, 8Fh, '{', '[', 0 ; 26 a A (overcircle)
+ KeyDef 21, 0,0,0,0,0,0,0, 3, 4, '}', ']', 0 ; 27 diaresis circumflex
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, ':', ';', 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, '"', "'", 0 ; 40 a A (diaresis)
+ KeyDef 21, 0,0,0,0,0,0,0, '<', '>', 7Ch, '\', 0 ; 41 < >
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 21, 0,0,0,0,0,0,0, "'", '*', '~', '`', 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, 0, 0 ; 46 c C
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 0, 0 ; 47 v V
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 0, 0 ; 48 b B
+ KeyDef 1, 0,0,0,0,0,0,0, 'n', 'N', 0, 0, 0 ; 49 n N
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 0, 0 ; 50 m M
+ KeyDef 4, 0,0,0,0,0,0,0, ',', ';', '<', 0, 0 ; 51 , ;
+ KeyD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 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <0FEh,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2SV437001
+
+;******************************************************************************
+
+Public _Ow2SV437011 ;***************
+_Ow2SV437011 Label Byte ;Beginning of the table. SV 437 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,1,0,0,EN,Len2,'SV','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,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24 o O
+ KeyDef 1, 0,0,0,0,0,0,0, 'p', 'P', 0, 0, 0 ; 25 p P
+ KeyDef 3, 0,0,0,0,0,0,0, 86h, 8Fh, 0, 0, 0 ; 26 a A (overcircle)
+ KeyDef 11, 0,0,0,0,0,0,0, 3, 4, 5, 0, 3 ; 27 diaresis circumflex
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, 0, 0, 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, 0, 0, 0 ; 40 a A (diaresis)
+ KeyDef 4, 0,0,0,0,0,0,0, 15h,0ABh, 0, 0, 0 ; 41 section one-half
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '*', 0, 0, 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0,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2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <"'",13,0,0,0,131,'a',0A0h,'e',82h,'i',0A1h,'o',0A2h,'u',0A3h,'E',90h,' ',"'">
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,' ','`'>
+
+AccEnt <0FEh,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'O',99h,'U',9Ah>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'n',0A4h,'N',0A5h,' ','~'>
+
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2SV437011
+
+;*****************************************************************************
+
+Public _Ow2SV850000 ;***************
+_Ow2SV850000 Label Byte ;Beginning of the table. SV 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,1,0,0,0,0,0,1,0,0,AT,Len3,'SV','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, '#', 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', '^', 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '/', '&', 0, 0 ; 8 7 /
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', '*', 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')', '(', 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '=', ')', 0, 0 ; 11 0 =
+ KeyDef 21, 0,0,0,0,0,0,0, '+', '?', '_', '-', 0 ; 12 + ?
+ KeyDef 21, 0,0,0,0,0,0,0, 1, 2, '+', '=', 0 ; 13 acute grave
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 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yDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, ':', ';', 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, '"', "'", 0 ; 40 a A (diaresis)
+ KeyDef 21, 0,0,0,0,0,0,0, '<', '>', 7Ch, '\', 0 ; 41 < >
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 21, 0,0,0,0,0,0,0, "'", '*', '~', '`', 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0,0, 'x', 'X', 0, 0, 0 ; 45 x X
+ KeyDef 1, 0,0,0,0,0,0,0, 'c', 'C', 0, 0, 0 ; 46 c C
+ KeyDef 1, 0,0,0,0,0,0,0, 'v', 'V', 0, 0, 0 ; 47 v V
+ KeyDef 1, 0,0,0,0,0,0,0, 'b', 'B', 0, 0, 0 ; 48 b B
+ KeyDef 1, 0,0,0,0,0,0,0, 'n', 'N', 0, 0, 0 ; 49 n N
+ KeyDef 1, 0,0,0,0,0,0,0, 'm', 'M', 0, 0, 0 ; 50 m M
+ KeyDef 4, 0,0,0,0,0,0,0, ',', ';', '<', 0, 0 ; 51 , ;
+ KeyDef 4, 0,0,0,0,0,0,0, '.', ':', '>', 0, 0 ; 52 . :
+ KeyDef 21, 0,0,0,0,0,0,0, '-', '_', '?', '/', 0 ; 53 - _
+ KeyDef 12, 0,0,0,0,0,0,0, 1, 0, 0, 0, 0 ; 54 Shift(R)
+ KeyDef 9, 0,0,0,0,0,0,0, '*', 114, 0, 0, 0 ; 55 * PrtSc
+ KeyDef 14, 0,0,0,0,0,0,0, 8, 2, 8, 0, 0 ; 56 Alt
+ KeyDef 4, 1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, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,0,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2SV850000
+
+;*****************************************************************************
+
+Public _Ow2SV850010 ;***************
+_Ow2SV850010 Label Byte ;Beginning of the table. SV 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,1,0,0,EN,Len4,'SV','153'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', '@', 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 9Ch, 0, 0 ; 4 3 #
+ KeyDef 4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P', 0, 0, 0 ; 25 p P
+ KeyDef 3, 0,0,0,0,0,0,0, 86h, 8Fh, 0, 0, 0 ; 26 a A (overcircle)
+ KeyDef 11, 0,0,0,0,0,0,0, 3, 4, 5, 0, 3 ; 27 diaresis circumflex
+ KeyDef 8, 0,0,0,0,0,0,0, 13, 10, 0, 0, 0 ; 28 Enter
+ KeyDef 12, 0,0,0,0,0,0,0, 4, 1, 4, 0, 0 ; 29 Ctrl
+ KeyDef 1, 1,1,1,1,0,0,0, 'a', 'A', 0, 0, 0 ; 30 a A
+ KeyDef 1, 0,0,0,0,0,0,0, 's', 'S', 0, 0, 0 ; 31 s S
+ KeyDef 1, 0,0,0,0,0,0,0, 'd', 'D', 0, 0, 0 ; 32 d D
+ KeyDef 1, 0,0,0,0,0,0,0, 'f', 'F', 0, 0, 0 ; 33 f F
+ KeyDef 1, 0,0,0,0,0,0,0, 'g', 'G', 0, 0, 0 ; 34 g G
+ KeyDef 1, 0,0,0,0,0,0,0, 'h', 'H', 0, 0, 0 ; 35 h H
+ KeyDef 1, 0,0,0,0,0,0,0, 'j', 'J', 0, 0, 0 ; 36 j J
+ KeyDef 1, 0,0,0,0,0,0,0, 'k', 'K', 0, 0, 0 ; 37 k K
+ KeyDef 1, 0,0,0,0,0,0,0, 'l', 'L', 0, 0, 0 ; 38 l L
+ KeyDef 3, 0,0,0,0,0,0,0, 94h, 99h, 0, 0, 0 ; 39 o O (diaresis)
+ KeyDef 3, 0,0,0,0,0,0,0, 84h, 8Eh, 0, 0, 0 ; 40 a A (diaresis)
+ KeyDef 4, 0,0,0,0,0,0,0, 0F5h,0ABh, 0, 0, 0 ; 41 section one-half
+ KeyDef 12, 0,0,0,0,0,0,0, 2, 0, 0, 0, 0 ; 42 Shift(L)
+ KeyDef 4, 0,0,0,0,0,0,0, "'", '*', 0, 0, 0 ; 43 ' *
+ KeyDef 1, 0,0,0,0,0,0,0, 'z', 'Z', 0, 0, 0 ; 44 z Z
+ KeyDef 1, 0,0,0,0,0,0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'
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 108 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 109 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 110 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+;AccEnt #1
+db 0EFh,13, 0,0, 0,131
+db 'a',0A0h, 'e',82h, 'i',0A1h, 'o',0A2h, 'u',0A3h, 'y',0ECh
+db 'A',0B5h, 'E',90h, 'I',0D6h, 'O',0E0h, 'U',0E9h, 'Y',0EDh, ' ',0EFh
+db 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0
+
+AccEnt <'`',13,0,0,0,131,'a',85h,'e',8Ah,'i',8Dh,'o',95h,'u',97h,'A',0B7h,'E',0D4h,'I',0DEh,'O',0E3h,'U',0EBh,' ','`'>
+
+AccEnt <0F9h,27,29,27,0,27,'a',84h,'e',89h,'i',8Bh,'o',94h,'u',81h,'y',98h,'A',8Eh,'E',0D3h,'I',0D8h,'O',99h,'U',9Ah,' ',0F9h>
+
+AccEnt <'^',27,29,27,0,0,'a',83h,'e',88h,'i',8Ch,'o',93h,'u',96h,'A',0B6h,'E',0D2h,'I',0D7h,'O',0E2h,'U',0EAh,' ','^'>
+
+AccEnt <'~',27,29,27,0,0,'n',0A4h,'N',0A5h,' ','~'>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2SV850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/ukkbd.asm b/private/os2/os2ses/i386/ukkbd.asm
new file mode 100644
index 000000000..dbc3c35e6
--- /dev/null
+++ b/private/os2/os2ses/i386/ukkbd.asm
@@ -0,0 +1,1129 @@
+;; SCCSID = @(#)ukkbd.asm 12.1 88/03/18
+ Page 58,132
+ Title UKKBD - Translate Table Structure for CP/DOS 1.1
+ Name UKKBD
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: UKKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for UK. *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Changes: *
+;* Changed 7Ch to B3h for scan code 29h in ENH 437, all *
+;* cs IDs (PTM 186). pjr *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK UKKBD; **
+;** RELOC UKKBD.EXE UKKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-.286
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+
+; db 115,143,116,144 ;@@ Keypad 4, 5, 6, + (PTM 5024)
+; db 117,145,118 ;@@ Keypad 1, 2, 3 (PTM 5024)
+
+Public _Ow2UK437001 ;***************
+_Ow2UK437001 Label Byte ;Beginning of the table. UK 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,1,AT,Len1,'UK','166' ;&&
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 0, 0 ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 12 - _
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+', 0, 0, 0 ; 13 = +
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0,0,0,0,0,0, 'q', 'Q', 0, 0, 0 ; 16 q Q
+ KeyDef 1, 0,0,0,0,0,0,0, 'w', 'W', 0, 0, 0 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,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2UK437001
+
+;***************************************************************************
+
+Public _Ow2UK437011 ;***************
+_Ow2UK437011 Label Byte ;Beginning of the table. UK 437 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,0,0,1,EN,Len2,'UK','166'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 0, 0 ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 12 - _
+ KeyDef 4, 0,0,0,0,0,0,0, '=', '+', 0, 0, 0 ; 13 = +
+ KeyDef 8, 0,0,0,0,0,0,0, 8, 127, 0, 0, 0 ; 14 BkSp
+ KeyDef 4, 0,0,0,0,0,0,0, 9, 0, 0, 0, 0 ; 15 Tabs
+ KeyDef 1, 0,0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,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2UK437011
+
+
+;***************************************************************************
+;&&B
+Public _Ow2UK437111 ;***********************
+_Ow2UK437111 Label Byte ;Beginning of the table. UK 437 EN Kbd New Std
+ ;***********************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,1,0,1,0,0,0,1,EN,Len3,'UK','168'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"',0FDh, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%',0ABh, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 4, 0,0,0,0,0,0,0, '7', "'", 0, 0, 0 ; 8 7 '
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '(', 0, 0, 0 ; 9 8 (
+ KeyDef 4, 0,0,0,0,0,0,0, '9', ')',0F1h, 0, 0 ; 10 9 )
+ KeyDef 4, 0,0,0,0,0,0,0, '0', '#',0F8h, 0, 0 ; 11 0 #
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '=', 0, 0, 0 ; 12 - =
+ KeyDef 4, 0,0,0,0,0,0,0, 'ª',0C4h, 0, 0, 0 ; 13 _ ª
+ Ke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yDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2UK437111
+;&&E
+
+
+
+;***************************************************************************
+
+Public _Ow2UK850000 ;***************
+_Ow2UK850000 Label Byte ;Beginning of the table. UK 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,0,0,1,AT,Len4,'UK','166'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 0, 0 ; 11 0 )
+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, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2UK850000
+
+;***************************************************************************
+
+Public _Ow2UK850010 ;***************
+_Ow2UK850010 Label Byte ;Beginning of the table. UK 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,0,0,1,EN,Len5,'UK','166'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"', 0, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch, 0, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,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,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len5 EQU $ - _Ow2UK850010
+
+
+
+;***************************************************************************
+;&&B
+
+Public _Ow2UK850011 ;***********************
+_Ow2UK850011 Label Byte ;Beginning of the table. UK 850 EN Kbd New Std
+ ;***********************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,1,0,0,0,0,0,1,EN,Len6,'UK','168'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '"',0FDh, 0, 0 ; 3 2 "
+ KeyDef 4, 0,0,0,0,0,0,0, '3', 9Ch,0FCh, 0, 0 ; 4 3 9Ch
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%',0ABh, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '&', 0, 0, 0 ; 7 6 &
+ KeyDef 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, 0, 0 ; 111 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,a1,s2,a2..c20,a20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,a1 - c20,a20 are the char/char code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len6 EQU $ - _Ow2UK850011
+;&&E
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/i386/uskbd.asm b/private/os2/os2ses/i386/uskbd.asm
new file mode 100644
index 000000000..8ec338b9f
--- /dev/null
+++ b/private/os2/os2ses/i386/uskbd.asm
@@ -0,0 +1,761 @@
+;; SCCSID = @(#)uskbd.asm 12.1 88/03/18
+; Page 58,132
+ Title USKBD - Translate Table Structure for CP/DOS 1.1
+ Name USKBD
+
+;********************* Start of Specifications *************************
+;* *
+;* Source File Name: USKBD.ASM *
+;* *
+;* Descriptive Name: Keyboard translate tables for US. *
+;* *
+;* *
+;* Status: CP/DOS Version 1.1.1 *
+;* *
+;* Function: N/A *
+;* *
+;* Notes: *
+;* Dependencies: see linkage instructions below *
+;* Restrictions: None *
+;* Patch Label: None *
+;* *
+;* Entry Points: None *
+;* *
+;* External References: None *
+;* *
+;* Changes: *
+;* *
+;* 2/13/87 - Corrected 850 AT LED key keydefs per PTM 2270. pjr *
+;* *
+;********************** End of Specifications **************************
+;***********************************************************************
+;** **
+;** Linkage instructions: **
+;** LINK USKBD; **
+;** RELOC USKBD.EXE USKBD.TBL **
+;** **
+;***********************************************************************
+
+.386p ;MJ-
+
+include kbdxlat.inc
+
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
+Public _Ow2US437001 ;******
+_Ow2US437001 Label Byte ;Beginning of the table. US 437 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,0,AT,Len1,'US','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', ')', 0, 0, 0 ; 11 0 )
+ KeyDef 4, 0,0,0,0,0,0,0, '-', '_', 0, 0, 0 ; 12 - _
+ Ke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0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len1 EQU $ - _Ow2US437001
+
+;******************************************************************************
+
+Public _Ow2US437011 ;******
+_Ow2US437011 Label Byte ;Beginning of the table. US 437 EN Kbd
+ ;***************
+
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 437,0,0,0,0,1,0,0,0,0,EN,Len2,'US','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 4, 0,0,0,0,0,0,0, '9', '(', 0, 0, 0 ; 10 9 (
+ KeyDef 4, 0,0,0,0,0,0,0, '0', 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, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len2 EQU $ - _Ow2US437011
+
+;*****************************************************************************
+
+Public _Ow2US850000 ;******
+_Ow2US850000 Label Byte ;Beginning of the table. US 850 AT Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,0,0,0,AT,Len3,'US','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 0, 0 ; 8 7 &
+ KeyDef 4, 0,0,0,0,0,0,0, '8', '*', 0, 0, 0 ; 9 8 *
+ KeyDef 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 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccentEntry <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len3 EQU $ - _Ow2US850000
+
+;*****************************************************************************
+
+Public _Ow2US850010 ;******
+_Ow2US850010 Label Byte ;Beginning of the table. US 850 EN Kbd
+ ;***************
+;&& Form of XtHeader "XtHeader cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs"
+;&& where cp is the code page, a,b,c,d,e,f,g,h,i are the flags:
+; a - ShiftAlt (use shift-alt for Char 3)
+; b - AltGrafL (use left alt key for Char 3)
+; c - AltGrafR (use right alt key for Char 3)
+; d - ShiftLock (all core keys are shifted when Capslock active)
+; e - DefaultTable (default table for language)
+; f - ShiftToggle (ShiftLock is toggle operated, not latched)
+; g - AccentPass (invalid dead key/char combination outputs both and beeps)
+; h - CapsShift (use Char 5 for Caps-Shift combination)
+;&& i - MachineDep (table is machine dependent)
+; kb is the keyboard type, l is the length of the table in bytes,
+;&& cc is the country layout ID, and cs is the subcountry layout ID
+
+;&& cp a b c d e f g h i kb l cc cs
+;&& | | | | | | | | | | | | | |
+XtHeader 850,0,0,0,0,0,0,0,0,0,EN,Len4,'US','103'
+
+; Form of XlateTable KeyDefs: "KeyDef f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+; where a,b,c,d,e are Char1 - Char5, f is the Action number to
+; apply in translating this key, and g1-7 are 1 or 0 flags if
+; accents 1 - 7 apply to the key.
+
+; +--Key Type number. +---Chars-+----+----+ Scan Legend
+; | +AccentFlags+ 1 2 3 4 5 Code |
+; | | | | | | | | | | | | | | |
+ KeyDef 8, 0,0,0,0,0,0,0, 27, 27, 0, 0, 0 ; 1 ESC
+ KeyDef 4, 0,0,0,0,0,0,0, '1', '!', 0, 0, 0 ; 2 1 !
+ KeyDef 4, 0,0,0,0,0,0,0, '2', '@', 0, 0, 0 ; 3 2 @
+ KeyDef 4, 0,0,0,0,0,0,0, '3', '#', 0, 0, 0 ; 4 3 #
+ KeyDef 4, 0,0,0,0,0,0,0, '4', '$', 0, 0, 0 ; 5 4 $
+ KeyDef 4, 0,0,0,0,0,0,0, '5', '%', 0, 0, 0 ; 6 5 %
+ KeyDef 4, 0,0,0,0,0,0,0, '6', '^', 0, 0, 0 ; 7 6 ^
+ KeyDef 4, 0,0,0,0,0,0,0, '7', '&', 0, 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, 0, 0 ; 112 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 113 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 114 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 115 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 116 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 117 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 118 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 119 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 120 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 121 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 122 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 123 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 124 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 125 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 126 '
+ KeyDef 0, 0,0,0,0,0,0,0, 0, 0, 0, 0, 0 ; 127 '
+
+; Form of AccEnt's below is:
+; "AccEnt <a,b,c,d,e,f,c1,s1,c2,s2..c20,s20>"
+; where a & b are the scan code & char to use when the key following this accent
+; isn't affected by the accent so the accent itself must be used,
+; c & d are the scan code & char to use when Ctl-[accent] is pressed,
+; and e & f do the same for Alt-[accent]. c1,s1 - c20,s20 are the char/scan code
+; mapping for accented translation.
+
+;Accent key definitions and mappings.
+
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+AccEnt <>
+
+Len4 EQU $ - _Ow2US850010
+
+_TEXT ends
+ END
diff --git a/private/os2/os2ses/imrqust.c b/private/os2/os2ses/imrqust.c
new file mode 100644
index 000000000..804c57d5f
--- /dev/null
+++ b/private/os2/os2ses/imrqust.c
@@ -0,0 +1,261 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ imrqust.c
+
+Abstract:
+
+ This module contains the Immon requests thread and
+ the handler for Immon requests.
+
+Author:
+
+ Akihiko Sasaki (v-akihis) 18-Dec-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#ifdef DBCS
+
+// If NLS module for console doesn't present, then NO_CONSOLE_NLS switch should be enable
+// difinition.
+// If NLS module for User doesn't present, then NO_IME switch should be enable difinition.
+//#define NO_CONSOLE_NLS
+//#define NO_IME
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include <stdio.h>
+#ifndef NO_IME
+#include <winnls32.h>
+#endif
+
+
+// From immonerr.h
+#define IM_NO_ERROR 0 /* IMMonitor No Error Code */
+#define IM_GENERAL_ERROR 3081 /* IMMonitor General Error (Internal) */
+#define IM_INVALID_SEG 3082 /* Cannot access application segment */
+#define IM_INVALID_SESSION 3083 /* Cannot register into Monitor chain */
+
+#define IM_IME_NOT_FOUND 3084 /* specified IME is not found */
+#define IM_IME_INV_ENTRY 3085 /* IME doesnot have all IMExxx entries */
+#define IM_NO_DEFAULT_IME 3086 /* there is no default IMEdit */
+#define IM_IME_NOT_INSTALL 3087 /* IME is not installed in this SG */
+#define IM_IME_FAIL_INSTALL 3088 /* fail to install requested IMEdit */
+#define IM_INVALID_LEN 3089 /* Data Length is invalid. (name.....) */
+
+#define IM_NOT_ENOUGH_BUFF 3090 /* buffer is not enough to save data */
+
+#define IM_INVALID_COMMAND 3091 /* invalid command on IMMxxx calls */
+#define IM_RESERVED_COMMAND 3092 /* command is reserved for system use */
+
+#define IM_INVALID_HANDLE 3093 /* invalid handle */
+
+#define IM_NO_XVIO_WINDOW 3094 /* there is no XVIO windows */
+#define IM_WINDOW_HIDDEN 3095 /* cannot make window visible */
+
+#ifndef NO_IME
+USHORT GetEditLen(IMEPRO *);
+#endif
+
+BOOL
+ServeImmonRequest(IN PIMMONREQUEST PReq,
+ OUT PVOID PStatus)
+{
+ DWORD Rc;
+ DWORD dwNlsMode;
+
+ Rc = 0;
+
+ switch (PReq->Request)
+ {
+ case IMMONStatus:
+ if (PReq->d.MonStatBlk.cb != sizeof(MONSTATBLK))
+ {
+#if DBG
+ KdPrint(("OS2SES(ImmonRequest): invalid parameter\n"));
+#endif
+ Rc = ERROR_INVALID_PARAMETER;
+ } else
+ {
+ switch (PReq->d.MonStatBlk.usInfoLevel)
+ {
+ case 0x21:
+#ifndef NO_IME
+ {
+ IMEPRO ImeInfo;
+ PUSHORT pInfoBuf, dst;
+ USHORT BufLen, len;
+
+
+ if (!IMPGetIME( NULL, &ImeInfo ))
+ {
+#if DBG
+ KdPrint(("OS2SES(ImmonRequest): Can not get IME info\n"));
+#endif
+ Rc = IM_IME_NOT_INSTALL;
+ break;
+
+ }
+
+ BufLen = PReq->d.MonStatBlk.cbInfoBuf;
+ if ((GetEditLen(&ImeInfo) + 10) > BufLen)
+ {
+ BufLen = 2;
+ Rc = IM_NOT_ENOUGH_BUFF;
+ } else
+ {
+ pInfoBuf = dst = (PUSHORT)Os2SessionCtrlDataBaseAddress;
+
+ len = strlen(ImeInfo.szName) + 1;
+ *dst++ = len + 2;
+ RtlMoveMemory(dst, ImeInfo.szName, len);
+ (PCHAR) dst += len;
+
+
+ len = strlen(ImeInfo.szDescription) + 1;
+ *dst++ = len + 2;
+ RtlMoveMemory(dst, ImeInfo.szDescription, len);
+ (PCHAR) dst += len;
+
+ len = strlen(ImeInfo.szOptions) + 1;
+ *dst++ = len + 2;
+ RtlMoveMemory(dst, ImeInfo.szOptions, len);
+ (PCHAR) dst += len;
+
+ *dst++ = 3;
+ *(PUCHAR) dst = '\0';
+ }
+ }
+#endif
+ break;
+ case 0x23:
+ if (PReq->d.MonStatBlk.cbInfoBuf < 2)
+ {
+ Rc = ERROR_BUFFER_OVERFLOW;
+ break;
+ }
+#ifndef NO_CONSOLE_NLS
+ if (!GetConsoleNlsMode(hConsoleInput,&dwNlsMode))
+ {
+#if DBG
+ KdPrint(("OS2SES(ImmonRequest): Can not get CONIN NLS Mode\n"));
+#endif
+ dwNlsMode = 0;
+ }
+#else
+ dwNlsMode = 0;
+#endif
+
+#ifndef NO_IME
+ if (dwNlsMode & NLS_IME_DISABLE)
+ *(PUSHORT)Os2SessionCtrlDataBaseAddress = 0;
+ else
+ *(PUSHORT)Os2SessionCtrlDataBaseAddress = 1;
+#endif
+
+ break;
+ default:
+ Rc = IM_INVALID_COMMAND;
+ }
+ }
+ break;
+
+ case IMMONActive:
+
+#ifndef NO_CONSOLE_NLS
+ if (!GetConsoleNlsMode(hConsoleInput,&dwNlsMode))
+ {
+#if DBG
+ KdPrint(("OS2SES(ImmonRequest): Can not get CONIN NLS Mode\n"));
+#endif
+ dwNlsMode = 0;
+ }
+
+ dwNlsMode &= ~NLS_IME_DISABLE;
+
+ if (!SetConsoleNlsMode(hConsoleInput,dwNlsMode))
+ {
+#if DBG
+ KdPrint(("OS2SES(ImmonRequest): Can not set CONIN NLS Mode\n"));
+#endif
+ }
+
+#endif
+ break;
+
+ case IMMONInactive:
+#ifndef NO_CONSOLE_NLS
+ if (!GetConsoleNlsMode(hConsoleInput,&dwNlsMode))
+ {
+#if DBG
+ KdPrint(("OS2SES(ImmonRequest): Can not get CONIN NLS Mode\n"));
+#endif
+ dwNlsMode = 0;
+ }
+
+ dwNlsMode |= NLS_IME_DISABLE;
+
+ if (!SetConsoleNlsMode(hConsoleInput,dwNlsMode))
+ {
+#if DBG
+ KdPrint(("OS2SES(ImmonRequst): Can not set CONIN NLS Mode\n"));
+#endif
+ }
+
+#endif
+ break;
+
+ default:
+ Rc = (DWORD)-1L; //STATUS_INVALID_PARAMETER;
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE)
+ {
+ KdPrint(("OS2SES(ImmonRequest): Unknown Immon request = %lC\n",
+ PReq->Request));
+ }
+#endif
+ }
+
+ if ( Rc == 1 )
+ {
+ Rc = GetLastError();
+ }
+
+ *(PDWORD) PStatus = Rc;
+
+ return(TRUE); // Continue
+}
+
+#ifndef NO_IME
+USHORT
+GetEditLen(IMEPRO *ImeInfo)
+{
+ USHORT Length, Total;
+ CHAR *Str;
+
+ Str = (PUCHAR) ImeInfo->szName;
+ for (Length = 1; *Str++; Length++) ;
+
+ Total = Length;
+
+ Str = (PUCHAR) ImeInfo->szDescription;
+ for (Length = 1; *Str++; Length++) ;
+
+ Total += Length;
+
+ Str = (PUCHAR) ImeInfo->szOptions;
+ for (Length = 1; *Str++; Length++) ;
+
+ return (Total + Length);
+}
+#endif
+#endif
diff --git a/private/os2/os2ses/kbd.h b/private/os2/os2ses/kbd.h
new file mode 100644
index 000000000..8959e7706
--- /dev/null
+++ b/private/os2/os2ses/kbd.h
@@ -0,0 +1,27 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ kbd.h
+
+Abstract:
+
+ Prototypes for functions & macros in kbdrqust.c
+
+Author:
+
+ Michael Jarus (mjarus) 27-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+
+DWORD KbdNewCp( IN ULONG CodePage);
+
diff --git a/private/os2/os2ses/kbddd.inc b/private/os2/os2ses/kbddd.inc
new file mode 100644
index 000000000..638d3a2af
--- /dev/null
+++ b/private/os2/os2ses/kbddd.inc
@@ -0,0 +1,269 @@
+;; SCCSID = @(#)kbddd.inc 13.1 90/12/14
+;; SCCSID = @(#)kbddd.inc 12.2E%
+;;***********************************************************************
+;;* *
+;;@@ 1.1 Keyboard Device Driver Common Structures and Equates *
+;;* *
+;;***********************************************************************
+
+;*****
+;* Definition of a Character Data record.
+;*****
+CharData Struc ;Format of character data record.
+ Char db ? ;The translated character.
+ Scan db ? ;The original scan code (unless "extended" char).
+ Status db ? ;Status bits (init to "char available", and
+ ;@@ Shift Report off).
+ DShift db ? ;DBCS Shift state at time of keystroke.
+ Shift dw ? ;Shift state at time of keystroke.
+ Time dd ? ;@@ PTM 2233: Timestamp of keystroke in ms since IPL.
+CharData Ends
+ChDaRecLen Equ Size CharData ;Length of a CharData record.
+
+;*****
+;* Definition of the packet to send to the monitors, if any registered.
+;* Even when none registered, is used during and after translation.
+;* See just below for bit equates for the flagwords in the packet.
+;*****
+KPacket Struc ;This is the packet.
+ MonFlags dw 0 ;Flagword for mon's to see with key.
+ Key db ChDaRecLen Dup(0) ;Space for a CharData record.
+ DDFlags dw 0 ;Device driver flags for the packet.
+ ;@@ See DDFlags equates below.
+KPacket Ends
+KeyPacketLen Equ Size KPacket ;Length of this packet.
+
+;***
+;* Following equates apply to the low byte of the MonFlags word in
+;* a Key Packet:
+;***
+;OpenPacket Equ 01h ;Packet is an open request (we don't use this).
+;ClosePacket Equ 02h ;Packet is a close request (we don't use this).
+;FlushPacket Equ 04h ;Packet is a flush request.
+;;NOTE: following must match bit being defined by Mike Peters!!!
+NotInserted Equ 80h ;Key wasn't inserted by a monitor.
+
+;***
+;* Following equates apply to the DDFlags word in a Key Packet:
+;***
+NotSQPacket Equ 0400h ;&& Don't put this packet in SQ buffer
+AccentedKey Equ 0200h ;Key was translated using previous accent.
+MultiMake Equ 0100h ;Key was repeated make of a toggle key.
+SecondaryKey Equ 0080h ;Previous scan code was the E0 prefix code.
+KeyBreak Equ 0040h ;This is the break of the key.
+KeyTypeMask Equ 003Fh ;Isolates the Key Type field of DDFlags.
+UndefKey Equ 003Fh ;@@ Key packet is undefined
+SysReqKey Equ 0017h ;@@ This key packet is the SysReq key (4990)
+PrintFlushKey Equ 0016h ;@@ This packet is Ct-Alt-PrtScr
+PSPrintEchoKey Equ 0015h ;@@ This packet is Ctl-P
+PrintEchoKey Equ 0014h ;@@ This packet is Ctl-PrtScr
+PrtScrKey Equ 0013h ;@@ This packet is PrtScr
+PSBreakKey Equ 0012h ;@@ This packet is Ctl-C
+BreakKey Equ 0011h ;@@ This packet is Ctl-Break
+AccentKey Equ 0010h ;@@ This packet is an accent key
+XRorPNot Equ 000Dh ;## This packet is a Read or Peek Notification Pct.
+HotKeyPacket Equ 000Ch ;&& This packet is the hot key.
+BadKeyCombo Equ 000Bh ;@@ Accent/char combo undefined, beep only.
+WakeUpKey Equ 000Ah ;@@ This packet is one following PAUSEKEY
+PSPauseKey Equ 0009h ;@@ This packet is Ctl-S
+PauseKey Equ 0008h ;@@ This packet is Ctl-Numlock or PAUSE
+ShiftMask Equ 0007h ;@@ Key is a shift Key
+DumpKey Equ 0006h ;@@ This packet is Ctl-Numlock-NumLock
+RebootKey Equ 0005h ;@@ This packet is Ctl-Alt-Del
+ResendCode Equ 0004h ;@@ This packet is resend code from controller
+OverRunCode Equ 0003h ;@@ This packet is overrun code from controller
+SecPrefixCode Equ 0002h ;@@ This packet is E0/E1 scan code
+AckCode Equ 0001h ;@@ This packet is ack code from keyboard
+
+
+;*****
+;* SFlags - Equates to use when accessing the ShiftFlags word in a Char-
+;* Data rec. These equates are used when accessing Key Packets, etc.
+;*****
+SysRqFlag = 8000h ;SysRq key down.
+CapsFlag = 4000h ;Capslock key down.
+NumFlag = 2000h ;Numlock key down.
+ScrollFlag = 1000h ;Scroll lock key down.
+RAltFlag = 0800h ;Right Alt key down.
+RCtlFlag = 0400h ;Right Ctrl key down.
+LAltFlag = 0200h ;Left Alt key down.
+LCtlFlag = 0100h ;Left Ctrl key down.
+
+;Following can be used when accessing low-byte only, also.
+
+InsTogl = 0080h ;Insert key toggled on.
+CapsTogl = 0040h ;Capslock key toggled on.
+NumTogl = 0020h ;Numlock key toggled on.
+ScrollTogl = 0010h ;Scroll lock key toggled on.
+AltFlag = 0008h ;An Alt key is down.
+CtlFlag = 0004h ;A Ctrl key is down.
+LShiftFlag = 0002h ;Left shift key down.
+RShiftFlag = 0001h ;Right shift key down.
+
+ifdef JAPAN
+; MSKK Aug.15.1993 V-AKihiS
+;*****
+;* DSFlags - Equates to use when accessing the DShiftFlags word in a Char-
+;* Data rec. These equates are used when accessing Key Packets, etc.
+;*****
+
+KanaToKanji = 10000000b ;Kana to Kanji transfar mode.
+RomanMode = 01000000b ;Roman character mode.
+ShiftDisp = 00011000b ;Display of shift status line.
+CharMode = 00000110b ;Character mode.
+DoubleChar = 00000001b ;Double byte character (Zen-Kaku).
+
+Katakana = 010b ;CharMode is katakana mode.
+Hiragana = 100b ;CharMode is Hiragana mode.
+CMResMask Equ RomanMode+Katakana+Hiragana+DoubleChar
+ToggleMake Equ 01h ;Key was repeated make of a toggle key.
+endif
+
+;@@ PTM 3377: Following equate used for checking reserved bits for Set
+;@@ SM Hot Key IOCTL (56h):
+
+HKResMask Equ InsTogl+CapsTogl+NumTogl+ScrollTogl+AltFlag+CtlFlag ;@@
+
+;@@ *****
+;@@ Following is the structure of the Flag variable data areas used
+;@@ by KbdXlate, for both interrupt- and strategy- time translation.
+;@@ *****
+
+XlateVars Struc ;@@ The flag area structure.
+ XDRFlags dw 0 ;@@ See XCOMPLETE below. Not
+ ;@@ used at interrupt time.
+ XHotKeyShift dw 0 ;@@ ;OS2SS-Moved to here, Interrupt driven shift status
+ XPSGFlags dw 0 ;@@ ;OS2SS-Moved to here, Copy of caller's PSG flags.
+ ;&& (changed byte->word and position
+ ;&& in structure per DCR8)
+ XlateFlags db 0 ;@@ See equates below.
+ ToggleFlags db 0 ;@@ See equates below.
+ XInputMode db 0 ;@@ Copy of desired input mode.
+ XAltKeyPad db 0 ;@@ Accumulator for Alt-nnn entry
+ OtherFlags db 0 ;Misc flags (should be zeroed on a session switch).
+XlateVars Ends ;@@ End flag area stucture.
+
+XLATEVARSIZE Equ Size XlateVars ;@@ Get the size of this area.
+ ;@@ NOTE! Beware of XDRSIZE
+ ;@@ adjustment of XlateVars in
+ ;@@ KBDDATA.ASM!
+
+;XCOMPLETE Equ 0001h ;@@ Indicates strategy time
+; ;@@ translation is complete.
+
+;Equates for using XlateFlags byte in translation data area:
+
+DumpKeyOnce Equ 01h ;Dump key sequence has been hit once.
+PSKeyDown Equ 02h ;Print Screen key is down right now.
+SecPrefix Equ 04h ;G keyboard E0 prefix scan code just seen.
+NormalAlt Equ 08h ;@@ Normal Alt (not AltGraph) is down
+Use3Index Equ 10h ;@@ Use character 3 in translate table as index into
+ ;@@ accent table
+PseudoCtl Equ 20h ;@@ Ctl key was emulated by Enhanced kbd
+E1Prefix Equ 40h ;@@ Enhanced keyboard E1 prefix just seen
+
+;Equates for using ToggleFlags byte in translation data area:
+
+TKeyDown = ScrollTogl+NumTogl+CapsTogl ;Latches for toggle keys.
+InsKeyDown Equ 80h ;Insert key is down right now.
+
+;*****
+;* Equates for accessing the XtableFlags1 translate table flagword:
+;*****
+;;XTFlags1 Equ 2 ;Offset of XTableFlags1 in XTHead. ??? NEEDED?
+ShftAlt Equ 0001h ;Use Shift+Alt instead of Ctl+Alt in CtlAltRemap.
+AltGrafL Equ 0002h ;Use left Alt Key as an Alt-Graphics shift key.
+AltGrafR Equ 0004h ;Use right Alt Key as an Alt-Graphics shift key.
+ShiftLock Equ 0008h ;Keyboard uses ShiftLock rather than CapsLock.
+DefTable Equ 0010h ;@@ Default Table for the Language
+ShiftToggle Equ 0020h ;@@ ShiftLock Toggle keyboard
+AccentPass Equ 0040h ;@@ Pass Accent key packet and beep
+CapsShift Equ 0080h ;@@ If CapsShift down, use character 5 from XTable
+
+ATKbd Equ 0000h ;@@ XTKbdType it an AT kbd.
+FERRARI_P Equ 0AB54h ;## PTM 3128 Equate for 88/89 key keyboard.
+FERRARI_G Equ 0AB41h ;## PTM 3128 Equate for 101/102 key keyboard.
+JAGUAR Equ 0AB86h ;%% DCR 1085 Equate for Jaguar 122 key keyboard.
+PCATKBD Equ 0100h ;## ID byte indication for an AT kbd.
+
+;*****
+;* Masks for accessing the XlateOp fields in a keydef.
+;*****
+AccFlagsMask Equ 0FE00h ;@@ Accent flags is now high 7 bits
+ActionMask Equ 01FFh ;@@ KeyType is now low 9 bits
+
+;******
+;* Values for special keyboard scan codes ;@@
+;******
+BufferFull Equ 0FFh ;Keyboard overrun code sent by keyboard.
+Resend Equ 0FEh ;Resend command request from keyboard.
+Ack Equ 0FAh ;Command acknowledge from keyboard.
+OtherKey Equ 0E0h ;Enhanced keyboard's secondary key prefix.
+OtherKey2 Equ 0E1h ;Another secondary key prefix.
+BreakBit Equ 80h ;Mask for break bit in a scan code.
+
+;*****
+;* Equates for PSGFlags - misc flags used by individual screen group.
+;* (Should be zeroed on session termination.)
+;* DCR8: Changed from byte to word to add single queue support.
+;*****
+SQMODE Equ 0200h ;&& Indicates Single Queue mode processing.
+SGInUse Equ 0080h ;This session has been initialized & not terminated.
+;OS2SS-SG3xBox Equ 0040h ;This session is the 3xBox.
+ActiveSG Equ 0020h ;This session is the currently active one.
+Flushing Equ 0010h ;Currently flushing monitors in this PSG.
+NowPaused Equ 0008h ;This session currently paused.
+PrevAccent Equ 0007h ;Bits where accent number saved til next keystroke.
+WakeUpSent Equ 0100h ;## B790266 The WakeUpKey flag has been set ON in the DDFlags
+
+;;*****
+;;* Misc Equates used by various routines:
+;;*****
+;INPUTMODE Equ 80h ;@@ Input mode flag. 1=Binary, 0=ASCII.
+EXTENDEDCODE Equ 2 ;## DCR 357: Define status bit for secondary keys.
+SHIFTREPORT Equ 1 ;@@ Shift Report, input mode flag.
+
+;*****
+;* OtherFlags: Misc flags (should be zeroed on a session switch).
+;* Use following equates to access the OtherFlags byte:
+;*****
+OFlags Record a7:1,a6:1,a5:1,a4:1,a3:1,a2:1,a1:1,a0:1
+;Note: leave HotKeyDown & MHotKeyDown in bits 0 and 1!!!
+;HotKeyDown = Mask a0 ;SM HotKey is down right now.
+;MHotKeyDown = Mask a1 ;Monitor inserted SM HotKey down now.
+InterruptTime = Mask a2 ;Currently processing an interrupt.
+;HotKeyFound = Mask a3 ;@@ Hot key was found in table
+;RecvdPMode = Mask a4 ;@@ PTM 7582 - Interrupt time mode flag.
+;AlreadySwitch = Mask a5 ;@@ PTM 7582 - Interrupt time mode flag.
+;IntInProgress = Mask a6 ;@@ PTM 5336 - Int is in progress.
+;NestedInt = Mask a7 ;@@ PTM 5336 - Interrupt is nested.
+
+;;*****
+;;* MiscFlags: Misc flags, mostly just used once by KBDDD.
+;;* Use following equates to access the MiscFlags byte:
+;;*****
+MFlags Record m7:1,m6:1,m5:1,m4:1,m3:1,m2:1,m1:1,m0:1
+EnhancedKbd = Mask m4 ;Enhanced Kbd is out there (must be Bit 4!).
+
+;&& PTM 291: BEGIN
+;&& *****
+;&& * MiscFlags3:
+;&& * Use following equates to access the MiscFlags3 byte:
+;&& *****
+;&& Define the bits...
+MFlags3 Record mb7:1,mb6:1,mb5:1,mb4:1,mb3:1,mb2:1,mb1:1,mb0:1
+;SQon = Mask mb0 ;&& DCR 75: indicates whether any SG is in SQ.
+AltPacket = Mask mb1 ;&& DCR 1713: indicates that Alt-Numpad
+ ;&& accumulation is finished.
+PauseLatch = Mask mb2 ;&& PTM 2344: indicates correct keystroke
+ ;&& sequence for a Ctrl-NumLock.
+;IOCTl1st = Mask mb3 ;&& PTM 2189: indicates first keyboard IOCTl for
+ ;&& SetCurrentSG received.
+E0Packet = Mask mb4 ;&& PTM 2382: indicates that an E0 packet is
+ ;&& to be sent with the next packet.
+;SENDTIMERNEEDED = Mask mb5 ;&& PTM 291 indicates whether we need the
+ ;&& timer handler to flag an error.
+;SETSENDTIMER = Mask mb6 ;&& PTM 291 indicates whether we need to reset
+ ;&& the ticks for the timer handler.
+SecAltNumPad = Mask mb7 ;## PTR AK00370: indicates AltNumpad with R-Alt.
+
diff --git a/private/os2/os2ses/kbdnls.c b/private/os2/os2ses/kbdnls.c
new file mode 100644
index 000000000..26d6c5207
--- /dev/null
+++ b/private/os2/os2ses/kbdnls.c
@@ -0,0 +1,191 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ kbdnls.c
+
+Abstract:
+
+ This module contains the NLS support for Kbd.
+
+Author:
+
+ KazuM 15-May-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#ifdef DBCS
+
+// If NLS module for console doesn't present, then NO_CONSOLE_NLS switch should be enable
+// difinition.
+// If NLS module for User doesn't present, then NO_IME switch should be enable difinition.
+//#define NO_CONSOLE_NLS
+//#define NO_IME
+
+#include <stdio.h>
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#ifndef NO_IME
+#include <ime.h>
+#endif
+
+#ifndef NO_CONSOLE_NLS
+typedef struct _NLS_SHIFT_REPORT {
+ WORD wVirtualKeyCode;
+ BYTE NlsShiftKeyCode;
+} NLS_SHIFT_REPORT, *PNLS_SHIFT_REPORT;
+
+NLS_SHIFT_REPORT NlsShiftReport[] = {
+ {VK_DBE_ALPHANUMERIC, 0x80},
+ {VK_DBE_KATAKANA, 0x40},
+ {VK_DBE_HIRAGANA, 0x20},
+ {VK_KANJI, 0x10},
+ {VK_DBE_SBCSCHAR, 0x08},
+ {VK_DBE_DBCSCHAR, 0x08}
+};
+#endif
+
+BYTE
+MapWinToOs2KbdNlsShift(IN PKEY_EVENT_RECORD WinKey)
+{
+ BYTE bNlsShift = LOBYTE(HIWORD(WinKey->dwControlKeyState));
+
+// MSKK Aug.23.1993 V-AkihiS
+// if (bNlsShift & OS2_NLS_IME_CONVERSION)
+// return bNlsShift;
+// else
+// return 0;
+ return bNlsShift;
+}
+
+BYTE
+MapWinToOs2KbdInterim(IN PKEY_EVENT_RECORD WinKey)
+{
+ return (BYTE)(HIBYTE(HIWORD(WinKey->dwControlKeyState))+0x40);
+}
+
+// MSKK Aug.10.1993 V-AkihiS
+ULONG
+MapWinToOs2KbdNlsChar(IN PKEY_EVENT_RECORD WinKey,
+ OUT PKBD_MON_PACKAGE Os2KeyInfo)
+{
+// MSKK Oct.30.1992 V-AkihiS
+// MSKK Aug.05.1993 V-AkihiS
+ BOOL Dummy;
+ BYTE AsciiDbcs[2];
+ PBYTE Asc;
+ ULONG NumBytes, i;
+
+ NumBytes = sizeof(AsciiDbcs);
+ NumBytes = WideCharToMultiByte(SesGrp->KbdCP,
+ 0,
+ &WinKey->uChar.UnicodeChar,
+ 1,
+ AsciiDbcs,
+ NumBytes,
+ NULL,
+ &Dummy);
+ Asc = AsciiDbcs;
+ for (i = 0; i < NumBytes; i ++) {
+ Os2KeyInfo[i].KeyInfo.chChar = *Asc++;
+ Os2KeyInfo[i].KeyInfo.chScan = 0;
+ Os2KeyInfo[i].KeyInfo.fbStatus = MapWinToOs2KbdInterim(WinKey);
+ }
+
+#if DBG
+ IF_OD2_DEBUG(KBD)
+ {
+ KdPrint(("MapWinToOs2KbdNlsChar: ASCII %x, Uni %x, VKey %x, VScan %x, Ctrl %lx =>\n ASCII %x, Scan %x\n",
+ WinKey->uChar.AsciiChar, WinKey->uChar.UnicodeChar,
+ WinKey->wVirtualKeyCode, WinKey->wVirtualScanCode,
+ WinKey->dwControlKeyState,
+ Os2KeyInfo[0].KeyInfo.chChar, Os2KeyInfo[0].KeyInfo.chScan));
+ }
+#endif
+ return NumBytes;
+}
+
+BYTE
+MapWinToOs2KbdNlsShiftReport(IN PKEY_EVENT_RECORD WinKey,
+ IN PKBDKEYINFO Os2Key)
+{
+ int i;
+
+#ifndef NO_CONSOLE_NLS
+ if (Os2Key->bNlsShift & OS2_NLS_IME_CONVERSION)
+ {
+ for (i=0; i < sizeof(NlsShiftReport)/sizeof(NLS_SHIFT_REPORT); i++)
+ if (NlsShiftReport[i].wVirtualKeyCode == WinKey->wVirtualKeyCode)
+ if (WinKey->bKeyDown)
+ return NlsShiftReport[i].NlsShiftKeyCode;
+ }
+#endif
+ return 0;
+}
+
+VOID
+GetNlsMode(IN PKBDINFO KbdInfo)
+{
+ DWORD dwNlsMode;
+ BYTE NlsShift;
+ BYTE Interim;
+
+#ifndef NO_CONSOLE_NLS
+ if (!GetConsoleNlsMode(hConsoleInput,&dwNlsMode)) {
+#if DBG
+ IF_OD2_DEBUG2( KBD, OS2_EXE )
+ KdPrint(("GetNlsMode: Can not get CONIN NLS Mode\n"));
+#endif
+ dwNlsMode = 0;
+ }
+#else
+ dwNlsMode = 0;
+#endif
+
+ NlsShift = LOBYTE(HIWORD(dwNlsMode));
+ Interim = HIBYTE(HIWORD(dwNlsMode));
+ KbdInfo->fsInterim = MAKEWORD((KbdInfo->fsInterim | Interim),NlsShift);
+}
+
+VOID
+SetNlsMode(IN KBDINFO KbdInfo)
+{
+ DWORD dwNlsMode;
+ BYTE NlsShift;
+ BYTE Interim;
+
+ NlsShift = HIBYTE(KbdInfo.fsInterim);
+ Interim = LOBYTE(KbdInfo.fsInterim);
+ dwNlsMode = MAKELONG(0, MAKEWORD(NlsShift,Interim));
+
+#ifndef NO_CONSOLE_NLS
+// MSKK Apr.04.1993 V-AkihiS
+// MSKK Aug.23.1993 V-AkihiS
+ //
+ // When hiragana or sbcsdbcs is set, set IME enable flag too.
+ //
+ if (dwNlsMode & (NLS_DBCSCHAR | NLS_HIRAGANA)) {
+ dwNlsMode |= NLS_IME_CONVERSION;
+ }
+
+ if (!SetConsoleNlsMode(hConsoleInput,dwNlsMode)) {
+#if DBG
+ IF_OD2_DEBUG2( KBD, OS2_EXE )
+ KdPrint(("SetNlsMode: Can not set CONIN NLS Mode\n"));
+#endif
+ dwNlsMode = 0;
+ }
+#endif
+
+}
+#endif
diff --git a/private/os2/os2ses/kbdrqust.c b/private/os2/os2ses/kbdrqust.c
new file mode 100644
index 000000000..3c17e9332
--- /dev/null
+++ b/private/os2/os2ses/kbdrqust.c
@@ -0,0 +1,4046 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ kbdrqust.c
+
+Abstract:
+
+ This module contains the Kbd requests thread and
+ the handler for Kbd requests.
+
+Author:
+
+ Michael Jarus (mjarus) 23-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "trans.h"
+#include "event.h"
+#include "kbd.h"
+#include "os2win.h"
+#include <stdio.h>
+
+#define OS2_SCAN_INSERT_0 0x52
+#define OS2_SCAN_END_1 0x4F
+#define OS2_SCAN_CTRL_END_1 0x75
+#define OS2_SCAN_DOWN_2 0x50
+#define OS2_SCAN_LEFT_4 0x4B
+#define OS2_SCAN_CTRL_LEFT_4 0x73
+#define OS2_SCAN_RIGHT_6 0x4D
+#define OS2_SCAN_CTRL_RIGHT_6 0x74
+#define OS2_SCAN_HOME_7 0x47
+#define OS2_SCAN_CTRL_HOME_7 0x77
+#define OS2_SCAN_UP_8 0x48
+#define OS2_SCAN_DEL 0x53
+
+DWORD
+Ow2GetOs2KbdEventIntoQueue();
+
+DWORD
+Ow2VioUpdateCurPos(
+ IN COORD CurPos
+ );
+
+DWORD
+Ow2VioReadCurPos(
+ );
+
+DWORD
+Ow2VioReadCurType();
+
+VOID
+KbdSetTable(
+ IN ULONG KbdCP
+ );
+
+#if DBG
+BYTE KbdEchoCharToConsoleStr[] = "KbdEchoCharToConsole";
+BYTE KbdEchoCharStr[] = "KbdEchoChar";
+BYTE KbdEchoStringToConsoleStr[] = "KbdEchoStringToConsole";
+BYTE KbdEchoAStringStr[] = "KbdEchoAString";
+BYTE KbdEchoBSAndFillSpacesStr[] = "KbdEchoBSAndFillSpaces";
+BYTE KbdEchoESCStr[] = "KbdEchoESC";
+BYTE KbdCueMoveToRightStr[] = "KbdCueMoveToRight";
+#endif
+
+#define KEYBOARD_NEW_MASK (USHORT)(KEYBOARD_2B_TURNAROUND | KEYBOARD_SHIFT_REPORT)
+#define KEYBOARD_ECHO (USHORT)(KEYBOARD_ECHO_ON | KEYBOARD_ECHO_OFF)
+#define KEYBOARD_INPUT (USHORT)(KEYBOARD_ASCII_MODE | KEYBOARD_BINARY_MODE)
+
+#define KEYBOARD_BINARY_SHIFT (KEYBOARD_BINARY_MODE | KEYBOARD_SHIFT_REPORT)
+#define MODE_BINARY_SHIFT (SHIFT_REPORT_MODE | BINARY_MODE)
+
+#define KEYBOARD_SHIFT_ASCII_INPUT (USHORT)(KEYBOARD_ASCII_MODE | KEYBOARD_SHIFT_REPORT)
+#define KEYBOARD_INPUT_RESERVED \
+ ~( KEYBOARD_ECHO_ON | KEYBOARD_ECHO_OFF | KEYBOARD_BINARY_MODE | \
+ KEYBOARD_ASCII_MODE | KEYBOARD_MODIFY_STATE | KEYBOARD_MODIFY_INTERIM | \
+ KEYBOARD_MODIFY_TURNAROUND | KEYBOARD_2B_TURNAROUND | KEYBOARD_SHIFT_REPORT )
+
+#define KbdBuffSize 256
+#define KBD_BUFFER_ADDRESS ((PUCHAR)KbdAddress) // used for ECHO to console
+#define KBD_BUFFER_SIZE OS2_KBD_PORT_MSG_SIZE
+
+#define ALPHANUM_CHAR(BuffIndex) \
+ ((((Char = LineInputBuff[BuffIndex].Char) >= '0') && \
+ (Char <= '9')) || \
+ ((Char >= 'a') && (Char <= 'z')) || \
+ ((Char >= 'A') && (Char <= 'Z'))) \
+
+#define GET_CURRENT_COORD (SesGrp->WinCoord)
+
+typedef struct _LINE_EDIT_KBD
+{
+ UCHAR Char;
+ SHORT X_Pos; // Used as X Coordinate for edit
+ // Used as offset for CUE
+} LINE_EDIT_KBD;
+
+typedef enum
+{
+ CharMode,
+ AsciiMode,
+ BinaryMode
+} KBDMODE;
+
+//CONSOLE_SCREEN_BUFFER_INFO KbdConsoleInfo;
+KBDMODE KbdState; // state for HandleKeyboardInput
+ULONG KbdWaitFlag; // flags for KbdCheckPackage and
+ // arg to GetKeyboardInput
+/* (from event.h)
+ CharIn Peek String Read
+ ------ ---- ------ ----
+ WAIT_MASK 0x01 User NOWAIT User WAIT (0 IO_WAIT, 1 IO_NOWAIT)
+ ENABLE_SHIFT_KEY 0x02 <if SHIFT report>
+ ENABLE_NON_ASCII_KEY 0x04 + + <if BINARY>
+ ENABLE_LN_EDITOR_KEY 0x08 <if ASCII (for KEYS OFF)>
+ ENABLE_KEYS_ON_KEY 0x10 <if ASCII and KEYS ON>
+ */
+
+#define ENABLE_SHIFT_KEY 0x02 /* enable shift report keys (and break for them) */
+
+/*
+ * for Command line editing
+ */
+
+PUCHAR KbdCueBuffer = NULL; // 64K CUE buffer for KEYS ON
+ // This is a cyclic bufffer and all
+ // pointers are index of type USHORT.
+BOOL KbdLineWasEdited; // TRUE if user edited the current line
+USHORT KbdNextLinePointer; // where to put next input line
+USHORT KbdCurrentLine; // index of current line in KbdCueBuffer
+USHORT KbdIndexInLine; // index of current char in input line
+BOOL KbdCueUpRowIsCurrent; // flag set after CR to indicate UP arrow
+ // returns the current line
+
+/*
+ * for GetOs2KbdRead
+ */
+
+USHORT KbdBuffNextPtr; // when string typed was longer the size (ASCII read only)
+ // it points to the remain string
+USHORT KbdBuffNextLen; // remaining bytes in the string
+
+/*
+ * for for HandleKeyboardInput.CharMode:
+ */
+
+BOOL KbdPeekFlag; // called by CharIn (0) or Peek(1)
+
+/*
+ * for for HandleKeyboardInput.Ascii/BinaryMode:
+ */
+
+USHORT KbdInputLength; // the current string length (num of chars
+ // already in input buffer for the user)
+ULONG KbdMaxLength; // maximun input length (String.cb
+ // for StringIn, KbdBuffSize for Read)
+USHORT KbdLength; // On enter: the requested length,
+ // On exit: the returned string length
+USHORT KbdEndLength; // length of Turn Around string
+
+/*
+ * for for HandleKeyboardInput.AsciiMode:
+ */
+
+LINE_EDIT_KBD LineInputBuff[KbdBuffSize]; // the current input buffer
+UCHAR KbdLastBuff[KbdBuffSize]; // holds the previous "Buff"
+USHORT KbdLastBuffPtr; // points to the char in KbdLastBuff to take (if F1)
+USHORT LastStringLength; // length of the previous "Buff"
+USHORT KbdEditFlag; // support EDIT line (F1 .. F4, ->, <-, Ins, Del)
+USHORT KbdReadMode; // called by StringIn (0) or Read(1)
+USHORT KbdFxWaitForChar; // waiting for char after F2(1) or F4(2)
+BOOL KbdEchoFlag; // set if ECHO ON
+BOOL KbdInsertOn; // INSERT key current state (1 - ON)
+BOOL KbdEchoString; // copy string from last buffer (F2 and F3)
+USHORT KbdTurnAroundChar; // turn around char to look for
+BOOLEAN KbdTurnAroundCharTwo; // 2-byte turn around char (KEYBOARD_2B_TURNAROUND)
+USHORT KbdDelIndex;
+SHORT KbdFirstColumn; // first column for this input request
+SHORT KbdStartOfLine; // first column on this line
+
+BOOLEAN KbdSetupTurnAroundCharTwo; // KbsSetStatus of KbdTurnAroundCharTwo:
+ // before new read KbdTurnAroundCharTwo
+ // is updated from this.
+
+#ifdef JAPAN
+// MSKK May.07.1993 V-AkihiS
+/*
+ * for KBDGetKbdType
+ */
+extern USHORT KbdType, KbdSubType;
+extern BYTE OemId, OemSubType;
+#endif
+
+/*
+ * internal functions
+ */
+
+DWORD
+GetOs2KbdKey(
+ IN BOOL PeekFlag,
+ IN USHORT WaitFlag,
+ OUT PKBDKEYINFO KeyInfo,
+ IN PVOID pMsg,
+ OUT PULONG pReply
+ );
+
+DWORD
+GetOs2KbdString(
+ IN USHORT WaitFlag,
+ IN OUT PKBDREQUEST PReq,
+ IN PVOID pMsg,
+ OUT PULONG pReply
+ );
+
+DWORD
+GetOs2KbdRead(
+ IN PULONG Length,
+ IN PVOID pMsg,
+ OUT PULONG pReply
+ );
+
+VOID
+KbdNewSetup(
+ IN PKBDINFO LastSetup
+ );
+
+DWORD
+GetOs2KbdStringRead(
+ IN USHORT WaitFlag,
+ IN USHORT EditFlag,
+ IN USHORT ReadMode,
+ IN ULONG MaxLength,
+ IN OUT PUSHORT Length,
+ IN PVOID pMsg,
+ OUT PULONG pReply
+ );
+
+DWORD
+HandleKeyboardInput(
+ IN PKEYEVENTINFO pKbd
+ );
+
+DWORD
+Ow2KbdSetStatus(
+ IN PKBDREQUEST PReq
+ );
+
+BOOL
+KbdKeyIsTurnAround(
+ IN UCHAR Char,
+ IN UCHAR Scan
+ );
+
+/*
+ * Echo functions for KbdStringIn/Read (ASCII)
+ */
+
+DWORD
+KbdEchoNL(
+ IN ULONG Count
+ );
+
+DWORD
+KbdEchoESC(
+ IN ULONG Count,
+ IN ULONG HorzMove
+ );
+
+DWORD
+KbdEchoBSAndFillSpaces(
+ IN ULONG BSCount,
+ IN ULONG SpaceCount
+ );
+
+DWORD
+KbdEchoBeep(
+ IN ULONG Count
+ );
+
+DWORD
+KbdEchoChar(
+ IN UCHAR Char,
+ IN ULONG Count
+ );
+
+DWORD
+KbdEchoAString(
+ IN PUCHAR String,
+ IN ULONG Length
+ );
+
+/*
+ * CUE functions
+ */
+
+VOID
+KbdCueEraseAndDisplayLine(
+ IN ULONG NewLineIndex
+ );
+
+VOID
+KbdCueMoveToRight(
+ IN ULONG StartIndex,
+ IN ULONG StringLength,
+ IN ULONG UpdateLVB
+ );
+
+VOID
+KbdCueMoveToLeft(
+ IN ULONG StartIndex,
+ IN ULONG MoveLength
+ );
+
+VOID
+KbdCueUpdateBufferOffset(
+ IN ULONG StartIndex,
+ IN ULONG StringLength,
+ IN ULONG StartOffset
+ );
+
+VOID
+KbdCueDeleteCharAndShift(
+ IN ULONG StartIndex,
+ IN ULONG NumChar
+ );
+
+VOID
+KbdCueHandleChar(
+ IN UCHAR Char,
+ IN ULONG Count
+ );
+
+VOID
+KbdCueSetCurTypeToHalf();
+
+VOID
+KbdCueSetCurTypeToQuater();
+
+
+DWORD
+KbdInit(IN VOID)
+{
+ KBDINFO LastSetup;
+
+ if (InitQueue(&KbdQueue))
+ {
+ return(TRUE);
+ }
+
+ KbdMonQueue = PhyKbdQueue = KbdQueue;
+
+ KbdQueue->Setup.cb = sizeof(KBDINFO);
+ KbdQueue->Setup.fsMask = KEYBOARD_ECHO_ON | KEYBOARD_ASCII_MODE;
+ KbdQueue->Setup.chTurnAround = 0x0D; /* default: <ENTER>/<CR> */
+ KbdQueue->Setup.fsInterim = 0;
+ KbdQueue->Setup.fsState = 0;
+ KbdQueue->bNlsShift = 0;
+ KbdQueue->LastKeyFlag = FALSE;
+
+ LastSetup.fsMask = KEYBOARD_BINARY_MODE;
+ KbdNewSetup(&LastSetup);
+
+ KbdAddress = ((PCHAR)Os2SessionCtrlDataBaseAddress) + KBD_OFFSET;
+
+ Ow2KbdXlateVars.OtherFlags = InterruptTime;
+
+ return(FALSE);
+}
+
+
+DWORD
+KbdInitAfterSesGrp(IN VOID)
+{
+ if (SesGrp->KeysOnFlag)
+ {
+ KbdCueBuffer = HeapAlloc(HandleHeap, 0, 64 * 1024);
+ if ( KbdCueBuffer == NULL )
+ {
+#if DBG
+ KdPrint(("OS2SES(KbdRequset): unable to allocate Cue buffer\n"));
+#endif
+ return ERROR_KBD_NO_MORE_HANDLE;
+ }
+ }
+ return(FALSE);
+}
+
+
+BOOL
+ServeKbdRequest(IN PKBDREQUEST PReq,
+ OUT PVOID PStatus,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+ DWORD Rc;
+ KBDINFO LastSetup;
+ PKEY_EVENT_QUEUE TempKbdQueue;
+ KEYEVENTINFO In;
+
+ Rc = 0;
+ TempKbdQueue = (PKEY_EVENT_QUEUE) PReq->hKbd;
+
+#if DBG
+ if (( PReq->Request != KBDNewFocus ) &&
+ ( PReq->Request != KBDNewCountry ) &&
+ ( PReq->Request != KBDOpen ) &&
+ (KbdQueue != TempKbdQueue))
+ {
+ KdPrint(("OS2SES(KbdRequest-%u): illegal handle\n",
+ PReq->Request));
+ }
+#endif
+
+ switch (PReq->Request)
+ {
+ case KBDOpen:
+ if((Rc = InitQueue(&TempKbdQueue)) == NO_ERROR)
+ {
+ PReq->hKbd = TempKbdQueue;
+ }
+ break;
+
+ case KBDClose:
+ if (( TempKbdQueue != PhyKbdQueue) && TempKbdQueue->Count )
+ {
+ if ( !--TempKbdQueue->Count )
+ {
+ HeapFree(HandleHeap, 0,
+ (LPSTR) TempKbdQueue->MonHdr.MemoryStartAddress);
+ }
+ }
+ break;
+
+ case KBDDupLogHandle:
+ if (TempKbdQueue != PhyKbdQueue)
+ {
+ TempKbdQueue->Count++ ;
+ }
+ break;
+
+ case KBDReadStdIn:
+ if (!hStdInConsoleType)
+ {
+#if DBG
+ KdPrint(("OS2SES(KbdRequest-KbdReadStdIn): illegal request\n"));
+#endif
+ Rc = ERROR_INVALID_HANDLE;
+ break;
+ }
+ // falls into KBDRead
+
+ case KBDRead:
+ Rc = GetOs2KbdRead(&PReq->Length,
+ pMsg,
+ pReply);
+ break;
+
+
+ case KBDCharIn:
+ Rc = GetOs2KbdKey(0, /* CharIn/Peek flag */
+ (USHORT)PReq->fWait,
+ &PReq->d.KeyInfo,
+ pMsg,
+ pReply);
+ break;
+
+ case KBDStringIn:
+ Rc = GetOs2KbdString((USHORT)PReq->fWait,
+ PReq,
+ pMsg,
+ pReply);
+ break;
+
+ case KBDPeek:
+ Rc = GetOs2KbdKey(1, /* CharIn/Peek flag */
+ IO_NOWAIT,
+ &PReq->d.KeyInfo,
+ pMsg,
+ pReply);
+ break;
+
+ case KBDFlushBuffer:
+ In.wRepeatCount = 0x7FFF;
+ while (TRUE)
+ {
+ KbdQueue->LastKeyFlag = FALSE;
+ KbdQueue->Out == KbdQueue->In;
+
+ Rc = GetKeyboardInput( IO_NOWAIT,
+ &In,
+ pMsg,
+ pReply);
+
+ if ( !Rc ) /* no char & NO_WAIT */
+ break;
+ }
+ break;
+
+ case KBDGetStatus:
+ if (PReq->d.KbdInfo.cb < 10 )
+ { Rc = ERROR_KBD_INVALID_LENGTH;
+ break;
+ }
+ Ow2GetOs2KbdEventIntoQueue();
+ PReq->d.KbdInfo = KbdQueue->Setup;
+#ifdef DBCS
+// MSKK May.18.1992 KazuM
+ GetNlsMode(&KbdQueue->Setup);
+#endif
+ PReq->d.KbdInfo.fsState &= KBDINFO_STATE_MASK;
+ break;
+
+ case KBDSetStatus:
+ Rc = Ow2KbdSetStatus(PReq);
+ break;
+
+ case KBDFreeFocus:
+ LastSetup = KbdQueue->Setup;
+ KbdQueue = PhyKbdQueue;
+ NewKbdQueue(KbdQueue);
+ KbdNewSetup(&LastSetup);
+ break;
+
+ case KBDNewFocus:
+ LastSetup = KbdQueue->Setup;
+ KbdQueue = TempKbdQueue;
+ NewKbdQueue(KbdQueue);
+ KbdNewSetup(&LastSetup);
+ break;
+
+// BUGBUG?? - do the following requests working on the current/last-focused
+// logical keyboard, on the physical keyboard or on a logical
+// keyboard passed as a parameter
+
+ case KBDGetInputMode:
+ switch (KbdQueue->Setup.fsMask & KEYBOARD_BINARY_SHIFT)
+ {
+ case KEYBOARD_BINARY_SHIFT:
+ PReq->d.InputMode = MODE_BINARY_SHIFT;
+ break;
+
+ case KEYBOARD_BINARY_MODE:
+ PReq->d.InputMode = BINARY_MODE;
+ break;
+
+ default:
+ PReq->d.InputMode = ASCII_MODE;
+ break;
+ }
+ break;
+
+ case KBDGetInterimFlag:
+#ifdef DBCS
+// MSKK May.18.1992 KazuM
+ GetNlsMode(&KbdQueue->Setup);
+#endif
+ PReq->d.Interim = (UCHAR)(KbdQueue->Setup.fsInterim &
+ (CONVERSION_REQUEST | INTERIM_CHAR));
+ break;
+
+ case KBDGetKbdType:
+#ifdef JAPAN
+// MSKK May.07.1993 V-AkihiS
+ if (KbdType == KBD_TYPE_JAPAN && OemId == SUB_KBD_TYPE_MICROSOFT)
+ {
+ switch(OemSubType)
+ {
+ case MICROSOFT_KBD_101_TYPE:
+ PReq->d.KbdType[0] = 0x0001;
+ PReq->d.KbdType[1] = 0x0000;
+ PReq->d.KbdType[2] = 0x0000;
+ break;
+ case MICROSOFT_KBD_AX_TYPE:
+ PReq->d.KbdType[0] = 0x0010;
+ PReq->d.KbdType[1] = 0x0000;
+ PReq->d.KbdType[2] = 0x0001;
+ break;
+ case MICROSOFT_KBD_106_TYPE:
+ PReq->d.KbdType[0] = 0x0001;
+ PReq->d.KbdType[1] = 0x82B3;
+ PReq->d.KbdType[2] = 0x0032;
+ break;
+ case MICROSOFT_KBD_002_TYPE:
+ PReq->d.KbdType[0] = 0x0006;
+ PReq->d.KbdType[1] = 0x82B3;
+ PReq->d.KbdType[2] = 0x0032;
+ break;
+ default:
+ PReq->d.KbdType[0] = 0x0001;
+ PReq->d.KbdType[1] = 0x0000;
+ PReq->d.KbdType[2] = 0x0000;
+#if DBG
+ KdPrint(("OS2SES(Kbd) This keyboard isn't supported yet.\n"));
+#endif
+ }
+ } else
+ {
+ PReq->d.KbdType[0] = 0x0001;
+ PReq->d.KbdType[1] = 0x0000;
+ PReq->d.KbdType[2] = 0x0000;
+#if DBG
+ KdPrint(("OS2SES(Kbd) This keyboard isn't supported yet.\n"));
+#endif
+ }
+#else
+ PReq->d.KbdType = 0x0001; // BUGBUG
+#endif
+ break;
+
+ case KBDGetHotKey:
+ // BUGBUG PReq->d.HotKey =
+ /*
+
+ if ((*pParm != HOTKEY_MAX_COUNT) &&
+ (*pParm != HOTKEY_CURRENT_COUNT))
+ {
+ }
+#define HOTKEY_MAX_COUNT 0x0000
+#define HOTKEY_CURRENT_COUNT 0x0001
+ */
+
+ break;
+
+ case KBDGetShiftState:
+#ifdef DBCS
+// MSKK Oct.20.1992 V-AkihiS
+ GetNlsMode(&KbdQueue->Setup);
+ PReq->d.Shift.fNLS = HIBYTE(KbdQueue->Setup.fsInterim);
+#else
+ PReq->d.Shift.fNLS = KbdQueue->bNlsShift;
+#endif
+ PReq->d.Shift.fsState = KbdQueue->Setup.fsState;
+ break;
+
+ case KBDSetInputMode:
+ LastSetup = KbdQueue->Setup;
+ KbdQueue->Setup.fsMask = (USHORT)
+ ((KbdQueue->Setup.fsMask & ~(KEYBOARD_INPUT | KEYBOARD_SHIFT_REPORT)) |
+ ((PReq->d.InputMode & SHIFT_REPORT_MODE) ? KEYBOARD_SHIFT_REPORT : 0) |
+ ((PReq->d.InputMode & BINARY_MODE ) ?
+ KEYBOARD_BINARY_MODE : KEYBOARD_ASCII_MODE));
+ KbdNewSetup(&LastSetup);
+ break;
+
+ case KBDSetShiftState:
+ LastSetup = KbdQueue->Setup;
+ KbdQueue->Setup.fsState = PReq->d.Shift.fsState;
+ // BUGBUG : SHIFTSTATE.fbNLS PReq->d.Shift.fNLS
+#ifdef DBCS
+// MSKK Oct.20.1992 V-AkihiS
+ KbdQueue->Setup.fsInterim = MAKEWORD(
+ KbdQueue->Setup.fsInterim,
+ PReq->d.Shift.fNLS
+ );
+ SetNlsMode(KbdQueue->Setup);
+#endif
+ KbdNewSetup(&LastSetup);
+ break;
+
+ case KBDSetTypamaticRate:
+ Rc = !SystemParametersInfo(
+ SPI_SETKEYBOARDDELAY,
+ PReq->d.RateDelay.usDelay,
+ NULL,
+ 0);
+ if (!Rc)
+ {
+ Rc = !SystemParametersInfo(
+ SPI_SETKEYBOARDSPEED,
+ PReq->d.RateDelay.usRate,
+ NULL,
+ 0
+ );
+ }
+ break;
+
+ case KBDSetInTerimFlag:
+ LastSetup = KbdQueue->Setup;
+#ifdef DBCS
+// MSKK Mar.03.1993 V-AkihiS
+ KbdQueue->Setup.fsInterim = MAKEWORD(
+ PReq->d.Interim,
+ HIBYTE(KbdQueue->Setup.fsInterim)
+ );
+ SetNlsMode(KbdQueue->Setup);
+#else
+ KbdQueue->Setup.fsInterim = (USHORT)PReq->d.Interim;
+#endif
+ KbdNewSetup(&LastSetup);
+ break;
+
+ case KBDGetCp:
+ PReq->d.CodePage = SesGrp->KbdCP;
+ break;
+
+ case KBDSetCp:
+ Rc = KbdNewCp(PReq->d.CodePage);
+ break;
+
+ case KBDNewCountry:
+ SesGrp->KeyboardCountry = PReq->d.CodePage; //Hack - Not Really CodePage
+ KbdSetTable(SesGrp->KbdCP);
+ *pReply = 0;
+
+ break;
+
+ case KBDXlate:
+ /*
+ {
+ KBD_XLATE_VARS XlateVars;
+ KBD_MON_PACKAGE KeyInfo[3];
+ PKBDTRANS pKbdXlate = &PReq->d.KbdTrans;
+
+ RtlZeroMemory(&XlateVars, sizeof(KBD_XLATE_VARS));
+ if (pKbdXlate->fsShift != 0)
+ {
+ // continue translation
+
+ //? = pKbdXlate->fsShift;
+ }
+
+ RtlZeroMemory(&Os2KeyInfo[0], 3 * sizeof(KBD_MON_PACKAGE));
+
+ //KeyInfo[0].MonitorFlag = pKbdXlate->...;
+ //KeyInfo[0].DeviceFlag = pKbdXlate->...;
+ KeyInfo[0].KeyInfo.chChar = pKbdXlate->chChar;
+ KeyInfo[0].KeyInfo.chScan = pKbdXlate->chScan;
+ KeyInfo[0].KeyInfo.fbStatus = pKbdXlate->fbStatus;
+ KeyInfo[0].KeyInfo.bNlsShift = pKbdXlate->bNlsShift;
+ KeyInfo[0].KeyInfo.fsState = pKbdXlate->fsState;
+ KeyInfo[0].KeyBoardFlag = pKbdXlate->fsDD;
+
+ KeyInfo[0].KeyInfo.fbStatus = 0x40;
+
+ //? XlateVars.XlateFlags |= SecPrefix; // Have seen E0 prefix
+
+ Rc = Ow2KbdXlate(
+ pKbdXlate->chScan, // ScanCode,
+ &XlateVars, // pFlagArea,
+ &KeyInfo[0], // pMonitorPack,
+ Ow2KbdScanTable // pTransTable
+ );
+
+ //? which packet - KeyInfo[?]
+ pKbdXlate->chChar = KeyInfo[0].KeyInfo.chChar;
+ pKbdXlate->chScan = KeyInfo[0].KeyInfo.chScan;
+ pKbdXlate->fbStatus = KeyInfo[0].KeyInfo.fbStatus;
+ pKbdXlate->bNlsShift = KeyInfo[0].KeyInfo.bNlsShift;
+ pKbdXlate->fsState = KeyInfo[0].KeyInfo.fsState;
+ pKbdXlate->fsDD = KeyInfo[0].KeyBoardFlag;
+ //? pKbdXlate->fsXlate = ;
+ //? pKbdXlate->fsShift = ;
+ }
+ */
+ case KBDSetCustXt:
+ /* from ??? */
+ default:
+ Rc = (DWORD)-1L; //STATUS_INVALID_PARAMETER;
+#if DBG
+ IF_OD2_DEBUG2( KBD, OS2_EXE )
+ KdPrint(("OS2SES(KbdRequest): Unknown Kbd request = %X\n", PReq->Request));
+#endif
+ }
+
+ if ( Rc == 1 )
+ {
+ Rc = GetLastError();
+ }
+
+ *(PDWORD) PStatus = Rc;
+ return(TRUE); // Continue
+}
+
+
+DWORD
+Ow2KbdSetStatus(IN PKBDREQUEST PReq)
+{
+ KBDINFO LastSetup, *pKbdSetup;
+ USHORT KbdMask, Mask;
+
+ /*
+ * check legalty of parameters:
+ *
+ * 1. sizeof structure
+ * 2. reserved bits
+ * 3. mutuex bits (ECHO_ON & ECHO_OFF, ASCII & BINARY, ASCII & SHIFT)
+ */
+
+ LastSetup = KbdQueue->Setup;
+ if (PReq->d.KbdInfo.cb != 10 )
+ {
+ return ERROR_KBD_INVALID_LENGTH;
+ }
+
+ KbdMask = PReq->d.KbdInfo.fsMask;
+ pKbdSetup = &KbdQueue->Setup;
+
+ if (KbdMask & KEYBOARD_INPUT_RESERVED)
+ {
+ return ERROR_KBD_INVALID_INPUT_MASK;
+ }
+
+ if ((KbdMask & KEYBOARD_ECHO ) == KEYBOARD_ECHO)
+ {
+ return ERROR_KBD_INVALID_ECHO_MASK;
+ }
+
+ if ((KbdMask & KEYBOARD_INPUT) == KEYBOARD_INPUT)
+ {
+ return ERROR_KBD_INVALID_INPUT_MASK;
+ }
+
+ if ((KbdMask & KEYBOARD_SHIFT_ASCII_INPUT) == KEYBOARD_SHIFT_ASCII_INPUT)
+ {
+ return ERROR_KBD_INVALID_INPUT_MASK;
+ }
+
+ /*
+ * check modified bits and set the flags according:
+ *
+ * 1. STATE - set fsState
+ * 2. INTERIM - set fsInterim
+ * 3. TURNAROUND - set chTurnAround
+ */
+
+#ifdef DBCS
+// MSKK Jul.1993 V-AKihiS
+ if (KbdMask & KEYBOARD_MODIFY_STATE)
+ {
+ pKbdSetup->fsState = PReq->d.KbdInfo.fsState;
+ pKbdSetup->fsInterim = MAKEWORD(
+ LOBYTE(pKbdSetup->fsInterim),
+ HIBYTE(PReq->d.KbdInfo.fsInterim)
+ );
+ SetNlsMode(*pKbdSetup);
+ }
+
+ if (KbdMask & KEYBOARD_MODIFY_INTERIM)
+ pKbdSetup->fsInterim = MAKEWORD(
+ LOBYTE(PReq->d.KbdInfo.fsInterim),
+ HIBYTE(pKbdSetup->fsInterim)
+ );
+#else
+ if (KbdMask & KEYBOARD_MODIFY_STATE)
+ pKbdSetup->fsState = PReq->d.KbdInfo.fsState;
+
+ if (KbdMask & KEYBOARD_MODIFY_INTERIM)
+ pKbdSetup->fsInterim = PReq->d.KbdInfo.fsInterim;
+#endif
+
+ if (KbdMask & KEYBOARD_MODIFY_TURNAROUND)
+ pKbdSetup->chTurnAround = PReq->d.KbdInfo.chTurnAround;
+
+ /*
+ * update mask:
+ *
+ * 1. update mask of new bits SHIFT_REPORT & 2B_TURNAROUND
+ * 2. if new mask includes new ECHO then update mask
+ * 3. if new mask includes new INPUT then update mask
+ */
+
+ Mask = KEYBOARD_NEW_MASK;
+
+ if (KbdMask & KEYBOARD_ECHO)
+ {
+ Mask |= KEYBOARD_ECHO;
+ }
+
+ if (KbdMask & KEYBOARD_INPUT)
+ {
+ Mask |= KEYBOARD_INPUT;
+ }
+
+ pKbdSetup->fsMask =
+ (pKbdSetup->fsMask & ~Mask) | (KbdMask & Mask);
+
+ KbdNewSetup(&LastSetup);
+
+ return (0L);
+}
+
+
+DWORD
+GetOs2KbdKey( IN BOOL PeekFlag,
+ IN USHORT WaitFlag,
+ OUT PKBDKEYINFO KeyInfo,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+/*++
+
+Routine Description:
+
+ This routine get kbd char for KbdCharIn and KbdPeek
+
+Arguments:
+
+ PeekFlag - TRUE if peek (0 - CharIn, 1 - Peek)
+
+ WaitFlag - Wait if no input (IO_WAIT or IO_NOWAIT)
+
+ KeyInfo - Where to return the key input record
+
+ pMsg - Pointer to the LPC message
+
+ pReply - Pointer to flag if return reply on LPC
+
+Return Value:
+
+
+Note:
+
+ If no event and IO_WAIT: save pMsg, put 0 into *pReply and
+ the reply is postponed.
+
+--*/
+{
+
+ DWORD Rc;
+ KEYEVENTINFO In;
+
+
+ RtlZeroMemory(KeyInfo, sizeof(KBDKEYINFO));
+ KeyInfo->fsState = 1;
+
+ if ( KbdQueue->Setup.fsMask & KEYBOARD_ASCII_MODE )
+ {
+ KbdAsciiMode = 1;
+ } else
+ {
+ KbdAsciiMode = 0;
+ if ((KbdQueue->Setup.fsMask & KEYBOARD_BINARY_SHIFT) == KEYBOARD_BINARY_SHIFT)
+ {
+ WaitFlag |= ENABLE_SHIFT_KEY;
+ }
+ }
+
+ WaitFlag |= ENABLE_NON_ASCII_KEY;
+
+ KbdState = CharMode;
+ KbdWaitFlag = (ULONG)WaitFlag;
+ KbdPeekFlag = PeekFlag;
+
+ for(;;)
+ {
+ if (KbdQueue->LastKeyFlag)
+ {
+ In = KbdQueue->LastKey;
+ KbdQueue->LastKeyFlag = FALSE;
+ } else
+ {
+ In.wRepeatCount = 0x7FFF;
+ Rc = GetKeyboardInput( KbdWaitFlag,
+ &In,
+ pMsg,
+ pReply);
+
+ if ( !Rc ) /* no char & (NO_WAIT or postponed reply) */
+ return(Rc);
+ }
+
+ if (( HandleKeyboardInput(
+ &In
+ )) == NO_ERROR )
+ {
+ *KeyInfo = In.KeyInfo[0].KeyInfo;
+ return(0L);
+ }
+ }
+}
+
+
+DWORD
+GetOs2KbdString( IN USHORT WaitFlag,
+ //IN OUT KBDRW *Length,
+ IN OUT PKBDREQUEST PReq,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+
+ DWORD Rc;
+ USHORT EditFlag = 0;
+ STRINGINBUF String = PReq->d.String;
+
+ KbdAsciiMode = (BOOL)(( KbdQueue->Setup.fsMask & KEYBOARD_ASCII_MODE ) ? 1 : 0);
+
+ if ( String.cchIn && ( String.cchIn <= String.cb ) &&
+ ( KbdLastBuff[String.cchIn] == '\r' ))
+ {
+ EditFlag = 1;
+ }
+
+ String.cchIn = String.cb;
+
+ Rc = GetOs2KbdStringRead( WaitFlag,
+ EditFlag,
+ 0,
+ (ULONG)String.cb,
+ &String.cchIn,
+ pMsg,
+ pReply);
+ if ( pReply )
+ {
+ PReq->Length = (ULONG)KbdLength;
+ String.cchIn = KbdLength;
+ if ( String.cchIn != String.cb )
+ PReq->Length++ ; // ASCII mode - copy the CR
+ }
+
+ return(Rc);
+
+}
+
+
+DWORD
+GetOs2KbdRead(IN PULONG Length,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+ DWORD Rc, i;
+
+ KbdAsciiMode = (BOOL)(( KbdQueue->Setup.fsMask & KEYBOARD_ASCII_MODE ) ? 1 : 0);
+
+ /*
+ * ignore previously-typed-but-not-returned character in binary mode
+ */
+
+ if ( !KbdAsciiMode || !KbdBuffNextLen)
+ {
+
+ Rc = GetOs2KbdStringRead( IO_WAIT,
+ TRUE,
+ 1,
+ KbdBuffSize - 2,
+ (PUSHORT)Length,
+ pMsg,
+ pReply);
+
+ return(Rc);
+
+ }
+
+ /*
+ *
+ * Copy from kbd buffer
+ *
+ */
+
+ if (*Length > (ULONG)KbdBuffNextLen)
+ *Length = KbdBuffNextLen;
+
+ for (i = 0 ; i < *Length ; i++ )
+ {
+ if ((KBD_BUFFER_ADDRESS[i] = KbdLastBuff[i + KbdBuffNextPtr]) == '\n')
+ {
+ *Length = i + 1;
+ break;
+ }
+ }
+
+ KbdBuffNextLen -= *((PUSHORT)Length);
+ KbdBuffNextPtr += (USHORT)*Length;
+
+ return(0L);
+}
+
+
+DWORD
+GetOs2KbdStringRead(IN USHORT WaitFlag,
+ IN USHORT EditFlag,
+ IN USHORT ReadMode,
+ IN ULONG MaxLength,
+ IN OUT PUSHORT Length,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+/*++
+
+Routine Description:
+
+ This routine get kbd string for KbdStringIn and Read("KBD$" or non-redirected
+ STD-IN).
+
+Arguments:
+
+ WaitFlag - Wait if no input (IO_WAIT or IO_NOWAIT)
+
+ EditFlag - TRUE if edit last line(0/1 according to cchIn - StringIn, 1 - Read)
+
+ ReadMode - Called by StringIn (0) or Read(1)
+
+ MaxLength - Maximun input length (String.cb for StringIn, KbdBuffSize
+ for Read)
+
+ Length - On enter: the requested length, on exit: the returned string
+ length (String.cchIn for StringIn, Length field in LPC for Read)
+
+ pMsg - Pointer to the LPC message
+
+ pReply - Pointer to flag if return reply on LPC
+
+Return Value:
+
+
+Note:
+
+ If no event and IO_WAIT: save pMsg, put 0 into *pReply and
+ the reply is postponed.
+
+--*/
+{
+ KEYEVENTINFO In;
+ DWORD Rc;
+
+ KbdLastBuffPtr = KbdInputLength = KbdFxWaitForChar = KbdDelIndex = 0;
+ KbdIndexInLine = 0;
+ KbdInsertOn = KbdEchoString = KbdLineWasEdited = FALSE;
+ //KbdSecondTurnAround = KbdEndFlag = FALSE;
+ KbdLength = *Length;
+
+ if ( KbdAsciiMode )
+ {
+ /*
+ * ASCII mode
+ */
+
+ KbdWaitFlag = (ULONG)(WaitFlag | ENABLE_LN_EDITOR_KEY);
+
+ /*
+ *
+ * Get Start Cursor-Position
+ *
+ */
+
+ // force SesGrp->WinCoord and CurType params to get updated
+
+ Ow2VioReadCurPos();
+ Ow2VioReadCurType();
+
+ if (SesGrp->KeysOnFlag)
+ {
+ KbdWaitFlag |= ENABLE_KEYS_ON_KEY;
+ KbdCueSetCurTypeToQuater();
+ }
+ KbdMaxLength = MaxLength - 1; /* leave space for the TurnAround char at the end */
+ KbdEndLength = 1;
+ KbdReadMode = ReadMode;
+
+ KbdEchoFlag = (BOOL)(( KbdQueue->Setup.fsMask & KEYBOARD_ECHO_ON ) ? 1 : 0);
+ KbdTurnAroundChar = KbdQueue->Setup.chTurnAround;
+ KbdTurnAroundCharTwo = KbdSetupTurnAroundCharTwo;
+
+ //if (KbdQueue->Setup.chTurnAround & 0x80)
+ if(KbdTurnAroundCharTwo)
+ { KbdMaxLength--; /* need another space for 2-byte-TurnAround */
+ KbdEndLength++;
+ }
+
+ KbdEditFlag = EditFlag;
+
+ LineInputBuff[KbdInputLength].X_Pos = KbdStartOfLine = KbdFirstColumn =
+ GET_CURRENT_COORD.X;
+
+ KbdState = AsciiMode;
+
+ } else
+ {
+ KbdWaitFlag = (ULONG)(WaitFlag | ENABLE_NON_ASCII_KEY);
+ KbdState = BinaryMode;
+ }
+
+ for(;;)
+ {
+ /*
+ *
+ * Restore saved Input Key if any
+ *
+ */
+
+ if (KbdQueue->LastKeyFlag)
+ {
+ In = KbdQueue->LastKey;
+ KbdQueue->LastKeyFlag = FALSE;
+ } else
+ {
+ /*
+ *
+ * Get Input Key if any
+ *
+ */
+
+ In.wRepeatCount = 0x7FFF;
+ Rc = GetKeyboardInput( KbdWaitFlag,
+ &In,
+ pMsg,
+ pReply);
+
+ if ( !Rc ) /* no char & NO_WAIT */
+ return(Rc);
+ }
+
+ if (( HandleKeyboardInput(
+ &In
+ )) == NO_ERROR )
+ {
+ *Length = KbdLength;
+ return(0L);
+ }
+ }
+}
+
+
+DWORD
+HandleKeyboardInput(IN PKEYEVENTINFO pKbd)
+{
+ DWORD NumChar = 0;
+ UCHAR Char, Scan, *puchLastString;
+ USHORT i, usIndex, StringLengthToEcho, NumBeep = 0;
+ SHORT X_Pos, Offset;
+
+ Scan = pKbd->KeyInfo[0].KeyInfo.chScan;
+ Char = pKbd->KeyInfo[0].KeyInfo.chChar;
+
+#if DBG
+ IF_OD2_DEBUG(KBD)
+ {
+ KdPrint(("HandleKeyboardInput: %s - Char %x, Scan %x, Status %x, State %x, Flag %x\n",
+ (KbdState == CharMode) ? "CharMode" :
+ (KbdState == AsciiMode) ? "AsciiMode" : "BinaryMode",
+ Char, Scan, pKbd->KeyInfo[0].KeyInfo.fbStatus,
+ pKbd->KeyInfo[0].KeyInfo.fsState, pKbd->KeyInfo[0].KeyboardFlag));
+ }
+#endif
+ switch (KbdState)
+ {
+ case CharMode:
+ if ( KbdPeekFlag || (pKbd->wRepeatCount > 1))
+ {
+ KbdQueue->LastKey = *pKbd;
+ KbdQueue->LastKeyFlag = TRUE;
+ if (!KbdPeekFlag)
+ {
+ KbdQueue->LastKey.wRepeatCount--;
+ }
+ }
+
+ return (NO_ERROR);
+ break;
+
+ case AsciiMode:
+
+ KbdQueue->LastKey = *pKbd; // prepare it in case we read only one copy of the char
+ KbdQueue->LastKey.wRepeatCount--;
+
+ /*
+ *
+ * Handle CR (TurnAround Char)
+ *
+ * 1. put in buffer (if there is a room), beep otherwise
+ * 2. echo if echo_on
+ * 3. (READ only) add LF to CR (if there is a place)
+ *
+ */
+
+ if ( !KbdFxWaitForChar && KbdKeyIsTurnAround(Char, Scan) )
+ {
+ if ( pKbd->wRepeatCount > 1 )
+ {
+ KbdQueue->LastKeyFlag = TRUE;
+ }
+
+ if (( KbdReadMode == 1 ) && KbdInputLength &&
+ ( LineInputBuff[0].Char == 0x1A )) // ^Z
+ {
+ NumChar = KbdInputLength = 0;
+ } else
+ {
+ NumChar = KbdInputLength;
+
+ /*
+ * Add the TurnAround char at the end of the buffer
+ */
+
+ LineInputBuff[KbdInputLength++].Char = Char;
+
+ if (KbdTurnAroundCharTwo)
+ {
+ if ( KbdReadMode == 1 )
+ {
+ LineInputBuff[KbdInputLength - 1].Char = '\r';
+ Scan = '\n';
+ }
+ LineInputBuff[KbdInputLength++].Char = Scan;
+ } else if (( KbdReadMode == 1 ) && ( Char == '\r' ) &&
+ ( KbdInputLength <= (USHORT)KbdMaxLength ))
+ {
+ LineInputBuff[KbdInputLength++].Char = '\n';
+ }
+
+ }
+
+ /*
+ * Echo the TurnAround char to console
+ */
+
+ if (KbdEchoFlag && !KbdTurnAroundCharTwo)
+ {
+ KbdEchoNL(1);
+ }
+
+ /*
+ *
+ * Save string length and data in buffer for editing keys
+ *
+ */
+
+ for ( i = 0 ; i < KbdInputLength ; i++ )
+ {
+ KbdLastBuff[i] = LineInputBuff[i].Char;
+ }
+
+ if (KbdReadMode == 0)
+ {
+ KbdInputLength = (USHORT)NumChar;
+ }
+ LastStringLength = (USHORT)NumChar; // not include the TurnAround char
+
+ /*
+ *
+ * Copy to application buffer
+ *
+ */
+
+ if ( KbdLength > KbdInputLength )
+ KbdLength = KbdInputLength;
+
+ RtlMoveMemory(KbdAddress, KbdLastBuff, KbdLength);
+
+ if ( KbdReadMode == 0 )
+ KBD_BUFFER_ADDRESS[KbdLength] = Char; // add the CR at the end
+
+ /*
+ *
+ * Keep info for Read in case we don't return all the string
+ *
+ */
+
+ KbdBuffNextPtr = KbdLength;
+ KbdBuffNextLen = KbdInputLength - KbdLength;
+
+ /*
+ *
+ * Copy string to CUE buffer if active
+ *
+ */
+
+ if ( SesGrp->KeysOnFlag )
+ {
+ if( KbdLineWasEdited && NumChar )
+ {
+ KbdCurrentLine = KbdNextLinePointer;
+
+ for ( i = 0, usIndex = KbdNextLinePointer ;
+ i < NumChar ; i++, usIndex++ )
+ {
+ KbdCueBuffer[usIndex] = KbdLastBuff[i];
+ }
+
+ KbdNextLinePointer = usIndex + 1;
+
+ while (KbdCueBuffer[usIndex])
+ {
+ // zero the end of the last string we copy the new
+ // one on (fill with NULL till start of next line)
+
+ KbdCueBuffer[usIndex++] = 0;
+ }
+ }
+
+ KbdCueUpRowIsCurrent = TRUE;
+ }
+
+ return(0L);
+ }
+
+ /*
+ *
+ * Check for Speciel Keys (PFx, enhanced ...)
+ *
+ */
+
+ if (( Char == 0 ) || ( Char == 0xE0 ))
+ {
+ if (SesGrp->KeysOnFlag)
+ {
+ if ( Scan == OS2_SCAN_RIGHT_6 ) // Right
+ {
+ if (( NumChar = KbdInputLength - KbdIndexInLine ) >
+ pKbd->wRepeatCount )
+ {
+ NumChar = pKbd->wRepeatCount;
+ }
+
+ KbdCueMoveToRight(
+ KbdIndexInLine,
+ (USHORT)NumChar,
+ FALSE
+ );
+
+ } else if ( Scan == OS2_SCAN_LEFT_4 ) // Left
+ {
+ NumChar = ( KbdIndexInLine < pKbd->wRepeatCount ) ?
+ KbdIndexInLine : pKbd->wRepeatCount;
+
+ KbdCueMoveToLeft(
+ KbdIndexInLine,
+ (USHORT)NumChar
+ );
+
+ } else if ( Scan == OS2_SCAN_UP_8 ) // Up
+ {
+ /*
+ * Find previous command in the command queue
+ */
+
+ if (KbdCueBuffer[KbdCurrentLine]) // if anything at the CUE buffer
+ {
+ if (KbdCueUpRowIsCurrent)
+ {
+ pKbd->wRepeatCount--;
+ KbdCueUpRowIsCurrent = FALSE;
+ }
+
+ usIndex = KbdCurrentLine;
+ for ( i = 0 ; i < pKbd->wRepeatCount ; i++ )
+ {
+ usIndex--;
+ while (!KbdCueBuffer[--usIndex]); // skip all null
+ while (KbdCueBuffer[--usIndex]); // go to start of command
+
+ usIndex++;
+ }
+ KbdCurrentLine = usIndex;
+ } else
+ {
+ usIndex = KbdCurrentLine;
+ }
+
+ KbdCueEraseAndDisplayLine(usIndex);
+ } else if ( Scan == OS2_SCAN_DOWN_2 ) // Down
+ {
+ /*
+ * Find next command in the command queue
+ */
+
+ if (KbdCueBuffer[KbdCurrentLine]) // if anything at the CUE buffer
+ {
+ usIndex = KbdCurrentLine;
+ KbdCueUpRowIsCurrent = FALSE;
+
+ for ( i = 0 ; i < pKbd->wRepeatCount ; i++ )
+ {
+ while (KbdCueBuffer[++usIndex]);
+ while (!KbdCueBuffer[++usIndex]);
+ }
+ KbdCurrentLine = usIndex;
+ } else
+ {
+ usIndex = KbdCurrentLine;
+ }
+
+ KbdCueEraseAndDisplayLine(usIndex);
+ } else if ( Scan == OS2_SCAN_HOME_7 ) // Home
+ {
+ KbdCueMoveToLeft(
+ KbdIndexInLine,
+ KbdIndexInLine
+ );
+ } else if ( Scan == OS2_SCAN_END_1 ) // End
+ {
+ KbdCueMoveToRight(
+ KbdIndexInLine,
+ (USHORT)(KbdInputLength - KbdIndexInLine),
+ FALSE
+ );
+
+ } else if ( Scan == OS2_SCAN_CTRL_LEFT_4 ) // ^Left
+ {
+ USHORT PrevIndex = KbdIndexInLine;
+
+ for ( i = 0;
+ (i < pKbd->wRepeatCount) && PrevIndex ;
+ i++ )
+ {
+ /* for each char:
+ * go one char left
+ * skip all non-alphanumeric chars
+ * akip all alphanumeric chars
+ * while points to alpha, which is not the original
+ */
+
+ usIndex = PrevIndex - 1;
+
+ while (usIndex && !ALPHANUM_CHAR(usIndex))
+ {
+ usIndex--;
+ }
+
+ while (usIndex && ALPHANUM_CHAR(usIndex))
+ {
+ usIndex--;
+ }
+
+ if (usIndex || !ALPHANUM_CHAR(usIndex))
+ {
+ usIndex++;
+ }
+
+ if (!ALPHANUM_CHAR(usIndex) ||
+ (PrevIndex == usIndex))
+ {
+ break;
+ }
+
+ PrevIndex = usIndex;
+ }
+ if (NumChar = KbdIndexInLine - PrevIndex)
+ {
+ KbdCueMoveToLeft(
+ KbdIndexInLine,
+ (USHORT)NumChar
+ );
+ }
+ } else if ( Scan == OS2_SCAN_CTRL_RIGHT_6 ) // ^Right
+ {
+ USHORT PrevIndex = KbdIndexInLine;
+
+ for ( i = 0;
+ (i < pKbd->wRepeatCount) && (PrevIndex < KbdInputLength);
+ i++ )
+ {
+ /* for each char:
+ * go one char right
+ * akip all alphanumeric chars
+ * skip all non-alphanumeric chars
+ * while points to alpha, which is not the original
+ */
+
+ usIndex = PrevIndex;
+
+ while ((usIndex < KbdInputLength) &&
+ ALPHANUM_CHAR(usIndex))
+ {
+ usIndex++;
+ }
+
+ while ((usIndex < KbdInputLength) &&
+ !ALPHANUM_CHAR(usIndex))
+ {
+ usIndex++;
+ }
+
+ if ((usIndex >= KbdInputLength) ||
+ !ALPHANUM_CHAR(usIndex))
+ {
+ break;
+ }
+
+ PrevIndex = usIndex;
+ }
+ if (NumChar = PrevIndex - KbdIndexInLine)
+ {
+ KbdCueMoveToRight(
+ KbdIndexInLine,
+ (USHORT)NumChar,
+ FALSE
+ );
+ }
+ } else if ( Scan == OS2_SCAN_CTRL_END_1 ) // ^End
+ {
+ KbdLineWasEdited = TRUE;
+ KbdEchoBSAndFillSpaces(0, LineInputBuff[KbdInputLength].X_Pos -
+ LineInputBuff[KbdIndexInLine].X_Pos);
+
+ KbdInputLength = KbdIndexInLine;
+ } else if ( Scan == OS2_SCAN_DEL ) // Del
+ {
+ KbdLineWasEdited = TRUE;
+ if (( NumChar = KbdInputLength - KbdIndexInLine ) >
+ pKbd->wRepeatCount )
+ {
+ NumChar = pKbd->wRepeatCount;
+ }
+
+ KbdCueDeleteCharAndShift(
+ KbdIndexInLine,
+ (USHORT)NumChar
+ );
+ } else if ( Scan == OS2_SCAN_CTRL_HOME_7 ) // ^Home
+ {
+ if (NumChar = KbdIndexInLine)
+ {
+ KbdLineWasEdited = TRUE;
+ KbdCueMoveToLeft(
+ KbdIndexInLine,
+ (USHORT)NumChar
+ );
+
+ KbdCueDeleteCharAndShift(
+ KbdIndexInLine,
+ (USHORT)NumChar
+ );
+ }
+ } else if ( Scan == OS2_SCAN_INSERT_0 ) // Ins
+ {
+ if ( pKbd->wRepeatCount % 2 )
+ {
+ if( KbdInsertOn = ~KbdInsertOn )
+ {
+ KbdCueSetCurTypeToHalf();
+ } else
+ {
+ KbdCueSetCurTypeToQuater();
+ }
+ }
+ }
+
+ break;
+ } else
+ {
+ if ( KbdFxWaitForChar )
+ {
+ KbdFxWaitForChar = 0;
+ if (--pKbd->wRepeatCount)
+ {
+ KbdQueue->LastKey.wRepeatCount--;
+ KbdQueue->LastKeyFlag = TRUE;
+ } else
+ {
+ break;
+ }
+ }
+
+ if ( Scan == 0x40 )
+ {
+ Char = 0x1A; // F6 => ^Z
+ } else if ( Scan == 0x41 )
+ {
+ Char = 0x00; // F7 => ^@
+ } else if (KbdEditFlag)
+ {
+ if (( Scan == 0x3B ) || // F1
+ ( Scan == OS2_SCAN_RIGHT_6 )) // Right
+ {
+ KbdInsertOn = FALSE;
+ if ((USHORT)(KbdDelIndex + KbdLastBuffPtr) < LastStringLength)
+ {
+ Char = KbdLastBuff[KbdDelIndex + KbdLastBuffPtr]; // => previous char
+ } else
+ break;
+
+ } else if ( Scan == 0x3C ) // F2
+ {
+ KbdInsertOn = FALSE;
+ if (pKbd->wRepeatCount % 2)
+ {
+ KbdFxWaitForChar = 1;
+ }
+ break;
+ } else if ( Scan == 0x3D ) // F3
+ {
+ KbdInsertOn = FALSE;
+ if ((USHORT)(KbdDelIndex + KbdLastBuffPtr) < LastStringLength)
+ {
+ StringLengthToEcho = LastStringLength - KbdDelIndex - KbdLastBuffPtr;
+ KbdEchoString = TRUE;
+ } else
+ break;
+
+ } else if ( Scan == 0x3E ) // F4
+ {
+ KbdInsertOn = FALSE;
+ if (pKbd->wRepeatCount % 2)
+ {
+ KbdFxWaitForChar = 2;
+ }
+ break;
+ } else if ( Scan == OS2_SCAN_DEL ) // Del
+ {
+ KbdDelIndex += pKbd->wRepeatCount;
+ if(KbdDelIndex > LastStringLength)
+ {
+ KbdDelIndex = LastStringLength;
+ }
+ break;
+ } else if ( Scan == OS2_SCAN_INSERT_0 ) // Ins
+ {
+ if (pKbd->wRepeatCount % 2)
+ {
+ KbdInsertOn = ~KbdInsertOn;
+ }
+
+ break;
+
+ } else if ( Scan == OS2_SCAN_LEFT_4 ) // Left
+ {
+ Char = '\b'; // => BS
+ KbdInsertOn = FALSE;
+ } else
+ break;
+ } else
+ break;
+ }
+ }
+
+ /*
+ *
+ * Search for char in KbdLastBuff (for F2 & F4)
+ *
+ */
+
+ if (KbdFxWaitForChar)
+ {
+ if (pKbd->wRepeatCount > 1)
+ {
+ KbdQueue->LastKeyFlag = TRUE;
+ }
+ for ( i = KbdDelIndex + KbdLastBuffPtr ;
+ (i < LastStringLength) && (KbdLastBuff[i] != Char) ; i++ );
+ if ((i == (USHORT)(KbdDelIndex + KbdLastBuffPtr)) ||
+ (KbdLastBuff[i] != Char))
+ {
+ KbdFxWaitForChar = 0;
+ break;
+ }
+
+ StringLengthToEcho = i - (KbdDelIndex + KbdLastBuffPtr);
+
+ if (KbdFxWaitForChar == 1) // F2
+ {
+ KbdFxWaitForChar = 0;
+ KbdEchoString = TRUE;
+ } else // F4
+ {
+ KbdDelIndex += i;
+ KbdFxWaitForChar = 0;
+ break;
+ }
+ }
+
+ /*
+ *
+ * Echo string from KbdLastBuff (for F2 & F3)
+ *
+ * StringLengthToEcho - is the string length
+ */
+
+ if (KbdEchoString)
+ {
+ X_Pos = GET_CURRENT_COORD.X;
+ NumChar = 0;
+
+ for ( i = KbdDelIndex + KbdLastBuffPtr, puchLastString = &KbdLastBuff[i] ;
+ StringLengthToEcho && (KbdInputLength < (USHORT)KbdMaxLength) ; StringLengthToEcho-- )
+ {
+ Char = KbdLastBuff[i++];
+ NumChar++ ;
+
+ LineInputBuff[KbdInputLength++].Char = Char;
+ if (Char == '\t') // TAB
+ {
+ X_Pos += 8 - (X_Pos % 8);
+ } else if (Char < ' ')
+ {
+ X_Pos += 2;
+ } else
+ {
+ X_Pos++;
+ }
+
+ if (X_Pos >= SesGrp->ScreenColNum)
+ {
+ X_Pos -= SesGrp->ScreenColNum;
+ KbdStartOfLine = 0;
+ }
+
+ LineInputBuff[KbdInputLength].X_Pos = X_Pos;
+ }
+
+ if (KbdEchoFlag && NumChar)
+ {
+ KbdEchoAString(puchLastString, NumChar);
+ }
+
+ KbdLastBuffPtr += (USHORT)NumChar;
+
+ if (StringLengthToEcho)
+ {
+ KbdEchoBeep(i);
+ }
+
+ KbdEchoString = FALSE;
+ break;
+ }
+
+ /*
+ *
+ * Handle BS
+ *
+ */
+
+ if (( Char == '\b' ) || ( Char == 0x7F ))
+ {
+ if (SesGrp->KeysOnFlag)
+ {
+ if ( NumChar = KbdIndexInLine )
+ {
+ if ( NumChar > pKbd->wRepeatCount )
+ {
+ NumChar = pKbd->wRepeatCount;
+ }
+
+ KbdCueMoveToLeft(
+ KbdIndexInLine,
+ (USHORT)NumChar
+ );
+
+ KbdCueDeleteCharAndShift(
+ KbdIndexInLine,
+ (USHORT)NumChar
+ );
+
+ KbdLineWasEdited = TRUE;
+ }
+
+ break;
+ } else
+ {
+ KbdInsertOn = FALSE;
+
+ for ( i = 0 ; (i < pKbd->wRepeatCount) && KbdInputLength &&
+ (LineInputBuff[KbdInputLength].X_Pos != KbdStartOfLine) ; i++ )
+ {
+ if (KbdLastBuffPtr)
+ {
+ KbdLastBuffPtr--;
+ } else if (KbdDelIndex)
+ {
+ KbdDelIndex--;
+ }
+
+ KbdInputLength--;
+ }
+
+ NumChar = GET_CURRENT_COORD.X - LineInputBuff[KbdInputLength].X_Pos;
+
+ if(KbdEchoFlag && NumChar)
+ {
+ KbdEchoBSAndFillSpaces(NumChar, NumChar);
+ }
+
+ break;
+ }
+ }
+
+ if (!SesGrp->KeysOnFlag)
+ {
+ /*
+ *
+ * Handle LF
+ *
+ */
+
+ if (Char == '\n')
+ {
+ if (KbdEchoFlag)
+ {
+ KbdEchoNL(pKbd->wRepeatCount);
+ }
+
+ LineInputBuff[KbdInputLength].X_Pos = 0;
+ KbdStartOfLine = 0;
+
+ break;
+ }
+
+ /*
+ *
+ * Handle ^W
+ *
+ */
+
+ if (Char == 0x17)
+ {
+ USHORT PrevIndex = KbdIndexInLine;
+
+ KbdInsertOn = FALSE;
+
+ for ( i = 0;
+ (i < pKbd->wRepeatCount) && ( PrevIndex > KbdStartOfLine ) ;
+ i++ )
+ {
+ /* for each char:
+ * go one char left
+ * skip all non-alphanumeric chars
+ * akip all alphanumeric chars
+ * while points to alpha, which is not the original
+ */
+
+ usIndex = PrevIndex - 1;
+
+ while (( usIndex > KbdStartOfLine ) &&
+ !ALPHANUM_CHAR(usIndex))
+ {
+ usIndex--;
+ }
+
+ while (( usIndex > KbdStartOfLine ) &&
+ ALPHANUM_CHAR(usIndex))
+ {
+ usIndex--;
+ }
+
+ if (( usIndex > KbdStartOfLine ) ||
+ !ALPHANUM_CHAR(usIndex))
+ {
+ usIndex++;
+ }
+
+ if (!ALPHANUM_CHAR(usIndex) ||
+ (PrevIndex == usIndex))
+ {
+ break;
+ }
+
+ PrevIndex = usIndex;
+ }
+
+ NumChar = LineInputBuff[KbdIndexInLine].X_Pos -
+ LineInputBuff[PrevIndex].X_Pos ;
+
+ if(KbdEchoFlag && NumChar)
+ {
+ KbdEchoBSAndFillSpaces(NumChar, NumChar);
+ }
+
+ KbdIndexInLine = KbdInputLength = PrevIndex;
+ //KbdLastBuffPtr = 0;
+ break;
+ }
+ }
+
+ /*
+ *
+ * Handle ESC
+ *
+ */
+
+ if (Char == 0x1B)
+ {
+ // ^[ => Write '\'<NL> & Clear Buff
+
+ KbdInsertOn = FALSE;
+
+ KbdLastBuffPtr = KbdDelIndex = 0;
+ if (SesGrp->KeysOnFlag)
+ {
+ if (KbdCueBuffer[KbdCurrentLine])
+ {
+ usIndex = KbdCurrentLine - 1;
+ } else
+ {
+ usIndex = KbdCurrentLine;
+ }
+
+ KbdCueEraseAndDisplayLine(usIndex); // don't display anything
+ } else if (KbdEchoFlag)
+ {
+ KbdEchoESC(pKbd->wRepeatCount, KbdFirstColumn);
+ }
+
+ KbdStartOfLine = LineInputBuff[0].X_Pos = KbdFirstColumn;
+ KbdInputLength = 0;
+ break;
+ }
+
+ /*
+ *
+ * Handle ^F
+ *
+ */
+
+ if (Char == 0x6)
+ {
+ break;
+ }
+
+ /*
+ *
+ * Handle char :
+ *
+ * 1. put in buffer (if there is a room), beep otherwise
+ * 2. save in buffer cursor position of next char
+ * 3. echo if echo_on
+ *
+ */
+
+ NumChar = 0;
+
+ if (SesGrp->KeysOnFlag)
+ {
+ KbdCueHandleChar(Char, pKbd->wRepeatCount);
+ } else
+ {
+ X_Pos = GET_CURRENT_COORD.X;
+
+ if (Char < ' ')
+ {
+ if (Char == '\t') // TAB
+ {
+ Offset = 8;
+ X_Pos &= ~7;
+ } else
+ {
+ Offset = 2;
+ }
+ } else
+ {
+ Offset = 1;
+ }
+
+ for ( i = 0 ; (i < pKbd->wRepeatCount) &&
+ (KbdInputLength < (USHORT)KbdMaxLength) ; i++ )
+ {
+ if (!KbdInsertOn)
+ {
+ KbdLastBuffPtr++;
+ }
+
+ LineInputBuff[KbdInputLength++].Char = Char;
+ X_Pos += Offset;
+
+ if (X_Pos >= SesGrp->ScreenColNum)
+ {
+ X_Pos -= SesGrp->ScreenColNum;
+ KbdStartOfLine = 0;
+ }
+ LineInputBuff[KbdInputLength].X_Pos = X_Pos;
+ }
+
+ if (KbdEchoFlag && i)
+ {
+ KbdEchoChar(Char, i);
+ }
+
+ if (i < pKbd->wRepeatCount)
+ {
+ KbdEchoBeep(pKbd->wRepeatCount - i);
+ }
+ }
+ break;
+
+ case BinaryMode:
+ /*
+ *
+ * Binary mode
+ *
+ */
+
+ /*
+ *
+ * Handle char :
+ *
+ * put in buffer (if a place exist)
+ * if enhanced - put also scan code
+ *
+ */
+
+ for ( i = 0 ; (i < pKbd->wRepeatCount) && (KbdInputLength < KbdLength); i++ )
+ {
+ KBD_BUFFER_ADDRESS[KbdInputLength++] = Char;
+
+ if ((Char == 0x0) && (KbdInputLength < KbdLength))
+ {
+ KBD_BUFFER_ADDRESS[KbdInputLength++] = Scan;
+ }
+ }
+
+ if ( KbdInputLength < KbdLength )
+ {
+ break;
+ } else if ( i < pKbd->wRepeatCount )
+ {
+ KbdQueue->LastKey = *pKbd; // prepare it in case we read only one copy of the char
+ KbdQueue->LastKey.wRepeatCount -= i;
+ KbdQueue->LastKeyFlag = TRUE;
+ }
+
+ /*
+ *
+ * Copy to application buffer
+ *
+ */
+
+ if ( KbdLength > KbdInputLength )
+ KbdLength = KbdInputLength;
+
+ /*
+ *
+ * Keep info for Read in case we don't return all the string
+ *
+ */
+
+ KbdBuffNextPtr = KbdLength;
+ KbdBuffNextLen = KbdInputLength - KbdLength;
+
+ /*
+ *
+ * No editing keys in binary mode
+ *
+ */
+
+ LastStringLength = 0;
+
+ return(0L);
+
+ default:
+ break;
+ }
+
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ if ( KbdState == AsciiMode )
+ {
+ USHORT CurrentIdx;
+ CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
+
+ CurrentIdx = (SesGrp->KeysOnFlag) ? KbdIndexInLine : KbdInputLength;
+
+ if (!GetConsoleScreenBufferInfo(
+ hConOut,
+ &ConsoleScreenBufferInfo
+ ))
+ {
+ ConsoleScreenBufferInfo.dwCursorPosition.X =
+ ConsoleScreenBufferInfo.dwCursorPosition.Y = 255;
+ KdPrint(("OS2SES(Ow2VioReadCurPos): Rc %lu\n", GetLastError()));
+ ASSERT( FALSE ); // should not happend
+ }
+ KdPrint(("HandleKeyboardInput: Len %u, CUE-Idx %u, Cur-Offset %u, Prev-Offset %u, Col %u, Pos %u:%u\n",
+ KbdInputLength, KbdIndexInLine,
+ LineInputBuff[CurrentIdx].X_Pos,
+ (CurrentIdx) ? LineInputBuff[CurrentIdx - 1].X_Pos : 255,
+ SesGrp->WinCoord.X,
+ ConsoleScreenBufferInfo.dwCursorPosition.Y,
+ ConsoleScreenBufferInfo.dwCursorPosition.X
+ ));
+ if (KbdEchoFlag)
+ {
+ ASSERT( ConsoleScreenBufferInfo.dwCursorPosition.X == SesGrp->WinCoord.X );
+ ASSERT( ConsoleScreenBufferInfo.dwCursorPosition.Y == SesGrp->WinCoord.Y );
+ ASSERT( (LineInputBuff[CurrentIdx].X_Pos % SesGrp->ScreenColNum) ==
+ SesGrp->WinCoord.X );
+ }
+ }
+ }
+#endif
+
+ return(1L);
+}
+
+
+DWORD
+KbdHandlePackage(IN PKEY_EVENT_QUEUE NextKbdMon,
+ IN PKBD_MON_PACKAGE KbdPackage)
+{
+ KEYEVENTINFO In;
+
+ if ( KbdCheckPackage( KbdPackage ))
+ {
+ return (0L); // ignore key
+ }
+
+#ifdef DBCS
+// MSKK Jul.23.1992 KazuM
+ In.wRepeatCount = NextKbdMon->In->wRepeatCount;
+#else
+ In.wRepeatCount = 1;
+#endif
+ In.KeyInfo[0] = *KbdPackage;
+
+ if ( HandleKeyboardInput( &In ))
+ {
+ return (0L); // not time to send reply yet
+ }
+
+ NextKbdMon->MonHdr.WaitForEvent = FALSE;
+
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ KdPrint(("KbdHandlePackage: %s respond\n",
+ (KbdRequestSaveArea.Request == KBDCharIn) ? "KbdCharIn" :
+ (KbdRequestSaveArea.Request == KBDStringIn) ? "KbdStringIn" :
+ "KbdRead"));
+ }
+#endif
+ if ( KbdRequestSaveArea.Request == KBDCharIn )
+ {
+ KbdRequestSaveArea.d.KeyInfo = In.KeyInfo[0].KeyInfo;
+
+ SendKbdReply((PVOID)NextKbdMon->MonHdr.MemoryStartAddress,
+ (PVOID)&KbdRequestSaveArea,
+ KbdAddress,
+ 0);
+ } else
+ {
+ KbdRequestSaveArea.Length = (ULONG)KbdLength;
+
+ if ( KbdRequestSaveArea.Request == KBDStringIn )
+ {
+ KbdRequestSaveArea.d.String.cchIn = KbdLength;
+ if ( KbdRequestSaveArea.d.String.cchIn != KbdRequestSaveArea.d.String.cb )
+ KbdRequestSaveArea.Length++ ; // ASCII mode - copy the CR
+ }
+
+ SendKbdReply ((PVOID)NextKbdMon->MonHdr.MemoryStartAddress,
+ (PVOID)&KbdRequestSaveArea,
+ KbdAddress,
+ 0);
+ }
+
+ return (1L);
+}
+
+
+DWORD
+KbdCheckPackage(IN PKBD_MON_PACKAGE KbdPackage)
+{
+ BOOL IgnoreKey = FALSE;
+ UCHAR Scan, Char;
+
+ Char = KbdPackage->KeyInfo.chChar;
+ Scan = KbdPackage->KeyInfo.chScan;
+
+ if (( Char == 0 ) && ( Scan == 0 ))
+ {
+ if(!( ENABLE_SHIFT_KEY & KbdWaitFlag ))
+ {
+ /*
+ * Ignore shift keys if { in ASCII mode or shift report off }
+ */
+#if DBG
+ IF_OD2_DEBUG(KBD)
+ {
+ KdPrint((" - ignore since shift report disable\n"));
+ }
+#endif
+ IgnoreKey = TRUE; // ignore shift report
+ } else if(!( KbdPackage->KeyInfo.fbStatus & 1))
+ {
+ /*
+ * Ignore non-shift keys
+ */
+#if DBG
+ IF_OD2_DEBUG(KBD)
+ {
+ KdPrint((" - ignore since non-shift key\n"));
+ }
+#endif
+ IgnoreKey = TRUE;
+ }
+ } else if ( KbdPackage->KeyboardFlag & KBD_KEY_BREAK )
+ {
+ /*
+ * Ignore Break if non-shift
+ */
+
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ KdPrint(("KbdCheckPackage: ignore key release\n"));
+ }
+#endif
+ IgnoreKey = TRUE; // ignore KEY_UP
+ } else if (( KbdWaitFlag & ENABLE_LN_EDITOR_KEY ) &&
+ KbdKeyIsTurnAround(Char, Scan) )
+ {
+ // don't ignore the turn around char in ASCII mode
+
+ } else if ( !( KbdWaitFlag & ENABLE_NON_ASCII_KEY ) &&
+ (( Char == 0 ) || ( Char == 0xE0 )))
+ {
+ IgnoreKey = TRUE; // ignore NON_ASCII
+
+ if ( KbdWaitFlag & ENABLE_KEYS_ON_KEY )
+ {
+ if (( Scan == OS2_SCAN_HOME_7 ) || // Home
+ ( Scan == OS2_SCAN_CTRL_HOME_7 ) || // ^Home
+ ( Scan == OS2_SCAN_END_1 ) || // End
+ ( Scan == OS2_SCAN_CTRL_END_1 ) || // ^End
+ ( Scan == OS2_SCAN_LEFT_4 ) || // Left
+ ( Scan == OS2_SCAN_CTRL_LEFT_4 ) || // ^Left
+ ( Scan == OS2_SCAN_RIGHT_6 ) || // Right
+ ( Scan == OS2_SCAN_CTRL_RIGHT_6 ) || // ^Right
+ ( Scan == OS2_SCAN_UP_8 ) || // Up
+ ( Scan == OS2_SCAN_DOWN_2 ) || // Down
+ ( Scan == OS2_SCAN_DEL ) || // Del
+ ( Scan == OS2_SCAN_INSERT_0 )) // Ins
+ {
+ IgnoreKey = FALSE; // don't ignore CUE keys
+ }
+ } else if ( KbdWaitFlag & ENABLE_LN_EDITOR_KEY )
+ {
+ if (( Scan == 0x3B ) || // F1
+ ( Scan == 0x3C ) || // F2
+ ( Scan == 0x3D ) || // F3
+ ( Scan == 0x3E ) || // F4
+ ( Scan == 0x40 ) || // F6
+ ( Scan == 0x41 ) || // F7
+ ( Scan == OS2_SCAN_LEFT_4 ) || // Left
+ ( Scan == OS2_SCAN_RIGHT_6 ) || // Right
+ ( Scan == OS2_SCAN_DEL ) || // Del
+ ( Scan == OS2_SCAN_INSERT_0 )) // Ins
+ {
+ IgnoreKey = FALSE; // don't ignore editing keys
+ }
+ }
+
+ if (IgnoreKey)
+ {
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ KdPrint(("KbdCheckPackage: ignore non-ASCII key\n"));
+ }
+#endif
+ }
+ } else if ( KbdAsciiMode )
+ {
+ /*
+ *
+ * Ignore speciel CTRL-Keys in ASCII mode
+ *
+ */
+
+ if (( Char == 0x03 ) || // ^C
+ ( Char == 0x10 ) || // ^P
+ // ^Q: in non-US kbd(AZARTY) ^Q is passed
+ // and ^A not (mjarus 7/5/93)
+ (( Scan == 0x10 ) &&
+ ((KbdPackage->KeyInfo.fsState & (OS2_CONTROL | OS2_ALT)) == OS2_CONTROL)) ||
+ ( Char == 0x13 )) // ^S
+ {
+#if DBG
+ IF_OD2_DEBUG(KBD)
+ {
+ KdPrint((" - ignore Char %x in ASCII\n",
+ Char));
+ }
+#endif
+ IgnoreKey = TRUE; // ignore NON_ASCII
+ }
+ }
+
+ return ( (DWORD)IgnoreKey );
+}
+
+
+VOID
+KbdNewSetup(
+ IN PKBDINFO LastSetup
+ )
+{
+ PKBDINFO NewSetup = &KbdQueue->Setup;
+ USHORT Mask;
+
+// if (*LastSetup == *NewSetup)
+// return;
+
+ /* BUGBUG=> handle new setup */
+
+ SesGrp->ModeFlag = (USHORT)((NewSetup->fsMask & KEYBOARD_BINARY_MODE ) ? 1 : 0);
+
+ Mask = NewSetup->fsMask & (KEYBOARD_BINARY_MODE | KEYBOARD_SHIFT_REPORT);
+
+ Ow2KbdXlateVars.XInputMode = (Mask) ?
+ ((Mask & KEYBOARD_SHIFT_REPORT) ? (BINARY_MODE | SHIFT_REPORT_MODE) :
+ BINARY_MODE) : 0;
+
+ if ((NewSetup->fsMask & KEYBOARD_ASCII_MODE ) &&
+ (LastSetup->fsMask & KEYBOARD_BINARY_MODE ))
+ {
+ LastStringLength = 0;
+ KbdBuffNextPtr = 0;
+ KbdBuffNextLen = 0;
+ }
+
+ KbdAsciiMode = (BOOL)(( NewSetup->fsMask & KEYBOARD_ASCII_MODE ) ? 1 : 0);
+
+ if (NewSetup->fsMask & KEYBOARD_2B_TURNAROUND)
+ {
+ KbdSetupTurnAroundCharTwo = (BOOLEAN)TRUE;
+ } else
+ {
+ KbdSetupTurnAroundCharTwo = (BOOLEAN)FALSE;
+ }
+
+ return;
+}
+
+
+VOID
+KbdCueEraseAndDisplayLine(
+ IN ULONG NewLineIndex
+ )
+/*++
+
+Routine Description:
+
+ This routine erase the current input line and display new one.
+
+Arguments:
+
+ NewLineIndex - pointer in CUE buffer for new line (or to NULL
+ if nothing to diaply).
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE string mode.
+
+ Used by UP-ARROW, DOWN-ARROW and ESC.
+
+ 1. Erase the active command line being displayed and
+ 2. Display the new command in the command queue.
+
+ Uses:
+
+ - KbdInputLength - active command line length.
+ - KbdIndexInLine - current index in command line.
+ - LineInputBuff[0, KbdIndexInLine, KbdInputLength].X_Pos
+ - KbdCueBuffer[NewLineIndex..]
+
+ Updates:
+
+ - KbdInputLength - new line length.
+ - KbdIndexInLine - 0.
+ - LineInputBuff[0..KbdInputLength].Char and .X_Pos
+ - console display
+ - LVB
+ - SesGrp->WinCoord - by other routines.
+
+ Calls:
+
+ - KbdEchoBSAndFillSpaces
+ - KbdCueUpdateBufferOffset
+ - KbdCueMoveToRight
+ - KbdCueMoveToLeft
+
+--*/
+{
+ /*
+ * Erase the active command line being displayed.
+ */
+
+ if ( KbdInputLength )
+ {
+ KbdEchoBSAndFillSpaces(
+ LineInputBuff[KbdIndexInLine].X_Pos - LineInputBuff[0].X_Pos,
+ LineInputBuff[KbdInputLength].X_Pos - LineInputBuff[0].X_Pos
+ );
+
+ KbdIndexInLine = 0;
+ KbdInputLength = 0;
+ }
+
+ /*
+ * Display the new command in the command queue
+ */
+
+ for ( KbdInputLength = 0 ;
+ LineInputBuff[KbdInputLength].Char = KbdCueBuffer[NewLineIndex + KbdInputLength] ;
+ KbdInputLength++ );
+
+ if (KbdInputLength)
+ {
+ KbdCueUpdateBufferOffset(
+ 0,
+ KbdInputLength,
+ LineInputBuff[0].X_Pos
+ );
+
+ KbdCueMoveToRight(
+ 0,
+ KbdInputLength,
+ TRUE
+ );
+
+ KbdCueMoveToLeft(
+ KbdInputLength,
+ KbdInputLength
+ );
+ }
+}
+
+
+VOID
+KbdCueMoveToRight(
+ IN ULONG StartIndex,
+ IN ULONG StringLength,
+ IN ULONG UpdateLVB
+ )
+/*++
+
+Routine Description:
+
+ This routine moves the console cursor position to the right
+ while sending the active command line to the console.
+
+Arguments:
+
+ StartIndex - index in LineInputBuff[] (the active command line) to start
+ moving right from.
+
+ StringLength - number of character to move right.
+
+ UpdateLVB - flag if to set LVB also (for new info)
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE string mode.
+
+ Used by RIGHT-ARROW, END, ^RIGHT-ARROW, KbdCueEraseAndDisplayLine,
+ KbdCueDeleteCharAndShift and KbdCueHandleChar.
+
+ 1. Send to console
+ 2. Update Coord
+ 3. Update LVB
+ 4. Update position
+
+ Uses:
+
+ - LineInputBuff[0..KbdInputLength].Char and .X_Pos
+
+ Updates:
+
+ - KbdInputLength - NO.
+ - KbdIndexInLine - add StringLength.
+ - LineInputBuff[0..KbdInputLength].Char and .X_Pos - NO
+ - console display
+ - LVB (if UpdateLVB)
+ - SesGrp->WinCoord - add StringLength.
+
+ Calls:
+
+ - Or2WinWriteConsoleA
+ - Ow2VioUpdateCurPos
+ - VioLVBScrollBuff
+ - VioLVBCopyStr
+
+--*/
+{
+ UCHAR Char;
+ ULONG NumChar, NumBytes, NumWritten, NumLines = 0;
+ COORD OldCoord, Coord;
+
+ OldCoord = Coord = GET_CURRENT_COORD;
+
+ /*
+ * Copy to temp buffer
+ */
+
+ for ( NumBytes = 0, NumChar = 0 ; NumChar < StringLength ; NumChar++ )
+ {
+ if ((Char = LineInputBuff[StartIndex + NumChar].Char) < ' ')
+ {
+ KBD_BUFFER_ADDRESS[NumBytes++] = '^';
+ KBD_BUFFER_ADDRESS[NumBytes++] = (UCHAR)(Char + '@');
+ } else
+ {
+ KBD_BUFFER_ADDRESS[NumBytes++] = Char;
+ }
+ }
+
+ if (!NumBytes)
+ {
+ return ;
+ }
+
+ if ( KbdEchoFlag )
+ {
+ /*
+ * Send to console
+ */
+
+ if(!Or2WinWriteConsoleA(
+ #if DBG
+ KbdCueMoveToRightStr,
+ #endif
+ hConOut,
+ (LPSTR)KBD_BUFFER_ADDRESS,
+ NumBytes,
+ &NumWritten,
+ NULL
+ ))
+ {
+#if DBG
+ ASSERT1("OS2SES(KbdCueMoveToRight): failed on WriteConsoleA", FALSE);
+#endif
+ }
+
+#if DBG
+ if ( NumBytes != NumWritten )
+ {
+ KdPrint(("OS2SES(KbdCueMoveToRight): partial data WriteConsoleA (%u from %u)\n",
+ NumWritten, NumBytes));
+ ASSERT( FALSE );
+ }
+#endif
+
+ /*
+ * Update Coord
+ */
+
+ Coord.X += (SHORT)NumWritten;
+ while ( Coord.X >= SesGrp->ScreenColNum )
+ {
+ Coord.Y++;
+ Coord.X -= SesGrp->ScreenColNum;
+ }
+
+ if ( Coord.Y >= SesGrp->ScreenRowNum )
+ {
+ NumLines = Coord.Y - SesGrp->ScreenRowNum + 1;
+ Coord.Y = SesGrp->ScreenRowNum - 1;
+ }
+
+ Ow2VioUpdateCurPos(Coord);
+
+ /*
+ * Update LVB
+ */
+
+ if ( UpdateLVB )
+ {
+ if ( NumLines && ( SesGrp->ScreenSize < 512 ))
+ {
+ ULONG NumChar1 = SesGrp->ScreenRowNum - OldCoord.X;
+ UCHAR *Ptr = &KBD_BUFFER_ADDRESS[0];
+
+ while ( NumWritten )
+ {
+ VioLVBCopyStr(
+ Ptr,
+ OldCoord,
+ NumChar1
+ );
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ OldCoord,
+ NumChar1
+ );
+
+ OldCoord.X = 0;
+
+ if ( ++OldCoord.Y >= SesGrp->ScreenRowNum )
+ {
+ OldCoord.Y--;
+ VioLVBScrollBuff(1);
+ NumLines--;
+ }
+
+ NumWritten -= NumChar1;
+
+ if (( NumChar1 = NumWritten ) > (ULONG)SesGrp->ScreenColNum )
+ {
+ NumChar1 = SesGrp->ScreenColNum;
+ }
+ }
+
+ ASSERT( NumLines == 0 );
+ } else
+ {
+ if ( NumLines )
+ {
+ OldCoord.Y -= (SHORT)NumLines;
+ VioLVBScrollBuff(NumLines);
+ }
+
+ VioLVBCopyStr(
+ KBD_BUFFER_ADDRESS,
+ OldCoord,
+ NumWritten
+ );
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ OldCoord,
+ NumWritten
+ );
+ }
+ }
+ }
+
+ /*
+ * Update position index
+ */
+
+ KbdIndexInLine += (USHORT)StringLength;
+}
+
+
+VOID
+KbdCueMoveToLeft(
+ IN ULONG StartIndex,
+ IN ULONG MoveLength
+ )
+/*++
+
+Routine Description:
+
+ This routine moves the console cursor position to the left
+ using '\b'.
+
+Arguments:
+
+ StartIndex - index in LineInputBuff[] (the active command line) to start
+ moving left from.
+
+ MoveLength - number of character to move left.
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE string mode.
+
+ Used by LEFT-ARROW, HOME, ^LEFT-ARROW, ^HOME, BS, KbdCueEraseAndDisplayLine,
+ KbdCueDeleteCharAndShift and KbdCueHandleChar.
+
+ 1. Send to console
+ 2. Update position
+
+ Uses:
+
+ - LineInputBuff[StartIndex - MoveLength,StartIndex].X_Pos
+ - LineInputBuff[StartIndex - MoveLength..StartIndex].Char
+
+ Updates:
+
+ - KbdInputLength - NO.
+ - KbdIndexInLine - sub MoveLength.
+ - LineInputBuff[0..KbdInputLength].Char and .X_Pos - NO
+ - console display - NO
+ - LVB - NO
+ - SesGrp->WinCoord - by other routines.
+
+ Calls:
+
+ - KbdEchoBSAndFillSpaces
+
+--*/
+{
+ ULONG NumBytes;
+
+ /*
+ * Calculate byte count
+ */
+
+ NumBytes = LineInputBuff[StartIndex].X_Pos - LineInputBuff[StartIndex - MoveLength].X_Pos;
+
+ if (!NumBytes)
+ {
+ return ;
+ }
+
+ if ( KbdEchoFlag )
+ {
+ if ( SesGrp->ScreenSize < 512 )
+ {
+ ULONG Row1, Row2;
+
+ Row1 = LineInputBuff[StartIndex - MoveLength].X_Pos / SesGrp->ScreenColNum;
+ Row2 = LineInputBuff[KbdInputLength].X_Pos / SesGrp->ScreenColNum;
+
+ if (( Row2 - Row1 + 1 ) > (ULONG)SesGrp->ScreenRowNum )
+ {
+ NumBytes += LineInputBuff[StartIndex - MoveLength].X_Pos % SesGrp->ScreenColNum;
+ NumBytes -= (Row2 - Row1 + 1 - SesGrp->ScreenRowNum) * SesGrp->ScreenColNum;
+ }
+ }
+
+ /*
+ * Send to console and update coord
+ */
+
+ KbdEchoBSAndFillSpaces(NumBytes, 0);
+ }
+
+ /*
+ * Update position index
+ */
+
+ KbdIndexInLine -= (USHORT)MoveLength;
+}
+
+
+VOID
+KbdCueUpdateBufferOffset(
+ IN ULONG StartIndex,
+ IN ULONG StringLength,
+ IN ULONG StartOffset
+ )
+/*++
+
+Routine Description:
+
+ This routine updates the offset in buffer for the active command line.
+ This is done from StartIndex for StringLength + 1 (to update the offset
+ of the next char according to the last char in string). The StartIndex
+ gets X_Pos of StartOffset and the following are updated according the
+ char type (char under 0x20 holds two columns for ^X).
+
+Arguments:
+
+ StartIndex - index in LineInputBuff[] (the active command line) to start
+ updaing the X_Pos field from.
+
+ StringLength - number of character to update X_Pos for.
+
+ StartOffset - X_Pos for the first character.
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE string mode.
+
+ Used by KbdCueEraseAndDisplayLine, KbdCueDeleteCharAndShift and
+ KbdCueHandleChar.
+
+ 1. Updates the X_Pos field in LineInputBuff[].
+
+ Uses:
+
+ - KbdInputLength - active command line length.
+ - KbdIndexInLine - current index in command line.
+ - LineInputBuff[0, KbdIndexInLine, KbdInputLength].X_Pos
+ - KbdCueBuffer[NewLineIndex..]
+
+--*/
+{
+ ULONG NumChar, Index, Offset;
+
+ /*
+ * Update the offset in buffer. This is done for StringLength + 1
+ * to update the offset of the next char according to the last char
+ * in string.
+ */
+
+ for ( Index = StartIndex, Offset = StartOffset, NumChar = 0 ;
+ NumChar <= StringLength ; NumChar++ )
+ {
+ LineInputBuff[Index].X_Pos = (USHORT)Offset++;
+
+ if ( LineInputBuff[Index++].Char < ' ' )
+ {
+ Offset++;
+ }
+ }
+}
+
+
+VOID
+KbdCueDeleteCharAndShift(
+ IN ULONG StartIndex,
+ IN ULONG NumChar
+ )
+/*++
+
+Routine Description:
+
+ This routine delete character and shift the remaining command line
+ input to the left.
+
+Arguments:
+
+ StartIndex - index in LineInputBuff[] (the active command line) to start
+ deleting from.
+
+ NumChar - number of character to delete.
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE string mode.
+
+ Used by DEL, ^HOME and BS.
+
+ 1 Shift buffer info (Char field)
+ 2 Update X_Pos (Offset) field in the shifted area
+ 3 Send the shifted string to console and LVB
+ 4 Clear remaining line
+ 5 Return to the cursor position
+
+ Uses:
+
+ - LineInputBuff[].X_Pos and Char
+
+ Updates:
+
+ - KbdInputLength - sub NumChar.
+ - KbdIndexInLine - NO
+ - LineInputBuff[0..KbdInputLength].Char and .X_Pos
+ - console display
+ - LVB
+ - SesGrp->WinCoord - by other routines.
+
+ Calls:
+
+ - KbdCueUpdateBufferOffset
+ - KbdCueMoveToRight
+ - KbdEchoBSAndFillSpaces
+ - KbdCueMoveToLeft
+
+--*/
+{
+ if (NumChar)
+ {
+ ULONG Offset = LineInputBuff[StartIndex].X_Pos;
+ ULONG Delta = LineInputBuff[StartIndex + NumChar].X_Pos - Offset;
+ ULONG NumShift = KbdInputLength - StartIndex - NumChar;
+
+ if ( NumShift )
+ {
+ /*
+ * Shift buffer info (Char field)
+ */
+
+ RtlMoveMemory(
+ &LineInputBuff[StartIndex].Char,
+ &LineInputBuff[StartIndex + NumChar].Char,
+ NumShift * sizeof(LINE_EDIT_KBD)
+ );
+
+ /*
+ * Update X_Pos (Offset) field in the shifted area
+ */
+
+ KbdCueUpdateBufferOffset(
+ StartIndex,
+ NumShift,
+ Offset
+ );
+
+ /*
+ * Send the shifted string to console and LVB
+ */
+
+ KbdCueMoveToRight(
+ StartIndex,
+ NumShift,
+ TRUE
+ );
+ }
+
+ /*
+ * Clear remaining line
+ */
+
+ KbdEchoBSAndFillSpaces(0, Delta);
+
+ /*
+ * Return to the cursor position
+ */
+
+ KbdCueMoveToLeft(
+ StartIndex + NumShift,
+ NumShift
+ );
+
+ KbdInputLength -= (USHORT)NumChar;
+ }
+}
+
+
+VOID
+KbdCueHandleChar(
+ IN UCHAR Char,
+ IN ULONG Count
+ )
+/*++
+
+Routine Description:
+
+ This routine handle new char at CUE mode.
+
+Arguments:
+
+ Char - char to handle.
+
+ NumChar - number of character.
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE string mode.
+
+ Used by CHAR.
+
+ For INSERT:
+ 1 Shift buffer info (Char field)
+ 2 Fill new char
+ 3 Update X_Pos (Offset) field
+ 4 Send the new+old string to console and LVB
+ 5 Return to the cursor position
+ 6 Beep if no place
+ Else:
+ 1 Shift buffer info (Char field)
+ 2 Fill new char
+ 3 Update X_Pos (Offset) field
+ 4 Send the shifted string to console and LVB
+ 5 Clear remaining line
+ 6 Return to the cursor position
+ 7 Beep if no place
+
+ Uses:
+
+ - LineInputBuff[].X_Pos and Char
+ - KbdInsertOn
+ - KbdIndexInLine
+ - KbdMaxLength
+ - KbdInputLength
+
+ Updates:
+
+ - KbdInputLength
+ - KbdIndexInLine
+ - LineInputBuff[0..KbdInputLength].Char and .X_Pos
+ - console display
+ - LVB
+ - SesGrp->WinCoord - by other routines.
+
+ Calls:
+
+ - KbdCueUpdateBufferOffset
+ - KbdCueMoveToRight
+ - KbdCueMoveToLeft
+ - KbdEchoBSAndFillSpaces
+ - KbdEchoBeep
+ - RtlMoveMemory
+
+--*/
+{
+ ULONG NumChar, NumBeep = 0, NumShift, UpdateRight, i;
+ ULONG LastOffset = LineInputBuff[KbdInputLength].X_Pos;
+
+ if ( KbdInsertOn )
+ {
+ if (( NumChar = KbdMaxLength - KbdInputLength ) > Count )
+ {
+ NumChar = Count;
+ } else
+ {
+ NumBeep = Count - NumChar;
+ }
+
+ /*
+ * Shift buffer info (Char field) to free space for new char
+ */
+
+ NumShift = KbdInputLength - KbdIndexInLine;
+
+ RtlMoveMemory(
+ &LineInputBuff[KbdIndexInLine + NumChar].Char,
+ &LineInputBuff[KbdIndexInLine].Char,
+ NumShift * sizeof(LINE_EDIT_KBD)
+ );
+ /*
+ * Fill new char
+ */
+
+ for ( i = 0 ; i < NumChar ; i++ )
+ {
+ LineInputBuff[KbdIndexInLine + i].Char = Char;
+ }
+
+ /*
+ * Update X_Pos (Offset) field in the shifted and new areas
+ */
+
+ KbdCueUpdateBufferOffset(
+ KbdIndexInLine,
+ NumChar + NumShift,
+ LineInputBuff[KbdIndexInLine].X_Pos
+ );
+
+ /*
+ * Send the shifted string to console and LVB
+ */
+
+ KbdCueMoveToRight(
+ KbdIndexInLine,
+ NumChar + NumShift,
+ TRUE
+ );
+
+ /*
+ * Return to the cursor position
+ */
+
+ KbdCueMoveToLeft(
+ KbdIndexInLine,
+ NumShift
+ );
+
+ KbdInputLength += (USHORT)NumChar;
+ } else
+ {
+ if (( NumChar = KbdMaxLength - KbdIndexInLine ) > Count )
+ {
+ NumChar = Count;
+ } else
+ {
+ NumBeep = Count - NumChar;
+ }
+
+ UpdateRight = max(NumChar, (ULONG)(KbdInputLength - KbdIndexInLine));
+
+ /*
+ * Fill new char
+ */
+
+ for ( i = 0 ; i < NumChar ; i++ )
+ {
+ LineInputBuff[KbdIndexInLine + i].Char = Char;
+ }
+
+ /*
+ * Update X_Pos (Offset) field in the old and new areas
+ */
+
+ KbdCueUpdateBufferOffset(
+ KbdIndexInLine,
+ UpdateRight,
+ LineInputBuff[KbdIndexInLine].X_Pos
+ );
+
+ /*
+ * Send the shifted string to console and LVB
+ */
+
+ KbdCueMoveToRight(
+ KbdIndexInLine,
+ UpdateRight,
+ TRUE
+ );
+
+ if ( LastOffset > (ULONG)LineInputBuff[KbdIndexInLine].X_Pos )
+ {
+ /*
+ * Fill spaces at the EOL if needed
+ */
+
+ KbdEchoBSAndFillSpaces(
+ 0,
+ LastOffset - LineInputBuff[KbdIndexInLine].X_Pos
+ );
+ }
+
+ if ( UpdateRight != NumChar )
+ {
+ /*
+ * Return to the cursor position
+ */
+
+ KbdCueMoveToLeft(
+ KbdIndexInLine,
+ UpdateRight - NumChar
+ );
+ }
+
+ if ( KbdIndexInLine > KbdInputLength )
+ {
+ KbdInputLength = KbdIndexInLine;
+ }
+ }
+
+ if ( NumBeep != Count )
+ {
+ KbdLineWasEdited = TRUE;
+ }
+
+ if ( NumBeep )
+ {
+ KbdEchoBeep(NumBeep);
+ }
+}
+
+
+VOID
+KbdCueSetCurTypeToHalf()
+{
+ VIOCURSORINFO CurType;
+
+ //Ow2VioGetCurType((PVOID)&CurType);
+ //CurType = SesGrp->CursorInfo;
+
+ //CurType.cEnd = SesGrp->CellVSize;
+ CurType.cEnd = SesGrp->CursorInfo.cEnd;
+ CurType.yStart = (CurType.cEnd + 1 ) / 2;
+ CurType.cx = 1;
+ CurType.attr = 0;
+
+ Ow2VioSetCurType((PVOID)&CurType);
+}
+
+
+VOID
+KbdCueSetCurTypeToQuater()
+{
+ VIOCURSORINFO CurType;
+
+ //Ow2VioGetCurType((PVOID)&CurType);
+ //CurType = SesGrp->CursorInfo;
+
+ //CurType.cEnd = SesGrp->CellVSize;
+ CurType.cEnd = SesGrp->CursorInfo.cEnd;
+ CurType.yStart = (CurType.cEnd + 1 ) * 3 / 4;
+ CurType.cx = 1;
+ CurType.attr = 0;
+
+ Ow2VioSetCurType((PVOID)&CurType);
+}
+
+
+DWORD
+KbdEchoCharToConsole(
+ IN UCHAR Char,
+ IN ULONG Count
+ )
+/*++
+
+Routine Description:
+
+ This routine write <Char> to console <Count> times.
+
+Arguments:
+
+ Char - character to write.
+
+ Count - number of times to write char
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE/EDIT string mode.
+
+ Used by KbdEchoNL, KbdEchoBSAndFillSpaces, KbdEchoBeep and KbdEchoChar.
+
+ Calls:
+
+ - Or2WinWriteConsoleA
+
+--*/
+{
+ ULONG NumChar, NumWritten, MaxCount = Count;
+
+ NumChar = (MaxCount > KBD_BUFFER_SIZE) ? KBD_BUFFER_SIZE : MaxCount;
+ memset(KBD_BUFFER_ADDRESS, Char, NumChar);
+
+ while (MaxCount)
+ {
+ if(!Or2WinWriteConsoleA(
+ #if DBG
+ KbdEchoCharToConsoleStr,
+ #endif
+ hConOut,
+ (LPSTR)KBD_BUFFER_ADDRESS,
+ NumChar,
+ &NumWritten,
+ NULL))
+ {
+#if DBG
+ ASSERT1("OS2SES(KbdEchoCharToConsole): failed on WriteConsoleA", FALSE);
+#endif
+ }
+
+#if DBG
+ if ( NumChar != NumWritten )
+ {
+ KdPrint(("OS2SES(KbdEchoCharToConsole): partial data WriteConsoleA %u from %u\n",
+ NumWritten, NumChar));
+ ASSERT( FALSE );
+ }
+#endif
+
+ MaxCount -= NumChar;
+ NumChar = (MaxCount > KBD_BUFFER_SIZE) ? KBD_BUFFER_SIZE : MaxCount;
+ }
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+KbdEchoNL(
+ IN ULONG Count
+ )
+/*++
+
+Routine Description:
+
+ This routine write NL to console <Count> times and update LVB.
+
+Arguments:
+
+ Count - number of times to write char
+
+Return Value:
+
+
+Note:
+
+ ASCII CUE/EDIT string mode.
+
+ Used by LF (EDIT only) and CR.
+
+ Updates:
+
+ - SesGrp->WinCoord
+ - LVB
+
+ Calls:
+
+ - KbdEchoCharToConsole
+ - VioLVBScrollBuff
+
+--*/
+{
+ ULONG NumLines = 0;
+ COORD Coord = GET_CURRENT_COORD;
+
+ Coord.X = 0;
+ Coord.Y += (SHORT)Count;
+ if ( Coord.Y >= SesGrp->ScreenRowNum )
+ {
+ NumLines = Coord.Y - SesGrp->ScreenRowNum + 1;
+ Coord.Y = SesGrp->ScreenRowNum - 1;
+ }
+
+ KbdEchoCharToConsole('\n', Count);
+ Ow2VioUpdateCurPos(Coord);
+
+ if (NumLines)
+ {
+ VioLVBScrollBuff(NumLines);
+ }
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+KbdEchoESC(
+ IN ULONG Count,
+ IN ULONG HorzMove
+ )
+/*++
+
+Routine Description:
+
+ This routine write <ESC> to console <Count> times with <HorzMove>
+ number of spaces on the next line. It also update LVB.
+
+Arguments:
+
+ Count - number of times to write char
+
+ HorzMove - number of spaces on the start of the new line.
+
+Return Value:
+
+
+Note:
+
+ ASCII EDIT string mode.
+
+ Used by ESC.
+
+ Updates:
+
+ - SesGrp->WinCoord
+ - LVB
+
+ Calls:
+
+ - Or2WinWriteConsoleA
+ - VioLVBScrollBuff
+
+--*/
+{
+ ULONG NumChar, NumWritten, MaxCount = Count, NumLines = 0, Length = HorzMove + 1;
+ COORD OldCoord, Coord;
+
+ OldCoord = Coord = GET_CURRENT_COORD;
+
+ KBD_BUFFER_ADDRESS[0] = '\\';
+ KBD_BUFFER_ADDRESS[1] = '\n';
+ memset(&KBD_BUFFER_ADDRESS[2], ' ', HorzMove);
+ KBD_BUFFER_ADDRESS[HorzMove + 2] = '\\';
+ NumChar = HorzMove + 2;
+
+ Coord.Y += (SHORT)Count;
+ Coord.X = (SHORT)HorzMove;
+
+ if ( Coord.Y >= SesGrp->ScreenRowNum )
+ {
+ NumLines = Coord.Y - SesGrp->ScreenRowNum + 1;
+ Coord.Y = SesGrp->ScreenRowNum - 1;
+ }
+
+ while ( MaxCount )
+ {
+ if(!Or2WinWriteConsoleA(
+ #if DBG
+ KbdEchoESCStr,
+ #endif
+ hConOut,
+ (LPSTR)KBD_BUFFER_ADDRESS,
+ NumChar,
+ &NumWritten,
+ NULL))
+ {
+#if DBG
+ ASSERT1("OS2SES(KbdEchoESC): failed on WriteConsoleA", FALSE);
+#endif
+ //return (1);
+ }
+
+#if DBG
+ if ( NumChar != NumWritten )
+ {
+ KdPrint(("OS2SES(KbdEchoESC): partial data WriteConsoleA %u from %u\n",
+ NumWritten, NumChar));
+ ASSERT( FALSE );
+ }
+#endif
+
+ MaxCount--;
+ }
+
+ Ow2VioUpdateCurPos(Coord);
+
+ VioLVBFillChar(
+#ifdef DBCS
+// MSKK Oct.14.1993 V-AkihiS
+ "\\",
+#else
+ '\\',
+#endif
+ OldCoord,
+ 1
+ );
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ OldCoord,
+ 1
+ );
+
+ OldCoord.X = 0;
+
+ for ( NumChar = 0 ; NumChar < Count ; NumChar++ )
+ {
+ if ( ++OldCoord.Y >= SesGrp->ScreenRowNum )
+ {
+ OldCoord.Y--;
+ VioLVBScrollBuff(1);
+ NumLines--;
+ }
+
+ if ( NumChar == ( Count - 1 ))
+ {
+ Length--; // don't put the slash at the last line
+ }
+
+ VioLVBCopyStr(
+ &KBD_BUFFER_ADDRESS[2],
+ OldCoord,
+ Length
+ );
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ OldCoord,
+ Length
+ );
+ }
+
+ ASSERT( NumLines == 0 );
+ return(NO_ERROR);
+}
+
+
+DWORD
+KbdEchoBSAndFillSpaces(
+ IN ULONG BSCount,
+ IN ULONG SpaceCount
+ )
+/*++
+
+Routine Description:
+
+ This routine write BS ('\b') to console <BSCount> times and fill
+ <SpaceCount> times spaces in console and LVB.
+
+Arguments:
+
+ BSCount - number of times to write \b char to console
+
+ SpaceCount - number of times to fill space char to console and LVB
+
+Return Value:
+
+
+Note:
+
+ ASCII EDIT/CUE string mode.
+
+ Used by ^END, BS (EDIT only), LF (EDIT only), KbdCueEraseAndDisplayLine,
+ KbdCueMoveToLeft, KbdCueDeleteCharAndShift and KbdCueHandleChar.
+
+ Updates:
+
+ - SesGrp->WinCoord (for BSCount only)
+ - LVB (for SpaceCount only)
+
+ Calls:
+
+ - KbdEchoCharToConsole
+ - Or2WinFillConsoleOutputCharacterA
+ - VioLVBFillChar
+
+--*/
+{
+ ULONG NumFilled;
+ COORD OldCoord, Coord;
+
+ if ( !KbdEchoFlag )
+ {
+ return (0L);
+ }
+
+ if (((long) BSCount < 0) || ((long) SpaceCount < 0)) {
+#if DBG
+ DbgPrint("KbdEchoBSAndFillSpaces: BSCount %d or SpaceCount %d are negative\n",
+ (long)BSCount, (long)SpaceCount);
+#endif
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ OldCoord = Coord = GET_CURRENT_COORD;
+
+ Coord.X -= (SHORT)BSCount;
+ while ( Coord.X < 0 )
+ {
+ if ( Coord.Y )
+ {
+ Coord.Y--;
+ Coord.X += SesGrp->ScreenColNum;
+ } else
+ {
+ if ( SpaceCount )
+ {
+ if ( SpaceCount > (ULONG)abs(Coord.X) )
+ {
+ SpaceCount += (ULONG)Coord.X;
+ } else
+ {
+ SpaceCount = 0;
+ }
+ }
+
+ BSCount += (ULONG)Coord.X; // sub the negative value
+ Coord.X = 0;
+ }
+ }
+
+ KbdEchoCharToConsole('\b', BSCount);
+ Ow2VioUpdateCurPos(Coord);
+
+ if ( SpaceCount )
+ {
+ if (!Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ KbdEchoBSAndFillSpacesStr,
+ #endif
+ hConOut,
+ ' ',
+ SpaceCount,
+ Coord,
+ &NumFilled))
+ {
+#if DBG
+ ASSERT1("OS2SES(KbdEchoBSAndFillSpaces): failed on FillConsoleOutputCharacterA\n", FALSE);
+#endif
+ }
+
+#if DBG
+ if ( NumFilled != SpaceCount )
+ {
+ KdPrint(("OS2SES(KbdEchoBSAndFillSpaces): partial data %u from %u\n",
+ NumFilled, SpaceCount));
+ ASSERT( FALSE );
+ }
+#endif
+ VioLVBFillChar(
+#ifdef DBCS
+// MSKK Oct.14.1993 V-AkihiS
+ " ",
+#else
+ ' ',
+#endif
+ Coord,
+ SpaceCount
+ );
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ Coord,
+ SpaceCount
+ );
+ }
+ return(NO_ERROR);
+}
+
+
+DWORD
+KbdEchoBeep(
+ IN ULONG Count
+ )
+/*++
+
+Routine Description:
+
+ This routine send BEPP ('\07') to console <Count> times.
+
+Arguments:
+
+ Count - number of times to write \g char to console
+
+Return Value:
+
+
+Note:
+
+ ASCII EDIT/CUE string mode.
+
+ Used when no place in the active command line by KbdEchoString,
+ Char and KbdCueHandleChar.
+
+ Calls:
+
+ - KbdEchoCharToConsole
+
+--*/
+{
+ KbdEchoCharToConsole('\07', Count);
+ return(NO_ERROR);
+}
+
+
+DWORD
+KbdEchoChar(
+ IN UCHAR Char,
+ IN ULONG Count
+ )
+/*++
+
+Routine Description:
+
+ This routine echo <Char> to console <Count> times and update LVB.
+
+Arguments:
+
+ Char - char to send to console
+
+ Count - number of times to send char to console
+
+Return Value:
+
+
+Note:
+
+ ASCII EDIT string mode.
+
+ Updates:
+
+ - SesGrp->WinCoord
+ - LVB
+
+ Calls:
+
+ - KbdEchoCharToConsole
+ - VioLVBScrollBuff
+
+--*/
+{
+ COORD OldCoord, Coord;
+ BOOL SendByLine = FALSE;
+ UCHAR FillChar;
+ ULONG Offset;
+
+ OldCoord = Coord = GET_CURRENT_COORD;
+ if (( Char >= ' ' ) || ( Char == '\t' ))
+ {
+ KbdEchoCharToConsole(Char, Count);
+
+ if ( Char == '\t' )
+ {
+ Offset = 8 * Count - (Coord.X & 7);
+ FillChar = ' ';
+ } else
+ {
+ FillChar = Char;
+ Offset = Count;
+ }
+
+ if ((ULONG)( Offset + 2 * SesGrp->ScreenColNum ) > SesGrp->ScreenSize )
+ {
+ SendByLine = TRUE;
+ } else
+ {
+ Coord.X += (SHORT)Offset;
+ while ( Coord.X >= SesGrp->ScreenColNum )
+ {
+ Coord.Y++;
+ Coord.X -= SesGrp->ScreenColNum;
+ }
+
+ if ( Coord.Y >= SesGrp->ScreenRowNum )
+ {
+ VioLVBScrollBuff(Coord.Y - SesGrp->ScreenRowNum + 1);
+ OldCoord.Y -= Coord.Y - SesGrp->ScreenRowNum + 1;
+ Coord.Y = SesGrp->ScreenRowNum - 1;
+ }
+
+ Ow2VioUpdateCurPos(Coord);
+
+ VioLVBFillChar(
+#ifdef DBCS
+// MSKK Oct.14.1993 V-AkihiS
+ &FillChar,
+#else
+ FillChar,
+#endif
+ OldCoord,
+ Offset
+ );
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ OldCoord,
+ Offset
+ );
+ }
+ }
+
+ if ( SendByLine || (( Char < ' ' ) && ( Char != '\t' )))
+ {
+ ULONG NumChar, NumWritten, MaxCount, Pattern;
+
+ if ( SendByLine )
+ {
+ Pattern = (ULONG)((FillChar << 24) |
+ (FillChar << 16) |
+ (FillChar << 8) |
+ (FillChar));
+
+ MaxCount = 0;
+ } else
+ {
+ MaxCount = Offset = 2 * Count;
+ FillChar = (UCHAR)(Char + '@');
+
+ Pattern = (ULONG)((FillChar << 24) |
+ ('^' << 16) |
+ (FillChar << 8) |
+ ('^'));
+ }
+
+ NumChar = ( Offset > KBD_BUFFER_SIZE ) ? KBD_BUFFER_SIZE : Offset;
+
+ RtlFillMemoryUlong(
+ KBD_BUFFER_ADDRESS,
+ (NumChar + 3) & ~3,
+ Pattern
+ );
+
+ while ( MaxCount )
+ {
+ if(!Or2WinWriteConsoleA(
+ #if DBG
+ KbdEchoCharStr,
+ #endif
+ hConOut,
+ (LPSTR)KBD_BUFFER_ADDRESS,
+ NumChar,
+ &NumWritten,
+ NULL))
+ {
+#if DBG
+ ASSERT1("OS2SES(KbdEchoChar): failed on WriteConsoleA", FALSE);
+#endif
+ //return (1);
+ }
+
+#if DBG
+ if ( NumChar != NumWritten )
+ {
+ KdPrint(("OS2SES(KbdEchoChar): partial data WriteConsoleA %u from %u\n",
+ NumWritten, NumChar));
+ ASSERT( FALSE );
+ }
+#endif
+
+ MaxCount -= NumChar;
+ NumChar = ( MaxCount > KBD_BUFFER_SIZE ) ? KBD_BUFFER_SIZE : MaxCount;
+ }
+
+ if (( NumChar = SesGrp->ScreenColNum - Coord.X ) > Offset )
+ {
+ NumChar = Offset;
+ }
+
+ while ( Offset )
+ {
+ VioLVBCopyStr(
+ &KBD_BUFFER_ADDRESS[0],
+ Coord,
+ NumChar
+ );
+
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ Coord,
+ NumChar
+ );
+ Coord.X += (SHORT)NumChar;
+ if ( Coord.X >= SesGrp->ScreenColNum )
+ {
+ Coord.X -= SesGrp->ScreenColNum;
+ if ( ++Coord.Y >= SesGrp->ScreenRowNum )
+ {
+ VioLVBScrollBuff(1);
+ Coord.Y--;
+ }
+ }
+
+ Offset -= NumChar;
+ if (( NumChar = SesGrp->ScreenColNum - Coord.X ) > Offset )
+ {
+ NumChar = Offset;
+ }
+ }
+
+ Ow2VioUpdateCurPos(Coord);
+ }
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+KbdEchoAString(
+ IN PUCHAR String,
+ IN ULONG Length
+ )
+/*++
+
+Routine Description:
+
+ This routine echo <String>, which size is <Lenght> to console and update LVB.
+
+Arguments:
+
+ String - char string to send to console
+
+ Length - string length
+
+Return Value:
+
+
+Note:
+
+ ASCII EDIT string mode.
+
+ Updates:
+
+ - SesGrp->WinCoord
+ - LVB
+
+ Calls:
+
+ - Or2WinWriteConsoleA
+
+--*/
+{
+ ULONG NumWritten, NumChar, NumBytes, Num;
+ COORD OldCoord, Coord;
+ UCHAR Char;
+
+ OldCoord = Coord = GET_CURRENT_COORD;
+
+ for ( NumChar = 0, NumBytes = 0 ; NumChar < Length ; NumChar++ )
+ {
+ Char = String[NumChar];
+ if ( Char >= ' ' )
+ {
+ KBD_BUFFER_ADDRESS[NumBytes++] = Char;
+ } else if ( Char = '\t' )
+ {
+ Num = 8 - ((Coord.X + NumBytes) & 7);
+ memset(&KBD_BUFFER_ADDRESS[NumBytes], ' ', Num);
+ NumBytes += Num;
+ } else
+ {
+ KBD_BUFFER_ADDRESS[NumBytes++] = '^';
+ KBD_BUFFER_ADDRESS[NumBytes++] = (UCHAR)(Char + '@');
+ }
+
+ if (((ULONG)( Coord.X + NumBytes ) >= (ULONG)SesGrp->ScreenColNum ) ||
+ ( NumChar == ( Length - 1 )))
+ {
+ if(!Or2WinWriteConsoleA(
+ #if DBG
+ KbdEchoAStringStr,
+ #endif
+ hConOut,
+ (LPSTR)KBD_BUFFER_ADDRESS,
+ NumBytes,
+ &NumWritten,
+ NULL))
+ {
+#if DBG
+ ASSERT1("OS2SES(KbdEchoAString): failed on WriteConsoleA", FALSE);
+#endif
+ }
+
+#if DBG
+ if ( NumBytes != NumWritten )
+ {
+ KdPrint(("OS2SES(KbdEchoAString): partial data WriteConsoleA %u from %u\n",
+ NumWritten, NumBytes));
+ ASSERT( FALSE );
+ }
+#endif
+ OldCoord = Coord;
+ Coord.X += (SHORT)NumBytes;
+ if ( Coord.X >= SesGrp->ScreenColNum )
+ {
+ Coord.Y++;
+ Coord.X -= SesGrp->ScreenColNum;
+
+ if ( Coord.Y >= SesGrp->ScreenRowNum )
+ {
+ Coord.Y = SesGrp->ScreenRowNum - 1;
+ OldCoord.Y--;
+ }
+ }
+
+ Ow2VioUpdateCurPos(Coord);
+
+ VioLVBCopyStr(
+ &KBD_BUFFER_ADDRESS[0],
+ OldCoord,
+ NumBytes
+ );
+
+ VioLVBFillAtt(
+ SesGrp->AnsiCellAttr,
+ OldCoord,
+ NumBytes
+ );
+ NumBytes = 0;
+ }
+ }
+ return(NO_ERROR);
+}
+
+
+BOOL
+KbdKeyIsTurnAround(
+ IN UCHAR Char,
+ IN UCHAR Scan
+ )
+{
+ if ( KbdTurnAroundCharTwo )
+ {
+ if ( Scan == (UCHAR)KbdTurnAroundChar )
+ {
+ if ((( KbdReadMode == 0 ) &&
+ (( Char == 0 ) || ( Char == 0xE0 ))) ||
+ (( KbdReadMode == 1 ) && ( Char == HIBYTE(KbdTurnAroundChar) )))
+ {
+ return(TRUE);
+ }
+ }
+ } else
+ {
+ if ( Char == (UCHAR)KbdTurnAroundChar )
+ {
+ return(TRUE);
+ }
+ }
+
+ return(FALSE);
+}
+
diff --git a/private/os2/os2ses/kbdtable.c b/private/os2/os2ses/kbdtable.c
new file mode 100644
index 000000000..f1e39119e
--- /dev/null
+++ b/private/os2/os2ses/kbdtable.c
@@ -0,0 +1,653 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ kbdtabl.c
+
+Abstract:
+
+ This module contains the translation table for KBD according to CP
+
+Author:
+
+ Michael Jarus (mjarus) 28-Apr-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#include "kbd.h"
+#include <stdio.h>
+
+#ifdef JAPAN
+// MSKK May.07.1993 V-AkihiS
+// Support IOCtl KBD_KETKEYBDTYPE and KBD_GETHARDWAREID
+USHORT KbdType, KbdSubType;
+BYTE OemId, OemSubType;
+#endif
+
+USHORT Ow2KbdHWIDs = 1; // BUGBUG -?
+USHORT Ow2KCBShFlgs = 0; // BUGBUG -?
+
+UCHAR Ow2MiscFlags = 0;
+#define EnhancedKbd 0x10 // bit 4 - Enhanced Kbd is out there (must be Bit 4!).
+
+UCHAR Ow2MiscFlags3 = 0;
+#define AltPacket 2 // bit 1 - DCR 1713: indicates that Alt-Numpad accumulation is finished.
+#define PauseLatch 4 // bit 2 - PTM 2344: indicates correct keystroke sequence for a Ctrl-NumLock.
+#define E0Packet 0x10 // bit 4 - PTM 2382: indicates that an E0 packet is to be sent with the next packet.
+#define SecAltNumPad 0x80 // bit 7 - PTR AK00370: indicates AltNumpad with R-Alt.
+
+
+extern PVOID Ow2US437001, Ow2US437011, Ow2US850000, Ow2US850010;
+extern PVOID Ow2BE437001, Ow2BE437011, Ow2BE850000, Ow2BE850010;
+extern PVOID Ow2CF863001, Ow2CF863011, Ow2CF850000, Ow2CF850010;
+extern PVOID Ow2DK865001, Ow2DK865011, Ow2DK850000, Ow2DK850010;
+extern PVOID Ow2FR437001, Ow2FR437011, Ow2FR437111, Ow2FR850000, Ow2FR850010, Ow2FR850011;
+extern PVOID Ow2GR437001, Ow2GR437011, Ow2GR850000, Ow2GR850010;
+extern PVOID Ow2IT437001, Ow2IT437011, Ow2IT437111, Ow2IT850000, Ow2IT850010, Ow2IT850011;
+extern PVOID Ow2LA437001, Ow2LA437011, Ow2LA850000, Ow2LA850010;
+extern PVOID Ow2NL437001, Ow2NL437011, Ow2NL850000, Ow2NL850010;
+extern PVOID Ow2NO865001, Ow2NO865011, Ow2NO850000, Ow2NO850010;
+extern PVOID Ow2PO860001, Ow2PO860011, Ow2PO850000, Ow2PO850010;
+extern PVOID Ow2SF437001, Ow2SF437011, Ow2SF850000, Ow2SF850010;
+extern PVOID Ow2SG437001, Ow2SG437011, Ow2SG850000, Ow2SG850010;
+extern PVOID Ow2SP437001, Ow2SP437011, Ow2SP850000, Ow2SP850010;
+extern PVOID Ow2SU437001, Ow2SU437011, Ow2SU850000, Ow2SU850010;
+extern PVOID Ow2SV437001, Ow2SV437011, Ow2SV850000, Ow2SV850010;
+extern PVOID Ow2UK437001, Ow2UK437011, Ow2UK437111, Ow2UK850000, Ow2UK850010, Ow2UK850011;
+#ifdef JAPAN
+// MSKK Aug.02.1993 V-AkihiS
+extern PVOID Ow2JP932011AX, Ow2JP437011AX;
+extern PVOID Ow2JP932011IBM002, Ow2JP437011IBM002;
+extern PVOID Ow2JP932011IBMA01, Ow2JP437011IBMA01;
+extern PVOID Ow2JP932011IBM101, Ow2JP437011IBM101;
+#endif
+
+typedef struct _KBD_TYPE_TABLE
+{
+ PVOID CP1Table;
+ PVOID CP2Table;
+} KBD_TYPE_TABLE, *PKBD_TYPE_TABLE;
+
+typedef struct _KBD_LANG_TABLE
+{
+ ULONG Country;
+ ULONG CodePage1;
+ ULONG CodePage2;
+ KBD_TYPE_TABLE AtTable;
+ KBD_TYPE_TABLE EnTable;
+ KBD_TYPE_TABLE EnNewTable;
+} KBD_LANG_TABLE;
+
+KBD_LANG_TABLE KbdNlsTable[] =
+ {
+ {
+ CTRY_BELGIUM,
+ 437,
+ 850,
+ {
+ &Ow2BE437001, // BE 437 AT Kbd
+ &Ow2BE850000, // BE 850 AT Kbd
+ },
+ {
+ &Ow2BE437011, // BE 437 EN Kbd
+ &Ow2BE850010, // BE 850 EN Kbd
+ },
+ {
+ &Ow2BE437011, // BE 437 EN Kbd (for New Std as Old)
+ &Ow2BE850010 // BE 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_CANADA,
+ 863,
+ 850,
+ {
+ &Ow2CF863001, // CF 863 AT Kbd
+ &Ow2CF850000, // CF 850 AT Kbd
+ },
+ {
+ &Ow2CF863011, // CF 863 EN Kbd
+ &Ow2CF850010, // CF 850 EN Kbd
+ },
+ {
+ &Ow2CF863011, // CF 863 EN Kbd (for New Std as Old)
+ &Ow2CF850010 // CF 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_DENMARK,
+ 865,
+ 850,
+ {
+ &Ow2DK865001, // DK 865 AT Kbd
+ &Ow2DK850000, // DK 850 AT Kbd
+ },
+ {
+ &Ow2DK865011, // DK 865 EN Kbd
+ &Ow2DK850010, // DK 850 EN Kbd
+ },
+ {
+ &Ow2DK865011, // DK 865 EN Kbd (for New Std as Old)
+ &Ow2DK850010 // DK 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_FRANCE,
+ 437,
+ 850,
+ {
+ &Ow2FR437001, // FR 437 AT Kbd
+ &Ow2FR850000, // FR 850 AT Kbd
+ },
+ {
+ &Ow2FR437011, // FR 437 EN Kbd
+ &Ow2FR850010, // FR 850 EN Kbd
+ },
+ {
+ &Ow2FR437111, // FR 437 EN Kbd New Std
+ &Ow2FR850011 // FR 850 EN Kbd New Std
+ }
+ },
+ {
+ CTRY_GERMANY,
+ 437,
+ 850,
+ {
+ &Ow2GR437001, // GR 437 AT Kbd
+ &Ow2GR850000, // GR 850 AT Kbd
+ },
+ {
+ &Ow2GR437011, // GR 437 EN Kbd
+ &Ow2GR850010, // GR 850 EN Kbd
+ },
+ {
+ &Ow2GR437011, // GR 437 EN Kbd (for New Std as Old)
+ &Ow2GR850010 // GR 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_ITALY,
+ 437,
+ 850,
+ {
+ &Ow2IT437001, // IT 437 AT Kbd
+ &Ow2IT850000, // IT 850 AT Kbd
+ },
+ {
+ &Ow2IT437011, // IT 437 EN Kbd
+ &Ow2IT850010, // IT 850 EN Kbd
+ },
+ {
+ &Ow2IT437111, // IT 437 EN Kbd New Std
+ &Ow2IT850011 // IT 850 EN Kbd New Std
+ }
+ },
+ {
+ COUNTRY_LATIN_AMERICA,
+ 437,
+ 850,
+ {
+ &Ow2LA437001, // LA 437 AT Kbd
+ &Ow2LA850000, // LA 850 AT Kbd
+ },
+ {
+ &Ow2LA437011, // LA 437 EN Kbd
+ &Ow2LA850010, // LA 850 EN Kbd
+ },
+ {
+ &Ow2LA437011, // LA 437 EN Kbd (for New Std as Old)
+ &Ow2LA850010 // LA 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_NETHERLANDS,
+ 437,
+ 850,
+ {
+ &Ow2NL437001, // NL 437 AT Kbd
+ &Ow2NL850000, // NL 850 AT Kbd
+ },
+ {
+ &Ow2NL437011, // NL 437 EN Kbd
+ &Ow2NL850010, // NL 850 EN Kbd
+ },
+ {
+ &Ow2NL437011, // NL 437 EN Kbd (for New Std as Old)
+ &Ow2NL850010 // NL 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_NORWAY,
+ 865,
+ 850,
+ {
+ &Ow2NO865001, // NO 865 AT Kbd
+ &Ow2NO850000, // NO 850 AT Kbd
+ },
+ {
+ &Ow2NO865011, // NO 865 EN Kbd
+ &Ow2NO850010, // NO 850 EN Kbd
+ },
+ {
+ &Ow2NO865011, // NO 865 EN Kbd (for New Std as Old)
+ &Ow2NO850010 // NO 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_PORTUGAL,
+ 860,
+ 850,
+ {
+ &Ow2PO860001, // PO 860 AT Kbd
+ &Ow2PO850000, // PO 850 AT Kbd
+ },
+ {
+ &Ow2PO860011, // PO 860 EN Kbd
+ &Ow2PO850010, // PO 850 EN Kbd
+ },
+ {
+ &Ow2PO860011, // PO 860 EN Kbd (for New Std as Old)
+ &Ow2PO850010 // PO 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_SWITZERLAND,
+ 437,
+ 850,
+ {
+ &Ow2SF437001, // SF 437 AT Kbd
+ &Ow2SF850000, // SF 850 AT Kbd
+ },
+ {
+ &Ow2SF437011, // SF 437 EN Kbd
+ &Ow2SF850010, // SF 850 EN Kbd
+ },
+ {
+ &Ow2SF437011, // SF 437 EN Kbd (for New Std as Old)
+ &Ow2SF850010 // SF 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_SWITZERLAND,
+ 437,
+ 850,
+ {
+ &Ow2SG437001, // SG 437 AT Kbd
+ &Ow2SG850000, // SG 850 AT Kbd
+ },
+ {
+ &Ow2SG437011, // SG 437 EN Kbd
+ &Ow2SG850010, // SG 850 EN Kbd
+ },
+ {
+ &Ow2SG437011, // SG 437 EN Kbd (for New Std as Old)
+ &Ow2SG850010 // SG 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_SPAIN,
+ 437,
+ 850,
+ {
+ &Ow2SP437001, // SP 437 AT Kbd
+ &Ow2SP850000, // SP 850 AT Kbd
+ },
+ {
+ &Ow2SP437011, // SP 437 EN Kbd
+ &Ow2SP850010, // SP 850 EN Kbd
+ },
+ {
+ &Ow2SP437011, // SP 437 EN Kbd (for New Std as Old)
+ &Ow2SP850010 // SP 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_FINLAND,
+ 437,
+ 850,
+ {
+ &Ow2SU437001, // SU 437 AT Kbd
+ &Ow2SU850000, // SU 850 AT Kbd
+ },
+ {
+ &Ow2SU437011, // SU 437 EN Kbd
+ &Ow2SU850010, // SU 850 EN Kbd
+ },
+ {
+ &Ow2SU437011, // SU 437 EN Kbd (for New Std as Old)
+ &Ow2SU850010 // SU 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_SWEDEN,
+ 437,
+ 850,
+ {
+ &Ow2SV437001, // SV 437 AT Kbd
+ &Ow2SV850000, // SV 850 AT Kbd
+ },
+ {
+ &Ow2SV437011, // SV 437 EN Kbd
+ &Ow2SV850010, // SV 850 EN Kbd
+ },
+ {
+ &Ow2SV437011, // SV 437 EN Kbd (for New Std as Old)
+ &Ow2SV850010 // SV 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ CTRY_UNITED_KINGDOM,
+ 437,
+ 850,
+ {
+ &Ow2UK437001, // UK 437 AT Kbd
+ &Ow2UK850000, // UK 850 AT Kbd
+ },
+ {
+ &Ow2UK437011, // UK 437 EN Kbd
+ &Ow2UK850010, // UK 850 EN Kbd
+ },
+ {
+ &Ow2UK437111, // UK 437 EN Kbd New Std
+ &Ow2UK850011 // UK 850 EN Kbd New Std
+ }
+ },
+ {
+ /* Must be last as the default */
+
+ CTRY_UNITED_STATES,
+ 437,
+ 850,
+ {
+ &Ow2US437001, // US 437 AT Kbd
+ &Ow2US850000, // US 850 AT Kbd
+ },
+ {
+ &Ow2US437011, // US 437 EN Kbd
+ &Ow2US850010, // US 850 EN Kbd
+ },
+ {
+ &Ow2US437011, // US 437 EN Kbd (for New Std as Old)
+ &Ow2US850010 // US 850 EN Kbd (for New Std as Old)
+ }
+ },
+ {
+ 0,
+ 0,
+ 0,
+ {
+ NULL,
+ NULL,
+ },
+ {
+ NULL,
+ NULL,
+ },
+ {
+ NULL,
+ NULL
+ }
+ }
+ };
+
+#ifdef JAPAN
+// MSKK Aug.03.1993 V-AkihiS
+typedef struct _KBD_TYPE_TABLE_OEM
+{
+ BYTE OemSubType;
+ KBD_TYPE_TABLE EnTable;
+ #if DBG
+ PBYTE OemSubTypeStr;
+ #endif
+} KBD_TYPE_TABLE_OEM, *PKBD_TYPE_TABLE_OEM;
+
+typedef struct _KBD_TYPE_TABLE_JP
+{
+ BYTE OemId;
+ PKBD_TYPE_TABLE_OEM pKbdTableOEM;
+ #if DBG
+ PBYTE OemIdStr;
+ #endif
+} KBD_TYPE_TABLE_JP;
+
+#if DBG
+BYTE SubKbdTypeMicrosoftStr[] = "Microsoft";
+
+BYTE AXKbdDesktopTypeStr[] = "AX KeyBoard";
+BYTE IBMKbd002TypeStr[] = "IBM-002 Keyboard";
+BYTE IBMKbdA01TypeStr[] = "106 keyboard";
+BYTE IBM101KbdTypeStr[] = "101 keyboard";
+#endif
+
+KBD_TYPE_TABLE_OEM KbdTypeTableMicrosoft[] =
+ {
+ {
+ MICROSOFT_KBD_101_TYPE,
+ {
+ &Ow2JP932011IBM101, // 101 keybaord 932
+ &Ow2JP437011IBM101 // 101 keyboard 437
+ }
+ #if DBG
+ , (PBYTE)&IBM101KbdTypeStr
+ #endif
+ },
+ {
+ MICROSOFT_KBD_AX_TYPE,
+ {
+ &Ow2JP932011AX, // AX keybaord 932
+ &Ow2JP437011AX // AX keyboard 437
+ }
+ #if DBG
+ , (PBYTE)&AXKbdDesktopTypeStr
+ #endif
+ },
+ {
+ MICROSOFT_KBD_106_TYPE,
+ {
+ &Ow2JP932011IBMA01, // 106 keybaord 932
+ &Ow2JP437011IBMA01 // 106 keyboard 437
+ }
+ #if DBG
+ , (PBYTE)&IBMKbdA01TypeStr
+ #endif
+ },
+ {
+ MICROSOFT_KBD_002_TYPE,
+ {
+ &Ow2JP932011IBM002, // IBM-002 keybaord 932
+ &Ow2JP437011IBM002 // IBM-002 keyboard 437
+ }
+ #if DBG
+ , (PBYTE)&IBMKbd002TypeStr
+ #endif
+ },
+ {
+ 0xFF,
+ {
+ NULL,
+ NULL
+ }
+ #if DBG
+ , NULL
+ #endif
+ }
+ };
+
+
+KBD_TYPE_TABLE_JP KbdTableJp[] =
+ {
+ {
+ SUB_KBD_TYPE_MICROSOFT,
+ (PKBD_TYPE_TABLE_OEM)&KbdTypeTableMicrosoft
+ #if DBG
+ , (PBYTE)&SubKbdTypeMicrosoftStr
+ #endif
+ },
+ {
+ 0xFF,
+ NULL
+ #if DBG
+ , NULL
+ #endif
+ }
+ };
+#endif
+
+VOID
+KbdSetTable(
+ IN ULONG KbdCP
+ )
+{
+ ULONG i;
+ ULONG Ctry = SesGrp->KeyboardCountry;
+ PKBD_TYPE_TABLE pKbdType;
+#ifdef JAPAN
+// MSKK Aug.03.1993 V-AkihiS
+ ULONG j;
+#endif
+
+#ifdef JAPAN
+// MSKK Jul.29.1993 V-AkihiS
+ if (Ctry == COUNTRY_JAPAN)
+ {
+ //
+ // Get keyboard type to decide translation table
+ //
+ KbdType = GetKeyboardType(0);
+ KbdSubType = GetKeyboardType(1);
+ OemId = HIBYTE(KbdSubType);
+ OemSubType = LOBYTE(KbdSubType);
+
+ for ( i = 0 ;
+ (KbdTableJp[i].OemId != OemId) && KbdTableJp[i+1].OemId != 0xFF;
+ i++ );
+ for ( j = 0 ;
+ ((KbdTableJp[i].pKbdTableOEM)[j].OemSubType != OemSubType) &&
+ (KbdTableJp[i].pKbdTableOEM)[j+1].OemSubType !=0xFF;
+ j++ );
+
+ switch(KbdCP) {
+ case CODEPAGE_JAPAN:
+ case 0:
+ Ow2KbdScanTable = (KbdTableJp[i].pKbdTableOEM)[j].EnTable.CP1Table;
+ break;
+ default:
+ Ow2KbdScanTable = (KbdTableJp[i].pKbdTableOEM)[j].EnTable.CP2Table;
+ break;
+ }
+ Ow2MiscFlags = EnhancedKbd;
+#if DBG
+ IF_OS2_DEBUG2( OS2_EXE, KBD )
+ {
+ KdPrint(("KbdSetTable: Country %d, CP %u, OemId %s, OemSubType %s\n",
+ Ctry,
+ KbdCP,
+ KbdTableJp[i].OemIdStr,
+ (KbdTableJp[i].pKbdTableOEM)[j].OemSubTypeStr));
+ }
+#endif
+ return;
+ }
+#endif
+
+ for ( i = 0 ;
+ (KbdNlsTable[i].Country != Ctry) && KbdNlsTable[i+1].Country ;
+ i++ );
+
+ if (SesGrp->KeyboardType == OS2SS_AT_KBD)
+ {
+ pKbdType = &KbdNlsTable[i].AtTable;
+ Ow2MiscFlags = 0;
+ } else if (SesGrp->KeyboardType == OS2SS_ENNEW_KBD)
+ {
+ pKbdType = &KbdNlsTable[i].EnNewTable;
+ Ow2MiscFlags = EnhancedKbd;
+ } else // OS2SS_EN_KBD
+ {
+ pKbdType = &KbdNlsTable[i].EnTable;
+ Ow2MiscFlags = EnhancedKbd;
+ }
+
+ if (KbdNlsTable[i].CodePage2 == KbdCP)
+ {
+ Ow2KbdScanTable = pKbdType->CP2Table;
+ } else
+ {
+ // use CodePage 1 as the default
+
+ Ow2KbdScanTable = pKbdType->CP1Table;
+ }
+
+#if DBG
+ IF_OS2_DEBUG2( OS2_EXE, KBD )
+ {
+ KdPrint(("KbdSetTable: Country %d, CP %u, Type %s\n",
+ KbdNlsTable[i].Country,
+ (KbdNlsTable[i].CodePage2 == KbdCP) ? KbdCP : KbdNlsTable[i].CodePage1,
+ (SesGrp->KeyboardType == OS2SS_AT_KBD) ? "AT" :
+ ((SesGrp->KeyboardType == OS2SS_ENNEW_KBD) ? "EN-NEW" : "EN")));
+ }
+#endif
+
+ return;
+}
+
+
+DWORD
+KbdInitForNLS(
+ IN ULONG KbdCP
+ )
+{
+ SesGrp->KbdCP = KbdCP;
+ KbdQueue->Cp = (USHORT)KbdCP;
+ KbdSetTable(KbdCP);
+ return (NO_ERROR);
+}
+
+
+DWORD
+KbdNewCp( IN ULONG CodePage)
+{
+ DWORD Rc = NO_ERROR;
+
+#ifdef DBCS
+// MSKK Apr.16.1993 V-AkihiS
+ ULONG CPTmp;
+#endif
+
+#ifdef DBCS
+// MSKK Apr.16.1993 V-AkihiS
+ CPTmp = CodePage ? CodePage : SesGrp->PrimaryCP;
+#endif
+ if (SesGrp->KbdCP != CodePage)
+ {
+#ifdef DBCS
+// MSKK Apr.16.1993 V-AkihiS
+ Rc = !SetConsoleCP((UINT)CPTmp);
+#else
+ Rc = !SetConsoleCP((UINT)CodePage);
+#endif
+ if (Rc)
+ {
+ ASSERT1("KbdNewCp: Cannot set ConsoelCP", FALSE);
+ } else
+ {
+ KbdQueue->Cp = (USHORT)CodePage;
+ SesGrp->KbdCP = CodePage;
+ KbdSetTable(CodePage);
+ }
+ }
+ return (Rc);
+}
diff --git a/private/os2/os2ses/kbdxlat.inc b/private/os2/os2ses/kbdxlat.inc
new file mode 100644
index 000000000..981324253
--- /dev/null
+++ b/private/os2/os2ses/kbdxlat.inc
@@ -0,0 +1,164 @@
+;; SCCSID = @(#)kbdxlat.inc 12.1 88/03/18
+
+;******************************************************************
+;*
+;* EQUATES,STRUCS & MACROS FOR ACCESSING TRANSLATE TABLE FIELDS.
+;*
+
+MaxAct Equ 15h ;Highest Action number allowed in Action field.
+AT Equ 00h ; AT Keyboard
+EN Equ 01h ; ENhanced Keyboard
+
+ifdef JAPAN
+; MSKK Aug.04.1993 V-AKihiS
+; BUGBUG - should investigate OEM ID and OEM keyboard type of other keyboards.
+ JP_OEM Equ 10h ; Japan OEMs reserved keyboard ID.
+;;;; JP_OEM Equ 01h ; Japan OEMs reserved keyboard ID.
+OEM_AX Equ 00h ; OEMs ID (0=AX maker)
+AX_DESKTOP Equ 01h ; AX desktop type keyboard.
+endif
+
+
+;******************************************************************
+;* *
+;* EQUATES & STRUCS FOR ACCESSING TRANSLATE TABLE FIELDS. *
+;* *
+;***** *
+;* The KeyDef Structure: *
+;******
+KDef Struc ;Structure definition for a XlateTable KeyDef entry.
+ XlateOp dw 0 ;Accent flags & Action number.
+ Char1 db 0 ;Usually the unshifted character for a key.
+ Char2 db 0 ;Usually the left/right/Caps shifted char for a key.
+ Char3 db 0 ;Usually the Alt-Graphics shift char for a key.
+ Char4 db 0 ;Only used by a couple of keytypes.
+ Char5 db 0 ;Only used by a one of keytype (14h)
+KDef Ends
+KDefLen Equ Size KDef
+
+;*****
+;* Structure of the Translate Table itself.
+;*****
+Header Struc
+
+ ; Following is the Xlate Table Header:
+
+ XT_CP dw ? ;The translate table code page value.
+ XTFlags1 dw ? ;First flagword (use equates below for access).
+ XTFlags2 dw ? ;Second flagword.
+ XTKbdType dw ? ;FUTURE (keyboard type that uses this table).
+ XTKbdSubType dw ? ;FUTURE (keyboard sub-type that uses this table).
+ XTLength dw ? ;Length of table in bytes.
+ XTEntryCount dw 127 ;Number of scan codes (= keydef entries).
+ XTEntryWidth dw 7 ;Width of each entry.
+ XTCountry dw 'US' ;@@ Language this table represents.
+ XTTableID dw 1 ;@@ DCR031/PTM1730, added for use by Winthorne.
+ XTSubCountry db ' ' ;&& DCR #17 Add kbd kayout ID
+ XTRes dw 8 dup(?) ;&& RESERVED words (changed from 11, see
+ ;&& above).
+Header Ends
+HeaderLen Equ Size Header
+
+;*****
+;* The Accent Entry Structure:
+;*****
+AccEntry Struc ;Definition for entries in the AccentTable below.
+ NonAcChar db 0 ;Char code to pass when next char isn't accented.
+ NonAcScan db 0 ;Scan " " " " " " " "
+ CtlAcChar db 0 ;Char code to pass on Ctl-[accent key] keystroke.
+ CtlAcScan db 0 ;Scan " " " " " "
+ AltAcChar db 0 ;Char code to pass on Atl-[accent key] keystroke.
+ AltAcScan db 0 ;Scan " " " " " "
+;20 pairs of "from"(chars to be accented) and "to"(result char) values:
+ AcMap1 db 0 ;
+ db 0 ;
+ AcMap2 db 0 ;
+ db 0 ;
+ AcMap3 db 0 ;
+ db 0 ;
+ AcMap4 db 0 ;
+ db 0 ;
+ AcMap5 db 0 ;
+ db 0 ;
+ AcMap6 db 0 ;
+ db 0 ;
+ AcMap7 db 0 ;
+ db 0 ;
+ AcMap8 db 0 ;
+ db 0 ;
+ AcMap9 db 0 ;
+ db 0 ;
+ AcMap10 db 0 ;
+ db 0 ;
+ AcMap11 db 0 ;
+ db 0 ;
+ AcMap12 db 0 ;
+ db 0 ;
+ AcMap13 db 0 ;
+ db 0 ;
+ AcMap14 db 0 ;
+ db 0 ;
+ AcMap15 db 0 ;
+ db 0 ;
+ AcMap16 db 0 ;
+ db 0 ;
+ AcMap17 db 0 ;
+ db 0 ;
+ AcMap18 db 0 ;
+ db 0 ;
+ AcMap19 db 0 ;
+ db 0 ;
+ AcMap20 db 0 ;
+ db 0 ;
+AccEntry Ends ;
+AccEntryLen Equ Size AccEntry ;
+
+;*****
+;* Structure of the Translate Table itself.
+;*****
+XTSTRUC Struc
+ XTHead db HeaderLen dup(?)
+ ;@@ Following are the key definitions themselves.
+
+ KDefs db 127*KDefLen dup (?) ;The keydefs.
+
+ ;@@ Following are the accent entries.
+
+ Accents db 7*46 dup (?) ;The accent entries.
+
+XTSTRUC Ends
+
+;********
+;* AccEnt - Accent Entry Macro:
+;********
+
+AccEnt Macro PARMS
+.xlist
+ AccEntry <PARMS>
+.list
+ Endm
+
+;********
+;* KeyDef - Key definition entry macro:
+;********
+
+KeyDef Macro f,g1,g2,g3,g4,g5,g6,g7,a,b,c,d,e
+.erre f LE MaxAct ;Error if Action number is too big.
+z = g7*8000h+g6*4000h+g5*2000h+g4*1000h+g3*800h+g2*400h+g1*200h+f
+.xlist
+ KDef <z,&a,&b,&c,&d,&e>
+.list
+ Endm
+
+;*******
+;* XtHeader - Header definition Macro:
+;*******
+
+XtHeader Macro cp,a,b,c,d,e,f,g,h,i,kb,l,cc,cs ;&& DCR #17 - Machine
+z = i*256+h*128+g*64+f*32+e*16+d*8+c*4+b*2+a ;&& flag added and CS
+ Header <&cp,z,,&kb,,&l,,,cc,,cs> ;&& for subcountryID
+ Endm
+
+; *
+;***** END OF TRANSLATE TABLE DEFINITIONS ****************
+
diff --git a/private/os2/os2ses/makefile b/private/os2/os2ses/makefile
new file mode 100644
index 000000000..6ee4f43fa
--- /dev/null
+++ b/private/os2/os2ses/makefile
@@ -0,0 +1,6 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+!INCLUDE $(NTMAKEENV)\makefile.def
diff --git a/private/os2/os2ses/mon.h b/private/os2/os2ses/mon.h
new file mode 100644
index 000000000..eca918589
--- /dev/null
+++ b/private/os2/os2ses/mon.h
@@ -0,0 +1,82 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ mon.h
+
+Abstract:
+
+ Prototypes for functions & macros in monrqust.c
+
+Author:
+
+ Michael Jarus (mjarus) 2-Feb-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+/*
+ * Table for all (registered) monitor buffers
+ * <ProcessId>+<Buffer> must be unique.
+ */
+
+typedef struct _MON_BUFFER_TABLE
+{
+ PMON_HEADER MonHeader;
+ ULONG ProcessId;
+ PVOID Buffer;
+} MON_BUFFER_TABLE, *PMON_BUFFER_TABLE;
+
+#define MON_BUFFER_TABLE_SIZE 30
+
+MON_BUFFER_TABLE MonBuffTable[MON_BUFFER_TABLE_SIZE];
+
+/*
+ * Find/Add/Delete a Buffer in/to/from the monitor-buffer-table
+ */
+
+DWORD FindMonitorBuffer(IN PVOID Buffer,
+ IN ULONG ProcessId);
+
+DWORD AddMonitorBuffer(IN PVOID Buffer,
+ IN PMON_HEADER MonHeader,
+ IN ULONG ProcessId);
+
+DWORD DelMonitorBuffer(IN PMON_HEADER MonHeader);
+
+/*
+ * Add/Remove the monitor-queue to/from the device chain
+ */
+
+DWORD AddMonitor(IN PMON_HEADER NewMonHeader,
+ IN PMON_HEADER *pMonQueue);
+
+DWORD RemoveMonitor(IN PMON_HEADER OldMonHeader,
+ IN PMON_HEADER *pMonQueue);
+
+/*
+ * Mon internal functions to serve the client requsets.
+ */
+
+DWORD MonOpen(IN MONDEVNUMBER DevType,
+ OUT PHANDLE hMon);
+
+DWORD MonReg(IN PMON_REG MonReg);
+
+DWORD MonRead(IN OUT PMON_RW rwParms,
+ OUT PULONG pReply,
+ IN PVOID pMsg);
+
+DWORD MonWrite(IN PMON_RW rwParms,
+ OUT PULONG pReply,
+ IN PVOID pMsg);
+
+DWORD MonClose(IN HANDLE hMon);
+
diff --git a/private/os2/os2ses/monrqust.c b/private/os2/os2ses/monrqust.c
new file mode 100644
index 000000000..08c260829
--- /dev/null
+++ b/private/os2/os2ses/monrqust.c
@@ -0,0 +1,793 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ monrqust.c
+
+Abstract:
+
+ This module contains the Mon requests thread and
+ the handler for Mon requests.
+
+Author:
+
+ Michael Jarus (mjarus) 21-Jan-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#include "monitor.h"
+#include "mon.h"
+#include <stdio.h>
+
+
+USHORT RegSize[] = { MIN_KBD_MON_BUFFER, 127 };
+USHORT RWSize[] = { sizeof(KBD_MON_PACKAGE),
+ sizeof(MOU_MON_PACKAGE) };
+
+extern CRITICAL_SECTION QueueInputCriticalSection;
+
+DWORD
+MonQueueClose(IN HANDLE hMon);
+
+DWORD
+InitMonitor()
+{
+ RtlZeroMemory(&MonBuffTable[0].MonHeader, sizeof(MonBuffTable));
+ MonQueue = NULL;
+
+ MonitorEvent = CreateEventW(
+ NULL,
+ FALSE, /* auto reset */
+ TRUE,
+ NULL);
+
+ if (MonitorEvent == NULL)
+ {
+#if DBG
+ DbgPrint("OS2SES(InitMonitor): unable to create event for Monitor\n");
+#endif
+ return 1L;
+ }
+
+ KbdLastKeyDown = FALSE;
+
+ LastKbdMon = NULL;
+ LastMouMon = NULL;
+
+ return(0L);
+}
+
+
+BOOL
+ServeMonRequest(IN PMONREQUEST PReq,
+ OUT PVOID PStatus,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+ DWORD Rc;
+
+ Rc = *(PDWORD) PStatus = 0;
+
+ switch (PReq->Request)
+ {
+ case MONOpen:
+ Rc = *(PDWORD) PStatus = MonOpen(PReq->d.OpenClose.MonDevice,
+ &(PReq->d.OpenClose.hMON));
+ break;
+
+ case MONReg:
+ Rc = *(PDWORD) PStatus = MonReg(&(PReq->d.Reg));
+ break;
+
+ case MONRead:
+ Rc = *(PDWORD) PStatus = MonRead(&(PReq->d.rwParms),
+ pReply,
+ pMsg);
+ break;
+
+ case MONWrite:
+ Rc = *(PDWORD) PStatus = MonWrite(&(PReq->d.rwParms),
+ pReply,
+ pMsg);
+ break;
+
+ case MONClose:
+ Rc = *(PDWORD) PStatus = MonClose(PReq->d.OpenClose.hMON);
+ break;
+
+ default:
+ Rc = *(PDWORD) PStatus = ERROR_MON_INVALID_PARMS;
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ DbgPrint("OS2SES(MonRequest): Unknown Mon request = %X\n",
+ PReq->Request);
+ }
+#endif
+ }
+
+ return(TRUE); // Continue
+}
+
+
+DWORD
+MonOpen(IN MONDEVNUMBER DevType,
+ OUT PHANDLE hMon)
+{
+ DWORD Rc;
+
+ /*
+ * allocate buffer for header & queue
+ */
+
+ if (DevType == KbdDevice)
+ {
+ Rc = InitQueue((PKEY_EVENT_QUEUE *)hMon);
+ } else if (DevType == MouseDevice)
+ {
+ Rc = InitMouQueue((PMOU_EVENT_QUEUE *)hMon);
+ } else /* if (DevType == Lpt1Device) */
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ IF_OD2_DEBUG( OS2_EXE )
+ DbgPrint("OS2SES(MonOpen): illegal device\n");
+#endif
+
+ return(ERROR_MONITOR_NOT_SUPPORTED);
+ }
+
+ if (Rc)
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonOpen): unable to allocate handle\n");
+#endif
+
+ return(ERROR_NOT_ENOUGH_MEMORY);
+ }
+
+ ((PKEY_EVENT_QUEUE)*hMon)->MonHdr.DevType = DevType;
+ ((PKEY_EVENT_QUEUE)*hMon)->MonHdr.MonStat = MON_STAT_OPEN; // Mon-Open
+ ((PKEY_EVENT_QUEUE)*hMon)->MonHdr.NextMon = NULL;
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ DbgPrint("OS2SES(MonOpen): return address %lx\n", *hMon);
+ }
+#endif
+
+ return(0L);
+}
+
+
+DWORD
+MonReg(IN PMON_REG MonReg)
+{
+ DWORD Rc;
+ BOOL NewReg = FALSE;
+ PMON_HEADER NextMon, NewMonHeader;
+ PKEY_EVENT_QUEUE hMon;
+
+ /*
+ * make sure buffer are not used for other monitor
+ */
+
+ if ((FindMonitorBuffer(MonReg->In, MonReg->ProcessId)) ||
+ (FindMonitorBuffer(MonReg->Out, MonReg->ProcessId)))
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonReg): buffer already reg\n");
+#endif
+
+ return ERROR_MON_INVALID_PARMS;
+ }
+
+ hMon = (PKEY_EVENT_QUEUE)MonReg->hMON;
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ DbgPrint("OS2SES(MonReg): hMon address %lx\n", hMon);
+ }
+#endif
+
+ if ((MonReg->InSize < RegSize[hMon->MonHdr.DevType]) ||
+ (MonReg->OutSize < RegSize[hMon->MonHdr.DevType]))
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonReg): buffer too small\n");
+#endif
+
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ if (hMon->MonHdr.MonStat != MON_STAT_OPEN)
+ {
+ /*
+ * queue in use, allocate new one
+ */
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ DbgPrint("OS2SES(MonReg): allocate new queue\n");
+ }
+#endif
+
+ NewReg = TRUE;
+
+ if ((Rc = MonOpen(hMon->MonHdr.DevType,
+ (PHANDLE)&NewMonHeader)))
+ {
+#if DBG
+ DbgPrint("OS2SES(MonReg): unable to allocate handle\n");
+#endif
+ return Rc;
+ }
+
+ NextMon = (PMON_HEADER)hMon;
+
+ while (NextMon->NextMon != NULL)
+ {
+ NextMon = NextMon->NextMon;
+ }
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ DbgPrint("OS2SES(MonReg): find place\n");
+ }
+#endif
+
+ } else
+ NewMonHeader = (PMON_HEADER)hMon;
+
+ NewMonHeader->MonReg = *MonReg;
+
+ /*
+ * add monitor to the device-queue
+ */
+
+ Rc = AddMonitor(NewMonHeader, (PMON_HEADER *)
+ ((NewMonHeader->DevType == KbdDevice) ?
+ (PMON_HEADER *) &KbdMonQueue : (PMON_HEADER *) &MouMonQueue));
+
+ if (Rc)
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonReg): unable to register\n");
+#endif
+
+ if (NewReg)
+ {
+ HeapFree(HandleHeap, 0,
+ (LPSTR) NewMonHeader->MemoryStartAddress);
+ }
+
+ return(Rc);
+ }
+
+ /*
+ * add buffer to table of monitor-buffer
+ */
+
+ AddMonitorBuffer(MonReg->In, NewMonHeader, MonReg->ProcessId);
+ AddMonitorBuffer(MonReg->Out, NewMonHeader, MonReg->ProcessId);
+
+ NewMonHeader->MonStat = MON_STAT_REG; // Mon-Open-And-Reg
+
+ if (NewReg)
+ {
+ NextMon->NextMon = NewMonHeader;
+ }
+
+ MonReg->InSize = RWSize[NewMonHeader->DevType];
+ MonReg->OutSize = RWSize[NewMonHeader->DevType];
+
+ return(0L);
+}
+
+
+DWORD
+MonRead(IN OUT PMON_RW rwParms,
+ OUT PULONG pReply,
+ IN PVOID pMsg)
+{
+ PMON_HEADER MonHeader;
+ USHORT Length = 0;
+ DWORD MonBuf, Rc;
+
+ /*
+ * check legalty of BUFFER-In, Size of DataBuffer and Monitor state
+ */
+
+ if (!(MonBuf = FindMonitorBuffer(rwParms->MonBuffer, rwParms->ProcessId)) ||
+ (MonBuf == -1L))
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonRead): unable to find buffer\n");
+#endif
+
+ return(ERROR_MON_INVALID_PARMS);
+ }
+
+ MonHeader = (PMON_HEADER)MonBuf;
+
+ if (MonHeader->MonReg.In != rwParms->MonBuffer)
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonRead): illegal monitor buffer\n");
+#endif
+
+ return(ERROR_MON_INVALID_PARMS);
+ }
+
+ if (rwParms->Length < RWSize[MonHeader->DevType])
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonRead): buffer too small\n");
+#endif
+
+ return(ERROR_MON_BUFFER_TOO_SMALL);
+ }
+
+ if (MonHeader->MonStat != MON_STAT_REG)
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonRead): state not ok\n");
+#endif
+
+ //ASSERT(FALSE);
+
+// return(ERROR_MON_INVALID_PARMS);
+ }
+
+ /*
+ * read event if available
+ */
+
+ MonHeader->MonStat = MON_STAT_READ;
+
+ Rc = GetMonInput(
+ RWSize[MonHeader->DevType],
+ (PKEY_EVENT_QUEUE)MonHeader,
+ rwParms,
+ pMsg,
+ pReply
+ );
+
+ if ( *pReply != 0 )
+ {
+ MonHeader->MonStat = MON_STAT_REG;
+ }
+
+ return (Rc);
+}
+
+
+DWORD
+MonWrite(IN PMON_RW rwParms,
+ OUT PULONG pReply,
+ IN PVOID pMsg)
+{
+ PMON_HEADER MonHeader;
+ USHORT Length = 0;
+ DWORD MonBuf, Rc;
+
+ UNREFERENCED_PARAMETER(pMsg);
+ UNREFERENCED_PARAMETER(pReply);
+
+ /*
+ * check legalty of BUFFER-Out, Size of DataBuffer and Monitor state
+ */
+
+ if (!(MonBuf = FindMonitorBuffer(rwParms->MonBuffer, rwParms->ProcessId)) ||
+ (MonBuf == -1L))
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonWrite): unable to find buffer\n");
+#endif
+
+ return(ERROR_MON_INVALID_PARMS);
+ }
+
+ MonHeader = (PMON_HEADER)MonBuf;
+
+ if (MonHeader->MonReg.Out != rwParms->MonBuffer)
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonWrite): illegal monitor buffer\n");
+#endif
+
+ return(ERROR_MON_INVALID_PARMS);
+ }
+
+ if (rwParms->Length < RWSize[MonHeader->DevType])
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonWrite): buffer too small\n");
+#endif
+
+ return(ERROR_MON_INVALID_PARMS);
+ }
+
+ if (rwParms->Length > RWSize[MonHeader->DevType]) // BUGBUG
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonWrite): buffer too big\n");
+#endif
+
+ return(ERROR_MON_DATA_TOO_LARGE);
+ }
+
+ if (MonHeader->MonStat == MON_STAT_OPEN)
+ {
+#if DBG
+ IF_OD2_DEBUG( MON )
+ DbgPrint("OS2SES(MonWrite): state not ok\n");
+#endif
+
+ return(ERROR_MON_INVALID_PARMS);
+ }
+
+ /*
+ * write event
+ */
+
+#if DBG
+ IF_OD2_DEBUG( MON )
+ {
+ DbgPrint("OS2SES(MonWrite): (before) from queue %lx, to queue %lx\n",
+ MonHeader, MonHeader->NextQueue );
+ }
+#endif
+
+ Rc = PutMonInput(
+ RWSize[MonHeader->DevType],
+ (PKEY_EVENT_QUEUE)MonHeader->NextQueue,
+ 1,
+ //rwParms,
+ (PKBD_MON_PACKAGE)&(rwParms->ioBuff[0]),
+ pMsg,
+ pReply);
+
+ // BUGBUG if not enough place
+
+ return( Rc );
+}
+
+
+DWORD
+MonClose(IN HANDLE hMon)
+{
+ PMON_HEADER NextMon, MonHeader = (PMON_HEADER)hMon;
+
+ while (MonHeader)
+ {
+ NextMon = MonHeader->NextMon;
+ MonQueueClose((HANDLE)MonHeader);
+ MonHeader = NextMon;
+ }
+
+ return(0L);
+}
+
+
+DWORD
+MonQueueClose(IN HANDLE hMon)
+{
+ PMON_HEADER MonHeader = (PMON_HEADER)hMon;
+
+ if (MonHeader->MonStat >= MON_STAT_REG)
+ {
+ /*
+ * Monitor are reg - DeReg :
+ * remove monitor & delete entried in table
+ */
+
+ RemoveMonitor(MonHeader, (PMON_HEADER *)
+ ((MonHeader->DevType == KbdDevice) ?
+ (PMON_HEADER *) &KbdMonQueue :
+ (PMON_HEADER *) &MouMonQueue));
+
+ DelMonitorBuffer(MonHeader);
+ }
+
+ /*
+ * Free header from heap
+ */
+
+ HeapFree(HandleHeap, 0,
+ (LPSTR) MonHeader->MemoryStartAddress);
+
+ return(0L);
+}
+
+
+DWORD
+FindMonitorBuffer(IN PVOID Buffer,
+ IN ULONG ProcessId)
+{
+ ULONG i, FreeCount = 0;
+
+ for ( i = 0 ; i < MON_BUFFER_TABLE_SIZE ; i++ )
+ {
+ if ((MonBuffTable[i].Buffer == Buffer) &&
+ (MonBuffTable[i].ProcessId == ProcessId))
+ {
+ return((DWORD)MonBuffTable[i].MonHeader);
+ } else if (!MonBuffTable[i].Buffer)
+ {
+ FreeCount++;
+ }
+
+ }
+
+ if (FreeCount < 2)
+ {
+ return((DWORD)-1L); // no place for new 2 buffers
+ }
+
+ return(0L);
+}
+
+
+DWORD
+AddMonitorBuffer(IN PVOID Buffer,
+ IN PMON_HEADER MonHeader,
+ IN ULONG ProcessId)
+{
+ ULONG i, FindCount = 0;
+
+ for ( i = 0 ; i < MON_BUFFER_TABLE_SIZE ; i++ )
+ {
+ if (!MonBuffTable[i].Buffer)
+ {
+ MonBuffTable[i].Buffer = Buffer;
+ MonBuffTable[i].MonHeader = MonHeader;
+ MonBuffTable[i].ProcessId = ProcessId;
+
+ return((DWORD)MonBuffTable[i].MonHeader);
+ }
+ }
+
+ ASSERT( FALSE );
+
+ return(0L);
+}
+
+
+DWORD
+DelMonitorBuffer(IN PMON_HEADER MonHeader)
+{
+ ULONG i, FindCount = 0;
+
+ for ( i = 0 ; i < MON_BUFFER_TABLE_SIZE ; i++ )
+ {
+ if (MonBuffTable[i].MonHeader == MonHeader)
+ {
+ RtlZeroMemory(&(MonBuffTable[i]), sizeof(MON_BUFFER_TABLE));
+ FindCount++;
+ }
+ }
+
+ ASSERT( FindCount == 2 );
+
+ return(0L);
+}
+
+
+DWORD
+NewKbdQueue(IN PKEY_EVENT_QUEUE NewKbdQueue)
+{
+
+ if (WaitForSingleObject( MonitorEvent, INFINITE ))
+ {
+ return(ERROR_MONITOR_NOT_SUPPORTED);
+ }
+
+ if (LastKbdMon != NULL)
+ {
+ LastKbdMon->MonHdr.NextQueue = (PMON_HEADER)NewKbdQueue;
+ } else
+ KbdMonQueue = NewKbdQueue;
+
+ SetEvent( MonitorEvent );
+
+ return(0L);
+}
+
+
+DWORD AddMonitor(IN PMON_HEADER NewMonHeader,
+ IN PMON_HEADER *pMonQueue)
+{
+ PMON_HEADER MonHeader, LastMonHeader = NULL;
+ USHORT Index;
+#if DBG
+ PMON_HEADER DbgMonHeader;
+#endif
+
+ /*
+ * Positioning in chain
+ * --------------------
+ * 1st registered as FIRST
+ * ...
+ * last registered as FIRST
+ * last registered as DEFAULT
+ * ...
+ * 1st registered as DEFAULT
+ * last registered as END
+ * ...
+ * 1st registered as END
+ */
+
+ if (NewMonHeader->MonReg.Pos > MONITOR_END)
+ {
+ /*
+ * ignore MONITOR_SPECIAL
+ */
+
+ NewMonHeader->MonReg.Pos -= 3;
+ NewMonHeader->Flag = 1;
+ }
+
+ /*
+ * Translate Position:
+ * FIRST = 0
+ * DEFAULT = 1
+ * END = 2
+ * device (kbd/mouse) = 3
+ *
+ * when looking for the place, DEFAULT is assign also to FIRST
+ */
+
+ if (NewMonHeader->MonReg.Pos < MONITOR_END)
+ {
+ /*
+ * XOR MONITOR_FIRST & MONITOR_DEFAULT
+ */
+
+ NewMonHeader->MonReg.Pos = 1 - NewMonHeader->MonReg.Pos;
+ }
+
+ Index = (USHORT)NewMonHeader->MonReg.Pos;
+
+ if (Index == 0)
+ {
+ Index = 1; // last FIRST is equivalent to 1st DEFAULT
+ }
+
+ if (WaitForSingleObject( MonitorEvent, INFINITE ))
+ {
+ return(ERROR_MONITOR_NOT_SUPPORTED);
+ }
+
+ MonHeader = *pMonQueue;
+
+ /*
+ * find the place in chain
+ */
+
+ while (MonHeader->MonReg.Pos < (ULONG)Index)
+ {
+ LastMonHeader = MonHeader;
+ MonHeader = MonHeader->NextQueue;
+
+ }
+
+ NewMonHeader->NextQueue = MonHeader;
+
+ if (LastMonHeader == NULL)
+ {
+ NewMonHeader->NextQueue = *pMonQueue;
+ *pMonQueue = NewMonHeader;
+ } else
+ {
+ NewMonHeader->NextQueue = LastMonHeader->NextQueue;
+ LastMonHeader->NextQueue = NewMonHeader;
+ }
+
+ if ((MonHeader->MonReg.Pos == 3) && // we add the last queue in chain for Kbd
+ (*pMonQueue == (PMON_HEADER)KbdMonQueue ))
+ {
+ LastKbdMon = (PKEY_EVENT_QUEUE)NewMonHeader;
+ }
+
+ SetEvent( MonitorEvent );
+
+#if DBG
+ DbgMonHeader = *pMonQueue;
+
+ IF_OD2_DEBUG( MON )
+ {
+ while (DbgMonHeader->NextQueue)
+ {
+ DbgPrint("OS2SES(AddMonitor): Current %lx, next %lx\n", DbgMonHeader, DbgMonHeader->NextQueue);
+
+ DbgMonHeader = DbgMonHeader->NextQueue;
+ }
+
+ DbgPrint("OS2SES(MonReg): %lx ... %lx, (%lx) %lx, %lx (%lx) ... %lx, %lx\n",
+ KbdMonQueue, LastMonHeader,
+ (LastMonHeader) ? LastMonHeader->NextQueue : NULL,
+ NewMonHeader, NewMonHeader->NextQueue, MonHeader, LastKbdMon, KbdQueue);
+ }
+#endif
+
+ return(0L);
+}
+
+
+DWORD
+RemoveMonitor(IN PMON_HEADER OldMonHeader,
+ IN PMON_HEADER *pMonQueue)
+{
+ PMON_HEADER MonHeader, LastMonHeader = NULL;
+
+ if (WaitForSingleObject( MonitorEvent, INFINITE ))
+ {
+ return(ERROR_MONITOR_NOT_SUPPORTED);
+ }
+
+ MonHeader = *pMonQueue;
+
+ /*
+ * find the place in chain
+ */
+
+ while (MonHeader != NULL && MonHeader != OldMonHeader)
+ {
+ LastMonHeader = MonHeader;
+ MonHeader = MonHeader->NextQueue;
+ }
+
+ if (MonHeader == NULL)
+ {
+ return(0);
+ }
+
+ if (LastMonHeader == NULL)
+ {
+ *pMonQueue = MonHeader->NextQueue;
+ } else
+ LastMonHeader->NextQueue = MonHeader->NextQueue;
+
+ if ((OldMonHeader->NextQueue->MonReg.Index == 3) && // we remove the last queue in chain for Kbd
+ (*pMonQueue == (PMON_HEADER)KbdMonQueue ))
+ {
+ if (LastMonHeader == NULL)
+ {
+ LastKbdMon = NULL;
+ } else
+ LastKbdMon = (PKEY_EVENT_QUEUE)LastMonHeader;
+ }
+
+ SetEvent( MonitorEvent );
+
+ return(0L);
+}
diff --git a/private/os2/os2ses/mou.h b/private/os2/os2ses/mou.h
new file mode 100644
index 000000000..39144c09e
--- /dev/null
+++ b/private/os2/os2ses/mou.h
@@ -0,0 +1,28 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ mou.h
+
+Abstract:
+
+ Prototypes for functions & macros in mourqust.c
+
+Author:
+
+ Michael Jarus (mjarus) 27-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+
+DWORD
+MouReaderThread(IN PMOU_EVENT_QUEUE MonQueue);
+
diff --git a/private/os2/os2ses/mourqust.c b/private/os2/os2ses/mourqust.c
new file mode 100644
index 000000000..37359e88a
--- /dev/null
+++ b/private/os2/os2ses/mourqust.c
@@ -0,0 +1,235 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ mourqust.c
+
+Abstract:
+
+ This module contains the Mou requests thread and
+ the handler for Mou requests.
+
+Author:
+
+ Michael Jarus (mjarus) 23-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#include "mou.h"
+#include <stdio.h>
+
+#if DBG
+BYTE ServeMouRequestStr[] = "ServeMouRequest";
+#endif
+
+DWORD
+GetOs2MouEventIntoQueue();
+
+VOID
+Ow2MouOn();
+
+VOID
+Ow2MouOff();
+
+BOOL
+ServeMouRequest(IN PMOUREQUEST PReq,
+ OUT PVOID PStatus,
+ IN PVOID pMsg,
+ OUT PULONG pReply)
+{
+// COORD dwMousePosition;
+ DWORD Rc, NumEvent;
+ MOUEVENTINFO MouEvent;
+
+ UNREFERENCED_PARAMETER(pMsg);
+
+ Rc = *(PDWORD) PStatus = 0;
+ switch (PReq->Request)
+ {
+ case MOUOpen:
+ if (!MouNumber)
+ {
+ Ow2MouOn();
+ }
+ MouNumber++;
+ break;
+
+ case MOUClose:
+ MouNumber--;
+ if (!MouNumber)
+ {
+ Ow2MouOff();
+ MouQueue->Out = MouQueue->In;
+ }
+ break;
+
+ case MOUFlushQue:
+ Or2WinGetNumberOfConsoleInputEvents(
+ #if DBG
+ ServeMouRequestStr,
+ #endif
+ hConsoleInput,
+ &NumEvent
+ );
+ while (NumEvent)
+ {
+ MouQueue->Out = MouQueue->In;
+
+ GetOs2MouEvent( MOU_NOWAIT,
+ &MouEvent,
+ pMsg,
+ pReply);
+
+ MouQueue->Out = MouQueue->In;
+
+ Or2WinGetNumberOfConsoleInputEvents(
+ #if DBG
+ ServeMouRequestStr,
+ #endif
+ hConsoleInput,
+ &NumEvent
+ );
+ }
+ break;
+
+ case MOUGetNumQueEl:
+ GetOs2MouEventIntoQueue();
+ PReq->d.NumEvent.cEvents = (USHORT)((MouQueue->In >= MouQueue->Out) ?
+ (MouQueue->In - MouQueue->Out) :
+ (MouQueue->End - MouQueue->Out) +
+ (MouQueue->In - &(MouQueue->Event[0])) + (USHORT) 1);
+
+ PReq->d.NumEvent.cmaxEvents = MOUSE_QUEUE_LENGTH - 1;
+ break;
+
+ case MOUGetEventMask:
+ PReq->d.Setup = MouEventMask;
+ break;
+
+ case MOUSetEventMask:
+ if (PReq->d.Setup & ~OS2_MOUSE_LEGAL_EVENT_MASK)
+ Rc = *(PDWORD) PStatus = ERROR_MOUSE_INV_PARMS;
+ else
+ MouEventMask = PReq->d.Setup;
+ break;
+
+ case MOUGetNumButtons:
+ Rc = !Or2WinGetNumberOfConsoleMouseButtons(
+ #if DBG
+ ServeMouRequestStr,
+ #endif
+ &PReq->d.Setup
+ );
+ break;
+
+ case MOUReadEventQue:
+ RtlZeroMemory(&PReq->d.MouInfo, sizeof(MOUEVENTINFO));
+ Rc = *(PDWORD) PStatus = GetOs2MouEvent(PReq->fWait,
+ &PReq->d.MouInfo,
+ pMsg,
+ pReply);
+ break;
+
+ case MOUGetDevStatus:
+ PReq->d.Setup = MouDevStatus;
+ break;
+
+ case MOUGetScaleFact:
+ PReq->d.ScalFact.rowScale = 1;
+ PReq->d.ScalFact.colScale = 1;
+ break;
+
+ case MOUGetNumMickeys:
+ PReq->d.Setup = 80;
+ break;
+
+ case MOUGetPtrPos:
+ PReq->d.Loc = MouPtrLoc;
+ break;
+
+ case MOUSetDevStatus:
+ if (PReq->d.Setup & ~(MOUSE_DISABLED | MOUSE_MICKEYS))
+ {
+ Rc = *(PDWORD) PStatus = ERROR_MOUSE_INV_PARMS;
+ } else
+ {
+ if ((MouDevStatus = PReq->d.Setup) & MOUSE_DISABLED)
+ {
+ MouQueue->Out = MouQueue->In;
+ }
+ }
+ break;
+
+ case MOUGetPtrShape:
+ PReq->d.Shape.cb = 4;
+ PReq->d.Shape.col = 1;
+ PReq->d.Shape.row = 1;
+ PReq->d.Shape.colHot = 1;
+ PReq->d.Shape.rowHot = 1;
+ // we return the default mask of OS/2 (0xffff, 0x7700) after the lpc
+ break;
+
+ case MOUDrawPtr:
+ case MOURemovePtr:
+ case MOUSetPtrPos:
+ case MOUSetPtrShape:
+ case MOUSetScaleFact:
+ break;
+
+ default:
+ *(PDWORD) PStatus = (DWORD)-1L; //STATUS_INVALID_PARAMETER;
+ Rc = 1;
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ KdPrint(("OS2SES(MouRqust): Unknown Mou request = %X\n",
+ PReq->Request));
+ }
+#endif
+ }
+
+ if ( !Rc )
+ {
+ *(PDWORD) PStatus = 0;
+ } else if (*(PDWORD) PStatus == 0)
+/* BUGBUG=> BUGBUG! error code and returned Status are wrong */
+ {
+ *(PDWORD) PStatus = GetLastError();
+ }
+ return(TRUE); // Continue
+}
+
+
+DWORD
+MouInit(IN VOID)
+{
+
+ if (InitMouQueue(&MouQueue))
+ {
+ return(TRUE);
+ }
+
+ MouMonQueue = MouQueue;
+
+ MouNumber = 0;
+ MouLastEvent = 0;
+ MouEventMask = OS2_MOUSE_DEAFULT_EVENT_MASK;
+ MouDevStatus = 0;
+
+ MouPtrLoc.row = MouPtrLoc.col = 0;
+
+ return(FALSE);
+}
+
diff --git a/private/os2/os2ses/nls.c b/private/os2/os2ses/nls.c
new file mode 100644
index 000000000..f3a4d3ef4
--- /dev/null
+++ b/private/os2/os2ses/nls.c
@@ -0,0 +1,349 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ nls.c
+
+Abstract:
+
+ This module contains the support for NLS
+
+Author:
+
+ Michael Jarus (mjarus) 28-Jul-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#include <stdio.h>
+#include <string.h>
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "os2nls.h"
+#include "trans.h"
+#include "os2win.h"
+
+
+
+ULONG
+NlsCountryToLoacle(
+ IN ULONG NlsCountryCode,
+ IN LCID *NlsLocaleID
+ );
+
+#if DBG
+BYTE NLSInitStr[] = "NLSInit";
+#endif
+
+DWORD
+NLSInit()
+{
+ ULONG i, Win32LCID, CurrentVioCP, CurrentKbdCP;
+ USHORT LocaleLang;
+
+ /*
+ * Get Current Console CP
+ */
+
+ CurrentVioCP = (ULONG)Or2WinGetConsoleOutputCP(
+ #if DBG
+ NLSInitStr
+ #endif
+ );
+
+ CurrentKbdCP = (ULONG)Or2WinGetConsoleCP(
+ #if DBG
+ NLSInitStr
+ #endif
+ );
+
+#ifdef DBCS
+// MSKK Jun.16.1993 V-AkihiS
+ SesGrp->DosCP = (ULONG)Or2WinGetConsoleCP(
+ #if DBG
+ NLSInitStr
+ #endif
+ );
+#endif
+
+ Win32LCID = (ULONG)Or2WinGetThreadLocale(
+ #if DBG
+ NLSInitStr
+ #endif
+ );
+
+ if ((Win32LCID != SesGrp->Win32LCID) &&
+ (SesGrp->Os2srvUseRegisterInfo ||
+ (Win32LCID != SesGrp->Os2ssLCID)))
+ {
+ /*
+ * Inherit NLS definitions from Win32
+ * We get here if the LOCALE inherit by Os2srv is different
+ * from the LOCALE inherit by the os2.exe
+ * We handle only COUNTRY and LOCALE parms. (not CP, which are equal)
+ */
+
+ //SesGrp->Win32OEMCP = GetOEMCP();
+ //SesGrp->Win32ACP = GetACP();
+ SesGrp->Win32LCID = Win32LCID;
+ SesGrp->Win32LANGID = (ULONG)Or2WinGetUserDefaultLangID(
+ #if DBG
+ NLSInitStr
+ #endif
+ );
+
+ Or2NlsGetCountryFromLocale((LCID)SesGrp->Win32LCID, &SesGrp->Win32CountryCode);
+
+ //SesGrp->PrimaryCP = SesGrp->Win32OEMCP;
+ SesGrp->CountryCode = SesGrp->Win32CountryCode;
+ SesGrp->Os2ssLCID = SesGrp->Win32LCID;
+#ifdef JAPAN
+// MSKK Nov.04.1992 V-AkihiS
+ SesGrp->LanguageID = LANG_JAPANESE;
+#else
+ SesGrp->LanguageID = LANG_ENGLISH;
+#endif
+
+ LocaleLang = PRIMARYLANGID(LANGIDFROMLCID(Win32LCID));
+ for ( i = 0 ; Or2NlsLangIdTable[i] ; i++ )
+ {
+ if (Or2NlsLangIdTable[i] == LocaleLang)
+ {
+ SesGrp->LanguageID = Or2NlsLangIdTable[i];
+ break;
+ }
+ }
+
+ /*
+ * Get CtryInfo, DBCSEv, CollateTable, CaseMapTable for the default
+ * (We don't have to update CP-depent parms since CP,s are equal)
+ */
+
+ Or2NlsGetCtryInfo(
+ (LCID)SesGrp->Os2ssLCID,
+ (UINT)SesGrp->PrimaryCP,
+ (PCOUNTRYINFO)&SesGrp->CountryInfo
+ );
+
+#if DBG
+ /*
+ * Dump specail NLS info to the debugger
+ */
+
+ IF_OD2_DEBUG( NLS )
+ {
+ KdPrint(("OS2SES(Os2-NLS): "));
+ }
+#endif
+
+ //SesGrp->VioCP = SesGrp->KbdCP = SesGrp->DosCP = SesGrp->PrimaryCP;
+ } else
+ {
+ if (Win32LCID != SesGrp->Win32LCID)
+ {
+ Or2WinSetThreadLocale(
+ #if DBG
+ NLSInitStr,
+ #endif
+ (LCID)SesGrp->Win32LCID
+ );
+ }
+#if DBG
+ /*
+ * Dump specail NLS info to the debugger
+ */
+
+ IF_OD2_DEBUG( NLS )
+ {
+ KdPrint(("OS2SES(Os2-NLS): using OS2SRV NLS definitions\n "));
+ }
+#endif
+ }
+
+#if DBG
+ /*
+ * Dump all NLS info to the debugger
+ */
+
+ IF_OD2_DEBUG( NLS )
+ {
+ KdPrint(("CP %lu (%lu,%lu), Country %lu, LangID %lx ,LCID %lx\n",
+ SesGrp->DosCP, SesGrp->PrimaryCP, SesGrp->SecondaryCP,
+ SesGrp->CountryCode, SesGrp->LanguageID, SesGrp->Os2ssLCID));
+
+ KdPrint(("OS2SES(Win32-NLS): OEMCP %lu, ACP %lu, Country %lu, LangID %lx\n",
+ SesGrp->Win32OEMCP, SesGrp->Win32ACP, SesGrp->Win32CountryCode,
+ SesGrp->Win32LANGID));
+
+ KdPrint((" LCID %lx, ConCP %lu, ConOutCP %lu\n",
+ SesGrp->Win32LCID, CurrentKbdCP, CurrentVioCP));
+ }
+#endif
+
+ /*
+ * Complete the NLS initialization for Vio and KBD
+ */
+
+ KbdInitForNLS(CurrentKbdCP);
+ VioInitForNLS(CurrentVioCP);
+
+ return (NO_ERROR);
+}
+
+
+DWORD
+Ow2NlsGetCtryInfo(
+ IN ULONG NlsCodePage,
+ IN ULONG NlsCountryCode,
+ OUT PVOID NlsCountryInfo
+ )
+{
+ ULONG Rc;
+ LCID NlsLocaleID;
+
+ Rc = NlsCountryToLoacle(
+ NlsCountryCode,
+ &NlsLocaleID
+ );
+
+ if (Rc)
+ {
+#if DBG
+ IF_OD2_DEBUG2( NLS, OS2_EXE )
+ KdPrint(("OS2SES(NlsRequest-GetCtryInfo): cannot find LocaleID Rc %lu\n",
+ Rc));
+#endif
+ return(Rc);
+ }
+
+ return (Or2NlsGetCtryInfo(
+ NlsLocaleID,
+ (UINT)NlsCodePage,
+ (PCOUNTRYINFO)NlsCountryInfo
+ ));
+}
+
+
+DWORD
+Ow2NlsGetCollateTable(
+ IN ULONG NlsCodePage,
+ IN ULONG NlsCountryCode,
+ OUT PVOID NlsColateTable
+ )
+{
+ DWORD Rc;
+ LCID NlsLocaleID;
+
+ Rc = NlsCountryToLoacle(
+ NlsCountryCode,
+ &NlsLocaleID
+ );
+
+ if (Rc)
+ {
+#if DBG
+ IF_OD2_DEBUG2( NLS, OS2_EXE )
+ KdPrint(("OS2SES(NlsRequest-GetCtryInfo): cannot find LocaleID Rc %lu\n",
+ Rc));
+#endif
+ return(Rc);
+ }
+
+ Rc = Or2NlsGetMapTable(
+ NlsLocaleID,
+ (UINT)NlsCodePage,
+ LCMAP_SORTKEY,
+ (PUCHAR)NlsColateTable
+ );
+ if (Rc)
+ {
+ Rc = GetLastError();
+#if DBG
+ IF_OD2_DEBUG2( NLS, OS2_EXE )
+ KdPrint(("OS2SES(NlsRequest-GetColateTable): Rc %lu\n",
+ Rc));
+#endif
+ }
+ return(Rc);
+}
+
+
+DWORD
+Ow2NlsGetCaseMapTable(
+ IN ULONG NlsCodePage,
+ IN ULONG NlsCountryCode,
+ OUT PVOID NlsColateTable
+ )
+{
+ DWORD Rc;
+ LCID NlsLocaleID;
+
+ Rc = NlsCountryToLoacle(
+ NlsCountryCode,
+ &NlsLocaleID
+ );
+
+ if (Rc)
+ {
+#if DBG
+ IF_OD2_DEBUG2( NLS, OS2_EXE )
+ KdPrint(("OS2SES(NlsRequest-GetCtryInfo): cannot find LocaleID Rc %lu\n",
+ Rc));
+#endif
+ return(Rc);
+ }
+
+ Rc = Or2NlsGetMapTable(
+ NlsLocaleID,
+ (UINT)NlsCodePage,
+ LCMAP_UPPERCASE,
+ (PUCHAR)NlsColateTable
+ );
+ if (Rc)
+ {
+ Rc = GetLastError();
+#if DBG
+ IF_OD2_DEBUG2( NLS, OS2_EXE )
+ KdPrint(("OS2SES(NlsRequest-GetCaseMap): Rc %lu\n",
+ Rc));
+#endif
+ }
+ return(Rc);
+}
+
+
+DWORD
+Ow2NlsGetDBCSEn(
+ IN ULONG NlsCodePage,
+ OUT PVOID NlsDBCSVec
+ )
+{
+ POD2_DBCS_VECTOR_ENTRY DBCSVec = (POD2_DBCS_VECTOR_ENTRY) NlsDBCSVec;
+
+ return(Or2NlsGetCPInfo(
+ (UINT)NlsCodePage,
+ (POD2_DBCS_VECTOR_ENTRY) NlsDBCSVec
+ ));
+}
+
+
+ULONG
+NlsCountryToLoacle(
+ IN ULONG NlsCountryCode,
+ IN LCID *NlsLocaleID
+ )
+{
+ // BUGBUG: find LocalId from CountryCode
+
+ *NlsLocaleID = (LCID) -1;
+
+ return (ERROR_NLS_NO_CTRY_CODE);
+}
+
diff --git a/private/os2/os2ses/ntinitss.c b/private/os2/os2ses/ntinitss.c
new file mode 100644
index 000000000..449c81c34
--- /dev/null
+++ b/private/os2/os2ses/ntinitss.c
@@ -0,0 +1,1650 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ ntinitss.c
+
+Abstract:
+
+ This module contains the code to establish the connection between
+ the session console process and the OS2 Emulation Subsystem.
+
+Author:
+
+ Avi Nathan (avin) 17-Jul-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#define NTOS2_ONLY
+#include "os2ses.h"
+#include "os2tile.h"
+#if PMNT
+#define INCL_32BIT
+#include "pmnt.h"
+#endif
+#include <winerror.h>
+
+#define OD2_PORT_MEMORY_SIZE 0x10000
+
+extern PVOID Od2PortHeap;
+extern ULONG Od2PortMemoryRemoteDelta;
+extern PSZ Od2PgmFilePath;
+extern HANDLE Od2PortHandle;
+
+#if PMNT
+extern ULONG PMSubprocSem32;
+extern BOOLEAN Ow2WriteBackCloseEvent();
+extern APIRET DosSemClear(ULONG hsem);
+#endif //PMNT
+
+HANDLE
+CreateEventW(
+ PVOID lpEventAttributes,
+ BOOL bManualReset,
+ BOOL bInitialState,
+ LPCWSTR lpName
+ );
+
+ULONG
+KbdInitAfterSesGrp(IN VOID);
+
+APIRET
+Od2WaitForSingleObject(
+ IN HANDLE Handle,
+ IN BOOLEAN Alertable,
+ IN PLARGE_INTEGER Timeout OPTIONAL
+ );
+
+BOOLEAN
+Od2InitCreateProcessMessage(
+ OUT PSCREQ_CREATE pCreate
+ );
+
+VOID
+Od2HandleCreateProcessRespond(
+ IN PSCREQ_CREATE pCreate
+ );
+
+VOID
+ExitThread(
+ ULONG dwExitCode
+ );
+
+APIRET
+OpenLVBsection(VOID);
+
+DWORD
+GetCurrentDirectoryW(
+ DWORD nBufferLength,
+ LPWSTR lpBuffer
+ );
+
+BOOLEAN
+InitializeSecurityDescriptor (
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD dwRevision
+ );
+
+BOOLEAN
+SetSecurityDescriptorDacl (
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ BOOLEAN bDaclPresent,
+ PACL pDacl,
+ BOOLEAN bDaclDefaulted
+ );
+
+// Defined in <winbase.h> but we can't include it in this file
+typedef struct _SECURITY_ATTRIBUTES {
+ DWORD nLength;
+ PVOID lpSecurityDescriptor;
+ BOOL bInheritHandle;
+} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
+
+BOOLEAN Ow2ExitInProcess = (BOOLEAN)FALSE;
+HANDLE hOs2Srv;
+ULONG Ow2bNewSession = 0;
+OEM_STRING Ow2CommandLineString;
+
+HANDLE CtrlDataSemaphore;
+HANDLE KbdDataSemaphore;
+HANDLE FocusSemaphore;
+HANDLE MouDataSemaphore;
+HANDLE PopUpSemaphore;
+HANDLE ScreenLockSemaphore;
+HANDLE Od2StdHandleLockHandle;
+HANDLE Od2VioWriteSemHandle;
+
+BOOLEAN Od2ReceivedSignalAtInit = FALSE;
+ULONG Od2InitSignalType;
+
+BYTE NtInitssFail[] = "OS2SES(ntinitss) - error %X at %s\n";
+
+/*
+ * This is the table of Secions to initialize.
+ *
+ * Section
+ * SectionSize - the size of the section (0 - no section, -1 - for LVB)
+ * DataNamePrefix - the prefix added to get section name
+ * SectionDataBaseAddress - where to put the base address of the section
+ * SectionDataHandle - where to put the handle of the section
+ */
+
+struct
+{
+ ULONG SectionSize;
+ WCHAR DataNamePrefix;
+ PVOID *SectionDataBaseAddress;
+ HANDLE *SectionDataHandle;
+} PORT_TABLE[] =
+ {
+ {
+ OS2SES_CTRL_SECTION_SIZE,
+ U_OS2_SES_BASE_DATA_PREFIX,
+ &Os2SessionCtrlDataBaseAddress,
+ &Os2SessionCtrlDataSectionHandle
+ },
+ {
+ OS2SES_GROUP_SECTION_SIZE,
+ U_OS2_SES_GROUP_PREFIX,
+ &Os2SessionDataBaseAddress,
+ &Os2SessionSesGrpDataSectionHandle
+ },
+ {
+ // Warning: MUST BE THE LAST ENTRY OF THE TABLE
+
+ (ULONG)(-1L),
+ U_OS2_SES_BASE_LVB_PREFIX,
+ &(PVOID)(LVBBuffer),
+ &LVBHandle
+ },
+ {
+ 0, // End of Table
+ 0,
+ NULL,
+ NULL
+ }
+ };
+
+/*
+ * This is a table of semaphores to create (and close).
+ * All (but PauseEvent which is Event) are Semaphores.
+ */
+
+struct
+{
+ WCHAR NamePrefix;
+ HANDLE * SemaphoreHandle;
+} SEMAPHORE_TABLE [] =
+{
+ {
+ U_OS2_SES_CTRL_PORT_SEMAPHORE_PREFIX,
+ &CtrlDataSemaphore,
+ },
+ {
+ U_OS2_SES_KBD_PORT_SEMAPHORE_PREFIX,
+ &KbdDataSemaphore,
+ },
+ {
+ U_OS2_SES_KBD_FOCUS_SEMAPHORE_PREFIX,
+ &FocusSemaphore,
+ },
+ {
+ U_OS2_SES_MOU_PORT_SEMAPHORE_PREFIX,
+ &MouDataSemaphore,
+ },
+ {
+ U_OS2_SES_POPUP_SEMAPHORE_PREFIX,
+ &PopUpSemaphore,
+ },
+ {
+ U_OS2_SES_SLOCK_SEMAPHORE_PREFIX,
+ &ScreenLockSemaphore,
+ },
+ {
+ U_OS2_SES_STD_HANDLE_LOCK_PREFIX,
+ &Od2StdHandleLockHandle,
+ },
+ {
+ U_OS2_SES_PAUSE_EVENT_PREFIX,
+ &PauseEvent,
+ },
+ {
+ U_OS2_SES_VIOWRITE_SEMAPHORE_PREFIX,
+ &Od2VioWriteSemHandle,
+ },
+ {
+ 0,
+ NULL
+ }
+};
+
+#if DBG
+PSZ SEMAPHORE_NAME_TABLE[] =
+ {
+ "CtrlDataSemaphore",
+ "KbdDataSemaphore",
+ "FocusSemaphore",
+ "MouDataSemaphore",
+ "PopUpSemaphore",
+ "ScreenLockSemaphore",
+ "PauseEvent",
+ "VioWriteSemaphore",
+ NULL
+ };
+#endif
+
+ //
+ // A routine that wait for os2srv to connect
+ //
+
+NTSTATUS
+CtrlListen()
+{
+ NTSTATUS Status;
+ PSCCONNECTINFO ConnectionInfo;
+ SCREQUESTMSG ConnectionRequest;
+ HANDLE CommPortHandle;
+
+
+ /*
+ * Listen to the os2ss connection and then too all
+ * processes created in this session.
+ */
+
+ // Non-alertable, indefinite wait listen
+ Status = NtListenPort( Ow2hOs2sesPort,
+ (PPORT_MESSAGE) &ConnectionRequest);
+ if (!NT_SUCCESS( Status ))
+ {
+ KdPrint(( NtInitssFail, Status, "NtListenPort"));
+ return Status;
+ } else
+ {
+
+ // ??? Any reply
+ ConnectionInfo = &ConnectionRequest.ConnectionRequest;
+ ConnectionInfo->dummy = 0;
+
+ // BUGBUG!
+ // ServerView.Length = sizeof(ServerView);
+ // ServerView.SectionOffset = 0L;
+ // ServerView.ViewSize = 0L;
+
+ Status = NtAcceptConnectPort(
+ & CommPortHandle,
+ NULL,
+ (PPORT_MESSAGE) &ConnectionRequest,
+ (BOOLEAN)TRUE,
+ NULL, // &ServerView,
+ NULL);
+
+ if ( !NT_SUCCESS(Status) )
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "NtAcceptConnectPort"));
+#endif
+ return Status;
+ } else
+ {
+ /*
+ * Record the view section address in a global variable.
+ */
+ // BUGBUG! Os2SesConPortBaseAddress = ServerView.ViewBase;
+ Status = NtCompleteConnectPort( CommPortHandle );
+ ASSERT( NT_SUCCESS( Status) );
+
+ return Status;
+ }
+ }
+}
+
+
+DWORD
+SessionRequestThread(IN PVOID Parameter)
+{
+ NTSTATUS Status;
+
+ UNREFERENCED_PARAMETER(Parameter);
+
+ try {
+ //
+ // Listen and accept session request port
+ //
+
+ Status = CtrlListen();
+ if ( !NT_SUCCESS( Status ))
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "CtrlListen"));
+ ASSERT( FALSE );
+#endif
+ Ow2Exit( 0, NULL, 1);
+ }
+
+ ServeSessionRequests();
+ }
+ //
+ // if Os2Debug is on, and ntsd is attached, it will get the second chance
+ //
+#if DBG
+ except( (Os2Debug ? Ow2FaultFilter(EXCEPTION_CONTINUE_SEARCH, GetExceptionInformation()):
+
+ Ow2FaultFilter(EXCEPTION_EXECUTE_HANDLER, GetExceptionInformation())) ) {
+#else
+ except( Ow2FaultFilter(EXCEPTION_EXECUTE_HANDLER, GetExceptionInformation()) ) {
+#endif
+
+#if DBG
+ KdPrint(("OS2SES: Internal error - Exception occured in EventServerThread\n"));
+#endif
+ Ow2DisplayExceptionInfo();
+ ExitThread(1L);
+ }
+ ExitThread(0L);
+ return(0L);
+}
+
+CONST WCHAR OS2SSInitializationEvent[] = U_OS2_SS_INITIALIZATION_EVENT;
+
+/*
+ * OS2 Session console - protocol with OS2SS
+ *
+ * Connect
+ * 1. OS2SES ----------> OS2SRV
+ *
+ *
+ * Accept
+ * 2. OS2SES <---------- OS2SRV
+ * session
+ *
+ *
+ * Create process
+ * (also checkport for root process)
+ * 3. OS2SES ----------> OS2SRV
+ * session
+ *
+ * / Connect
+ * | 4. OS2SES <---------- OS2SRV
+ * root only by |
+ * ServerRequest|
+ * | Accept
+ * | 5. OS2SES ----------> OS2SRV
+ * \
+ *
+ * Returns:
+ * 0L - problem with resources, like memory
+ * -1L - problem connecting to os2srv
+ * 01L - OK
+ *
+ */
+
+DWORD
+InitOs2ssSessionPort()
+{
+ NTSTATUS Status;
+ ULONG ConnectionInfoLen, i, j, ViewSize = 0L;
+ HANDLE SessionUniqueId;
+ OS2SESCONNECTINFO ConnectionInfo;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ LARGE_INTEGER SectionSize;
+ UNICODE_STRING Name_U;
+ HANDLE SectionHandle;
+ HANDLE hCurrentProcess;
+ HANDLE hOs2srvProcess = NULL;
+ PWSTR BasePrefix;
+ PVOID PhyKbd;
+ REMOTE_PORT_VIEW ServerView;
+ PORT_VIEW ClientView;
+ OS2SESREQUESTMSG RequestMsg, ReplyMsg;
+ WCHAR SessionName_U[U_OS2_SES_BASE_PORT_NAME_LENGTH];
+ SECURITY_QUALITY_OF_SERVICE DynamicQos;
+ ULONG Length;
+#if DBG
+ BOOLEAN DebugOnStartup = FALSE;
+#endif
+ HANDLE InitialEventHandle;
+ DWORD NonFirstClient;
+ DWORD WaitState;
+ SECURITY_ATTRIBUTES Sa;
+ CHAR localSecurityDescriptor[SECURITY_DESCRIPTOR_MIN_LENGTH];
+
+ //
+ // Create a section to contain the Port Memory. Port Memory is private
+ // memory that is shared between the OS/2 client and server processes.
+ // This allows data that is too large to fit into an API request message
+ // to be passed to the OS/2 server.
+ //
+ // Create the client section now, to pass is to the server on the
+ // connection request.
+ //
+
+ SectionSize.HighPart = 0L;
+ SectionSize.LowPart = OD2_PORT_MEMORY_SIZE;
+ Status = NtCreateSection( &SectionHandle,
+ SECTION_ALL_ACCESS,
+ NULL,
+ &SectionSize,
+ PAGE_READWRITE,
+ SEC_RESERVE,
+ NULL
+ );
+ if (!NT_SUCCESS( Status ))
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "NtCreateSection"));
+ ASSERT( FALSE );
+#endif
+ return( 0L );
+ }
+
+ /*
+ * connect to OS2SS and notify of the new session and the port associated
+ * with it.
+ */
+
+#if DBG
+ if ( fBrkOnStart )
+ {
+ ConnectionInfo.In.SessionDbg = TRUE;
+ } else
+ {
+ ConnectionInfo.In.SessionDbg = FALSE;
+ }
+#else
+ ConnectionInfo.In.SessionDbg = FALSE;
+#endif
+ ConnectionInfo.In.ExpectedVersion = OS2_SS_VERSION;
+ ConnectionInfo.In.Win32ForegroundWindow = Ow2ForegroundWindow;
+ ConnectionInfoLen = sizeof(ConnectionInfo);
+
+ RtlInitUnicodeString( &Name_U, U_OS2_SS_SESSION_PORT_NAME );
+
+ //
+ // Set up the security quality of service parameters to use over the
+ // port. Use the most efficient (least overhead) - which is dynamic
+ // rather than static tracking.
+ //
+
+ DynamicQos.ImpersonationLevel = SecurityImpersonation;
+ DynamicQos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
+ DynamicQos.EffectiveOnly = TRUE;
+
+ ClientView.Length = sizeof( ClientView );
+ ClientView.SectionHandle = SectionHandle;
+ ClientView.SectionOffset = 0;
+ ClientView.ViewSize = OD2_PORT_MEMORY_SIZE;
+ ClientView.ViewBase = 0;
+ ClientView.ViewRemoteBase = 0;
+
+ ServerView.Length = sizeof( ServerView );
+ ServerView.ViewSize = 0;
+ ServerView.ViewBase = 0;
+
+ // Create security attribute record granting access to all
+ Sa.nLength = sizeof(Sa);
+ Sa.bInheritHandle = TRUE;
+
+ Status = RtlCreateSecurityDescriptor( (PSECURITY_DESCRIPTOR)
+ &localSecurityDescriptor,
+ SECURITY_DESCRIPTOR_REVISION );
+ if (!NT_SUCCESS( Status ))
+ {
+#if DBG
+ KdPrint(("OS2SES: failed at RtlCreateSecurityDescriptor %x\n", Status));
+ ASSERT(FALSE);
+#endif
+ return 0L;
+ }
+
+ Status = RtlSetDaclSecurityDescriptor( (PSECURITY_DESCRIPTOR)
+ &localSecurityDescriptor,
+ (BOOLEAN)TRUE,
+ (PACL) NULL,
+ (BOOLEAN)FALSE );
+
+ if (!NT_SUCCESS( Status ))
+ {
+#if DBG
+ KdPrint(("OS2SES: failed at RtlSetDaclSecurityDescriptor %x\n", Status));
+ ASSERT(FALSE);
+#endif
+ return 0L;
+ }
+ Sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR) &localSecurityDescriptor;
+
+ InitialEventHandle = CreateEventW(
+ &Sa,
+ TRUE, // Notification event
+ FALSE, // Nonsignaled
+ OS2SSInitializationEvent
+ );
+ if ((NonFirstClient = GetLastError()) || !InitialEventHandle) {
+ if (NonFirstClient != ERROR_ALREADY_EXISTS) {
+#if DBG
+ KdPrint(("OS2SES: Cannot create initialization event, error %d\n", NonFirstClient));
+#endif
+ return 0L;
+ }
+ }
+
+ if (!NonFirstClient) {
+ Status = (NTSTATUS) CreateOS2SRV(&hOs2srvProcess);
+ if (!NT_SUCCESS(Status) || !hOs2srvProcess) {
+#if DBG
+ KdPrint(("OS2SES: Fail to start server process, status %x\n", Status));
+#endif
+ return 0L;
+ }
+ NtClose(hOs2srvProcess);
+ }
+
+ //
+ // Wait for server. We want to see messages printed in debugger in the case that
+ // client waits too much (or may be it will wait forever).
+ //
+
+ while (TRUE) {
+ WaitState = WaitForSingleObject(
+ InitialEventHandle,
+ (DWORD) 4900L
+ );
+ if (WaitState == STATUS_TIMEOUT) {
+#ifdef DBG
+ KdPrint(("OS2SES: Waiting for server\n"));
+#endif
+ }
+ else {
+ break;
+ }
+ }
+
+ if (WaitState != WAIT_OBJECT_0) {
+#if DBG
+ KdPrint(("OS2SES: Initialization event wasn't set by the server, wait_state %d\n", WaitState));
+#endif
+ return (DWORD) -1L;
+ }
+
+ CloseHandle(InitialEventHandle);
+
+ Status = NtConnectPort(
+ &Ow2hOs2srvPort,
+ &Name_U,
+ &DynamicQos, // Security Quality
+ &ClientView,
+ &ServerView,
+ NULL, // MaxMessageLength,
+ (PVOID) &ConnectionInfo,
+ &ConnectionInfoLen
+ );
+
+ if (!NT_SUCCESS(Status)) {
+#if DBG
+ KdPrint(("OS2SES: Fail to connect to port, status %x\n", Status));
+#endif
+ return (DWORD) -1L;
+ }
+
+ NtClose( SectionHandle );
+
+ //
+ // Now capture the fact if we were exec'd with the DEBUG command
+ //
+#if DBG
+ if (ConnectionInfo.Out.Od2Debug)
+ {
+ Os2Debug |= ConnectionInfo.Out.Od2Debug;
+ DebugOnStartup = TRUE;
+ }
+#endif
+
+ Od2PortMemoryRemoteDelta = (ULONG)ClientView.ViewRemoteBase -
+ (ULONG)ClientView.ViewBase;
+
+#if DBG
+ IF_OD2_DEBUG( LPC )
+ {
+ KdPrint(( "OS2: ClientView: Base=%lX RemoteBase=%lX Delta: %lX Size=%lX\n",
+ (ULONG)ClientView.ViewBase, (ULONG)ClientView.ViewRemoteBase,
+ Od2PortMemoryRemoteDelta, (ULONG)ClientView.ViewSize
+ ));
+ }
+#endif
+
+ SessionUniqueId = (HANDLE)(ConnectionInfo.Out.SessionUniqueID);
+ Ow2bNewSession = ConnectionInfo.Out.IsNewSession;
+
+ Od2PortHeap = RtlCreateHeap( 0,
+ ClientView.ViewBase,
+ ClientView.ViewSize,
+ 0,
+ 0,
+ 0
+ );
+ if (Od2PortHeap == NULL)
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "RtlCreateHeap"));
+ ASSERT( FALSE );
+#endif
+ return 0L;
+ }
+
+ hOs2Srv = OpenProcess(
+ PROCESS_DUP_HANDLE,
+ FALSE, // no inherit
+ (DWORD)(ConnectionInfo.Out.Os2SrvId));
+ if (!hOs2Srv){
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "OpenProcess"));
+#endif
+ return((DWORD)-1L);
+ }
+
+#if DBG
+ if ( fVerbose )
+ {
+ KdPrint(("OS2SES: id =%d, Unique id=%d\n",
+ ConnectionInfo.Out.ProcessUniqueID, (ULONG)SessionUniqueId));
+ }
+#endif
+
+ CONSTRUCT_U_OS2_SES_NAME(SessionName_U, U_OS2_SES_BASE_PORT_PREFIX, (ULONG)SessionUniqueId);
+ RtlInitUnicodeString( &Name_U, SessionName_U );
+
+ /*
+ * used later to fix to the data section/port name
+ */
+
+ BasePrefix = &Name_U.Buffer[sizeof(U_OS2_SES_BASE_PORT_NAME) / 2];
+
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ PRTL_USER_PROCESS_PARAMETERS ProcessParameters =
+ (NtCurrentPeb())->ProcessParameters;
+
+ KdPrint(( "OS2SES(Win-Handles): hConsole %lx, StdIn %lx, StdOut %lx, StdErr %lx\n",
+ ProcessParameters->ConsoleHandle,
+ ProcessParameters->StandardInput,
+ ProcessParameters->StandardOutput,
+ ProcessParameters->StandardError ));
+ }
+#endif
+
+ /*
+ * Create 7 NT Semaphore and 1 Event that will be used to:
+ *
+ * 1. mutex use of CtrlDataSection
+ * 2. mutex use of KbdDataSection
+ * 3. focus the Kbd-handle
+ * 4. mutex enable PopUp
+ * 5. mutex screen lock
+ * 6. Pause event
+ * 7. mutex read Mouse Event
+ */
+
+ for ( i = 0, j = 0 ; SEMAPHORE_TABLE[i].NamePrefix ;)
+ {
+ *BasePrefix = SEMAPHORE_TABLE[i].NamePrefix;
+
+ InitializeObjectAttributes( &ObjectAttributes,
+ &Name_U,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+
+ if ( OS2SS_IS_SESSION( Ow2bNewSession ))
+ {
+ if (*BasePrefix == U_OS2_SES_PAUSE_EVENT_PREFIX)
+ {
+ Status = NtCreateEvent( SEMAPHORE_TABLE[i].SemaphoreHandle,
+ EVENT_ALL_ACCESS,
+ &ObjectAttributes,
+ 1,
+ (BOOLEAN)1);
+ } else if ((*BasePrefix == U_OS2_SES_VIOWRITE_SEMAPHORE_PREFIX) ||
+ (*BasePrefix == U_OS2_SES_KBD_PORT_SEMAPHORE_PREFIX) ||
+ (*BasePrefix == U_OS2_SES_MOU_PORT_SEMAPHORE_PREFIX))
+ {
+ Status = NtCreateMutant( SEMAPHORE_TABLE[i].SemaphoreHandle,
+ MUTANT_ALL_ACCESS,
+ &ObjectAttributes,
+ FALSE); // not owned
+ } else
+ {
+ Status = NtCreateSemaphore( SEMAPHORE_TABLE[i].SemaphoreHandle,
+ SEMAPHORE_ALL_ACCESS,
+ &ObjectAttributes,
+ 1,
+ 1);
+ }
+ } else
+ {
+ if (*BasePrefix == U_OS2_SES_PAUSE_EVENT_PREFIX)
+ {
+ Status = NtOpenEvent( SEMAPHORE_TABLE[i].SemaphoreHandle,
+ EVENT_ALL_ACCESS,
+ &ObjectAttributes);
+ } else if ((*BasePrefix == U_OS2_SES_VIOWRITE_SEMAPHORE_PREFIX) ||
+ (*BasePrefix == U_OS2_SES_KBD_PORT_SEMAPHORE_PREFIX) ||
+ (*BasePrefix == U_OS2_SES_MOU_PORT_SEMAPHORE_PREFIX))
+ {
+ Status = NtOpenMutant( SEMAPHORE_TABLE[i].SemaphoreHandle,
+ MUTANT_ALL_ACCESS,
+ &ObjectAttributes);
+ } else
+ {
+ Status = NtOpenSemaphore( SEMAPHORE_TABLE[i].SemaphoreHandle,
+ SEMAPHORE_ALL_ACCESS,
+ &ObjectAttributes);
+ }
+ }
+
+ if ( ! NT_SUCCESS( Status ) )
+ {
+ if (i==0 && OS2SS_IS_SESSION( Ow2bNewSession ) &&
+ Status == STATUS_OBJECT_NAME_COLLISION )
+ {
+ //
+ // A previous sesssion with the same cookie is being cleaned up - wait
+ // 30 seconds (600 times 50 ms is 30 seconds)
+ //
+ j++;
+ if (j<600)
+ {
+#if DBG
+ if (j == 1)
+ {
+ KdPrint(( "OS2SES(ntinitss) - waiting for previous os2 session cleanup\n"));
+ }
+ else {
+ KdPrint(( "."));
+
+ }
+#endif
+ Sleep(50L);
+ continue;
+ }
+
+ }
+#if DBG
+ KdPrint(( "OS2SES(ntinitss) - error %X at NtCreate/OpenSemaphore/Event #%u (%c-%s)\n",
+ Status, i, SEMAPHORE_TABLE[i].NamePrefix, SEMAPHORE_NAME_TABLE[i]));
+ ASSERT( FALSE );
+#endif
+ return(0L);
+ }
+ //
+ // increment i only if the create/open above was successful
+ //
+ i++;
+ }
+
+ /*
+ * Map the the whole section to virtual address.
+ * Let MM locate the view.
+ *
+ * The Vio case is different, since it has to be mapped
+ * into app space below 512M
+ */
+
+ Os2SessionCtrlDataBaseAddress = 0L;
+ Os2SessionDataBaseAddress = 0L;
+ LVBBuffer = (PUCHAR)(VIOSECTION_BASE);
+
+ for ( i = 0 ; PORT_TABLE[i].SectionSize ; i++ )
+ {
+
+ /*
+ * create 3 sections to be shared by all client processes runing in this
+ * session: Ctrl, SesGrp & LVB.
+ */
+
+ //
+ // Only for LVB the section size is unknon until OS2 is started.
+ // For the LVB< there is -1 at the SectionSize field in the table
+ //
+
+ if ( PORT_TABLE[i].SectionSize != -1L )
+ {
+ SectionSize.LowPart = PORT_TABLE[i].SectionSize;
+ } else
+ {
+ //
+ // This is the time to continue initiliziation: SesGrp
+ // is available.
+ //
+
+ SesGrp = (POS2_SES_GROUP_PARMS)Os2SessionDataBaseAddress;
+ PortMessageHeaderSize = sizeof(PORT_MESSAGE);
+
+ if (OS2SS_IS_PROCESS( Ow2bNewSession ))
+ {
+ if ((PhyKbd = StartEventHandler()) == NULL)
+ {
+ return(0);
+ }
+ } else
+ {
+ RtlZeroMemory(SesGrp, sizeof(OS2_SES_GROUP_PARMS));
+ if ((PhyKbd = StartEventHandlerForSession()) == NULL)
+ {
+ return(0);
+ }
+ SesGrp->PhyKbd = PhyKbd;
+ }
+ SectionSize.LowPart = SesGrp->MaxLVBsize; // LVB Buffer
+ }
+
+ ViewSize = 0L;
+
+ /*
+ * Get a private ID for the session data.
+ */
+
+ *BasePrefix = PORT_TABLE[i].DataNamePrefix;
+
+ /*
+ * create a 64k section.
+ * BUGBUG! - cruiser apis allow io of more then 64k
+ */
+
+ if (OS2SS_IS_SESSION( Ow2bNewSession ))
+ {
+ SECURITY_DESCRIPTOR SecurityDescriptor;
+
+ Status = RtlCreateSecurityDescriptor( &SecurityDescriptor,
+ SECURITY_DESCRIPTOR_REVISION );
+ if (!NT_SUCCESS(Status)) {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "RtlCreateSecurityDescriptor"));
+ ASSERT( FALSE );
+#endif
+ return(0L);
+ }
+
+ Status = RtlSetDaclSecurityDescriptor( &SecurityDescriptor,
+ TRUE,
+ NULL,
+ FALSE );
+ if (!NT_SUCCESS(Status)) {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "RtlSetDaclSecurityDescriptor"));
+ ASSERT(FALSE);
+#endif
+ return(0L);
+ }
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &Name_U,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ &SecurityDescriptor);
+
+ Status = NtCreateSection ( &SectionHandle,
+ /* BUGBUG! SECTION_ALL_ACCESS, */ SECTION_MAP_WRITE,
+ &ObjectAttributes,
+ &SectionSize,
+ PAGE_READWRITE,
+ SEC_COMMIT,
+ NULL);
+ } else
+ {
+ InitializeObjectAttributes(&ObjectAttributes,
+ &Name_U,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+
+ Status = NtOpenSection ( &SectionHandle,
+ SECTION_MAP_WRITE,
+ &ObjectAttributes);
+
+ }
+
+ if ( !NT_SUCCESS( Status ) )
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "NtCreate/OpenSection"));
+ ASSERT( FALSE );
+#endif
+ return(0L);
+ }
+
+ //
+ // Map the the whole section to virtual address.
+ //
+
+ Status = NtMapViewOfSection( SectionHandle,
+ NtCurrentProcess(),
+ PORT_TABLE[i].SectionDataBaseAddress,
+ 0L,
+ 0L,
+ NULL,
+ &ViewSize,
+ ViewUnmap,
+ 0L,
+ PAGE_READWRITE);
+
+ if ( !NT_SUCCESS( Status ) )
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "NtMapViewOfSection"));
+ ASSERT( FALSE );
+#endif
+ return(0L);
+ }
+
+ *(PORT_TABLE[i].SectionDataHandle) = SectionHandle;
+ }
+
+ OpenLVBsection();
+
+ Ow2hOs2sesPort = NULL;
+
+ //
+ // Connect to the OS/2 Emulation Subsystem server. Also pass information
+ // the OS/2 server needs in the connection information structure.
+ //
+
+ /*
+ * Set Header info
+ */
+
+ PORT_MSG_DATA_LENGTH(RequestMsg) = sizeof(RequestMsg) - sizeof(PORT_MESSAGE);
+ PORT_MSG_TOTAL_LENGTH(RequestMsg) = sizeof(RequestMsg); // BUGBUG! too much
+ PORT_MSG_ZERO_INIT(RequestMsg) = 0L;
+
+ RequestMsg.PortType = 1;
+ RequestMsg.Request = SesConCreate;
+ RequestMsg.d.Create.d.In.IsNewSession = Ow2bNewSession;
+
+ if ( !Od2InitCreateProcessMessage(&RequestMsg.d.Create) )
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "Od2InitCreateProcessMessage"));
+#endif
+ return(0L);
+ }
+
+ /*
+ * for all request pass the session handle
+ */
+
+ RequestMsg.Session = SessionUniqueId;
+
+ strncpy(&RequestMsg.d.Create.d.In.ApplName[0],
+ Od2PgmFilePath,
+ OS2_MAX_APPL_NAME
+ );
+ RequestMsg.d.Create.d.In.ApplName[OS2_MAX_APPL_NAME - 1] = '\0';
+
+ // server doesn't need the LPC, except for
+ // the root process in the session, so we'll create port only for it.
+
+ if (OS2SS_IS_SESSION( Ow2bNewSession ))
+ {
+ CHAR sd[SECURITY_DESCRIPTOR_MIN_LENGTH];
+ PSECURITY_DESCRIPTOR psd = (PSECURITY_DESCRIPTOR)&sd;
+
+ *BasePrefix = U_OS2_SES_BASE_PORT_PREFIX;
+
+ /*
+ * create (session) LPC port to be connected to all client processes
+ * runing in this session for Kbd, Mou, Mon, Tm and Prt.
+ */
+
+ InitializeSecurityDescriptor(psd, SECURITY_DESCRIPTOR_REVISION);
+ SetSecurityDescriptorDacl(psd, TRUE, NULL, FALSE); // NULL DACL means access free to all
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &Name_U,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ psd);
+
+ Status = NtCreatePort( &Ow2hOs2sesPort,
+ &ObjectAttributes,
+ sizeof( SCCONNECTINFO ),
+ U_OS2_SES_BASE_PORT_PREFIX,
+ 32 * U_OS2_SES_BASE_PORT_PREFIX);
+
+ if ( ! NT_SUCCESS( Status ) )
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "NtCreatePort"));
+ ASSERT( FALSE );
+#endif
+ return(0L);
+ }
+
+ //
+ // create 2 threads: one to read input from console
+ // and second to server requsets thru LPC
+ //
+
+ if (timing)
+ {
+ printf("Os2 time before CreateServerThreads is %d\n", (GetTickCount()) - timing);
+ }
+ if (CreateServerThreads())
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "CreateServerThread"));
+ ASSERT( FALSE );
+#endif
+ return(0L);
+ }
+
+ /*
+ * Set request info
+ */
+
+ RequestMsg.Request = SesCheckPortAndConCreate;
+
+ //
+ // duplicate handles for os2srv,
+ //
+
+ if (timing)
+ {
+ printf("Os2 time before DuplicateHandle is %d\n", (GetTickCount()) - timing);
+ }
+ hCurrentProcess = GetCurrentProcess();
+ //
+ // duplicate process and thread handles for os2srv
+ //
+
+ if (OS2SS_IS_NEW_SESSION( Ow2bNewSession ))
+ {
+ /*
+ * a new session, which isn't a child session
+ */
+
+ if (!DuplicateHandle(
+ hCurrentProcess,
+ hCurrentProcess,
+ hOs2Srv,
+ &RequestMsg.d.Create.d.In.hProcess,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS
+ ))
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "DuplicateHandle(Process)"));
+#endif
+ }
+ if (!DuplicateHandle(
+ hCurrentProcess,
+ GetCurrentThread(),
+ hOs2Srv,
+ &RequestMsg.d.Create.d.In.hThread,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS
+ ))
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "DuplicateHandle(Thread)"));
+#endif
+ }
+ }
+ //
+ // Duplicate the event thread handle, so os2srv can debug it
+ //
+ if (!DuplicateHandle(
+ hCurrentProcess,
+ EventServerThreadHandle,
+ hOs2Srv,
+ &RequestMsg.d.Create.d.In.hEventThread,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS
+ ))
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "DuplicateHandle(EventServerThread)"));
+#endif
+ }
+ //
+ // Duplicate the session request thread handle, so os2srv can debug it
+ //
+ if (!DuplicateHandle(
+ hCurrentProcess,
+ Ow2hSessionRequestThread,
+ hOs2Srv,
+ &RequestMsg.d.Create.d.In.hSessionRequestThread,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS
+ ))
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "DuplicateHandle(SessionRequestTread)"));
+#endif
+ }
+ }
+
+ Status = NtRequestWaitReplyPort( Ow2hOs2srvPort,
+ (PPORT_MESSAGE) &RequestMsg,
+ (PPORT_MESSAGE) &ReplyMsg);
+
+ if ( !NT_SUCCESS( Status ))
+ {
+#if DBG
+ KdPrint(( NtInitssFail, Status, "NtRequestWaitReplyPort"));
+ ASSERT( FALSE );
+#endif
+ return((DWORD)-1L );
+ }
+
+ if (!NT_SUCCESS(ReplyMsg.Status)){
+ //
+ // Could not initiate with os2srv - exit
+ //
+#if DBG
+ KdPrint(( NtInitssFail, ReplyMsg.Status, "Os2ConCreate"));
+#endif
+ return( (DWORD)-1L );
+ }
+
+ //
+ // Now capture the fact if we were exec'd with the DEBUG command
+ //
+#if DBG
+ if (DebugOnStartup)
+ {
+ DbgBreakPoint();
+ }
+#endif
+
+ Od2HandleCreateProcessRespond(&ReplyMsg.d.Create);
+
+ Ow2hSession = SessionUniqueId;
+
+ if (OS2SS_IS_SESSION( Ow2bNewSession ))
+ {
+ /*
+ * Complete all initializations that are depend on SesGrp from os2srv
+ */
+
+ if (timing)
+ {
+ printf("Os2 time before KbdInitAfterSesGrp is %d\n", (GetTickCount()) - timing);
+ }
+ if( KbdInitAfterSesGrp() )
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "KbdInitAfterSesGrp"));
+ ASSERT( FALSE );
+#endif
+ return( 0L );
+ }
+
+ /*
+ * Complete NLS initialization
+ */
+
+ if (timing)
+ {
+ printf("Os2 time before NlsInit is %d\n", (GetTickCount()) - timing);
+ }
+ if( NLSInit() )
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "NlsInit"));
+ ASSERT( FALSE );
+#endif
+ return( 0L );
+ }
+
+ //
+ // resume remaining threads
+ //
+
+ if (timing)
+ {
+ printf("Os2 time before ResumeServerThreads is %d\n", (GetTickCount()) - timing);
+ }
+ if (ResumeServerThreads())
+ {
+#if DBG
+ KdPrint(( NtInitssFail, GetLastError(), "ReleaseServerThreads"));
+ ASSERT( FALSE );
+#endif
+ return( 0L );
+ }
+ }
+
+ Length = SesGrp->LVBsize;
+ Ow2VioGetLVBBuf(&Length);
+
+ /*
+ * Don't put parameters into SesGrp before this point
+ * (since it's clear by the server when coping the NLS definitions).
+ */
+
+ return ( 1L );
+}
+
+
+VOID TerminateSession(VOID)
+{
+ //NTSTATUS Status;
+
+ Ow2ExitInProcess = (BOOLEAN)TRUE;
+ if (timing)
+ {
+ printf("Os2 main->Exit time is %d\n", (GetTickCount()) - timing);
+ }
+
+ /*
+ * remove event handler so we don't try to send a message
+ * for a dying session.
+ */
+
+ SetEventHandlers( FALSE );
+
+ if (OS2SS_IS_SESSION( Ow2bNewSession ))
+ {
+ RestoreWin32ParmsBeforeTermination();
+ }
+
+ // Close the named objects: port, section
+
+ NtClose(Ow2hOs2srvPort);
+ NtClose(Os2SessionCtrlDataSectionHandle);
+ NtClose(Os2SessionSesGrpDataSectionHandle);
+ NtClose(Ow2hOs2sesPort);
+ NtClose(hOs2Srv);
+ // Jul-2-1995 YosefD:
+ // Od2PortHandle is the same value as Ow2hOs2srvPort. This handle is already closed. An
+ // attemt to close it once more is a bug. On build 1096 this cause exception and
+ // process termination. The return value of the terminated process isn't right in this
+ // case.
+ //NtClose(Od2PortHandle);
+
+ /* =>? what about the following handles:
+
+HANDLE hConsoleInput;
+HANDLE hConsoleOutput;
+HANDLE hConsoleStdIn; if diff from hConsoleInput
+HANDLE hConsoleStdOut; if diff from hConsoleOutput
+HANDLE hConsoleStdErr;
+HANDLE hPopUpOutput; if not NULL
+HANDLE LVBHandle;
+HANDLE PauseEvent;
+HANDLE CtrlDataSemaphore;
+HANDLE KbdDataSemaphore;
+HANDLE FocusSemaphore;
+HANDLE MouDataSemaphore;
+HANDLE PopUpSemaphore;
+HANDLE ScreenLockSemaphore;
+HANDLE EventServerThreadHandle;
+HANDLE Ow2hSessionRequestThread;
+
+ */
+ // notify OS2SS
+
+ // Cleanup TaskMan stuff
+
+}
+
+
+BOOL
+SendSignalToOs2Srv(
+ IN int SignalType
+ )
+{
+ OS2SESREQUESTMSG RequestMsg;
+ OS2SESREQUESTMSG ReplyMsg;
+ NTSTATUS Status;
+
+#if DBG
+ IF_OD2_DEBUG2( OS2_EXE, SIG )
+ {
+ KdPrint(("OS2SES(SendSignalToOs2Srv): Signal %u\n", SignalType));
+ }
+#endif
+ /*
+ * Set Header info
+ */
+ PORT_MSG_DATA_LENGTH(RequestMsg) = sizeof(RequestMsg) - sizeof(PORT_MESSAGE);
+ PORT_MSG_TOTAL_LENGTH(RequestMsg) = sizeof(RequestMsg); // BUGBUG! too much
+ PORT_MSG_ZERO_INIT(RequestMsg) = 0L;
+ RequestMsg.PortType = 1;
+
+ RequestMsg.Request = SesConSignal;
+ RequestMsg.Session = Ow2hSession;
+ RequestMsg.d.Signal.Type = SignalType;
+
+ Status = NtRequestWaitReplyPort( Ow2hOs2srvPort,
+ (PPORT_MESSAGE) &RequestMsg,
+ (PPORT_MESSAGE) &ReplyMsg);
+
+ if ( !NT_SUCCESS( Status ))
+ {
+#if DBG
+ KdPrint(( "OS2SES: Unable to send signal - Status == %X\n",
+ Status));
+#endif
+
+ TerminateSession();
+ Ow2Exit(0, NULL, 15);
+ }
+
+ ASSERT ( PORT_MSG_TYPE(ReplyMsg) == LPC_REPLY );
+
+ if ( Ow2ExitInProcess )
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+BOOL
+EventHandlerRoutine (IN ULONG CtrlType)
+{
+ int SignalType;
+ BOOL Rc;
+ ULONG i=0;
+
+ //
+ // If Ow2hSession is null - os2srv is not ready yet to kill,
+ // wait so we don't loose the signal
+ //
+
+ if (!Od2SignalEnabled)
+ {
+#if DBG
+ IF_OD2_DEBUG2( OS2_EXE, SIG )
+ {
+ KdPrint(("OS2SES(EventHandlerRoutine): Ctr-Type %u before loading completed, handle later\n", CtrlType));
+ }
+#endif
+ Od2ReceivedSignalAtInit = TRUE;
+ Od2InitSignalType = CtrlType;
+ return(TRUE);
+ }
+
+#if DBG
+ IF_OD2_DEBUG2( OS2_EXE, SIG )
+ {
+ KdPrint(("OS2SES(EventHandlerRoutine): Ctr-Type %u\n", CtrlType));
+ }
+#endif
+
+ switch (CtrlType) {
+ case CTRL_C_EVENT:
+ if ((SesGrp->ModeFlag & 1 ) || // ^C in binary mode
+ SesGrp->WinProcessNumberInSession ) // There is a child Win process
+ {
+ return (TRUE);
+ }
+ SignalType = XCPT_SIGNAL_INTR;
+ break;
+ case CTRL_BREAK_EVENT:
+ if (SesGrp->WinProcessNumberInSession ) // There is a child Win process
+ {
+ return (TRUE);
+ }
+ SignalType = XCPT_SIGNAL_BREAK;
+ break;
+ case CTRL_CLOSE_EVENT:
+ SignalType = XCPT_SIGNAL_KILLPROC;
+#if PMNT
+CloseApp:
+ //
+ // PM apps handling
+ //
+ if (ProcessIsPMProcess())
+ {
+ // Regular app (i.e. not PMShell)
+ if (!ProcessIsPMShell())
+ {
+ if (Ow2WriteBackCloseEvent())
+ {
+ Sleep(7900L);
+ if (Ow2ExitInProcess)
+ return(FALSE);
+ else
+ return(TRUE);
+ }
+ else
+ {
+ // We failed to write-back a close event:
+ // must be DosExecPgm proc; Pass event through semaphore
+ DosSemClear(PMSubprocSem32);
+ Sleep(7900L);
+ if (Ow2ExitInProcess)
+ return(FALSE);
+ else
+ return(TRUE);
+ }
+ return(TRUE);
+ }
+ else // PMSHELL
+ {
+ if (Ow2WriteBackCloseEvent())
+ {
+ return(TRUE);
+ }
+ }
+ }
+#endif // PMNT
+ break;
+ case CTRL_LOGOFF_EVENT:
+ if (fService) // Are we running as a service ?
+ {
+#if DBG
+ DbgPrint("OS2: service - ignoring CTRL_LOGOFF_EVENT !\n");
+#endif
+ return FALSE;
+ }
+ SignalType = XCPT_SIGNAL_KILLPROC;
+#if PMNT
+ // Jump to CloseApp only for PM apps !
+ if (ProcessIsPMProcess())
+ goto CloseApp;
+#endif // PMNT
+ break;
+ case CTRL_SHUTDOWN_EVENT:
+ SignalType = XCPT_SIGNAL_KILLPROC;
+#if PMNT
+ // Jump to CloseApp only for PM apps !
+ if (ProcessIsPMProcess())
+ goto CloseApp;
+#endif // PMNT
+ break;
+ default:
+#if DBG
+ IF_OD2_DEBUG2( OS2_EXE, SIG )
+ {
+ KdPrint(("OS2SES(EventHandlerRoutine): Unknown CtrlType %lu\n", CtrlType));
+ }
+#endif
+ SignalType = CtrlType;
+ break;
+ }
+ //if (OS2SS_IS_SESSION( Ow2bNewSession )){
+ if (SesGrp->InTermination == 0){
+
+ //
+ // The root process of a session handles singals with os2srv
+ // always. child processes in the session only need to send
+ // the signal if they where in initialization when a CtrlC/CtrlBrk
+ // happened (server ignore signal in this case)
+ //
+
+ Rc = SendSignalToOs2Srv(SignalType);
+ } else{
+ Rc = TRUE;
+ }
+
+ if (Rc && ((CtrlType == CTRL_CLOSE_EVENT) ||
+ (CtrlType == CTRL_LOGOFF_EVENT) ||
+ (CtrlType == CTRL_SHUTDOWN_EVENT)))
+ {
+ //
+ // Cmd wait 10 sec before it popup a time-out fail message
+ // We are waiting 5 sec to give the application (client)
+ // time to clean-up before we return TRUE.
+
+ Sleep(5000);
+ if ( Ow2ExitInProcess )
+ {
+ Rc = FALSE;
+ }
+ } else if (Rc && SesGrp->InTermination && Od2SignalEnabled) {
+ Rc = SendSignalToOs2Srv(SignalType);
+ }
+
+ return (Rc);
+}
+
+
+ULONG
+Ow2GetProcessIdFromLPCMessage(
+ IN PVOID LPCMessage
+ )
+{
+ return((ULONG) ((PPORT_MESSAGE)LPCMessage)->ClientId.UniqueProcess);
+}
+
+
+DWORD
+Ow2CommandLineWToCommandLineA(
+ IN LPWSTR CommandLineW,
+ OUT PSZ *CommandLineA
+ )
+{
+ UNICODE_STRING CommandLine_U;
+ UNICODE_STRING CommandLineUpcase;
+ UNICODE_STRING CurrentDir_U;
+ UNICODE_STRING CurrentDirUpcase;
+ WCHAR CurrentDirectory[MAX_PATH];
+ WCHAR *pWchar;
+ NTSTATUS Status;
+
+ RtlInitUnicodeString(
+ &CommandLine_U,
+ CommandLineW
+ );
+
+ if (GetCurrentDirectoryW((DWORD)MAX_PATH, CurrentDirectory))
+ {
+ RtlInitUnicodeString(
+ &CurrentDir_U,
+ CurrentDirectory
+ );
+
+ //
+ // Prepare the structures for upcase strings and then upcase.
+ //
+ if (NULL == (CommandLineUpcase.Buffer =
+ RtlAllocateHeap(RtlProcessHeap(), 0, CommandLine_U.MaximumLength))) {
+ KdPrint(( NtInitssFail, 0, "RtlAllocateHeap(CommandLine)"));
+ return ((DWORD)-1L);
+ }
+ if (NULL == (CurrentDirUpcase.Buffer =
+ RtlAllocateHeap(RtlProcessHeap(), 0, CurrentDir_U.MaximumLength))) {
+ KdPrint(( NtInitssFail, 0, "RtlAllocateHeap(CurrentDir)"));
+ RtlFreeHeap(RtlProcessHeap(), 0, CommandLineUpcase.Buffer);
+ return ((DWORD)-1L);
+ }
+
+ CurrentDirUpcase.Length = CurrentDir_U.Length;
+ CurrentDirUpcase.MaximumLength = CurrentDir_U.MaximumLength;
+ Status = RtlUpcaseUnicodeString(&CurrentDirUpcase, &CurrentDir_U, FALSE);
+ if (!NT_SUCCESS(Status)) {
+ KdPrint(( NtInitssFail, 0, "RtlUpcaseUnicodeString(CurrentDirUpcase)"));
+ RtlFreeHeap(RtlProcessHeap(), 0, CommandLineUpcase.Buffer);
+ RtlFreeHeap(RtlProcessHeap(), 0, CurrentDirUpcase.Buffer);
+ return ((DWORD)-1L);
+ }
+
+ CommandLineUpcase.Length = CommandLine_U.Length;
+ CommandLineUpcase.MaximumLength = CommandLine_U.MaximumLength;
+ Status = RtlUpcaseUnicodeString(&CommandLineUpcase, &CommandLine_U, FALSE);
+ if (!NT_SUCCESS(Status)) {
+ KdPrint(( NtInitssFail, 0, "RtlUpcaseUnicodeString(CommandLineUpcase)"));
+ RtlFreeHeap(RtlProcessHeap(), 0, CommandLineUpcase.Buffer);
+ RtlFreeHeap(RtlProcessHeap(), 0, CurrentDirUpcase.Buffer);
+ return ((DWORD)-1L);
+ }
+
+ //
+ // Initialize pWchar and append NULL to the end of the upcased strings
+ // for the search of wsstr().
+ //
+ pWchar = CommandLineUpcase.Buffer;
+ CurrentDirUpcase.Buffer[CurrentDirUpcase.Length / 2] = (WCHAR)NULL;
+ CommandLineUpcase.Buffer[CommandLineUpcase.Length / 2] = (WCHAR)NULL;
+
+ //
+ // Replace every prefix of the current directory in the command
+ // line with what GetCurrentDirectoryW() returned. This resolves
+ // problems caused by apps transfering the command line in
+ // apper/lower case.
+ //
+ while ((pWchar < &CommandLineUpcase.Buffer[CommandLineUpcase.Length / 2]) &&
+ (pWchar = wcsstr(pWchar, CurrentDirUpcase.Buffer))) {
+ wcsncpy(&CommandLine_U.Buffer[pWchar - CommandLineUpcase.Buffer],
+ CurrentDirectory,
+ CurrentDirUpcase.Length / 2);
+ pWchar += CurrentDirUpcase.Length / 2;
+ }
+
+ //
+ // Free the allocated buffers.
+ //
+ RtlFreeHeap(RtlProcessHeap(), 0, CommandLineUpcase.Buffer);
+ RtlFreeHeap(RtlProcessHeap(), 0, CurrentDirUpcase.Buffer);
+ }
+
+ Status = RtlUnicodeStringToOemString(
+ &Ow2CommandLineString,
+ &CommandLine_U,
+ TRUE
+ );
+ if (!NT_SUCCESS( Status ))
+ {
+ KdPrint(( NtInitssFail, Status, "CommandLine-UnicodeToOemString"));
+ return ((DWORD)-1L);
+ }
+
+ *CommandLineA = Ow2CommandLineString.Buffer;
+
+ return(0L);
+}
+#if PMNT
+
+
+// Returns true if process is the root process of a session
+// otherwise returns false
+// This procedure was written to enable 16 Bit dll init routine (PMWIN)
+// to check if the it is executed from the root process of a session.
+APIRET PMNTIsSessionRoot()
+{
+
+ if ( OS2SS_IS_SESSION( Ow2bNewSession ))
+ return(TRUE);
+ else
+ return(FALSE);
+}
+
+#endif // PMNT
diff --git a/private/os2/os2ses/ntrqust.c b/private/os2/os2ses/ntrqust.c
new file mode 100644
index 000000000..d0955428d
--- /dev/null
+++ b/private/os2/os2ses/ntrqust.c
@@ -0,0 +1,402 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ ntrqust.c
+
+Abstract:
+
+ This module contains the session requests threads and the listen threads.
+
+Author:
+
+ Avi Nathan (avin) 17-Jul-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#include "string.h"
+#include <stdlib.h>
+#define NTOS2_ONLY
+#include "os2ses.h"
+
+
+VOID ServeSessionRequests(VOID)
+{
+
+ SCREQUESTMSG ReceiveMsg, *PReplyMsg;
+ NTSTATUS Status = STATUS_SUCCESS;
+ BOOL fCont=TRUE;
+ ULONG Reply;
+
+ PReplyMsg = NULL;
+
+ for ( ; Status != STATUS_INVALID_HANDLE ; )
+ {
+ if ( fCont )
+ {
+ Status = NtReplyWaitReceivePort(Ow2hOs2sesPort,
+ NULL,
+ (PPORT_MESSAGE) PReplyMsg,
+ (PPORT_MESSAGE) &ReceiveMsg);
+
+#if DBG
+ IF_OD2_DEBUG( LPC )
+ {
+ KdPrint(("OS2SES: NtRequst: Msg %u, Request %u (%u), Status %lx\n",
+ PORT_MSG_TYPE(ReceiveMsg), ReceiveMsg.Request,
+ ReceiveMsg.d.Kbd.Request, Status));
+ } else if (!NT_SUCCESS(Status))
+ {
+ KdPrint(("OS2SES: NtRequst: Msg %u, Request %u, Status %lx\n",
+ PORT_MSG_TYPE(ReceiveMsg), ReceiveMsg.Request, Status));
+ }
+#endif
+ } else
+ {
+#if 0
+ Status = NtReplyPort(Ow2hOs2sesPort,
+ (PPORT_MESSAGE) PReplyMsg);
+#endif
+ }
+
+#if DBG
+ if ( fTrace )
+ {
+ _asm int 3;
+ }
+#endif
+
+ if (!NT_SUCCESS(Status)) {
+ PReplyMsg = NULL;
+ continue;
+ }
+
+ if ( PORT_MSG_TYPE(ReceiveMsg) == LPC_PORT_CLOSED )
+ {
+ break;
+ }
+
+ if ( !fCont )
+ {
+ break;
+ }
+
+ Reply = 1;
+
+ try
+ {
+ switch ( ReceiveMsg.Request)
+ {
+ case MouRequest:
+ fCont = ServeMouRequest( &ReceiveMsg.d.Mou,
+ &ReceiveMsg.Status,
+ (PVOID)&ReceiveMsg,
+ &Reply);
+ break;
+
+ case MonRequest:
+ fCont = ServeMonRequest( &ReceiveMsg.d.Mon,
+ &ReceiveMsg.Status,
+ (PVOID)&ReceiveMsg,
+ &Reply);
+ break;
+
+ case KbdRequest:
+ fCont = ServeKbdRequest( &ReceiveMsg.d.Kbd,
+ &ReceiveMsg.Status,
+ (PVOID)&ReceiveMsg,
+ &Reply);
+ break;
+
+ case PrtRequest:
+ fCont = ServePrtRequest( &ReceiveMsg.d.Prt,
+ &ReceiveMsg.Status);
+ break;
+
+ case TaskManRequest:
+ fCont = ServeTmRequest( &ReceiveMsg.d.Tm,
+ &ReceiveMsg.Status);
+ if (ReceiveMsg.d.Tm.Request == TmReleaseLPC) {
+ Reply = 0;
+ }
+ break;
+
+ case WinCreateProcess:
+ fCont = ServeWinCreateProcess( &ReceiveMsg.d.WinExecPgm,
+ &ReceiveMsg.Status
+ );
+ break;
+
+ default:
+#if DBG
+ KdPrint(( "OS2SES: Unknown NT request = %X\n",
+ ReceiveMsg.Request));
+#endif
+ break;
+ }
+ } except ( EXCEPTION_EXECUTE_HANDLER )
+ {
+#if DBG
+ KdPrint(("OS2SES: Exception in request server thread, terminating\n"));
+#endif
+ NtTerminateProcess(NtCurrentProcess(), Status);
+ // BUGBUG! The client should kill the process
+ }
+
+#if DBG
+ IF_OD2_DEBUG( LPC )
+ {
+ KdPrint(("OS2SES: NtRequst: Msg %u, Reply %s, Status %lx\n",
+ PORT_MSG_TYPE(ReceiveMsg), (Reply) ? "Yes" : "No",
+ ReceiveMsg.Status));
+ }
+#endif
+ if (Reply)
+ {
+ PReplyMsg = &ReceiveMsg;
+ } else
+ PReplyMsg = NULL;
+ }
+ Ow2Exit(0, NULL, Os2ReturnCode);
+}
+
+
+VOID
+SavePortMessegeInfo(OUT PVOID MonHeader,
+ IN PVOID pMsg)
+{
+ RtlMoveMemory(MonHeader,
+ pMsg,
+ sizeof(PORT_MESSAGE));
+}
+
+
+VOID
+SaveKbdPortMessegeInfo(OUT PVOID MonHeader,
+ OUT PVOID KbdRequestArea,
+ IN PVOID pMsg)
+{
+ RtlMoveMemory(MonHeader,
+ pMsg,
+ sizeof(PORT_MESSAGE));
+ RtlMoveMemory(KbdRequestArea,
+ &((PSCREQUESTMSG)pMsg)->d.Kbd,
+ sizeof(KBDREQUEST));
+}
+
+
+VOID
+SendMonReply(IN PVOID MonHeader,
+ IN PVOID pData,
+ IN USHORT Length)
+{
+ SCREQUESTMSG SendMsg;
+ NTSTATUS Status;
+
+ RtlMoveMemory(&SendMsg,
+ MonHeader,
+ sizeof(PORT_MESSAGE));
+
+ if ( pData )
+ {
+ SendMsg.Status = 0L;
+ RtlMoveMemory((PVOID)&(SendMsg.d.Mon.d.rwParms.ioBuff[0]), pData, Length);
+ } else
+ {
+ /*
+ * This call is from EventReleaseLPC
+ * return -2 to terminate thread
+ */
+
+ SendMsg.Status = -2L;
+ RtlZeroMemory((PVOID)&(SendMsg.d.Mon.d.rwParms.ioBuff[0]), Length);
+ }
+
+ SendMsg.Request = MonRequest;
+ SendMsg.d.Mon.Request = MONRead;
+ SendMsg.d.Mon.d.rwParms.Length = Length;
+
+ Status = NtReplyPort(Ow2hOs2sesPort,
+ (PPORT_MESSAGE) &SendMsg);
+
+ if ( !NT_SUCCESS( Status ) )
+ {
+#if DBG
+ IF_OD2_DEBUG2( MON, OS2_EXE )
+ /* KdPrint(("OS2SES(NtRqust-SendMonReply): fail to send reply\n")) */;
+#endif
+ }
+}
+
+
+VOID
+SendMouReply(IN PVOID MonHeader,
+ IN PVOID pData)
+{
+ SCREQUESTMSG SendMsg;
+ NTSTATUS Status;
+
+ RtlMoveMemory(&SendMsg,
+ MonHeader,
+ sizeof(PORT_MESSAGE));
+
+ if ( pData )
+ {
+ SendMsg.Status = 0L;
+ SendMsg.d.Mou.d.MouInfo = *(PMOUEVENTINFO)pData;
+ } else
+ {
+ /*
+ * This call is from EventReleaseLPC
+ * return -2 to terminate thread
+ */
+
+ SendMsg.Status = -2L;
+ RtlZeroMemory((PVOID)&SendMsg.d.Mou.d.MouInfo, sizeof(MOUEVENTINFO));
+ }
+
+ SendMsg.d.Mou.Request = MOUReadEventQue;
+
+ Status = NtReplyPort(Ow2hOs2sesPort,
+ (PPORT_MESSAGE) &SendMsg);
+
+ if ( !NT_SUCCESS( Status ) )
+ {
+#if DBG
+ IF_OD2_DEBUG2( MOU, OS2_EXE )
+ /* KdPrint(("OS2SES(NtRqust-SendMouseReply): fail to send reply\n")) */;
+#endif
+ }
+}
+
+
+VOID
+SendKbdReply(IN PVOID MonHeader,
+ IN PVOID KbdRequestArea,
+ IN PVOID pData,
+ IN USHORT Length)
+{
+ SCREQUESTMSG SendMsg;
+ NTSTATUS Status;
+
+ RtlMoveMemory(&SendMsg,
+ MonHeader,
+ sizeof(PORT_MESSAGE));
+ RtlMoveMemory(&SendMsg.d.Kbd,
+ KbdRequestArea,
+ sizeof(KBDREQUEST));
+
+ if ( pData )
+ {
+ SendMsg.Status = 0L;
+ RtlMoveMemory( KbdAddress, pData, Length );
+ } else
+ {
+ /*
+ * This call is from EventReleaseLPC
+ * return -2 to terminate thread
+ */
+
+ SendMsg.Status = -2L;
+ }
+
+ SendMsg.Request = KbdRequest;
+
+ Status = NtReplyPort(Ow2hOs2sesPort,
+ (PPORT_MESSAGE) &SendMsg);
+
+ if ( !NT_SUCCESS( Status ) )
+ {
+#if DBG
+ IF_OD2_DEBUG2( KBD, OS2_EXE )
+ /* KdPrint(("OS2SES(NtRqust-SendKbdReply): fail to send reply\n")) */;
+#endif
+ }
+}
+
+
+VOID
+Os2sesTerminateThread(VOID)
+{
+ Os2sesTerminateThreadRc(0);
+}
+
+
+VOID
+Os2sesTerminateThreadRc(IN ULONG Rc)
+{
+ //NTSTATUS Status = (NTSTATUS)Rc;
+
+ NtTerminateThread( NtCurrentThread(), (NTSTATUS)Rc );
+}
+
+
+VOID EnableScreenUpdate()
+{
+ NTSTATUS Status;
+
+ Status = NtSetEvent(PauseEvent,
+ NULL);
+
+ SesGrp->PauseScreenUpdate = FALSE;
+}
+
+
+VOID DisableScreenUpdate()
+{
+ NTSTATUS Status;
+
+ Status = NtResetEvent(PauseEvent,
+ NULL);
+
+ SesGrp->PauseScreenUpdate = TRUE;
+}
+
+
+VOID SendNewFocusSet(IN ULONG WindowFocus)
+{
+ OS2SESREQUESTMSG RequestMsg;
+ DWORD Status;
+
+ /*
+ * Set Header info
+ */
+
+ PORT_MSG_DATA_LENGTH(RequestMsg) = sizeof(RequestMsg) - sizeof(PORT_MESSAGE);
+ PORT_MSG_TOTAL_LENGTH(RequestMsg) = sizeof(RequestMsg); // BUGBUG! too much
+ PORT_MSG_ZERO_INIT(RequestMsg) = 0L;
+ RequestMsg.PortType = 1;
+
+ RequestMsg.Request = SesConFocus;
+ RequestMsg.Session = Ow2hSession;
+ RequestMsg.d.FocusSet = WindowFocus;
+
+ Status = NtRequestWaitReplyPort( Ow2hOs2srvPort,
+ (PPORT_MESSAGE) &RequestMsg,
+ (PPORT_MESSAGE) &RequestMsg);
+
+ if ( !NT_SUCCESS( Status ))
+ {
+ PTEB Teb = NtCurrentTeb();
+#if DBG
+ KdPrint(( "OS2SES: Unable to send focus - Status == %X\n",
+ Status));
+#endif
+ EventReleaseLPC((ULONG)(Teb->ClientId.UniqueProcess));
+ TerminateSession();
+ Ow2Exit(0, NULL, 15);
+
+ }
+
+// ASSERT ( PORT_MSG_TYPE(RequestMsg) == LPC_REPLY );
+}
+
+
diff --git a/private/os2/os2ses/os2.c b/private/os2/os2ses/os2.c
new file mode 100644
index 000000000..f69f05aa0
--- /dev/null
+++ b/private/os2/os2ses/os2.c
@@ -0,0 +1,1750 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ os2.c
+
+Abstract:
+
+ This module contains the main of the session console process (OS2.EXE).
+
+Author:
+
+ Avi Nathan (avin) 17-Jul-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#include <stdio.h>
+#include <io.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "trans.h"
+#include "os2res.h"
+#include "os2win.h"
+#include "conapi.h"
+#ifdef PMNT
+#define INCL_32BIT
+#include "pmnt.h"
+extern ULONG PMNTGetOurWindow(void);
+extern ULONG PMSubprocSem32;
+extern BOOLEAN Ow2WriteBackCloseEvent();
+extern APIRET DosSemClear(ULONG hsem);
+#endif
+
+BOOLEAN fService = FALSE; // Are we running as a service ?
+BOOLEAN fRootService = FALSE; // Directly invoked by the service
+
+/*
+ * External prototypes
+ */
+
+#undef InitOs2SessionPort
+DWORD InitOs2ssSessionPort();
+
+DWORD
+Ow2CommandLineWToCommandLineA(
+ IN LPWSTR CommandLineW,
+ OUT PSZ *CommandLineA
+ );
+
+BOOLEAN
+Od2DllInitialize(
+ IN PVOID DllHandle,
+ IN ULONG Reason,
+ IN PCONTEXT Context OPTIONAL
+ );
+
+BOOLEAN
+Od2ProcessIsDetached(VOID);
+
+int
+Loader_main(VOID);
+
+VOID
+ Od2FinalProcessCleanup();
+/*
+ * Internal prototypes
+ */
+
+UINT
+GetPgmName(
+ int argc
+ );
+
+UINT
+InitStdConout();
+
+#define OS2_VIO_MAX_ROW 100
+
+WORD StartUpwAttributes = 0x7;
+CONSOLE_SCREEN_BUFFER_INFO StartUpScreenInfo;
+CONSOLE_CURSOR_INFO StartUpCursorInfo;
+PVOID BASE_TILE;
+HANDLE handOS2 = NULL;
+
+ //
+ // Environment related global variables
+ //
+PSZ Od2CommandLinePtr; // to be used by dllinit.c
+char Od2PgmFullPathBuf[MAX_PATH + 1];
+ULONG Od2PgmFullPathBufLength;
+PSZ Od2PgmFilePath;
+DWORD Od2ForegroundWindow;
+
+ULONG Od2DosExitIsDone = 0;
+
+#if DBG
+BYTE SetEventHandlerStr[] = "SetEventHandler";
+BYTE InitStdConoutStr[] = "InitStdConout";
+BYTE SesGrpInitStr[] = "SesGrpInit";
+BYTE RestoreWin32ParmsBeforeTerminationStr[] = "RestoreWin32ParmsBeforeTermination";
+BYTE CreateServerThreadsStr[] = "CreateServerThreads";
+BYTE ResumeServerThreadsStr[] = "ResumeServerThreads";
+#endif
+
+extern BOOLEAN Od2ReceivedSignalAtInit;
+extern DWORD Od2InitSignalType;
+BOOL
+EventHandlerRoutine (IN ULONG CtrlType);
+
+extern PVOID Od2Process;
+PVOID IsOs2Thread();
+ULONG Od2ThreadId();
+ULONG Od2ProcessId();
+PSZ Od2ApplName();
+PSZ Od2GetLastAPI();
+
+// global variable to keep exception information
+
+EXCEPTION_POINTERS ExPtrs;
+EXCEPTION_RECORD ExRec;
+WORD wSavedFpStatus = 0, wSavedFpCtrl = 0;
+
+/*
+ * Os2ServiceThread:
+ * Created to allow the service who started this copy of OS2.EXE to terminate
+ * the process tree.
+ */
+VOID
+Os2ServiceThread(
+ IN PVOID Parameter
+ )
+{
+ CHAR SemName[MAX_PATH];
+ HANDLE hServiceEvent;
+
+ wsprintf(SemName, "OS2SSService-%d", GetCurrentProcessId());
+
+ //
+ // Create the service event for this process
+ //
+ hServiceEvent = CreateEventA(
+ NULL,
+ FALSE, // automatic reset
+ FALSE, // initial state = non-signaled
+ SemName);
+
+ if (hServiceEvent == NULL)
+ {
+#if DBG
+ DbgPrint("OS2: Os2ServiceThread(), error at CreateEvent, error=%d\n",
+ GetLastError());
+#endif
+ }
+
+ // Wait on the Service semaphore
+ if (WaitForSingleObject(
+ hServiceEvent,
+ INFINITE) == WAIT_FAILED)
+ {
+#if DBG
+ DbgPrint("OS2: Os2ServiceThread(), failed to NtWaitForSingleObject PMShellEvent, error=%d\n",
+ GetLastError());
+#endif
+ }
+
+#if DBG
+ DbgPrint("OS2: Os2ServiceThread() - event signaled\n");
+#endif
+#if PMNT
+ //
+ // PM apps handling
+ //
+ if (ProcessIsPMProcess())
+ {
+ // Regular app (i.e. not PMShell)
+ if (!ProcessIsPMShell())
+ {
+ if (!Ow2WriteBackCloseEvent())
+ {
+ // We failed to write-back a close event:
+ // must be DosExecPgm proc; Pass event through semaphore
+ DosSemClear(PMSubprocSem32);
+ Sleep(7900L);
+ }
+ }
+ else // PMSHELL
+ {
+#if DBG
+ DbgPrint("OS2: Os2ServiceThread(), ignoring signal - process is PMShell\n");
+#endif
+ }
+ return;
+ }
+#endif // PMNT
+ SendSignalToOs2Srv(XCPT_SIGNAL_KILLPROC);
+}
+
+DWORD Ow2FaultFilter(ULONG wFaultFilter, PEXCEPTION_POINTERS lpExP)
+{
+
+ // copy the exception record to global variable
+ ExPtrs = *lpExP;
+ ExRec = *lpExP->ExceptionRecord;
+
+ _asm {
+ fnstcw wSavedFpCtrl
+ fnstsw wSavedFpStatus
+ }
+ return(wFaultFilter);
+}
+
+void Ow2DisplayExceptionInfo()
+{
+ char ErrMsg[512];
+
+ wsprintf(ErrMsg,
+ "OS2: Internal Exception 0x%lx occured at %lx\nApplication Name=%s\nLast OS/2 API=%s\nTID=%d PID=%d\nFP: Ctrl=%lx, Status=%lx\nEAX=%lx EBX=%lx ECX=%lx EDX=%lx ESI=%lx EDI=%lx\nESP=%lx EBP=%lx",
+ ExRec.ExceptionCode,
+ ExRec.ExceptionAddress,
+ Od2Process ? Od2ApplName() : "None",
+ (IsOs2Thread()) ? (Od2GetLastAPI()) : "None",
+ (IsOs2Thread()) ? (Od2ThreadId()) : 0,
+ Od2Process ? Od2ProcessId() : 0,
+ (DWORD) wSavedFpCtrl,
+ (DWORD) wSavedFpStatus,
+ (ExPtrs.ContextRecord)->Eax,
+ (ExPtrs.ContextRecord)->Ebx,
+ (ExPtrs.ContextRecord)->Ecx,
+ (ExPtrs.ContextRecord)->Edx,
+ (ExPtrs.ContextRecord)->Esi,
+ (ExPtrs.ContextRecord)->Edi,
+ (ExPtrs.ContextRecord)->Esp,
+ (ExPtrs.ContextRecord)->Ebp
+ );
+
+ MessageBox(NULL, ErrMsg, "Error", MB_OK | MB_ICONSTOP | MB_SYSTEMMODAL | MB_SETFOREGROUND);
+}
+
+void __cdecl
+main (int argc,
+ char *argv[],
+ char *envp[])
+{
+ UINT StringCode;
+ ULONG tmp, ConStringCode;
+#if PMNT
+ HANDLE NewForegroundWindow;
+#endif //PMNT
+
+ //
+ // Get the handle of the foreground window which is the window of the
+ // curent process.
+ // BUGBUG - This value is not neccessarily the right value because
+ // the user might immediately switch to another window which
+ // results in OS2.EXE having the handle of some other window
+ //
+ // Do not remove this statement without consulting with PM/NT team - the
+ // Ow2ForegroundWindow below is used by PM/NT call(s).
+ Ow2ForegroundWindow = GetForegroundWindow();
+
+ //
+ // Put the entire execution of the os/2 program inside a try/except.
+ // This way we ensure that we recover from 32 bit exceptions
+ //
+ // Note that the above is done only for RETAIL build. For DBG builds,
+ // it is better to let NTSD handle the exception so that we can debug
+ // the problem right away.
+ //
+ try {
+ timing = 0;
+#if DBG
+ Os2Debug = 0;
+ fVerbose = FALSE;
+ fTrace = FALSE;
+ fBrkOnStart = FALSE;
+#endif
+ //timing = GetTickCount();
+ //printf("Os2 main init time is %d\n", timing);
+ //Os2Debug = OS2_DEBUG_OS2_EXE;
+ Os2ReturnCode = 0;
+ Od2SignalEnabled = FALSE;
+
+ SetErrorMode(1);
+ /*
+ * get the full path of the program to execute
+ */
+
+ if (timing)
+ {
+ printf("Os2 time before GetPgmName is %d\n", (GetTickCount()) - timing);
+ }
+ if (StringCode = GetPgmName(argc))
+ {
+ Ow2Exit(StringCode, Od2PgmFullPathBuf, 1);
+ }
+
+ if (!fService)
+ {
+ char TmpBuffer[256];
+
+ // OS/2 child processes of OS/2 apps started from a service don't
+ // have the /S switch but they should find a variable 'Os2SSService'
+ // in their environment
+
+ if (GetEnvironmentVariable(
+ "Os2SSService",
+ &TmpBuffer[0],
+ 256))
+ {
+ // non-zero return code means variable was found
+ fService = TRUE;
+ }
+ }
+ else
+ {
+ if (!SetEnvironmentVariable(
+ "Os2SSService",
+ "1"))
+ {
+#if DBG
+ KdPrint(("OS2: failed to SetEnvironment variable Os2SSService, error=%d\n",
+ GetLastError()));
+#endif
+ }
+ }
+
+#if DBG
+ if (fService)
+ KdPrint(("Os2: Loading %s (as a service)\n", Od2PgmFullPathBuf));
+ else
+ KdPrint(("Os2: Loading %s\n", Od2PgmFullPathBuf));
+#endif
+ /*
+ * Set event handlers to handle Ctrl-C etc.
+ */
+
+ if (timing)
+ {
+ printf("Os2 time before SetEventHandlers is %d\n", (GetTickCount()) - timing);
+ }
+
+ SetEventHandlers(TRUE);
+
+ /*
+ * Set Std-Handles and open CONOUT$
+ */
+
+ if (timing)
+ {
+ printf("Os2 time before InitStdConout is %d\n", (GetTickCount()) - timing);
+ }
+
+ ConStringCode = InitStdConout();
+
+
+ /*
+ * Connect with OS2SS
+ */
+
+ if (timing)
+ {
+ printf("Os2 time before InitOs2ssSessionPort is %d\n", (GetTickCount()) - timing);
+ }
+ tmp = InitOs2ssSessionPort();
+
+ //
+ // InitOs2ssSessionPort returns:
+ // 0L - problem with resources, like memory
+ // -1L - problem connecting to os2srv
+ // otherwise - OK
+ //
+ if (tmp == -1L)
+ {
+ Ow2Exit(IDS_OS2_NOCONNECT, NULL, 1);
+ }
+ else if (tmp == 0)
+ {
+ Ow2Exit(IDS_OS2_NOMEMORY, NULL, 1);
+ }
+
+ Sleep(2);
+
+#if PMNT
+ NewForegroundWindow = (HANDLE)PMNTGetOurWindow();
+ if ((NewForegroundWindow != 0) &&
+ (NewForegroundWindow != Ow2ForegroundWindow))
+ {
+#if DBG
+ DbgPrint("Os2:main(), warning Ow2ForeGroundWindow changed from %x to %x\n",
+ Ow2ForegroundWindow,
+ NewForegroundWindow);
+#endif // DBG
+ Ow2ForegroundWindow = NewForegroundWindow;
+ }
+#endif // PMNT
+
+ if (timing)
+ {
+ printf("Os2 time before calling Od2DllInitialize is %d\n", (GetTickCount()) - timing);
+ }
+
+ if (!Od2DllInitialize(NULL, DLL_PROCESS_ATTACH, NULL))
+ {
+#if DBG
+ KdPrint(("OS2SES: Od2DllInitialize failed\n"));
+#endif
+ Ow2Exit(IDS_OS2_INITFAIL, NULL, 1);
+ // Ow2Exit(0, NULL, 1);
+ }
+
+ if (Od2CommandLinePtr)
+ if (LocalFree(Od2CommandLinePtr) != NULL)
+ {
+#if DBG
+ KdPrint(("OS2SES: Failed to free PsevdoArgv\n"));
+#endif
+ }
+
+ if ( ConStringCode )
+ {
+
+ if (!Od2ProcessIsDetached())
+ {
+#if DBG
+ KdPrint(("Os2: InitStdConout returned error %d\n", ConStringCode));
+#endif
+/**
+ For now, we do nothing, because the code below popup a window for a second.
+ if we find a better way, we'll use it, otherwise do nothing.
+ //
+ // Two cases - created with DETACH_PROCESS by non-OS/2 app
+ // OR
+ // failed somehow to create the console.
+ //
+ // No official way to test it, so we allocate console,
+ // if we succeed, this is the 1st case, free it and continue.
+ // if we fail, it means we already have one but can't access
+ // it somehow, fail the app.
+ //
+ if (AllocConsole())
+ {
+ FreeConsole();
+ }
+ else
+ Ow2Exit(ConStringCode, NULL, 1);
+**/
+ }
+ }
+
+ if (fRootService)
+ {
+ HANDLE ThreadHandle;
+ ULONG Tid;
+
+ ThreadHandle = CreateThread( NULL,
+ 0,
+ (LPTHREAD_START_ROUTINE)Os2ServiceThread,
+ NULL,
+ 0,
+ &Tid);
+
+ if (!ThreadHandle)
+ {
+#if DBG
+ DbgPrint("OS2: main(), fail to create service thread, error %d\n",
+ GetLastError());
+#endif
+ }
+ else
+ {
+ if (!CloseHandle(ThreadHandle))
+ {
+#if DBG
+ DbgPrint("OS2: main(), CloseHandle(service thread=%x) failed, error=%d\n",
+ ThreadHandle, GetLastError());
+#endif // DBG
+ }
+ }
+ }
+
+ if (timing)
+ {
+ printf("Os2 time before calling loader_main is %d\n", (GetTickCount()) - timing);
+ }
+ Loader_main();
+ if (Od2ReceivedSignalAtInit) {
+ //
+ // OS2.EXE received a signal before complete loading,
+ // handle it now
+ //
+ EventHandlerRoutine(Od2InitSignalType);
+ }
+ }
+
+ //
+ // if Os2Debug is on, and ntsd is attached, it will get the second chance
+ //
+#if DBG
+ except( (Os2Debug ? Ow2FaultFilter(EXCEPTION_CONTINUE_SEARCH, GetExceptionInformation()):
+
+ Ow2FaultFilter(EXCEPTION_EXECUTE_HANDLER, GetExceptionInformation())) ) {
+#else
+ except( Ow2FaultFilter(EXCEPTION_EXECUTE_HANDLER, GetExceptionInformation()) ) {
+#endif
+#if DBG
+ KdPrint(("OS2SES: Internal error - Exception occured in 32bit os2ss code\n"));
+#endif
+ Ow2DisplayExceptionInfo();
+
+ //
+ // Cleanup client state, server will get notified
+ // via the exitprocess debug event
+ //
+ Od2FinalProcessCleanup();
+ Ow2Exit(IDS_OS2_INTERNAL_ERROR, NULL, 1);
+ }
+}
+
+
+VOID SetEventHandlers(IN BOOL fSet)
+{
+
+ Or2WinSetConsoleCtrlHandler(
+ #if DBG
+ SetEventHandlerStr,
+ #endif
+ EventHandlerRoutine,
+ fSet
+ );
+}
+
+struct
+{
+ LPTHREAD_START_ROUTINE lpStartAddress;
+ int Priority;
+ HANDLE *hServerThread;
+} SERVER_THREAD_TABLE[] =
+ {
+ {
+ EventServerThread,
+ OS2_EVENT_THREAD_PRIORITY,
+ &EventServerThreadHandle
+ },
+ {
+ SessionRequestThread,
+ OS2_SERVER_THREAD_PRIORITY,
+ &Ow2hSessionRequestThread
+ },
+ {
+ NULL,
+ 0,
+ NULL
+ }
+ };
+
+
+DWORD
+CreateServerThreads(VOID)
+{
+ HANDLE tHandle;
+ DWORD Tid, i;
+
+ /*
+ * create 1 for getting Input Event and dispatch them to 2 seperate
+ * queues for Kbd & Mou
+ */
+
+ for ( i = 0 ; SERVER_THREAD_TABLE[i].lpStartAddress ; i++ )
+ {
+
+ if((tHandle = Or2WinCreateThread(
+ #if DBG
+ CreateServerThreadsStr,
+ #endif
+ NULL,
+ 0,
+ SERVER_THREAD_TABLE[i].lpStartAddress,
+ NULL,
+ CREATE_SUSPENDED,
+ &Tid
+ )) == NULL)
+ {
+#if DBG
+ KdPrint(("OS2SES(Os2-CreateServerThreads): error %lu CreateThread %u\n",
+ GetLastError(), i));
+ ASSERT( FALSE );
+#endif
+ return(1L);
+ }
+
+ *SERVER_THREAD_TABLE[i].hServerThread = tHandle;
+ }
+
+ if(Or2WinResumeThread(
+ #if DBG
+ CreateServerThreadsStr,
+ #endif
+ Ow2hSessionRequestThread
+ ) == -1)
+ {
+#if DBG
+ KdPrint(("OS2SES(Os2-CreateServerThreads): error %lu ResumeThread ServerRequest\n",
+ GetLastError()));
+ ASSERT( FALSE );
+#endif
+ return(1L);
+ }
+
+ if (!Or2WinSetThreadPriority(
+ #if DBG
+ CreateServerThreadsStr,
+ #endif
+ Ow2hSessionRequestThread,
+ OS2_SERVER_THREAD_PRIORITY
+ ))
+ {
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ KdPrint(("OS2SES(Os2-CreateServerThreads): error %lu SetThreadPriority RequestThread\n",
+ GetLastError()));
+#endif
+ }
+ return(0L);
+}
+
+
+DWORD
+ResumeServerThreads(VOID)
+{
+ HANDLE tHandle;
+ DWORD i;
+
+ for ( i = 0 ; SERVER_THREAD_TABLE[i].lpStartAddress ; i++ )
+ {
+ if ((tHandle = *SERVER_THREAD_TABLE[i].hServerThread) !=
+ Ow2hSessionRequestThread)
+ {
+ if(Or2WinResumeThread(
+ #if DBG
+ ResumeServerThreadsStr,
+ #endif
+ tHandle
+ ) == -1)
+ {
+#if DBG
+ KdPrint(("OS2SES(Os2-CreateServerThreads): error %lu CreateThread %u\n",
+ GetLastError(), i));
+ ASSERT( FALSE );
+#endif
+ return(1L);
+ }
+
+ if (!Or2WinSetThreadPriority(
+ #if DBG
+ ResumeServerThreadsStr,
+ #endif
+ tHandle,
+ SERVER_THREAD_TABLE[i].Priority
+ ))
+ {
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ KdPrint(("OS2SES(Os2-CreateServerThreads): error %lu SetThreadPriority %u\n",
+ GetLastError(), i));
+#endif
+ }
+ }
+ }
+ return(0L);
+}
+
+
+#define SKIP_ARG( Ptr ) \
+{ \
+ register char ch; \
+ argc --; \
+ while( ch = *Ptr++ ) \
+ { \
+ if(( ch == ' ' ) || ( ch == '\t' )) \
+ { \
+ break; \
+ } \
+ } \
+} \
+
+UINT
+GetPgmName(
+ int argc
+ )
+{
+ char *lpPgmName = NULL, CurChar, *ArgvPtr;
+ DWORD Rc;
+ int i;
+ CHAR ch;
+
+ /*
+ * Get the command line in OEM code page.
+ * Format is : "OS2 /P <full path> /C <original CommandLine>"
+ */
+
+ Rc = Ow2CommandLineWToCommandLineA(
+ GetCommandLineW(),
+ &ArgvPtr
+ );
+
+ //RtlProcessHeap
+ if ( Rc )
+ {
+ return(IDS_OS2_NOMEMORY);
+ }
+
+ /*
+ * skip program name ("OS2.EXE")
+ */
+
+ SKIP_ARG( ArgvPtr )
+
+ /*
+ * look for flags for os2 up to /C
+ *
+ */
+
+ while ( argc )
+ {
+ if ( ArgvPtr[0] == '/' )
+ {
+ CurChar = ArgvPtr[1] | ('a'-'A');
+ ArgvPtr += 2;
+ if ( CurChar == 'c' )
+ {
+ /*
+ * Skip the /C and break from the while loop
+ */
+
+ ArgvPtr++;
+ break;
+
+ } else switch ( CurChar )
+ {
+ case 'p':
+ SKIP_ARG(ArgvPtr);
+ lpPgmName = ArgvPtr;
+ break;
+#if DBG
+ case 'b':
+ fBrkOnStart = TRUE;
+ KdPrint((
+ "OS2: Breakpoint caused by /B switch!\n"));
+ _asm int 3;
+ break;
+
+ case 'v':
+ fVerbose = TRUE;
+ break;
+
+ case 't':
+ fTrace = TRUE;
+ break;
+#endif
+ case 's':
+ fService = TRUE;
+#if PMNT
+ // Don't consider PMSHELL a root service, i.e. don't
+ // create a termination thread for it. We don't want
+ // PMSHELL to terminate even if the service which started it
+ // is stopped because there may be PM apps out there which
+ // weren't started by services.
+ if (!ProcessIsPMShell())
+ fRootService = TRUE;
+#else
+ fRootService = TRUE;
+#endif
+ break;
+
+ default:
+ strncpy(Od2PgmFullPathBuf, ArgvPtr, MAX_PATH);
+ Od2PgmFullPathBuf[MAX_PATH - 1] = '\0';
+ return(IDS_OS2_WHATFLAG);
+ }
+ } else
+ {
+ return(IDS_OS2_USAGE);
+ }
+
+ SKIP_ARG(ArgvPtr);
+ }
+
+ /*
+ * We exit the loop when "/C" was found or when "argc=0".
+ * Make sure "/C" was found and "/P <appl_full_path>" had been
+ * found.
+ */
+
+ if (( CurChar != 'c' ) || !lpPgmName )
+ {
+ return(IDS_OS2_NOCMD);
+ }
+
+ /*
+ * The full path of the program to execute is pointed by lpPgmName
+ * but is space terminated. ArgvPtr points to the original command
+ * line.
+ */
+
+ for ( i = 0 ;
+ ( lpPgmName[i] != '\0' ) &&
+ ( lpPgmName[i] != ' ' ) &&
+ ( lpPgmName[i] != '\t' ) &&
+ ( i < MAX_PATH )
+ ; Od2PgmFullPathBuf[i] = lpPgmName[i], i++ );
+
+ if ( i == MAX_PATH )
+ {
+ return(IDS_OS2_NOMEMORY);
+ }
+
+ Od2PgmFullPathBuf[i] = '\0';
+ Od2PgmFullPathBufLength = i;
+
+ // Code below replaces the program name with the full-path. This caused
+ // the PM Deskpic screen-saver to GP because it looked for '\'
+ // (31-May-94, RAID bug#2932)
+
+ SKIP_ARG(ArgvPtr);
+
+ ch = lpPgmName[i];
+
+ if (argc > 1)
+ {
+ Od2CommandLinePtr =
+ (PSZ)LocalAlloc(0,
+ // Path + SPACE + arguments + /0
+ Od2PgmFullPathBufLength + 1 + strlen(ArgvPtr) + 1);
+ }
+ else
+ {
+ Od2CommandLinePtr =
+ (PSZ)LocalAlloc(0,
+ // Path + /0
+ Od2PgmFullPathBufLength + 1);
+ }
+
+ if (Od2CommandLinePtr == NULL)
+ {
+ return(IDS_OS2_NOMEMORY);
+ }
+
+ strcpy(Od2CommandLinePtr, Od2PgmFullPathBuf);
+
+ if (argc > 1)
+ {
+ strncat(Od2CommandLinePtr, &ch, 1); // Cat the argv0-1 seperating char
+ strcat(Od2CommandLinePtr, ArgvPtr); // Fill in all the rest (argvs)
+ }
+
+ // Find the program name by skipping up to (and include) '\', '/' and ':'
+
+ Od2PgmFilePath = &Od2PgmFullPathBuf[0];
+
+ for ( i = 0 ; ( Od2PgmFullPathBuf[i] != '\0' ) ; i++ )
+ {
+ if (( Od2PgmFullPathBuf[i] == ':' ) ||
+ ( Od2PgmFullPathBuf[i] == '/' ) ||
+ ( Od2PgmFullPathBuf[i] == '\\' ))
+ {
+ Od2PgmFilePath = &Od2PgmFullPathBuf[i+1];
+ }
+ }
+
+ return(0);
+}
+
+
+UINT
+InitStdConout()
+{
+// SECURITY_ATTRIBUTES SecurityAttributes;
+#if DBG
+ DWORD Status;
+#endif
+
+ /*
+ * Get a handle to CONIN$ & CONOUT$ for KBD & VIO requests
+ */
+
+ hConsoleStdIn = GetStdHandle(STD_INPUT_HANDLE);
+ hConsoleStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+ hConsoleStdErr = GetStdHandle(STD_ERROR_HANDLE);
+
+ hStdInConsoleType = (USHORT)(CONSOLE_HANDLE(hConsoleStdIn) &&
+ VerifyConsoleIoHandle(hConsoleStdIn));
+ hStdOutConsoleType = (USHORT)(CONSOLE_HANDLE(hConsoleStdOut) &&
+ VerifyConsoleIoHandle(hConsoleStdOut));
+ hStdErrConsoleType = (USHORT)(CONSOLE_HANDLE(hConsoleStdErr) &&
+ VerifyConsoleIoHandle(hConsoleStdErr));
+
+// SecurityAttributes.bInheritHandle = FALSE;
+// SecurityAttributes.lpSecurityDescriptor = NULL;
+// SecurityAttributes.nLength = sizeof (SECURITY_ATTRIBUTES);
+
+ /*
+ * Open CONOUT$ if StdOut id redirected
+ */
+
+ if (hStdOutConsoleType)
+ {
+ hConsoleOutput = hConsoleStdOut;
+ } else
+ {
+ hConsoleOutput = Or2WinCreateFileW(
+ #if DBG
+ InitStdConoutStr,
+ #endif
+ L"CONOUT$",
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ|FILE_SHARE_WRITE,
+ NULL, /* &SecurityAttributes, */
+ OPEN_EXISTING, /* CREATE_ALWAYS, */
+ 0,
+ NULL
+ );
+
+// hConsoleOutput = Or2WinCreateConsoleScreenBuffer(
+// #if DBG
+// InitStdConoutStr,
+// #endif
+// GENERIC_READ | GENERIC_WRITE,
+// FILE_SHARE_READ|FILE_SHARE_WRITE,
+// NULL, /* &SecurityAttributes */
+// CONSOLE_TEXTMODE_BUFFER,
+// NULL);
+
+ if (hConsoleOutput == INVALID_HANDLE_VALUE)
+ {
+ return (IDS_OS2_CREATECONOUT);
+ }
+
+ if (!Or2WinSetConsoleActiveScreenBuffer(
+ #if DBG
+ InitStdConoutStr,
+ #endif
+ hConsoleOutput
+ ))
+ {
+#if DBG
+// return (IDS_OS2_ACTIVECONOUT);
+ Status = GetLastError();
+ IF_OD2_DEBUG( ANY )
+ {
+ KdPrint(("OS2SES(Os2-SetConsoleActiveScreenBuffer): can't activate CONOUT(%lu) in Full-Screen\n", Status));
+ }
+#endif
+ }
+ }
+
+ hConOut = hConsoleOutput;
+
+ SetConsoleInputModeAgain = 0;
+ SetConsoleOutputModeAgain = 0;
+
+ return(0);
+}
+
+
+DWORD
+SesGrpInit()
+{
+ DWORD Type, Rc, i;
+ HANDLE *Handle;
+ USHORT *fType, FileType;
+ COORD Coord;
+ CONSOLE_FONT_INFO ConsoleCurrentFont;
+#if DBG
+ UCHAR ErrBuff[ERROR_BUFFER_SIZE];
+#endif
+
+ //SesGrp->WinProcessNumberInSession = 0;
+ //SesGrp->WinSyncProcessNumberInSession = 0;
+
+ SesGrp->hConsoleInput = hConsoleInput;
+ SesGrp->hConsoleOutput = hConsoleOutput;
+
+ SesGrp->StdIn = hConsoleStdIn;
+ SesGrp->StdOut = hConsoleStdOut;
+ SesGrp->StdErr = hConsoleStdErr;
+
+ SesGrp->StdInFlag = hStdInConsoleType;
+ SesGrp->StdOutFlag = hStdOutConsoleType;
+ SesGrp->StdErrFlag = hStdErrConsoleType;
+
+ //SesGrp->KbdInFocus = 0;
+ SesGrp->NoKbdFocus = TRUE;
+ SesGrp->FirstProcess = TRUE;
+ SesGrp->StdInHandleCount = 1;
+ SesGrp->StdOutHandleCount = 1;
+ SesGrp->StdErrHandleCount = 1;
+ //SesGrp->hConsolePopUp = NULL;
+
+ for ( i=0, Handle = &(SesGrp->StdIn),
+ fType = &(SesGrp->StdInFileType) ;
+ i<3 ; i++, Handle++, fType++ )
+ {
+ Type = GetFileType(*Handle);
+ // BUGBUG maybe call NtQueryVolumeInformationFile directly (base\client\filehops.h)
+ switch (Type)
+ {
+ case FILE_TYPE_DISK:
+ FileType = 0x0000; // FILE_TYPE_FILE
+ break;
+
+ case FILE_TYPE_CHAR:
+ FileType = 0x0001; // FILE_TYPE_DEV
+ break;
+
+ case FILE_TYPE_PIPE:
+ FileType = 0x0002; // FILE_TYPE_PIPE
+ break;
+
+ //case FILE_TYPE_UNKNOWN:
+ default:
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ DbgPrint("OS2SES(SesGrpInit): GetFileType(handle %lx) failed, LastError = %ld\n",
+ *Handle, GetLastError());
+ }
+#endif
+ FileType = 0x0001; // FILE_TYPE_DEV - to be safety
+ break;
+ }
+
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ KdPrint(("OS2SES(HandlesTypes): Handle %lx(%lu), WinType %lx, Os2Type %lx\n",
+ *Handle, i, Type, FileType ));
+ }
+#endif
+ *fType = FileType;
+ }
+
+ Or2WinGetConsoleScreenBufferInfo(
+ #if DBG
+ SesGrpInitStr,
+ #endif
+ hConsoleOutput,
+ &StartUpScreenInfo
+ );
+
+ SesGrp->ScreenColNum = StartUpScreenInfo.dwSize.X;
+ if ((SesGrp->ScreenRowNum = StartUpScreenInfo.dwSize.Y) > OS2_VIO_MAX_ROW)
+ {
+#if DBG
+ IF_OD2_DEBUG( ANY )
+ {
+ KdPrint(("OS2SES: Screen size is bigger than the maximum for OS/2.\n"));
+ KdPrint((" OS2SS will use only first %d rows of the %d available\n",
+ OS2_VIO_MAX_ROW, StartUpScreenInfo.dwSize.Y));
+ }
+#endif
+ SesGrp->ScreenRowNum = OS2_VIO_MAX_ROW;
+ }
+ SesGrp->CellVSize = SesGrp->CellHSize = 8;
+
+ if (!GetCurrentConsoleFont(hConsoleOutput,
+ TRUE, /* maximize window */
+ &ConsoleCurrentFont))
+ {
+#if DBG
+ Rc = GetLastError();
+ if ( Rc == ERROR_FULLSCREEN_MODE )
+ {
+ IF_OD2_DEBUG( ANY )
+ {
+ KdPrint(("OS2SES(Os2-GetCurrentConsoleFont): can't query current font(%lu) in Full-Screen\n",
+ Rc));
+ }
+ } else
+ {
+ sprintf(ErrBuff, "OS2SES(Os2-GetCurrentConsoleFont): can't query current font(%lu)\n", Rc);
+ ASSERT1( ErrBuff, FALSE );
+ }
+#endif
+ } else
+ {
+ Coord = GetConsoleFontSize(hConsoleOutput,
+ ConsoleCurrentFont.nFont);
+
+#if DBG
+ if ((!Coord.X) && (!Coord.Y))
+ {
+ Rc = GetLastError();
+ sprintf(ErrBuff, "OS2SES(Os2-GetConsoelFontSize): can't query font Size(%lu)\n", Rc);
+ ASSERT1( ErrBuff, FALSE );
+ }
+#endif
+
+ SesGrp->CellVSize = Coord.Y;
+ SesGrp->CellHSize = Coord.X;
+ }
+
+ StartUpwAttributes = StartUpScreenInfo.wAttributes;
+
+ if (!Or2WinGetConsoleMode(
+ #if DBG
+ SesGrpInitStr,
+ #endif
+ hConsoleOutput,
+ &SesGrp->DefaultWinOutputMode
+ ))
+ {
+ Rc = GetLastError();
+#if DBG
+ ASSERT1( "Can not get CONOUT for default Mode\n", FALSE );
+#endif
+ SesGrp->DefaultWinOutputMode = WINDOW_DEFAULT_OUTPUT_MODE;
+ }
+
+ SesGrp->OutputModeFlags = WINDOW_DEFAULT_OUTPUT_MODE;
+
+ if (!Or2WinSetConsoleMode(
+ #if DBG
+ SesGrpInitStr,
+ #endif
+ hConsoleOutput,
+ OS2_DEFAULT_OUTPUT_MODE
+ ))
+ {
+ Rc = GetLastError();
+#if DBG
+ ASSERT1( "Can not set CONOUT for default Mode\n", FALSE );
+#endif
+ }
+ else
+ SesGrp->OutputModeFlags = OS2_DEFAULT_OUTPUT_MODE;
+
+ SesGrp->MaxLVBsize =
+ (SesGrp->ScreenColNum * SesGrp->ScreenRowNum * 4 );
+
+ if (SesGrp->MaxLVBsize < 80 * 100 * 4) /* buffer for 100x80 window */
+ {
+ SesGrp->MaxLVBsize = 80 * 100 * 4;
+ }
+
+ if (SesGrp->MaxLVBsize > (64 * 1024)) /* more than 64K */
+ {
+ SesGrp->MaxLVBsize = 64 * 1024;
+ }
+
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ KdPrint(("OS2SES(Os2-Handles): hIn %lx, hOut %lx, StdIn %lx (%s), StdOut %lx(%s), StdErr %lx(%s)\n",
+ hConsoleInput, hConsoleOutput,
+ hConsoleStdIn, ((hStdInConsoleType) ? "Std" : "Rdr" ),
+ hConsoleStdOut, ((hStdOutConsoleType) ? "Std" : "Rdr" ),
+ hConsoleStdErr, ((hStdErrConsoleType) ? "Std" : "Rdr" )
+ ));
+ }
+#endif
+
+#if DBG
+// KdPrint(("OS2SES(Os2-ConInfo): Size %x:%x, Pos %x:%x, Attr %x, Win %x:%x-%x:%x, Max %x:%x\n",
+// StartUpScreenInfo.dwSize.Y, StartUpScreenInfo.dwSize.X,
+// StartUpScreenInfo.dwCursorPosition.Y, StartUpScreenInfo.dwCursorPosition.X,
+// StartUpScreenInfo.wAttributes,
+// StartUpScreenInfo.srWindow.Top, StartUpScreenInfo.srWindow.Left,
+// StartUpScreenInfo.srWindow.Bottom, StartUpScreenInfo.srWindow.Right,
+// StartUpScreenInfo.dwMaximumWindowSize.Y, StartUpScreenInfo.dwMaximumWindowSize.X ));
+#endif
+
+ return(0L);
+}
+
+
+VOID
+RestoreWin32ParmsBeforeTermination()
+{
+ Or2WinSetConsoleMode(
+ #if DBG
+ RestoreWin32ParmsBeforeTerminationStr,
+ #endif
+ hConsoleInput,
+ DefaultWinInputMode
+ );
+
+ Or2WinSetConsoleMode(
+ #if DBG
+ RestoreWin32ParmsBeforeTerminationStr,
+ #endif
+ hConsoleOutput,
+ SesGrp->DefaultWinOutputMode
+ );
+
+ /*
+ * This is a workaround since the CMD doesn't restore its CurType
+ *
+ * Bug #4323 (OS2SS: CURSOR DISAPPEARS AFTER EXITING WORD5.0)
+ */
+
+ Or2WinSetConsoleCursorInfo(
+ #if DBG
+ RestoreWin32ParmsBeforeTerminationStr,
+ #endif
+ hConsoleOutput,
+ &StartUpCursorInfo
+ );
+}
+
+
+VOID
+Ow2Exit(
+ IN UINT StringCode,
+ IN PCHAR ErrorText,
+ IN int ExitCode
+ )
+/*++
+
+Routine Description:
+
+ This routine performs the exit from OS2.EXE for OS/2 application.
+
+Arguments:
+
+ StringCode - A code to retrieve an error message from the string RC file
+ (os2.rc). It's printed to the stderr. If zero - no message will be
+ printed.
+
+ ErrorText - test to use in the error message (in place of %s, like
+ DLL name, ordinal number, etc.)
+
+ ExitCode - code to return to Win32 CRT
+
+Return Value:
+
+
+Note:
+
+ This routine calls CRT's exit() and doesn't return.
+
+--*/
+{
+ WCHAR ErrBuffW[ERROR_BUFFER_SIZE];
+ CHAR ErrBuff[ERROR_BUFFER_SIZE];
+ DWORD Count;
+ DWORD Rc;
+
+ //if ((handOS2 = GetModuleHandle("os2.exe")) == NULL)
+ if (StringCode)
+ {
+ if ((handOS2 == NULL) &&
+ ((handOS2 = GetModuleHandle(NULL)) == NULL))
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2 ended! (error %lu on GetModuleHandle for ExitCode %lu)\n",
+ Rc, StringCode));
+#endif
+ } else
+ {
+ if ((Count = LoadStringW(handOS2,
+ StringCode,
+ ErrBuffW,
+ ERROR_BUFFER_SIZE)) == 0L)
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2 ended! (error %lu on LoadStringW for ExitCode %lu)\n",
+ Rc, StringCode));
+#endif
+ } else
+ {
+ Count = WideCharToMultiByte(
+ CP_OEMCP,
+ 0L,
+ ErrBuffW,
+ Count,
+ ErrBuff,
+ ERROR_BUFFER_SIZE,
+ NULL,
+ NULL);
+
+ if (Count != 0) {
+
+ ErrBuff[Count] = '\0';
+ fprintf(stderr, ErrBuff, ErrorText);
+#if DBG
+ KdPrint((ErrBuff, ErrorText));
+#endif
+ } else {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2 ended! (error %lu on WideCharToMultiByte for ExitCode %lu)\n",
+ Rc, StringCode));
+#endif
+ }
+ }
+ }
+ }
+
+#if DBG
+ IF_OD2_DEBUG( ANY )
+ {
+ KdPrint(( "OS2 ended! (%lx)\n", ExitCode ));
+ }
+#endif
+
+ ExitProcess(ExitCode);
+}
+
+
+#define CAP_BUFFER_SIZE 80
+#define TEXT_BUFFER_SIZE 256
+
+CHAR DefaultConfigSysAccessCap[] = "OS/2 Subsystem -- CONFIG.SYS Access";
+CHAR DefaultConfigSysAccessText[] = "An OS/2 Application requested access to CONFIG.SYS - Read Only access is granted. In order to modify OS/2 CONFIG.SYS, logon as ADMINISTRATOR.\n";
+CHAR DriveNotReadyDefaultMsg[] = "There is no disk in the drive.\nPlease insert a disk into drive%s.\n" ;
+CHAR WriteProtectDefaultMsg[] = "The disk cannot be written to because it is write protected.\nPlease remove the write protection from the volume\nin drive%s.\n" ;
+CHAR DriveNotReadyDefaultHdr[] = "%s.EXE - No Disk";
+CHAR WriteProtectDefaultHdr[] = "%s.EXE - Write Protect Error";
+
+CHAR DefaultBoundAppLoadCap[] = "%s - OS/2 Subsystem Bound Application Load Failure";
+CHAR DefaultBoundAppLoadText[] =
+ "This application uses an unsupported OS/2 API, and therefore "
+ "cannot be executed by the OS/2 Subsystem. "
+ "After the application terminates, you may try re-running it "
+ "using forcedos, as the DOS Subsystem may be able to support it. "
+ "Press Enter to terminate the application.";
+
+VOID
+Ow2ConfigSysPopup(
+ VOID
+ )
+
+/*++
+
+Routine Description:
+
+ Pops up a window informing the user that s/he cannot update the registry due
+ to insufficient privilege.
+
+ The message is only popped up once per program.
+
+Arguments:
+
+ None.
+
+Return Value:
+
+ None.
+
+--*/
+
+{
+ static MessageAlreadyShown = FALSE;
+ CHAR TextBuff[TEXT_BUFFER_SIZE];
+ CHAR CapBuff[CAP_BUFFER_SIZE];
+
+ if (MessageAlreadyShown) {
+ return;
+ }
+
+ MessageAlreadyShown = TRUE;
+
+ if ((handOS2 == NULL) &&
+ ((handOS2 = GetModuleHandle(NULL)) == NULL))
+ {
+#if DBG
+ KdPrint(("Ow2ConfigSysPopup: error %lu on GetModuleHandle\n",
+ GetLastError()));
+#endif
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ IDS_OS2_CONFIGSYS_ACCESS_TXT,
+ TextBuff,
+ TEXT_BUFFER_SIZE))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2ConfigSysPopup: error %lu on LoadString1\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(TextBuff, DefaultConfigSysAccessText, TEXT_BUFFER_SIZE - 1);
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ IDS_OS2_CONFIGSYS_ACCESS_CAP,
+ CapBuff,
+ CAP_BUFFER_SIZE))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2ConfigSysPopup: error %lu on LoadString2\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(CapBuff, DefaultConfigSysAccessCap, CAP_BUFFER_SIZE - 1);
+ }
+
+ MessageBoxEx( NULL,
+ TextBuff,
+ CapBuff,
+ MB_APPLMODAL | MB_ICONEXCLAMATION | MB_OK | MB_SETFOREGROUND,
+ 0
+ );
+}
+
+
+int
+Ow2DisplayHardErrorPopup(
+ IN int Drive,
+ IN BOOLEAN WriteProtectError,
+ IN PUCHAR AppName
+ )
+{
+ int size;
+ char CaptionMessage[CAP_BUFFER_SIZE], TextMessage[TEXT_BUFFER_SIZE];
+ char CaptionBuffer[CAP_BUFFER_SIZE], TextBuffer[TEXT_BUFFER_SIZE];
+ char ApplNameBuff[OS2_MAX_APPL_NAME], DriveBuf[4];
+ char *ErrMsg, *ErrHdr;
+ UINT CapCode, TextCode;
+
+
+ strncpy(ApplNameBuff, AppName, OS2_MAX_APPL_NAME);
+ size = strlen(ApplNameBuff);
+ if ((size > 4 ) && !stricmp(&ApplNameBuff[size-4], ".exe")) {
+ ApplNameBuff[size-4] = '\0';
+ }
+ strupr(ApplNameBuff);
+
+ if (Drive != 0)
+ {
+ sprintf(DriveBuf, " %c:", ('A' - 1) + Drive );
+ } else
+ {
+ DriveBuf[0] = '\0';
+ }
+
+ if (WriteProtectError)
+ {
+ ErrMsg = WriteProtectDefaultMsg;
+ ErrHdr = WriteProtectDefaultHdr;
+ CapCode = IDS_OS2_WRITE_PROTECT_CAP;
+ TextCode = IDS_OS2_WRITE_PROTECT_TXT;
+ } else
+ {
+ ErrMsg = DriveNotReadyDefaultMsg;
+ ErrHdr = DriveNotReadyDefaultHdr;
+ CapCode = IDS_OS2_DEVIVE_NOT_READY_CAP;
+ TextCode = IDS_OS2_DEVIVE_NOT_READY_TXT;
+ }
+
+ if ((handOS2 == NULL) &&
+ ((handOS2 = GetModuleHandle(NULL)) == NULL))
+ {
+#if DBG
+ KdPrint(("Ow2DisplayHardErrorPopup: error %lu on GetModuleHandle\n",
+ GetLastError()));
+#endif
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ TextCode,
+ TextMessage,
+ TEXT_BUFFER_SIZE))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2DispalyardErrorPopup: error %lu on LoadString1\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(TextMessage, ErrMsg, TEXT_BUFFER_SIZE - 1);
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ CapCode,
+ CaptionMessage,
+ CAP_BUFFER_SIZE))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2DispalyardErrorPopup: error %lu on LoadString2\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(CaptionMessage, ErrHdr, CAP_BUFFER_SIZE - 1);
+ }
+
+ sprintf(CaptionBuffer, CaptionMessage, ApplNameBuff);
+ sprintf(TextBuffer, TextMessage, DriveBuf);
+
+ return (MessageBox(
+ GetActiveWindow(),
+ TextBuffer,
+ CaptionBuffer,
+ MB_ABORTRETRYIGNORE | MB_DEFBUTTON2 | MB_ICONSTOP | MB_SYSTEMMODAL | MB_SETFOREGROUND
+ ));
+}
+
+VOID
+Ow2BoundAppLoadPopup(
+ IN PSZ AppName
+ )
+
+/*++
+
+Routine Description:
+
+ Pops up a window informing the user that an attempt to load a bound app has
+ failed, and that s/he may try to use forcedos.
+
+Arguments:
+
+ None.
+
+Return Value:
+
+ None.
+
+--*/
+
+{
+ CHAR TextBuff[512];
+ CHAR CapBuff[CAP_BUFFER_SIZE];
+ CHAR CapBuff2[CAP_BUFFER_SIZE];
+
+ if ((handOS2 == NULL) &&
+ ((handOS2 = GetModuleHandle(NULL)) == NULL))
+ {
+#if DBG
+ KdPrint(("Ow2BoundAppLoadPopup: error %lu on GetModuleHandle\n",
+ GetLastError()));
+#endif
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ IDS_OS2_BOUND_APP_LOAD_TXT,
+ TextBuff,
+ 512))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2BoundAppLoadPopup: error %lu on LoadString1\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(TextBuff, DefaultBoundAppLoadText, 511);
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ IDS_OS2_BOUND_APP_LOAD_CAP,
+ CapBuff,
+ CAP_BUFFER_SIZE))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2BoundAppLoadPopup: error %lu on LoadString2\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(CapBuff, DefaultBoundAppLoadCap, CAP_BUFFER_SIZE - 1);
+ }
+
+ sprintf(CapBuff2, CapBuff, AppName);
+
+ MessageBoxEx( NULL,
+ TextBuff,
+ CapBuff2,
+ MB_APPLMODAL | MB_ICONSTOP | MB_OK | MB_SETFOREGROUND,
+ 0
+ );
+}
+
+#ifdef PMNT
+
+CHAR DefaultPMShellNotUpCap[] = "%s - PM Subsystem Application Load Failure";
+CHAR DefaultPMShellNotUpText[] = "You are attempting to execute an application under the PM Subsystem. \
+PM Shell needs to be running before this application. \
+Click on OK, or press ENTER to terminate the application, \
+then start PM Shell and re-try.";
+CHAR Default2ndPMShellCap[] = "%s - PM Subsystem 2nd PM Shell Failure";
+CHAR Default2ndPMShellText[] = "You are attempting to execute PM Shell. \
+Another copy of PM shell is already running, and therefore \
+this copy cannot be executed by the PM Subsystem.";
+CHAR DefaultPMShellFullScreenCap[] = "%s - PM Subsystem PM Shell Load Failure";
+CHAR DefaultPMShellFullScreenText[] = "PM Shell cannot be started from a full-screen CMD session. \
+Please start it from the Program Manager or from a windowed CMD session.";
+
+VOID
+Ow2PMShellErrorPopup(
+ IN PSZ AppName,
+ IN int error_flag
+ )
+
+/*++
+
+Routine Description:
+
+ Pops up a window informing the user that:
+ 1. an attempt to load a PM has failed because PM Shell is not up
+ 2. an attemp to load PM Shelll has failed because another copy
+ of PM Shell is already up.
+
+Arguments:
+
+ None.
+
+Return Value:
+
+ None.
+
+--*/
+
+{
+ CHAR TextBuff[512];
+ CHAR CapBuff[CAP_BUFFER_SIZE];
+ CHAR CapBuff2[CAP_BUFFER_SIZE];
+ UINT ids_txt,ids_cap;
+ CHAR *default_txt,*default_cap;
+
+ if (error_flag == ERROR_PMSHELL_NOT_UP) {
+ ids_txt = IDS_OS2_PMSHELL_NOT_UP_TXT;
+ ids_cap = IDS_OS2_PMSHELL_NOT_UP_CAP;
+ default_txt = DefaultPMShellNotUpText;
+ default_cap = DefaultPMShellNotUpCap;
+ }
+ else if (error_flag == ERROR_PMSHELL_FULLSCREEN)
+ {
+ ids_txt = IDS_OS2_PMSHELL_FULLSCREEN_TXT;
+ ids_cap = IDS_OS2_PMSHELL_FULLSCREEN_CAP;
+ default_txt = DefaultPMShellFullScreenText;
+ default_cap = DefaultPMShellFullScreenCap;
+ }
+ else {
+ ids_txt = IDS_OS2_2ND_PMSHELL_TXT;
+ ids_cap = IDS_OS2_2ND_PMSHELL_CAP;
+ default_txt = Default2ndPMShellText;
+ default_cap = Default2ndPMShellCap;
+ }
+
+ if ((handOS2 == NULL) &&
+ ((handOS2 = GetModuleHandle(NULL)) == NULL))
+ {
+#if DBG
+ KdPrint(("Ow2PMShellErrorPopup: error %lu on GetModuleHandle\n",
+ GetLastError()));
+#endif
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ ids_txt,
+ TextBuff,
+ 512))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2PMShellErrorPopup: error %lu on LoadString1\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(TextBuff, default_txt, 511);
+ }
+
+ if (( handOS2 == NULL) ||
+ !LoadString(handOS2,
+ ids_cap,
+ CapBuff,
+ CAP_BUFFER_SIZE))
+ {
+#if DBG
+ if ( handOS2 != NULL)
+ {
+ KdPrint(("Ow2PMShellErrorPopup: error %lu on LoadString2\n",
+ GetLastError()));
+ }
+#endif
+ strncpy(CapBuff, default_cap, CAP_BUFFER_SIZE - 1);
+ }
+
+ sprintf(CapBuff2, CapBuff, AppName);
+
+ MessageBoxEx( NULL,
+ TextBuff,
+ CapBuff2,
+ MB_APPLMODAL | MB_ICONSTOP | MB_OK | MB_SETFOREGROUND,
+ 0
+ );
+}
+
+// PatrickQ: This function is called from another module (client\dllpmnt.c) and
+// is here just because os2ses\os2.c has the right set of include files for
+// WIN32 calls.
+
+VOID PMNTRemoveCloseMenuItem()
+{
+ HMENU SystemMenu;
+ DWORD rc;
+
+ SystemMenu = GetSystemMenu(Ow2ForegroundWindow, FALSE);
+ if (SystemMenu == 0)
+ {
+#if DBG
+ DbgPrint("Failed to get system menu !\n");
+#endif
+ return;
+ }
+
+ rc = DeleteMenu(
+ SystemMenu,
+ SC_CLOSE,
+ MF_BYCOMMAND);
+
+#if DBG
+ if (!rc)
+ {
+ DbgPrint("Failed to delete menu - last error=%d\n",
+ GetLastError());
+ }
+#endif
+}
+
+#endif //PMNT
diff --git a/private/os2/os2ses/os2.rc b/private/os2/os2ses/os2.rc
new file mode 100644
index 000000000..3c51f3822
--- /dev/null
+++ b/private/os2/os2ses/os2.rc
@@ -0,0 +1,155 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ os2.rc
+
+Abstract:
+
+ This module contains the resource for OS2.EXE.
+
+Author:
+
+ Michael Jarus (mjarus) 19-Jul-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#include <windows.h>
+#include <ntverp.h>
+
+/*-----------------------------------------------*/
+/* the following lines are specific to this file */
+/*-----------------------------------------------*/
+
+/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR
+ * and VER_INTERNALNAME_STR must be defined before including COMMON.VER
+ * The strings don't need a '\0', since common.ver has them.
+ */
+#define VER_FILETYPE VFT_DLL
+/* possible values: VFT_UNKNOWN
+ VFT_APP
+ VFT_DLL
+ VFT_DRV
+ VFT_FONT
+ VFT_VXD
+ VFT_STATIC_LIB
+*/
+#define VER_FILESUBTYPE VFT2_UNKNOWN
+/* possible values VFT2_UNKNOWN
+ VFT2_DRV_PRINTER
+ VFT2_DRV_KEYBOARD
+ VFT2_DRV_LANGUAGE
+ VFT2_DRV_DISPLAY
+ VFT2_DRV_MOUSE
+ VFT2_DRV_NETWORK
+ VFT2_DRV_SYSTEM
+ VFT2_DRV_INSTALLABLE
+ VFT2_DRV_SOUND
+ VFT2_DRV_COMM
+*/
+#define VER_FILEDESCRIPTION_STR "OS2 Subsystem Client"
+#define VER_INTERNALNAME_STR "OS2.EXE"
+#define VER_ORIGINALFILENAME_STR "OS2.EXE"
+
+#include "common.ver"
+
+#include "os2res.h"
+
+STRINGTABLE PRELOAD
+ BEGIN
+ IDS_OS2_WHATFLAG "Unknown flag : %s\n"
+ IDS_OS2_USAGE "Usage : OS2 /P <full path> /C <original CommandLine>\n"
+ IDS_OS2_NOCMD "Command missing from syntax\nUsage : OS2 /P <full path> /C <original CommandLine>\n"
+ IDS_OS2_NOCONNECT "Cannot connect to OS2 SubSystem\n"
+ IDS_OS2_STARTPROCESS "Cannot Start Process\n"
+ IDS_OS2_CREATECONOUT "Cannot Create CONOUT\n"
+ IDS_OS2_CREATETHREAD "Cannot Create Thread \n"
+
+ IDS_OS2_INITFAIL "Error Init routine failed\n"
+ IDS_OS2_SEGNUMBER "Error invalid segment number\n"
+ IDS_OS2_EXEINVALID "Error module marked invalid\n"
+ IDS_OS2_STACKSEG "The file %s has an invalid stack address\n"
+ IDS_OS2_NOFILE "The system cannot find the file %s\n"
+ IDS_OS2_NOPROC "Error procedure not found %s\n"
+ IDS_OS2_NOORDINAL "Error ordinal not found %s\n"
+ IDS_OS2_CODESEG "The file %s has an invalid starting address\n"
+ IDS_OS2_MODULETYPE "The module %s has an invalid module type\n"
+ IDS_OS2_EXEFORMAT "The file %s has a bad executable format\n"
+ IDS_OS2_NOMEMORY "Insufficient Memory\n"
+ IDS_OS2_RELOCCHAIN "Relocation Chain Exceeds Limit\n"
+ IDS_OS2_OS2CODE "Error OS/2 error code %s\n"
+ IDS_OS2_BADFORMAT "The file %s has a bad format\n"
+
+ IDS_OS2_CONFIGSYS_ACCESS_CAP "OS/2 Subsystem -- CONFIG.SYS Access"
+ IDS_OS2_CONFIGSYS_ACCESS_TXT "An OS/2 Application requested access to CONFIG.SYS - Read Only access is granted. In order to modify OS/2 CONFIG.SYS, logon as ADMINISTRATOR.\n"
+ IDS_OS2_WRITE_PROTECT_CAP "%s.EXE - Write Protect Error"
+ IDS_OS2_WRITE_PROTECT_TXT "The disk cannot be written to because it is write protected.\nPlease remove the write protection from the volume\nin drive%s.\n"
+ IDS_OS2_DEVIVE_NOT_READY_CAP "%s.EXE - No Disk"
+ IDS_OS2_DEVIVE_NOT_READY_TXT "There is no disk in the drive.\nPlease insert a disk into drive%s.\n"
+ IDS_OS2_INTERNAL_ERROR "Internal OS/2 Subsystem Error - application terminated"
+ IDS_OS2_BOUND_APP_LOAD_CAP "%s - OS/2 Subsystem Bound Application Load Failure"
+ IDS_OS2_BOUND_APP_LOAD_TXT "You are attempting to execute a bound DOS - OS/2 application. \
+This application uses an unsupported OS/2 API, and therefore \
+cannot be executed by the OS/2 Subsystem. \
+After the application terminates, you may try re-running it \
+using forcedos, as the DOS Subsystem may be able to support it. \
+Press Enter to terminate the application."
+
+#if PMNT
+ IDS_OS2_PMSHELL_NOT_UP_CAP "%s - PM Subsystem Application Load Failure"
+ IDS_OS2_PMSHELL_NOT_UP_TXT "You are attempting to execute an application under the PM Subsystem. \
+PM Shell needs to be running before this application. \
+Click on OK, or press ENTER to terminate the application, \
+then start PM Shell and re-try."
+ IDS_OS2_2ND_PMSHELL_CAP "%s - PM Subsystem 2nd PM Shell Failure"
+ IDS_OS2_2ND_PMSHELL_TXT "You are attempting to execute PM Shell. \
+Another instance of PM Shell is already running, and therefore \
+this copy cannot be executed by the PM Subsystem."
+ IDS_OS2_PMSHELL_FULLSCREEN_CAP "%s - PM Subsystem PM Shell Load Failure"
+ IDS_OS2_PMSHELL_FULLSCREEN_TXT "PM Shell cannot be started from a full-screen CMD session. \
+Please start it from the Program Manager or from a windowed CMD session."
+#endif
+ END
+
+//LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
+// This table is idendical to the default (NEUTRAL)
+
+// Add tables to all supported languages.
+//
+// The translation must leave the appearence of "%s" in the strings.
+// Tables that are identical to the default (i.e. no translation needed),
+// don't have to be copied.
+//
+// LANGUAGE LANG_FRENCH,SUBLANG_FRENCH
+// STRINGTABLE PRELOAD
+// BEGIN
+// IDS_OS2_WHATFLAG "French string for Unknown flag : %s\n"
+// IDS_OS2_USAGE "French string for Usage : OS2 /P <full path> /C <original CommandLine>\n"
+// IDS_OS2_NOCMD ...
+// .
+// .
+// .
+// IDS_OS2_EXEFORMAT "French string for The file %s has a bad executable format\n"
+// END
+//
+// LANGUAGE LANG_DUTCH,SUBLANG_DUTCH
+// STRINGTABLE PRELOAD
+// BEGIN
+// IDS_OS2_WHATFLAG "Dutch string for Unknown flag : %s\n"
+// IDS_OS2_USAGE "Dutch string for Usage : OS2 /P <full path> /C <original CommandLine>\n"
+// IDS_OS2_NOCMD ...
+// .
+// .
+// .
+// IDS_OS2_EXEFORMAT "Dutch string for The file %s has a bad executable format\n"
+// END
+//
+// ... (all other language tables)
diff --git a/private/os2/os2ses/os2ses.h b/private/os2/os2ses/os2ses.h
new file mode 100644
index 000000000..6dcf4c856
--- /dev/null
+++ b/private/os2/os2ses/os2ses.h
@@ -0,0 +1,324 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ os2ses.h
+
+Abstract:
+
+ Main header file for OS2SES module.
+ This module contains includes for both WIN32 and native NT modules.
+ Most files are clean WIN32 sources. files named nt* contain NT
+ calls and provides the interaction with os2 server and client.
+
+Author:
+
+ Avi Nathan (avin) 17-Jul-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+
+#ifdef NTOS2_ONLY
+#include <nt.h>
+#include <ntrtl.h>
+#include <nturtl.h>
+#include "os2win.h"
+#endif // NTOS2_ONLY
+
+#include "os2dbg.h"
+
+#ifdef WIN32_ONLY
+#include <windows.h>
+#include "os2nt.h"
+#endif // WIN32_ONLY
+
+#include "os2crt.h"
+
+#if DBG
+extern ULONG Os2Debug;
+
+#ifdef NTOS2_ONLY
+#define ASSERT1( str, exp ) \
+ if (!(exp)) \
+ { \
+ UCHAR WinErrBuf[100]; \
+ \
+ sprintf(WinErrBuf, "%s NtStatus %lx\n", str, Status); \
+ \
+ RtlAssert( #exp, __FILE__, __LINE__, WinErrBuf ); \
+ }
+
+#endif // NTOS2_ONLY
+#ifdef WIN32_ONLY
+#define ASSERT1( str, exp ) \
+ if (!(exp)) \
+ { \
+ UCHAR WinErrBuf[100]; \
+ \
+ sprintf(WinErrBuf, "%s WinError %lx\n", str, GetLastError()); \
+ \
+ RtlAssert( #exp, __FILE__, __LINE__, WinErrBuf ); \
+ }
+
+#endif // WIN32_ONLY
+#else // DBG
+#define ASSERT1( str, exp )
+#endif // DBG
+
+extern BOOLEAN fService; // Are we running as a service ?
+
+#include "sesport.h"
+
+#define WINDOW_DEFAULT_INPUT_MODE (ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_WINDOW_INPUT | ENABLE_PROCESSED_INPUT)
+#define WINDOW_DEFAULT_OUTPUT_MODE (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT)
+#define OS2_DEFAULT_INPUT_MODE 0
+#define OS2_DEFAULT_OUTPUT_MODE (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT)
+#define OS2_MOUSE_DEAFULT_EVENT_MASK (OS2_MOUSE_MOTION | OS2_MOUSE_MOTION_WITH_BN1_DOWN | OS2_MOUSE_BN1_DOWN | OS2_MOUSE_MOTION_WITH_BN2_DOWN | OS2_MOUSE_BN2_DOWN)
+#define OS2_MOUSE_LEGAL_EVENT_MASK (OS2_MOUSE_MOTION | OS2_MOUSE_MOTION_WITH_BN1_DOWN | OS2_MOUSE_BN1_DOWN | OS2_MOUSE_MOTION_WITH_BN2_DOWN | OS2_MOUSE_BN2_DOWN | OS2_MOUSE_MOTION_WITH_BN3_DOWN | OS2_MOUSE_BN3_DOWN)
+
+#define CONSOLE_HANDLE_SIGNATURE 0x00000003
+#define CONSOLE_HANDLE(HANDLE) (((ULONG)(HANDLE) & CONSOLE_HANDLE_SIGNATURE) == CONSOLE_HANDLE_SIGNATURE)
+#define LONG_MINUS_ONE 0xFFFFFFFF
+
+#define OS2_SERVER_THREAD_PRIORITY THREAD_PRIORITY_NORMAL
+#define OS2_EVENT_THREAD_PRIORITY THREAD_PRIORITY_TIME_CRITICAL
+#define OS2_WAITER_THREAD_PRIORITY THREAD_PRIORITY_HIGHEST
+
+
+HANDLE Ow2hOs2srvPort; /* handle for the port with OS2SRV */
+HANDLE Ow2hSession; /* handle for the session (return from OS2SRV) */
+
+/* os2ses side listner and reply for Vio, Kbd, Mou, Mon & Ctrl ports */
+
+HANDLE Ow2hOs2sesPort; /* handle for the LPC port */
+
+/* SectionHandle & Base Address of Vio, Kbd and Ctrl shared data section
+ *
+ * address of the shared memory section of the console ports.
+ */
+
+PVOID Os2SessionCtrlDataBaseAddress;
+HANDLE Os2SessionCtrlDataSectionHandle;
+PVOID Os2SessionDataBaseAddress;
+HANDLE Os2SessionSesGrpDataSectionHandle;
+
+POS2_SES_GROUP_PARMS SesGrp;
+
+#define Os2SessionNetDataBaseAddress Os2SessionCtrlDataBaseAddress
+
+PVOID KbdAddress;
+
+/* handles of Win-Console */
+
+HANDLE hConsoleInput; /* Input Handle */
+HANDLE hConsoleOutput; /* Output Handle */
+HANDLE hPopUpOutput; /* PopUp Handle */
+HANDLE hConOut; /* Current Output Handle: hConsoleOutput or hPopUpOutput */
+HANDLE hConsoleStdIn; /* Standart Input Handle */
+HANDLE hConsoleStdOut; /* Standart Output Handle */
+HANDLE hConsoleStdErr; /* Standart Error Handle */
+
+USHORT hStdInConsoleType; /* IS_CONSOLE StdHandle flag */
+USHORT hStdOutConsoleType; /* IS_CONSOLE StdHandle flag */
+USHORT hStdErrConsoleType; /* IS_CONSOLE StdHandle flag */
+
+/* handles of threads */
+
+HANDLE hCtrlListenThread;
+HANDLE EventServerThreadHandle;
+HANDLE Ow2hSessionRequestThread;
+
+/*
+ * Handle & Base Address of LVB (LogicalVideoBuffer)
+ */
+
+HANDLE LVBHandle;
+PUCHAR LVBBuffer;
+
+/*
+ * Handle of Pause(^S) event
+ */
+
+HANDLE PauseEvent;
+
+HANDLE HandleHeap; /* address of heap space for KBD handles */
+
+ULONG timing;
+BOOLEAN Od2SignalEnabled;
+ULONG Os2srvCountryCode;
+ULONG Os2srvCodePage[2];
+UCHAR Os2srvKeyboardLayout[2];
+ULONG PortMessageHeaderSize;
+ULONG KbdEventQueueSize;
+ULONG MouEventQueueSize;
+ULONG Os2WindowFocus;
+DWORD InputModeFlags; /* Console Input Mode */
+DWORD DefaultWinInputMode; /* Default Win Console Output Mode */
+DWORD ReturnCode;
+DWORD SetConsoleInputModeAgain; /* need to set console mode after Win CreateProcess */
+DWORD SetConsoleOutputModeAgain;
+ULONG ApplicationNcbAddress;
+ULONG ApplicationPostAddress;
+DWORD Os2ReturnCode;
+#ifdef DBCS
+// MSKK Jan.14.1993 V-AkihiS
+UCHAR OldWinAttr[3]; /* Win32 attr at entry point (OS2 format) */
+#else
+UCHAR OldWinAttr; /* Win32 attr at entry point (OS2 format) */
+#endif
+
+
+#if DBG
+BOOL fVerbose;
+BOOL fTrace;
+BOOL fBrkOnStart;
+#endif
+
+/*
+ * initialize procedures
+ */
+
+DWORD InitOs2SessionPort(
+ char *PgmName,
+ char **envp
+ );
+DWORD AnsiInit(VOID);
+DWORD AnsiInitForSession(VOID);
+DWORD VioInit(IN VOID);
+DWORD VioInitForSession(IN VOID);
+DWORD NLSInit();
+DWORD KbdInitForNLS(IN ULONG KbdCP);
+DWORD VioInitForNLS(IN ULONG VioCP);
+ULONG NtGetIntegerFromUnicodeString(IN WCHAR *sCountryCode);
+DWORD CreateServerThreads(VOID);
+DWORD ResumeServerThreads(VOID);
+DWORD SesGrpInit(VOID);
+ULONG
+Ow2GetProcessIdFromLPCMessage(
+ IN PVOID LPCMessage
+ );
+
+/*
+ * ServerThreads to serve all port requests
+ */
+
+VOID ServeSessionRequests(VOID);
+DWORD SessionRequestThread(IN PVOID Parameter);
+DWORD EventServerThread(IN PVOID Parameter);
+
+/*
+ * ServerRoutine to handle the requests
+ */
+
+BOOL ServeTmRequest(IN PSCTMREQUEST PReq, OUT PVOID PStatus);
+BOOL ServeWinCreateProcess(IN PWINEXECPGM_MSG PReq, OUT PVOID PStatus);
+BOOL ServeKbdRequest(IN PKBDREQUEST PReq, OUT PVOID PStatus,
+ IN PVOID pMsg, OUT PULONG pReply);
+BOOL ServeMouRequest(IN PMOUREQUEST PReq, OUT PVOID PStatus,
+ IN PVOID pMsg, OUT PULONG pReply);
+BOOL ServeMonRequest(IN PMONREQUEST PReq, OUT PVOID PStatus,
+ IN PVOID pMsg, OUT PULONG pReply);
+BOOL ServeNetRequest(IN PNETREQUEST PReq, OUT PVOID PStatus);
+BOOL ServePrtRequest(IN PPRTREQUEST PReq, OUT PVOID PStatus);
+#ifdef DBCS
+// MSKK Dec.23.1992 V-AkihiS
+BOOL ServeImmonRequest(IN PIMMONREQUEST PReq, OUT PVOID PStatus);
+#endif
+
+/*
+ * routine to save requests for proposed replies
+ */
+
+VOID SavePortMessegeInfo(OUT PVOID MonHeader,
+ IN PVOID pMsg);
+VOID SaveKbdPortMessegeInfo(OUT PVOID MonHeader,
+ OUT PVOID KbdRequestArea,
+ IN PVOID pMsg);
+VOID SendMonReply(IN PVOID MonHeader,
+ IN PVOID pData,
+ IN USHORT Length);
+VOID SendMouReply(IN PVOID MonHeader,
+ IN PVOID pData);
+VOID SendKbdReply(IN PVOID MonHeader,
+ IN PVOID KbdRequestArea,
+ IN PVOID pData,
+ IN USHORT Length);
+
+VOID DisableScreenUpdate();
+VOID EnableScreenUpdate();
+VOID SendNewFocusSet(IN ULONG WindowFocus);
+
+VOID RestartEventServerThread(VOID);
+
+VOID RestoreWin32ParmsBeforeTermination();
+VOID TerminateSession(VOID);
+VOID Os2sesTerminateThread(VOID);
+VOID Os2sesTerminateThreadRc(IN ULONG Rc);
+
+VOID
+EventReleaseLPC(
+ IN ULONG ProcessId
+ );
+
+VOID
+Ow2Exit(
+ IN UINT StringCode,
+ IN PCHAR ErrorText,
+ IN int ExitCode
+ );
+
+BOOL EventHandlerRoutine (IN ULONG CtrlType);
+BOOL SendSignalToOs2Srv(IN int SignalType);
+VOID SetEventHandlers(IN BOOL fSet);
+
+PVOID StartEventHandler(VOID);
+PVOID StartEventHandlerForSession(VOID);
+
+DWORD CreateOS2SRV(OUT PHANDLE hProcess);
+
+DWORD RemoveConForWinProcess();
+DWORD AddConAfterWinProcess();
+
+/*
+ * OS2 error used in OS2.EXE
+ *
+ * cannot include os2err.h because of collapstion wirh Nt/Win error def.
+ */
+
+#define ERROR_MONITOR_NOT_SUPPORTED 165
+#define NO_ERROR_MOUSE_NO_DATA 393
+#define ERROR_VIO_MODE 355
+#define ERROR_VIO_WIDTH 356
+#define ERROR_VIO_ROW 358
+#define ERROR_VIO_COL 359
+#define ERROR_KBD_INVALID_LENGTH 376
+#define ERROR_KBD_INVALID_ECHO_MASK 377
+#define ERROR_KBD_INVALID_INPUT_MASK 378
+#define ERROR_MOUSE_INV_PARMS 387
+#define ERROR_VIO_NO_POPUP 405
+#define ERROR_VIO_INVALID_PARMS 421
+#define ERROR_VIO_INVALID_LENGTH 438
+#define ERROR_KBD_NO_MORE_HANDLE 440
+#define ERROR_MON_INVALID_PARMS 379
+#define ERROR_MON_INVALID_HANDLE 381
+#define ERROR_MON_BUFFER_TOO_SMALL 382
+#define ERROR_MON_BUFFER_EMPTY 383
+#define ERROR_MON_DATA_TOO_LARGE 384
+#define ERROR_NLS_NO_CTRY_CODE 398
+
+/*
+ * Signal subtypes for XCPT_SIGNAL
+ */
+#define XCPT_SIGNAL_INTR 1
+#define XCPT_SIGNAL_KILLPROC 3
+#define XCPT_SIGNAL_BREAK 4
+
+HANDLE Ow2ForegroundWindow;
diff --git a/private/os2/os2ses/prtrqust.c b/private/os2/os2ses/prtrqust.c
new file mode 100644
index 000000000..1990255ad
--- /dev/null
+++ b/private/os2/os2ses/prtrqust.c
@@ -0,0 +1,327 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ prtrqust.c
+
+Abstract:
+
+ This module contains the PRT request handler.
+
+Author:
+
+ Michael Jarus (mjarus) 1-Oct-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "trans.h"
+#include "event.h"
+#include "os2win.h"
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+
+
+/* DosOpen/DosQueryFHState/DosQueryFileInfo et al file attributes; also */
+/* known as Dos File Mode bits... */
+
+#define FILE_READONLY 0x0001
+#define FILE_HIDDEN 0x0002
+#define FILE_SYSTEM 0x0004
+#define FILE_DIRECTORY 0x0010
+#define FILE_ARCHIVED 0x0020
+
+#define ATTR_CHANGEABLE (FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_ARCHIVED)
+#define ATTR_ALL (FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_DIRECTORY | FILE_ARCHIVED)
+#define ATTR_NOT_NORM 0x8000 // do not find normal files
+
+/* DosOpen() actions */
+
+#define FILE_EXISTED 0x0001
+#define FILE_CREATED 0x0002
+#define FILE_TRUNCATED 0x0003
+
+/* DosOpen() open flags */
+
+#define FILE_OPEN_EXISTING_FILE 0x0001
+#define FILE_TRUNCATE_EXISTING_FILE 0x0002
+#define FILE_CREATE_NEW_FILE 0x0010
+#define OPEN_ACTION_FAIL_IF_EXISTS 0x0000 /* ---- ---- ---- 0000 */
+#define OPEN_ACTION_OPEN_IF_EXISTS 0x0001 /* ---- ---- ---- 0001 */
+#define OPEN_ACTION_REPLACE_IF_EXISTS 0x0002 /* ---- ---- ---- 0010 */
+#define OPEN_ACTION_FAIL_IF_NEW 0x0000 /* ---- ---- 0000 ---- */
+#define OPEN_ACTION_CREATE_IF_NEW 0x0010 /* ---- ---- 0001 ---- */
+
+/* DosOpen/DosSetFHState flags */
+
+#define OPEN_ACCESS_READONLY 0x00000000 /* ---- ---- ---- -000 */
+#define OPEN_ACCESS_WRITEONLY 0x00000001 /* ---- ---- ---- -001 */
+#define OPEN_ACCESS_READWRITE 0x00000002 /* ---- ---- ---- -010 */
+#define OPEN_SHARE_DENYREADWRITE 0x00000010 /* ---- ---- -001 ---- */
+#define OPEN_SHARE_DENYWRITE 0x00000020 /* ---- ---- -010 ---- */
+#define OPEN_SHARE_DENYREAD 0x00000030 /* ---- ---- -011 ---- */
+#define OPEN_SHARE_DENYNONE 0x00000040 /* ---- ---- -100 ---- */
+#define OPEN_FLAGS_WRITE_THROUGH 0x00004000 /* -1-- ---- ---- ---- */
+
+#define ACCESS_FLAGS (OPEN_ACCESS_READONLY | OPEN_ACCESS_WRITEONLY | \
+ OPEN_ACCESS_READWRITE)
+#define SHARE_FLAGS (OPEN_SHARE_DENYREADWRITE | OPEN_SHARE_DENYWRITE | \
+ OPEN_SHARE_DENYREAD | OPEN_SHARE_DENYNONE)
+
+BOOL
+ServePrtRequest(IN PPRTREQUEST PReq,
+ OUT PVOID PStatus)
+{
+ DWORD Rc = 0;
+
+ switch (PReq->Request)
+ {
+ case PRTOpen:
+ Rc = Ow2PrintOpen(
+ PReq->d.Open.Attribute,
+ PReq->d.Open.OpenFlags,
+ PReq->d.Open.OpenMode,
+ PReq->d.Open.PrinterName,
+ &PReq->hPrinter,
+ &PReq->d.Open.Action
+ );
+ break;
+
+ case PRTClose:
+ Rc = Ow2PrintClose(
+ PReq->hPrinter
+ );
+ break;
+
+ case PRTWrite:
+ Rc = Ow2PrintWrite(
+ PReq->hPrinter,
+ PReq->d.Write.Offset,
+ &PReq->d.Write.Length
+ );
+ break;
+
+ default:
+ Rc = (DWORD)-1L; //STATUS_INVALID_PARAMETER;
+#if DBG
+ IF_OD2_DEBUG( OS2_EXE )
+ {
+ DbgPrint("OS2SES(VioRequest): Unknown Vio request = %X\n",
+ PReq->Request);
+ }
+#endif
+ }
+
+ if ( Rc == 1 )
+ {
+ Rc = GetLastError(); /* BUGBUG! error code and returned Status are wrong */
+ }
+
+ *(PDWORD) PStatus = Rc;
+
+ return(TRUE); // Continue
+}
+
+
+DWORD
+Ow2PrintOpen(
+ IN ULONG Attribute,
+ IN ULONG OpenFlags,
+ IN ULONG OpenMode,
+ IN PUCHAR PrinterName,
+ IN OUT PHANDLE phPrinter,
+ IN OUT PULONG Action
+ )
+{
+ DWORD Rc = 0, Access, Share = FILE_SHARE_READ | FILE_SHARE_WRITE;
+ DWORD Create = 0, Attr = FILE_ATTRIBUTE_NORMAL;
+ ULONG Os2Share;
+
+ /*
+ * Set CreateFile.fdwAttribute from DosOpen.Attribute
+ */
+
+ if (Attribute && FILE_READONLY)
+ {
+ Attr |= FILE_ATTRIBUTE_READONLY;
+ }
+ if (Attribute && FILE_ARCHIVED)
+ {
+ Attr |= FILE_ATTRIBUTE_ARCHIVE;
+ }
+ if (Attribute && FILE_HIDDEN)
+ {
+ Attr |= FILE_ATTRIBUTE_HIDDEN;
+ }
+ if (Attribute && FILE_SYSTEM)
+ {
+ Attr |= FILE_ATTRIBUTE_SYSTEM;
+ }
+
+ /*
+ * Set CreateFile.fdwCreate from DosOpen.OpenFlags
+ */
+
+ if (OpenFlags == OPEN_ACTION_CREATE_IF_NEW)
+ {
+ Create = CREATE_NEW;
+ } else if (OpenFlags == OPEN_ACTION_OPEN_IF_EXISTS)
+ {
+ Create = OPEN_EXISTING;
+ } else if (OpenFlags == OPEN_ACTION_REPLACE_IF_EXISTS)
+ {
+ Create = TRUNCATE_EXISTING;
+ } else if (OpenFlags ==
+ (OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW))
+ {
+ Create = OPEN_ALWAYS;
+ } else if (OpenFlags ==
+ (OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_REPLACE_IF_EXISTS))
+ {
+ Create = CREATE_ALWAYS;
+ } else
+ {
+#if DBG
+ IF_OD2_DEBUG2( MISC, OS2_EXE )
+ DbgPrint("OS2SES(PrtRequest-PrintOpen): illegal Create %lu\n",
+ Create);
+#endif
+ return(ERROR_INVALID_PARAMETER);
+ }
+
+ /*
+ * Set CreateFile.fdwShare from DosOpen.OpenMode
+ */
+
+ Os2Share = OpenMode && SHARE_FLAGS;
+
+ if ((Os2Share == OPEN_SHARE_DENYWRITE) ||
+ (Os2Share == OPEN_SHARE_DENYREADWRITE))
+ {
+ Share &= ~FILE_SHARE_WRITE;
+ }
+ if ((Os2Share == OPEN_SHARE_DENYREAD) ||
+ (Os2Share == OPEN_SHARE_DENYREADWRITE))
+ {
+ Share &= ~FILE_SHARE_READ;
+ }
+
+ /*
+ * Set CreateFile.fdwAccess from DosOpen.OpenMode
+ */
+
+ Os2Share = OpenMode && ACCESS_FLAGS;
+
+ if ((OpenMode && ACCESS_FLAGS) == OPEN_ACCESS_WRITEONLY)
+ {
+ Access = GENERIC_WRITE;
+ } else if ((OpenMode && ACCESS_FLAGS) == OPEN_ACCESS_READONLY)
+ {
+ Access = GENERIC_READ;
+ } else if ((OpenMode && ACCESS_FLAGS) == OPEN_ACCESS_READWRITE)
+ {
+ Access = GENERIC_READ | GENERIC_WRITE;
+ }
+
+ /*
+ * Set CreateFile.fdwAttribute.FILE_FLAG_WRITE_THROUGH
+ * from DosOpen.Attribute.OPEN_FLAGS_WRITE_THROUGH
+ */
+
+ if (OpenMode & OPEN_FLAGS_WRITE_THROUGH)
+ {
+ Attr |= FILE_FLAG_WRITE_THROUGH;
+ }
+
+ *phPrinter = CreateFile(
+ PrinterName,
+ Access,
+ Share,
+ NULL,
+ Create,
+ Attr,
+ NULL
+ );
+
+ if (*phPrinter != NULL)
+ {
+ // BUGBUG: set Action
+
+ *Action = FILE_EXISTED;
+ return(NO_ERROR);
+ }
+ if (Rc)
+ {
+ Rc = GetLastError();
+#if DBG
+ IF_OD2_DEBUG2( MISC, OS2_EXE )
+ DbgPrint("OS2SES(PrtRequest-PrintOpen): Rc %lu\n",
+ Rc);
+#endif
+ }
+ return(Rc);
+}
+
+
+DWORD
+Ow2PrintClose(
+ IN HANDLE hPrinter
+ )
+{
+ DWORD Rc;
+
+ Rc = CloseHandle(
+ hPrinter
+ );
+
+ if (Rc)
+ {
+ Rc = GetLastError();
+#if DBG
+ IF_OD2_DEBUG2( MISC, OS2_EXE )
+ DbgPrint("OS2SES(PrtRequest-PrintClose): Rc %lu\n",
+ Rc);
+#endif
+ }
+ return(Rc);
+}
+
+
+DWORD
+Ow2PrintWrite(
+ IN HANDLE hPrinter,
+ IN PVOID Buffer,
+ IN OUT PULONG Length
+ )
+{
+ DWORD Rc;
+
+ Rc = WriteFile(
+ hPrinter,
+ Buffer,
+ *Length,
+ Length,
+ NULL
+ );
+
+ if (Rc)
+ {
+ Rc = GetLastError();
+#if DBG
+ IF_OD2_DEBUG2( MISC, OS2_EXE )
+ DbgPrint("OS2SES(PrtRequest-PrintWrite): Rc %lu\n",
+ Rc);
+#endif
+ }
+ return(Rc);
+}
diff --git a/private/os2/os2ses/sources b/private/os2/os2ses/sources
new file mode 100644
index 000000000..348afd65a
--- /dev/null
+++ b/private/os2/os2ses/sources
@@ -0,0 +1,90 @@
+!IF 0
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ sources.
+
+Abstract:
+
+ This file specifies the target component being built and the list of
+ sources files needed to build that component. Also specifies optional
+ compiler switches and libraries that are unique for the component being
+ built.
+
+
+Author:
+
+ Avi Nathan 15-Jul-1991
+
+!ENDIF
+
+MAJORCOMP=os2
+MINORCOMP=os2ses
+
+TARGETNAME=os2
+TARGETPATH=obj
+TARGETTYPE=LIBRARY
+
+INCLUDES=..\inc
+
+NO_READONLY_STRINGS=1
+
+SOURCES=os2.rc \
+ prtrqust.c \
+ os2.c \
+ nls.c \
+ util.c \
+ viotty.c \
+ kbdtable.c \
+ trans.c \
+ violvb.c \
+ ntinitss.c \
+ ntrqust.c \
+ conrqust.c \
+ tmrqust.c \
+ event.c \
+ kbdrqust.c \
+ mourqust.c \
+ monrqust.c \
+ viorqust.c \
+ imrqust.c \
+ kbdnls.c \
+ vionls.c
+
+i386_SOURCES=i386\kbdxlat.asm i386\bekbd.asm i386\cfkbd.asm i386\dkkbd.asm \
+ i386\frkbd.asm i386\grkbd.asm i386\itkbd.asm i386\lakbd.asm \
+ i386\nlkbd.asm i386\nokbd.asm i386\pokbd.asm i386\sfkbd.asm \
+ i386\sgkbd.asm i386\spkbd.asm i386\sukbd.asm i386\svkbd.asm \
+ i386\ukkbd.asm i386\uskbd.asm i386\jpkbd.asm
+
+!IFDEF PMNT
+C_DEFINES=-DWIN32=1 -DPMNT=1
+!ELSE
+C_DEFINES=-DWIN32=1
+!ENDIF
+USE_CRTDLL=1
+
+UMTYPE=console
+UMAPPL=os2
+UMLIBS=obj\*\os2.lib \
+ obj\*\os2.res \
+ ..\loader\obj\*\loader.lib \
+ ..\obj\*\os2ssrtl.lib \
+ ..\client\obj\*\os2dll.lib \
+ $(BASEDIR)\Public\Sdk\Lib\*\netlib.lib \
+ $(BASEDIR)\Public\Sdk\Lib\*\NetRap.lib \
+ $(BASEDIR)\public\sdk\lib\*\netapi32.lib \
+ $(BASEDIR)\public\sdk\lib\*\user32.lib \
+ $(BASEDIR)\Public\SDK\Lib\*\rpcrt4.lib \
+ $(BASEDIR)\Public\SDK\Lib\*\rxcommon.lib \
+ $(BASEDIR)\Public\SDK\Lib\*\rxapi.lib \
+!IFDEF PMNT
+ $(BASEDIR)\public\sdk\lib\*\gdi32.lib \
+!ENDIF
+ $(BASEDIR)\public\sdk\lib\*\mpr.lib \
+ $(BASEDIR)\public\sdk\lib\*\ntdll.lib
+!IFDEF PMNT
+COFFBASE=os2pm
+!ENDIF
diff --git a/private/os2/os2ses/struc.inc b/private/os2/os2ses/struc.inc
new file mode 100644
index 000000000..f76dd9280
--- /dev/null
+++ b/private/os2/os2ses/struc.inc
@@ -0,0 +1,513 @@
+;; SCCSID = @(#)struc.inc 12.1 88/03/18
+;;STRUC.INC--Stucture Macro Library
+;;Version 2.20 08/08/86
+;;Written by Eric C. Rasmussen
+
+ if @Version GE 600
+ option nokeyword: <.if, .elseif, .else, .endif, .while>
+ endif
+
+if1
+$noconj equ 0
+$and equ 1
+$or equ 2
+$short equ 3
+$near equ 4
+$andor = 0
+$temp = 0
+$temp2 = 0
+$dist = 0
+
+$notype equ 10
+$conjif equ 11
+$iftype equ 12
+$elsetype equ 13
+$whiletype equ 14
+$conjwhile equ 15
+$repeattype equ 16
+$conjuntil equ 17
+$fortype equ 18
+$conjleave equ 19
+
+$StrucErr macro text
+ Structure error -- text
+endm
+
+j macro
+endm
+jn macro
+endm
+
+jbuild macro j1,j2
+ j1 macro tgt
+ .xcref j1
+ j2 tgt
+ endm
+endm
+
+irp x,<<jeq,je>,<jlt,jl>,<jgt,jg>,<jneq,jne>,<jnlt,jnl>,<jngt,jng>,<jnpe,jpo>,<jnpo,jpe>>
+ jbuild x
+endm
+irp x,<<jzero,jz>,<jnzero,jnz>,<jnonzero,jnz>,<jnnonzero,jz>,<jand,jnz>,<jnand,jz>,<jnnand,jnz>>
+ jbuild x
+endm
+irp x,<a,ae,b,be,c,e,g,ge,l,le,o,p,s,z,cxz>
+ jbuild jnn&x,j&x
+endm
+
+jncxz macro tgt
+ local skip
+ jcxz skip
+ jmp short tgt
+skip:
+endm
+
+purge jbuild
+
+$getconj macro p1,p2
+ $andor = $noconj
+ irp parm,<p1,p2>
+ ifnb <&parm>
+ irp x,<and,AND,or,OR>
+ ifidn <parm>,<x>
+ $andor = $&&&x
+ exitm
+ endif
+ endm
+ endif
+ endm
+endm
+
+$getdist macro p1,p2
+ irp parm,<p1,p2>
+ ifnb <parm>
+ irp x,<short,SHORT,near,NEAR>
+ ifidn <parm>,<x>
+ $dist = $&&&x
+ exitm
+ endif
+ endm
+ endif
+ endm
+endm
+
+
+$poke macro num,value
+ $st&num = value
+.xcref $st&num
+endm
+
+$peek macro sym,num
+ sym = $st&num
+endm
+
+$push macro value
+ $st = $st+1
+ $poke %$st,value
+endm
+
+$pop macro sym
+ $peek sym,%$st
+ $st = $st-1
+endm
+
+$labl macro num
+$l&num:
+endm
+
+$cjump macro lnum,tf,cond
+ local skip
+ if $dist eq $short
+ ifb <cond>
+ jmp short $l&lnum
+ else
+ ifidn <tf>,<f>
+ jn&cond $l&lnum
+ else
+ j&cond $l&lnum
+ endif
+ endif
+ else
+ ifnb <cond>
+ ifidn <tf>,<f>
+ j&cond skip
+ else
+ jn&cond skip
+ endif
+ endif
+ jmp $l&lnum
+ ifnb <cond>
+skip:
+ endif
+ endif
+endm
+
+
+$cloop macro lnum,cond
+ loop&cond $l&lnum
+endm
+
+$test macro tgt,a1,a2,a3,a4,x1
+ ifb <a1>
+ $StrucErr <invalid condition>
+ else
+ ifb <a2>
+ $cjump %&tgt,a1
+ else
+ ifb <a3>
+ ifdif <a1>,<zero>
+ ifdif <a1>,<nonzero>
+ ifdif <a1>,<ZERO>
+ ifdif <a1>,<NONZERO>
+ $StrucErr <invalid condition>
+ exitm
+ endif
+ endif
+ endif
+ endif
+ or a2,a2
+ $cjump %&tgt,a1
+ else
+ ifb <a4>
+ cmp a1,a3
+ $cjump %&tgt,a2
+ else
+ ifb <x1>
+ ifdif <a1>,<bit>
+ ifdif <a1>,<BIT>
+ $StrucErr <invalid condition>
+ exitm
+ endif
+ endif
+ test a2,a4
+ $cjump %&tgt,a3
+ else
+ $StrucErr <invalid condition>
+ endif
+ endif
+ endif
+ endif
+ endif
+endm
+
+$toptest macro args,ntype,ctype,p4,p5
+ $getconj p4,p5
+ $dist = $defdist
+ $getdist p4,p5
+ if $andor eq $noconj
+ $test <$sn-1,f>,args
+ $pop $temp
+ if $orfound
+ $labl %$temp
+ endif
+ $push ntype
+ else
+ if $andor eq $and
+ $test <$sn-1,f>,args
+ else
+ $orfound = 1
+ $test <$sn,t>,args
+ endif
+ $push ctype
+ endif
+endm
+;;*****************************************************************************
+.if macro tst,p2,p3
+ $peek $temp,%$st
+ if $temp eq $conjif
+ $pop $temp
+ else
+ $push $elseiffound
+ $elseiffound = 0
+ $orfound = 0
+ $sn = $sn+1
+ $push $sn
+ $sn = $sn+1
+ $push $sn
+ $sn = $sn+1
+ $push $sn
+ endif
+ $toptest <tst>,$iftype,$conjif,p2,p3
+endm
+;;*****************************************************************************
+.then macro
+ $peek $temp,%$st
+ if $temp ne $iftype
+ $StrucErr <then without if>
+ endif
+endm
+;;*****************************************************************************
+.elseif macro tst,p2,p3
+ $pop $temp
+ if $temp ne $iftype
+ $StrucErr <elseif without if>
+ exitm
+ endif
+ $elseiffound = 1
+ $orfound = 0
+ $pop $temp
+ $peek $temp2,%$st
+ $dist = $near
+ $cjump %$temp2
+ $labl %$temp
+ $sn = $sn+1
+ $push $sn
+ $sn = $sn+1
+ $push $sn
+ $toptest <tst>,$iftype,$conjif,p2,p3
+endm
+;;*****************************************************************************
+.else macro dist
+ $pop $temp
+ if $temp ne $iftype
+ $StrucErr <else without if>
+ exitm
+ endif
+ $sn = $sn+1
+ $dist = $defdist
+ $getdist dist
+ $cjump %$sn
+ $pop $temp
+ $labl %$temp
+ $push $sn
+ $push $elsetype
+endm
+;;*****************************************************************************
+.endif macro
+ $pop $temp
+ if $temp ne $iftype
+ if $temp ne $elsetype
+ $StrucErr <endif without if>
+ exitm
+ endif
+ endif
+ $pop $temp
+ $labl %$temp
+ $pop $temp
+ if $elseiffound
+ $labl %$temp
+ endif
+ $pop $elseiffound
+endm
+;;*****************************************************************************
+.while macro tst,p2,p3
+ $peek $temp,%$st
+ if $temp eq $conjwhile
+ $pop $temp
+ else
+ $push $endloop
+ $orfound = 0
+ $sn = $sn + 1
+ $push $sn
+ $labl %$sn
+ $sn = $sn + 2
+ $push $sn
+ $endloop = $sn - 1
+ endif
+ $toptest <tst>,$whiletype,$conjwhile,p2,p3
+endm
+;;*****************************************************************************
+.endwhile macro
+ $pop $temp
+ if $temp ne $whiletype
+ $StrucErr <endwhile without while>
+ exitm
+ endif
+ $pop $temp
+ $dist = $near
+ $cjump %$temp
+ $labl %$temp+1
+ $pop $endloop
+endm
+;;*****************************************************************************
+;OS2SS-.repeat macro
+;OS2SS- $push $endloop
+;OS2SS- $push $leavefound
+;OS2SS- $sn = $sn+1
+;OS2SS- $labl %$sn
+;OS2SS- $push $sn
+;OS2SS- $push $repeattype
+;OS2SS- $sn = $sn+1
+;OS2SS- $endloop = $sn
+;OS2SS- $leavefound = 0
+;OS2SS-endm
+;;*****************************************************************************
+;OS2SS-.until macro tst,p2,p3
+;OS2SS- $until_2 p2,p3,tst
+;OS2SS-endm
+;OS2SS-$until_2 macro p2,p3,a1,a2,a3,a4,x1
+;OS2SS- $pop $temp
+;OS2SS- if $temp ne $repeattype
+;OS2SS- if $temp ne $conjuntil
+;OS2SS- $StrucErr <until without repeat>
+;OS2SS- exitm
+;OS2SS- endif
+;OS2SS- else
+;OS2SS- $orfound = 0
+;OS2SS- endif
+;OS2SS- $dist = $defdist
+;OS2SS- $getdist p2,p3
+;OS2SS- $getconj p2,p3
+;OS2SS-
+;OS2SS- if $andor eq $noconj
+;OS2SS- $pop $temp
+;OS2SS- ifb <a1>
+;OS2SS- $dist = $near
+;OS2SS- $cjump %$temp,f
+;OS2SS- else
+;OS2SS- $test <$temp,f>,<a1>,<a2>,<a3>,<a4>,<x1>
+;OS2SS- endif
+;OS2SS- if $orfound or $leavefound
+;OS2SS- $labl %$temp+1
+;OS2SS- endif
+;OS2SS- $pop $leavefound
+;OS2SS- $pop $endloop
+;OS2SS- else
+;OS2SS- $peek $temp,%$st
+;OS2SS- if $andor eq $and
+;OS2SS- $test <$temp,f>,<a1>,<a2>,<a3>,<a4>,<x1>
+;OS2SS- else
+;OS2SS- $orfound = 1
+;OS2SS- $test <$temp+1,t>,<a1>,<a2>,<a3>,<a4>,<x1>
+;OS2SS- endif
+;OS2SS- $push $conjuntil
+;OS2SS- endif
+;OS2SS-endm
+;;*****************************************************************************
+;OS2SS-.loop macro cond
+;OS2SS- $pop $temp
+;OS2SS- if $temp ne $repeattype
+;OS2SS- $StrucErr <loop without repeat>
+;OS2SS- exitm
+;OS2SS- endif
+;OS2SS- $pop $temp
+;OS2SS- $cloop %$temp,cond
+;OS2SS- if $leavefound
+;OS2SS- $labl %$temp+1
+;OS2SS- endif
+;OS2SS- $pop $leavefound
+;OS2SS- $pop $endloop
+;OS2SS-endm
+;;*****************************************************************************
+;OS2SS-.for macro index,equals,start,to,stop,by,step,dist
+;OS2SS- mov index,start
+;OS2SS- $push $endloop
+;OS2SS- $sn = $sn+1
+;OS2SS- $push $sn
+;OS2SS- $labl %$sn
+;OS2SS- $sn = $sn+1
+;OS2SS- $endloop = $sn
+;OS2SS- cmp index,stop
+;OS2SS- $dist = $defdist
+;OS2SS- ifb <step>
+;OS2SS- $push 1
+;OS2SS- $getdist by
+;OS2SS- $cjump %$sn,t,gt
+;OS2SS- else
+;OS2SS- $getdist dist
+;OS2SS- $push %(step)
+;OS2SS- if step lt 0
+;OS2SS- $cjump %$sn,t,lt
+;OS2SS- else
+;OS2SS- $cjump %$sn,t,gt
+;OS2SS- endif
+;OS2SS- endif
+;OS2SS- $push $fortype
+;OS2SS-endm
+;;*****************************************************************************
+;OS2SS-.next macro index
+;OS2SS- $pop $temp
+;OS2SS- if $temp ne $fortype
+;OS2SS- $StrucErr <next without for>
+;OS2SS- exitm
+;OS2SS- endif
+;OS2SS- $pop $temp
+;OS2SS- if $temp eq 1
+;OS2SS- inc index
+;OS2SS- else
+;OS2SS- if $temp eq -1
+;OS2SS- dec index
+;OS2SS- else
+;OS2SS- add index,$temp
+;OS2SS- endif
+;OS2SS- endif
+;OS2SS- $pop $temp
+;OS2SS- $dist = $near
+;OS2SS- $cjump %$temp
+;OS2SS- $labl %$temp+1
+;OS2SS- $pop $endloop
+;OS2SS-endm
+;;*****************************************************************************
+;OS2SS-.leave macro tst,p2,p3
+;OS2SS- $leave_2 p2,p3,tst
+;OS2SS-endm
+;OS2SS-$leave_2 macro p2,p3,a1,a2,a3,a4,x1
+;OS2SS- ife $endloop
+;OS2SS- $StrucErr <leave outside a loop>
+;OS2SS- exitm
+;OS2SS- endif
+;OS2SS- $leavefound = 1
+;OS2SS- $peek $temp,%$st
+;OS2SS- if $temp eq $conjleave
+;OS2SS- $pop $temp
+;OS2SS- else
+;OS2SS- $orfound = 0
+;OS2SS- $sn = $sn + 1
+;OS2SS- endif
+;OS2SS- $dist = 0
+;OS2SS- $getdist <a1>
+;OS2SS- if $dist
+;OS2SS- $cjump %$endloop
+;OS2SS- if $orfound
+;OS2SS- $labl %$sn
+;OS2SS- endif
+;OS2SS- else
+;OS2SS- $dist = $defdist
+;OS2SS- $getdist p2,p3
+;OS2SS- $getconj p2,p3
+;OS2SS-
+;OS2SS- if $andor eq $noconj
+;OS2SS- ifb <a1>
+;OS2SS- $cjump %$endloop,t
+;OS2SS- else
+;OS2SS- $test <$endloop,t>,<a1>,<a2>,<a3>,<a4>,<x1>
+;OS2SS- endif
+;OS2SS- if $orfound
+;OS2SS- $labl %$sn
+;OS2SS- endif
+;OS2SS- else
+;OS2SS- if $andor eq $and
+;OS2SS- $orfound = 1
+;OS2SS- $test <$sn,f>,<a1>,<a2>,<a3>,<a4>,<x1>
+;OS2SS- else
+;OS2SS- $test <$endloop,t>,<a1>,<a2>,<a3>,<a4>,<x1>
+;OS2SS- endif
+;OS2SS- $push $conjleave
+;OS2SS- endif
+;OS2SS- endif
+;OS2SS-endm
+;;*****************************************************************************
+else
+ $pop $temp
+ if $temp ne $notype
+ $StrucErr <open structure(s)>
+ endif
+.xcref $noconj,$and,$or,$short,$near,$andor,$temp,$temp2,$dist
+.xcref $notype,$conjif,$iftype,$elsetype,$whiletype,$conjwhile
+.xcref $repeattype,$conjuntil,$fortype,$conjleave,jncxz
+.xcref jeq,jgt,jlt,jneq,jngt,jnlt,jnna,jnnae,jnnb,jnnbe,jnnc,jnncxz
+.xcref jnne,jnng,jnnge,jnnl,jnnle,jnno,jnnp,jnns,jnnz,jnpe,jnpo,jbuild
+.xcref $getconj,$getdist,$poke,$peek,$push,$pop,$labl,$cjump,$cloop,$test
+;OS2SS-.xcref $toptest,$leave_2,$until_2,$strucerr,j,jn,jand,jnand,jnnand
+.xcref $toptest,$strucerr,j,jn,jand,jnand,jnnand
+.xcref jnnonzero,jnonzero,jnzero,jzero
+.xcref $st,$sn,$orfound,$elseiffound,$endloop,$leavefound,$defdist
+endif
+$st = 0
+$sn = 0
+$orfound = 0
+$elseiffound = 0
+$endloop = 0
+$leavefound = 0
+$defdist = $short
+$push %$notype
diff --git a/private/os2/os2ses/tmrqust.c b/private/os2/os2ses/tmrqust.c
new file mode 100644
index 000000000..85094dd94
--- /dev/null
+++ b/private/os2/os2ses/tmrqust.c
@@ -0,0 +1,125 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ tmrqust.c
+
+Abstract:
+
+ This module contains the handler for task manager requests.
+
+Author:
+
+ Avi Nathan (avin) 17-Jul-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+#include <stdio.h>
+#include <stdlib.h>
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "os2res.h"
+
+extern DWORD Os2ReturnCode;
+
+BOOL ServeTmRequest(PSCTMREQUEST PReq, PVOID PStatus)
+{
+ UINT StringCode = 0;
+
+#if DBG
+ IF_OD2_DEBUG( SESSIONMGR )
+ {
+ KdPrint(("ServeTmRequest: Request %u\n", PReq->Request));
+ }
+#endif
+ *(PDWORD) PStatus = 0;
+
+ switch (PReq->Request) {
+ case TmExit:
+ Os2ReturnCode = PReq->ExitResults;
+ if ((PReq->ExitResults & 0x80000000) != 0) {
+ switch (PReq->ExitResults & 0x7fffffff) {
+ case 295:
+ StringCode = IDS_OS2_INITFAIL;
+ break;
+
+ case ERROR_INVALID_SEGMENT_NUMBER:
+ StringCode = IDS_OS2_SEGNUMBER;
+ break;
+
+ case ERROR_EXE_MARKED_INVALID:
+ StringCode = IDS_OS2_EXEINVALID;
+ break;
+
+ case ERROR_INVALID_STACKSEG:
+ StringCode = IDS_OS2_STACKSEG;
+ break;
+
+ case ERROR_FILE_NOT_FOUND:
+ StringCode = IDS_OS2_NOFILE;
+ break;
+
+ case ERROR_PROC_NOT_FOUND:
+ StringCode = IDS_OS2_NOPROC;
+ break;
+
+ case ERROR_INVALID_ORDINAL:
+ StringCode = IDS_OS2_NOORDINAL;
+ break;
+
+ case ERROR_INVALID_STARTING_CODESEG:
+ StringCode = IDS_OS2_CODESEG;
+ break;
+
+ case ERROR_INVALID_MODULETYPE:
+ StringCode = IDS_OS2_MODULETYPE;
+ break;
+
+ case ERROR_BAD_EXE_FORMAT:
+ StringCode = IDS_OS2_EXEFORMAT;
+ break;
+
+ case ERROR_RELOC_CHAIN_XEEDS_SEGLIM:
+ StringCode = IDS_OS2_RELOCCHAIN;
+ break;
+
+ case ERROR_BAD_FORMAT:
+ StringCode = IDS_OS2_BADFORMAT;
+ break;
+
+ default:
+ _itoa(PReq->ExitResults & 0x7fffffff, PReq->ErrorText, 10);
+ StringCode = IDS_OS2_OS2CODE;
+ break;
+
+ }
+ }
+ TerminateSession();
+ Ow2Exit(StringCode, &PReq->ErrorText[0], Os2ReturnCode);
+ //*(PDWORD) PStatus = 0;
+ return(FALSE);
+ break;
+
+ case TmReleaseLPC:
+ EventReleaseLPC(PReq->ExitResults);
+ break;
+
+ default:
+ *(PDWORD) PStatus = (DWORD) -1; // STATUS_INVALID_PARAMETER;
+#if DBG
+ KdPrint(( "OS2SES: Unknown TaskMan request = %X\n",
+ PReq->Request
+ ));
+#endif
+ break;
+ }
+
+ return(TRUE); // Do reply
+}
diff --git a/private/os2/os2ses/trans.c b/private/os2/os2ses/trans.c
new file mode 100644
index 000000000..3aed693fd
--- /dev/null
+++ b/private/os2/os2ses/trans.c
@@ -0,0 +1,463 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ trans.c
+
+Abstract:
+
+ This module contains the translation procedures
+ for Vio, Kbd and Mou.
+
+Author:
+
+ Michael Jarus (mjarus) 28-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#include <io.h>
+#include <stdio.h>
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+#include "vio.h"
+// MSKK Oct.01.1993 V-AkihiS
+// If NLS module for console doesn't present, then NO_CONSOLE_NLS switch
+// should be enable difinition.
+//#define NO_CONSOLE_NLS
+#endif
+
+
+MOUEVENTINFO LastMouseEvent = {0, 0L, 0, 0};
+KBD_MON_PACKAGE Os2KeyInfo[3];
+WORD LastVirtualKeyCode;
+WORD LastVirtualScanCode;
+WCHAR LastUnicodeChar;
+DWORD LastControlKeyState;
+
+ULONG
+Ow2KbdXlate(
+ ULONG ScanCode,
+ PKBD_XLATE_VARS pFlagArea,
+ PKBD_MON_PACKAGE pMonitorPack,
+ PVOID pTransTable
+ );
+
+USHORT
+MapWin2Os2KbdState(
+ IN DWORD WinState
+ )
+{
+ USHORT Os2Status = 0;
+
+ if ( WinState & RIGHT_ALT_PRESSED )
+ Os2Status |= OS2_ALT | OS2_RIGHTALT;
+
+ if ( WinState & LEFT_ALT_PRESSED )
+ Os2Status |= OS2_ALT | OS2_LEFTALT;
+
+ if ( WinState & RIGHT_CTRL_PRESSED)
+ Os2Status |= OS2_CONTROL | OS2_RIGHTCONTROL;
+
+ if ( WinState & LEFT_CTRL_PRESSED )
+ Os2Status |= OS2_CONTROL | OS2_LEFTCONTROL;
+
+ //if ( WinState & SHIFT_PRESSED )
+ // Os2Status |= OS2_RIGHTSHIFT | OS2_LEFTSHIFT;
+
+ if ( WinState & NUMLOCK_ON )
+ Os2Status |= OS2_NUMLOCK_ON;
+
+ if ( WinState & SCROLLLOCK_ON )
+ Os2Status |= OS2_SCROLLLOCK_ON;
+
+ if ( WinState & CAPSLOCK_ON )
+ Os2Status |= OS2_CAPSLOCK_ON;
+
+ return(Os2Status);
+}
+
+#define MAPOS2STATE (OS2_ALT | OS2_CONTROL | OS2_SCROLLLOCK_ON | OS2_NUMLOCK_ON | OS2_CAPSLOCK_ON | OS2_ANYCONTRL | OS2_ANYALT)
+
+DWORD
+MapWin2Os2KbdInfo(IN PKEY_EVENT_RECORD WinKey,
+ OUT PKEYEVENTINFO Os2Key)
+{
+ ULONG Rc;
+ BOOL DupPack = FALSE, ControlPack = FALSE;
+ USHORT Os2State, OldState;
+
+ /*
+ * This is a workaround for a console (TS) "feature": sometimes the
+ * make or nreak of shift/control/alt keys are not passed (eg. after
+ * pressing CTRL-ESC and returning to the window, no CTRL-UP is generated.
+ * (mjarus 9/7/93):
+ */
+
+ Os2State = MapWin2Os2KbdState(WinKey->dwControlKeyState);
+
+ if (( Os2State !=
+ (KbdQueue->Setup.fsState & MAPOS2STATE)) ||
+ ((WinKey->dwControlKeyState & SHIFT_PRESSED) &&
+ !(KbdQueue->Setup.fsState & (OS2_LEFTSHIFT | OS2_RIGHTSHIFT))) ||
+ (!(WinKey->dwControlKeyState & SHIFT_PRESSED) &&
+ (KbdQueue->Setup.fsState & (OS2_LEFTSHIFT | OS2_RIGHTSHIFT)))
+ )
+ {
+ if ((WinKey->wVirtualKeyCode != VK_SHIFT) &&
+ (WinKey->wVirtualKeyCode != VK_CONTROL) &&
+ (WinKey->wVirtualKeyCode != VK_MENU))
+ {
+ ControlPack = TRUE; // BUGBUG: generate another 1 or more packages
+ OldState = KbdQueue->Setup.fsState;
+ KbdQueue->Setup.fsState =
+ (KbdQueue->Setup.fsState & ~MAPOS2STATE) | Os2State;
+ Ow2KbdXlateVars.XHotKeyShift =
+ (Ow2KbdXlateVars.XHotKeyShift & ~MAPOS2STATE) | Os2State;
+
+ if (((WinKey->dwControlKeyState & SHIFT_PRESSED) &&
+ !(KbdQueue->Setup.fsState & (OS2_LEFTSHIFT | OS2_RIGHTSHIFT))) ||
+ (!(WinKey->dwControlKeyState & SHIFT_PRESSED) &&
+ (KbdQueue->Setup.fsState & (OS2_LEFTSHIFT | OS2_RIGHTSHIFT))))
+ {
+ KbdQueue->Setup.fsState &= ~OS2_ANYSHIFT;
+ Ow2KbdXlateVars.XHotKeyShift &= ~OS2_ANYSHIFT;
+ if (WinKey->dwControlKeyState & SHIFT_PRESSED)
+ {
+ KbdQueue->Setup.fsState |= OS2_RIGHTSHIFT;
+ Ow2KbdXlateVars.XHotKeyShift |= OS2_RIGHTSHIFT;
+ }
+ }
+ }
+ }
+
+ /*
+ * This is a workaround for a console (TS) "feature": sometimes after an
+ * accent, the console generates another package with the same VK and
+ * ScanCode but different ASCII/Unicode. (mjarus 5/7/93):
+ * eg. (for BE):
+ * [{ - VK DD, Scan 1A, Unicode 0
+ * zZ - 57, 2C 5E (^)
+ * 57, 2C 77 (w)
+ */
+
+ if (WinKey->bKeyDown)
+ {
+ if ((LastVirtualKeyCode == WinKey->wVirtualKeyCode) &&
+ (LastVirtualScanCode == WinKey->wVirtualScanCode) &&
+ (LastControlKeyState == WinKey->dwControlKeyState) &&
+ (LastUnicodeChar != WinKey->uChar.UnicodeChar))
+ {
+#if defined(DBCS) && !defined(NO_CONSOLE_NLS)
+// MSKK Aug.10.1993 V-AkihiS
+// When IME is active, WinKey->wVirtualScanCode is always 0.
+// So we should check IME is active or not.
+ if (!(WinKey->dwControlKeyState & NLS_IME_CONVERSION))
+ DupPack = TRUE;
+#else
+ DupPack = TRUE;
+#endif
+ }
+
+ LastVirtualKeyCode = WinKey->wVirtualKeyCode;
+ LastVirtualScanCode = WinKey->wVirtualScanCode;
+ LastUnicodeChar = WinKey->uChar.UnicodeChar;
+ LastControlKeyState = WinKey->dwControlKeyState;
+ }
+
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ if (WinKey->bKeyDown && !DupPack)
+ {
+ KdPrint(("***************************************************************************\n"));
+ } else
+ {
+ KdPrint(("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"));
+ }
+ KdPrint(("KbdInfo: VKey %x, VScan %x, Control %x, char(W) %x %s(count %u)\n",
+ WinKey->wVirtualKeyCode, WinKey->wVirtualScanCode,
+ WinKey->dwControlKeyState, WinKey->uChar.UnicodeChar,
+ (WinKey->bKeyDown ? "" : "(Up)"), WinKey->wRepeatCount));
+
+ if (ControlPack)
+ {
+ KdPrint((" => Adding control package, from %x to %x\n",
+ OldState, KbdQueue->Setup.fsState));
+ }
+ }
+#endif
+
+ if (DupPack)
+ {
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ KdPrint((" => Duplicate package\n"));
+ }
+#endif
+ return(0);
+ }
+
+ RtlZeroMemory(&Os2KeyInfo[0], 3 * sizeof(KBD_MON_PACKAGE));
+ Os2KeyInfo[0].KeyInfo.fbStatus = 0x40;
+ Os2KeyInfo[0].KeyInfo.fsState = KbdQueue->Setup.fsState;
+ Os2KeyInfo[0].DeviceFlag = WinKey->wVirtualScanCode;
+ if (!WinKey->bKeyDown)
+ {
+ Os2KeyInfo[0].DeviceFlag |= 0x80; // BREAK key
+ }
+
+ if ( WinKey->dwControlKeyState & ENHANCED_KEY )
+ {
+ Ow2KbdXlateVars.XlateFlags |= SecPrefix; // Have seen E0 prefix
+ }
+
+#ifdef DBCS
+// MSKK Aug.04.1993 V-AkihiS
+ //
+ // Get NlsShift
+ //
+ Os2KeyInfo[0].KeyInfo.bNlsShift = MapWinToOs2KbdNlsShift(WinKey);
+
+ if ((Os2KeyInfo[0].KeyInfo.bNlsShift & OS2_NLS_IME_CONVERSION) &&
+ (! WinKey->wVirtualScanCode))
+ {
+ Rc = MapWinToOs2KbdNlsChar(WinKey, &Os2KeyInfo[0]);
+ if (Rc == 2)
+ {
+ Os2Key->KeyInfo[0] = Os2KeyInfo[0];
+ (Os2Key + 1)->KeyInfo[0] = Os2KeyInfo[1];
+ } else
+ {
+ Os2Key->KeyInfo[0] = Os2KeyInfo[0];
+ }
+ } else
+ {
+ Rc = Ow2KbdXlate(
+ Os2KeyInfo[0].DeviceFlag, // ScanCode,
+ &Ow2KbdXlateVars, // pFlagArea,
+ &Os2KeyInfo[0], // pMonitorPack,
+ Ow2KbdScanTable // pTransTable
+ );
+ if (Rc == 2)
+ {
+ Os2Key->KeyInfo[0] = Os2KeyInfo[1];
+ (Os2Key + 1)->KeyInfo[0] = Os2KeyInfo[0];
+ } else
+ {
+ Os2Key->KeyInfo[0] = Os2KeyInfo[0];
+ //
+ // If SBCS katakana, set scan code to 0.
+ //
+ if ((SesGrp->KbdCP == 932) &&
+ (Os2Key->KeyInfo[0].KeyInfo.chChar >= 0xa0) &&
+ (Os2Key->KeyInfo[0].KeyInfo.chChar <= 0xdf))
+ Os2Key->KeyInfo[0].KeyInfo.chScan = 0;
+ }
+ }
+#else
+ Rc = Ow2KbdXlate(
+ Os2KeyInfo[0].DeviceFlag, // ScanCode,
+ &Ow2KbdXlateVars, // pFlagArea,
+ &Os2KeyInfo[0], // pMonitorPack,
+ Ow2KbdScanTable // pTransTable
+ );
+ if (Rc == 2)
+ {
+ Os2Key->KeyInfo[0] = Os2KeyInfo[1];
+ (Os2Key + 1)->KeyInfo[0] = Os2KeyInfo[0];
+ } else
+ {
+ Os2Key->KeyInfo[0] = Os2KeyInfo[0];
+ }
+#endif
+
+
+ if (!WinKey->bKeyDown)
+ Os2Key->KeyInfo[0].DeviceFlag |= 0x80;
+
+ /*
+ * keep Win info of RepeatCount
+ */
+
+ Os2Key->wRepeatCount = WinKey->wRepeatCount;
+
+ KbdQueue->Setup.fsState = Os2KeyInfo[0].KeyInfo.fsState;
+
+#if DBG
+ IF_OD2_DEBUG( KBD )
+ {
+ KdPrint((" Rc %lu\n", Rc));
+ KdPrint((" 1. Ch %x, Sc %x, fbStatus %x, NLS %x, fsState %x MF %x, DF %x, KF %x\n",
+ Os2Key->KeyInfo[0].KeyInfo.chChar,
+ Os2Key->KeyInfo[0].KeyInfo.chScan,
+ Os2Key->KeyInfo[0].KeyInfo.fbStatus,
+ Os2Key->KeyInfo[0].KeyInfo.bNlsShift,
+ Os2Key->KeyInfo[0].KeyInfo.fsState,
+ Os2Key->KeyInfo[0].MonitorFlag,
+ Os2Key->KeyInfo[0].DeviceFlag,
+ Os2Key->KeyInfo[0].KeyboardFlag
+ ));
+
+ if (Rc == 2)
+ {
+ KdPrint((" 2. Ch %x, Sc %x, fbStatus %x, NLS %x, fsState %x MF %x, DF %x, KF %x\n",
+ (Os2Key + 1)->KeyInfo[0].KeyInfo.chChar,
+ (Os2Key + 1)->KeyInfo[0].KeyInfo.chScan,
+ (Os2Key + 1)->KeyInfo[0].KeyInfo.fbStatus,
+ (Os2Key + 1)->KeyInfo[0].KeyInfo.bNlsShift,
+ (Os2Key + 1)->KeyInfo[0].KeyInfo.fsState,
+ (Os2Key + 1)->KeyInfo[0].MonitorFlag,
+ (Os2Key + 1)->KeyInfo[0].DeviceFlag,
+ (Os2Key + 1)->KeyInfo[0].KeyboardFlag
+ ));
+ }
+ if (Ow2KbdXlateVars.XlateFlags)
+ {
+ /*
+ * DumpKeyOnce Equ 01h
+ * PSKeyDown Equ 02h
+ * SecPrefix Equ 04h
+ * NormalAlt Equ 08h
+ * Use3Index Equ 10h
+ * PseudoCtl Equ 20h
+ * E1Prefix Equ 40h
+ */
+
+ KdPrint((" XlateFlags - %x\n", Ow2KbdXlateVars.XlateFlags));
+ }
+ if (Ow2KbdXlateVars.XPSGFlags)
+ {
+ /*
+ * SQMODE Equ 0200h
+ * SGInUse Equ 0080h
+ * SG3xBox Equ 0040h
+ * ActiveSG Equ 0020h
+ * Flushing Equ 0010h
+ * NowPaused Equ 0008h
+ * PrevAccent Equ 0007h
+ * WakeUpSent Equ 0100h
+ */
+
+ KdPrint((" XPSGFlags - %x\n", Ow2KbdXlateVars.XPSGFlags));
+ }
+ }
+#endif
+
+ if (!Rc)
+ {
+ return(Rc);
+ }
+
+ /*
+ * save info for next kbd
+ */
+
+ KbdLastKey = WinKey->wVirtualKeyCode;
+ KbdLastKeyDown = WinKey->bKeyDown;
+ return(Rc);
+}
+
+
+BOOL
+MapWin2Os2MouEvent(OUT PMOUEVENTINFO Mou,
+ IN PMOUSE_EVENT_RECORD Event)
+{
+ USHORT State = 0;
+
+ if (Event->dwButtonState & FROM_LEFT_1ST_BUTTON_PRESSED)
+ State |= OS2_MOUSE_BN1_DOWN;
+ if (Event->dwButtonState & RIGHTMOST_BUTTON_PRESSED)
+ State |= OS2_MOUSE_BN2_DOWN;
+ if (Event->dwButtonState & FROM_LEFT_2ND_BUTTON_PRESSED)
+ State |= OS2_MOUSE_BN3_DOWN;
+ if (Event->dwEventFlags & MOUSE_MOVED)
+ { if (State)
+ State >>= 1; /* shift right to set motion */
+ else
+ State = OS2_MOUSE_MOTION;
+ }
+ /* BUGBUG=> Double-Click */
+ /* BUGBUG=> ignore other buttons */
+
+ /* State==0 => releae */
+
+ if (State && !(State & MouEventMask))
+ {
+ // not-release-event which is 'mask-out' - ignore it
+
+#if DBG
+ IF_OD2_DEBUG( MOU )
+ {
+ KdPrint(("MapWin2Os2MouEvent: mask out event fs %x, Mask %x (Button %x, Flag %x)\n",
+ State, MouEventMask, Event->dwButtonState, Event->dwEventFlags));
+ }
+#endif
+ return (0L);
+ }
+
+ if (!State && (!LastMouseEvent.fs ||
+ (LastMouseEvent.fs == OS2_MOUSE_MOTION)))
+ {
+ // this event breaks (release) 'masked-out' event - ignore it
+
+#if DBG
+ IF_OD2_DEBUG( MOU )
+ {
+ KdPrint(("MapWin2Os2MouEvent: release of mask out event fs %x, Mask %x (Button %x, Flag %x)\n",
+ State, MouEventMask, Event->dwButtonState, Event->dwEventFlags));
+ }
+#endif
+ return (0L);
+ }
+
+ Mou->fs = State;
+
+ /* BUGBUG=> support mickeys and pels */
+
+ Mou->row = Event->dwMousePosition.Y;
+ Mou->col = Event->dwMousePosition.X;
+
+ if ((Event->dwEventFlags & MOUSE_MOVED) &&
+ (LastMouseEvent.row == Mou->row) &&
+ (LastMouseEvent.col == Mou->col))
+ {
+ // this events are "noises" that the console doesn't mask
+ // (i.e. the same action with the same position)
+
+#if DBG
+ IF_OD2_DEBUG( MOU )
+ {
+ KdPrint(("MapWin2Os2MouEvent: noise event - fs %x, Pos %u:%u (Button %x, Flag %x)\n",
+ Mou->fs, Mou->row, Mou->col,
+ Event->dwButtonState, Event->dwEventFlags));
+ }
+#endif
+ return (0L);
+ }
+
+ LastMouseEvent = *Mou;
+
+#if DBG
+ IF_OD2_DEBUG( MOU )
+ {
+ KdPrint(("MapWin2Os2MouEvent: Button %x, Flag %x => fs %x, Pos %u:%u\n",
+ Event->dwButtonState, Event->dwEventFlags,
+ Mou->fs, Mou->row, Mou->col));
+ }
+#endif
+ return (1L);
+}
+
diff --git a/private/os2/os2ses/trans.h b/private/os2/os2ses/trans.h
new file mode 100644
index 000000000..44a4cda00
--- /dev/null
+++ b/private/os2/os2ses/trans.h
@@ -0,0 +1,491 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ trans.h
+
+Abstract:
+
+ Prototypes for functions & macros in trans.c
+
+Author:
+
+ Michael Jarus (mjarus) 27-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+
+PVOID Ow2KbdScanTable;
+
+CONSOLE_CURSOR_INFO OldWinCurInfo; /* Win Cursor Info (saved in PopUp) */
+
+typedef struct _KBD_XLATE_VARS
+{
+ USHORT XDRFlags; // => delete: See XCOMPLETE below. Not
+ // used at interrupt time.
+ USHORT XHotKeyShift; // Interrupt driven shift status
+ USHORT XPSGFlags; // Copy of caller's PSG flags.
+ // (changed byte->word and position in structure per DCR8)
+ UCHAR XlateFlags; // See equates below.
+ UCHAR ToggleFlags; // See equates below.
+ UCHAR XInputMode; // Copy of desired input mode. 0 - cooked, SHIFTREPORT - to test this mode
+ UCHAR XAltKeyPad; // Accumulator for Alt-nnn entry
+ UCHAR OtherFlags; // NEW: for InterruptTime
+} KBD_XLATE_VARS, *PKBD_XLATE_VARS;
+
+// XPSGFlags
+#define PrevAccent 7 // Bits where accent number saved til next keystroke.
+// XlateFlags
+#define SecPrefix 4 // G keyboard E0 prefix scan code just seen.
+// OtherFlags
+#define InterruptTime 4 // bit 2 - Currently processing an interrupt.
+
+KBD_XLATE_VARS Ow2KbdXlateVars;
+
+DWORD VioSetScreenSize(IN SHORT Row, IN SHORT Col, IN HANDLE hConsole);
+DWORD SetScreenSizeParm(IN SHORT Row, IN SHORT Col);
+
+/* macros for char translation */
+
+/*
+ * OS2-->WIN : VIO-Character
+ * =============
+ */
+
+#ifdef DBCS
+// MSKK Jun.26.1992 KazuM
+// MSKK Oct.26.1992 V-AKihiS
+#define MapOs2ToWinChar(Os2Char, NumLen, WinChar) \
+ MultiByteToWideChar( \
+ (UINT)SesGrp->VioCP, \
+ OS2SS_NLS_MB_DEFAULT, \
+ (LPSTR)&Os2Char, \
+ (int)NumLen, \
+ (LPWSTR)&WinChar, \
+ (int)1);
+
+#else
+#define MapOs2ToWinChar(Os2Char, WinChar) \
+ MultiByteToWideChar( \
+ (UINT)SesGrp->VioCP, \
+ OS2SS_NLS_MB_DEFAULT, \
+ (LPSTR)&Os2Char, \
+ (int)1, \
+ (LPWSTR)&WinChar, \
+ (int)1);
+#endif
+
+/*
+ * OS2-->WIN : VIO-Attribute
+ * =============
+ */
+
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+WORD
+MapOs2ToWinAttr(
+ IN PBYTE Os2Attr
+ );
+#else
+#define MapOs2ToWinAttr(Os2Attr) \
+ ((WORD) Os2Attr)
+// ((WORD) (Os2Attr & ~OS2_BACKGROUND_BLINKING))
+#endif
+
+/*** Nt WinCon attribute flags
+
+#define FOREGROUND_BLUE 0x0001 // text color contains blue.
+#define FOREGROUND_GREEN 0x0002 // text color contains green.
+#define FOREGROUND_RED 0x0004 // text color contains red.
+#define FOREGROUND_INTENSITY 0x0008 // text color is intensified.
+#define BACKGROUND_BLUE 0x0010 // background color contains blue.
+#define BACKGROUND_GREEN 0x0020 // background color contains green.
+#define BACKGROUND_RED 0x0040 // background color contains red.
+#define BACKGROUND_INTENSITY 0x0080 // background color is intensified. ***/
+
+/*** OS/2 screen attributes ***/
+
+#define OS2_FOREGROUND_BLUE 0x0001 // text color contains blue.
+#define OS2_FOREGROUND_GREEN 0x0002 // text color contains green.
+#define OS2_FOREGROUND_RED 0x0004 // text color contains red.
+#define OS2_FOREGROUND_INTENSITY 0x0008 // text color is intensified.
+#define OS2_BACKGROUND_BLUE 0x0010 // background color contains blue.
+#define OS2_BACKGROUND_GREEN 0x0020 // background color contains green.
+#define OS2_BACKGROUND_RED 0x0040 // background color contains red.
+#define OS2_BACKGROUND_BLINKING 0x0080 // blinking character.
+#ifdef DBCS
+// MSKK Oct.13.1993 V-AkihiS
+#define OS2_COMMON_LVB_SBCS 0x00 // SBCS character
+#define OS2_COMMON_LVB_LEADING_BYTE 0x01 // DBCS leading byte
+#define OS2_COMMON_LVB_TRAILING_BYTE 0x81 // DBCS trailing byte
+#endif
+
+/*
+ * OS2-->WIN : VIO-Character-string
+ * ====================
+ */
+
+/*
+ * OS2-->WIN : VIO-Cell-string
+ * ===============
+ */
+
+#ifdef DBCS
+// MSKK Oct.26.1992 V-AkihiS
+#define MapOs2ToWinCellStr(DestChar, DestAttr, Sour, Length, NumWide) \
+ { int i, j; \
+ PBYTE os2Cell; \
+ PWORD winAttr; \
+ PBYTE winChar; \
+ \
+ os2Cell = Sour; \
+ winChar = (PBYTE)DestChar; \
+ winAttr = DestAttr; \
+ for (i=j=0; i<(int)Length; winChar[i]=(os2Cell[j]), \
+ winAttr[i++]=MapOs2ToWinAttr(&os2Cell[j+1]), \
+ j += (SesGrp->VioLength2CellShift<<1)\
+ ); \
+ if (CheckBisectStringA((DWORD)SesGrp->VioCP, \
+ (PCHAR)Ow2VioDataAddress, \
+ (DWORD)Length)) { \
+ *((PCHAR)Ow2VioDataAddress+Length-1) = ' '; \
+ } \
+ NumWide = Length; \
+ }
+#else
+#define MapOs2ToWinCellStr(DestChar, DestAttr, Sour, Length, NumWide) \
+ { int i, j; \
+ PBYTE os2Cell; \
+ PWORD winAttr; \
+ PBYTE winChar; \
+ \
+ os2Cell = Sour; \
+ winChar = (PBYTE)DestChar; \
+ winAttr = DestAttr; \
+ for (i=j=0; i<(int)Length; winChar[i]=(os2Cell[j++]), \
+ winAttr[i++]=MapOs2ToWinAttr(os2Cell[j++])); \
+ NumWide = Length; \
+ }
+#endif
+
+/*
+ * OS2-->WIN : VIO-CursorPosition
+ * ==================
+ */
+
+DWORD MapOs2ToWinCursor(IN OUT PVIOCURSORINFO pCursorInfo,
+ OUT PCONSOLE_CURSOR_INFO lpCursorInfo);
+/*
+ * WIN-->OS2 : VIO-Character
+ * =============
+ */
+
+#define MapWin2Os2Char(WinChar, Os2Char) \
+ { \
+ BOOL Bool; \
+ \
+ WideCharToMultiByte( \
+ (UINT)SesGrp->VioCP, \
+ OS2SS_NLS_WC_DEFAULT, \
+ (LPWSTR)&WinChar, \
+ (int)1, \
+ (LPSTR)&Os2Char, \
+ (int)1, \
+ NULL, \
+ &Bool); \
+ } \
+
+/*
+ * WIN-->OS2 : VIO-Attribute
+ * =============
+ */
+
+#ifdef DBCS
+// MSKK Jun.24.1992 KazuM
+VOID
+MapWin2Os2Attr(
+ IN WORD NtAttr,
+ OUT PBYTE Os2Attr
+ );
+#else
+#define MapWin2Os2Attr(NtAttr) \
+ ((BYTE)NtAttr)
+// ((BYTE)(NtAttr & ~OS2_BACKGROUND_BLINKING))
+#endif
+
+/*
+ * WIN-->OS2 : VIO-Character-string
+ * ====================
+ */
+
+/* BUGBUG=> Add support for NLS & UNICODE */
+
+#define MapWin2Os2CharStr(Dest, Sour, Length, NumChar) \
+ { \
+ BOOL Bool; \
+ \
+ NumChar = WideCharToMultiByte( \
+ (UINT)SesGrp->VioCP, \
+ OS2SS_NLS_WC_DEFAULT, \
+ (LPWSTR)Sour, \
+ (int)(Length), \
+ (LPSTR)Dest, \
+ (int)(KBD_OFFSET - WIDE_OFFSET), \
+ NULL, \
+ &Bool); \
+ } \
+
+/*
+ * WIN-->OS2 : VIO-Cell-string
+ * ===============
+ */
+
+#ifdef DBCS
+// MSKK Oct.26.1992 V-AkihiS
+// MSKK Nov.07.1992 V-AkihiS
+#define MapWin2Os2CellStr(Dest, SourChar, SourAttr, Length, NumChar) \
+ { int i, j; \
+ PBYTE os2Cell; \
+ PWORD winAttr; \
+ PBYTE winChar; \
+ BOOL Bool; \
+ BYTE c; \
+ BYTE Os2Attr[3]; \
+ \
+ os2Cell = Dest; \
+ winChar = (PBYTE)SourChar; \
+ winAttr = SourAttr; \
+ \
+ for (i=j=0; i<(int)Length;) \
+ { \
+ MapWin2Os2Attr(winAttr[i],Os2Attr); \
+ if (Ow2NlsIsDBCSLeadByte(c=winChar[i], SesGrp->VioCP)) { \
+ if (i <(int) (NumChar-1)) { \
+ if (SesGrp->VioLength2CellShift == 1) { \
+ os2Cell[j++]=c; \
+ os2Cell[j++]=Os2Attr[0]; \
+ i++; \
+ MapWin2Os2Attr(winAttr[i],Os2Attr); \
+ os2Cell[j++]=winChar[i]; \
+ os2Cell[j++]=Os2Attr[0]; \
+ i++; \
+ } \
+ else { \
+ os2Cell[j++]=c; \
+ os2Cell[j++]=Os2Attr[0]; \
+ os2Cell[j++]=Os2Attr[1]; \
+ os2Cell[j++]=Os2Attr[2]; \
+ i++; \
+ MapWin2Os2Attr(winAttr[i],Os2Attr); \
+ os2Cell[j++]=winChar[i]; \
+ os2Cell[j++]=Os2Attr[0]; \
+ os2Cell[j++]=Os2Attr[1]; \
+ os2Cell[j++]=Os2Attr[2]; \
+ i++; \
+ } \
+ } \
+ else { \
+ if (SesGrp->VioLength2CellShift == 1) { \
+ os2Cell[j++]=' '; \
+ os2Cell[j++]=Os2Attr[0]; \
+ i++; \
+ } \
+ else { \
+ os2Cell[j++]=' '; \
+ os2Cell[j++]=Os2Attr[0]; \
+ os2Cell[j++]=Os2Attr[1]; \
+ os2Cell[j++]=Os2Attr[2]; \
+ i++; \
+ } \
+ } \
+ } \
+ else { \
+ if (SesGrp->VioLength2CellShift == 1) { \
+ os2Cell[j++]=c; \
+ os2Cell[j++]=Os2Attr[0]; \
+ i++; \
+ } \
+ else { \
+ os2Cell[j++]=c; \
+ os2Cell[j++]=Os2Attr[0]; \
+ os2Cell[j++]=Os2Attr[1]; \
+ os2Cell[j++]=Os2Attr[2]; \
+ i++; \
+ } \
+ } \
+ } \
+ }
+#else
+#define MapWin2Os2CellStr(Dest, SourChar, SourAttr, Length, NumChar) \
+ { int i, j; \
+ PBYTE os2Cell; \
+ PWORD winAttr; \
+ PBYTE winChar; \
+ \
+ os2Cell = Dest; \
+ winChar = (PBYTE)SourChar; \
+ winAttr = SourAttr; \
+ \
+ NumChar = Length; \
+ for (i=j=0; i<(int)NumChar;) \
+ { os2Cell[j++]=winChar[i]; \
+ os2Cell[j++]=MapWin2Os2Attr(winAttr[i++]); \
+ } \
+ }
+#endif
+
+/*
+ * WIN-->OS2 : VIO-CursorPosition
+ * ==================
+ */
+
+DWORD MapWin2Os2Cursor( IN CONSOLE_CURSOR_INFO lpCursorInfo,
+ OUT PVIOCURSORINFO CursorInfo);
+
+/*
+ * WIN-->OS2 : KBD-KeyInfo
+ * ===========
+ * 1. KBD-Status
+ * 2. KBD-Character
+ */
+
+// DWORD MapWin2Os2KbdInfo(IN PKEY_EVENT_RECORD WinKey, in event.h
+// OUT PKEYEVENTINFO Os2Key);
+#ifdef DBCS
+// MSKK May.18.1992 KazuM
+BYTE MapWinToOs2KbdNlsShift(IN PKEY_EVENT_RECORD WinKey);
+BYTE MapWinToOs2KbdInterim(IN PKEY_EVENT_RECORD WinKey);
+BYTE MapWinToOs2KbdNlsShiftReport(IN PKEY_EVENT_RECORD WinKey,
+ IN PKBDKEYINFO Os2Key);
+VOID GetNlsMode(IN PKBDINFO KbdInfo);
+VOID SetNlsMode(IN KBDINFO KbdInfo);
+#endif
+
+/* NT win KBD definitions
+
+#define RIGHT_ALT_PRESSED 0x0001 // the right alt key is pressed.
+#define LEFT_ALT_PRESSED 0x0002 // the left alt key is pressed.
+#define RIGHT_CTRL_PRESSED 0x0004 // the right ctrl key is pressed.
+#define LEFT_CTRL_PRESSED 0x0008 // the left ctrl key is pressed.
+#define SHIFT_PRESSED 0x0010 // the shift key is pressed.
+#define NUMLOCK_ON 0x0020 // the numlock light is on.
+#define SCROLLLOCK_ON 0x0040 // the scrolllock light is on.
+#define CAPSLOCK_ON 0x0080 // the capslock light is on.
+#define ENHANCED_KEY 0x0100 // the key is enhanced. ***/
+
+/* OS2 Kbd definitions (bsedev.h) */
+
+#define OS2_RIGHTSHIFT 0x0001
+#define OS2_LEFTSHIFT 0x0002
+#define OS2_CONTROL 0x0004
+#define OS2_ALT 0x0008
+#define OS2_SCROLLLOCK_ON 0x0010
+#define OS2_NUMLOCK_ON 0x0020
+#define OS2_CAPSLOCK_ON 0x0040
+#define OS2_INSERT_ON 0x0080
+#define OS2_LEFTCONTROL 0x0100
+#define OS2_LEFTALT 0x0200
+#define OS2_RIGHTCONTROL 0x0400
+#define OS2_RIGHTALT 0x0800
+#define OS2_SCROLLLOCK 0x1000
+#define OS2_NUMLOCK 0x2000
+#define OS2_CAPSLOCK 0x4000
+#define OS2_SYSREQ 0x8000
+
+#define OS2_ANYSHIFT (OS2_RIGHTSHIFT | OS2_LEFTSHIFT)
+#define OS2_ANYALT (OS2_RIGHTALT | OS2_LEFTALT)
+#define OS2_ANYCONTRL (OS2_RIGHTCONTROL | OS2_LEFTCONTROL)
+
+#define KBDINFO_STATE_MASK (USHORT)(OS2_RIGHTSHIFT | OS2_LEFTSHIFT | OS2_CONTROL | OS2_ALT | OS2_SCROLLLOCK_ON | OS2_NUMLOCK_ON | OS2_CAPSLOCK_ON | OS2_INSERT_ON | OS2_SYSREQ)
+
+#ifdef DBCS
+// MSKK May.15.1992 KazuM
+#define OS2_NLS_IME_CONVERSION 0x80
+#endif
+
+/*
+ * WIN-->OS2 : MOU-Event
+ * =========
+ */
+
+BOOL MapWin2Os2MouEvent(OUT PMOUEVENTINFO Mou, IN PMOUSE_EVENT_RECORD Event);
+
+/*** NT win mouse definitions
+ //
+ // ButtonState flags
+ //
+
+#define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
+#define RIGHTMOST_BUTTON_PRESSED 0x0002
+#define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
+#define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
+#define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
+
+ //
+ // EventFlags
+ //
+
+#define MOUSE_MOVED 0x0001
+#define DOUBLE_CLICK 0x0002 ***/
+
+/* OS2 Mouse definitions (bsedev.h) */
+
+#define OS2_MOUSE_MOTION 0x0001
+#define OS2_MOUSE_MOTION_WITH_BN1_DOWN 0x0002
+#define OS2_MOUSE_BN1_DOWN 0x0004
+#define OS2_MOUSE_MOTION_WITH_BN2_DOWN 0x0008
+#define OS2_MOUSE_BN2_DOWN 0x0010
+#define OS2_MOUSE_MOTION_WITH_BN3_DOWN 0x0020
+#define OS2_MOUSE_BN3_DOWN 0x0040
+
+#define WIN_BUTTON_MASK (FROM_LEFT_1ST_BUTTON_PRESSED | RIGHTMOST_BUTTON_PRESSED | FROM_LEFT_2ND_BUTTON_PRESSED)
+
+/*
+ * routines to update Vio LVB (in violvb.c)
+ */
+
+VOID VioLVBCopyStr( IN PUCHAR Sour,
+ IN COORD Coord,
+ IN ULONG Length);
+
+VOID VioLVBFillAtt( IN PBYTE pAttr,
+ IN COORD Coord,
+ IN ULONG Length);
+
+#ifdef DBCS
+// MSKK Oct.13.1993 V-AkihiS
+VOID VioLVBFillChar(IN PBYTE Char,
+ IN COORD Coord,
+ IN ULONG Length);
+#else
+VOID VioLVBFillChar(IN BYTE Char,
+ IN COORD Coord,
+ IN ULONG Length);
+#endif
+
+VOID VioLVBFillCharAndScroll(IN BYTE Char,
+ IN COORD Coord,
+ IN ULONG Length);
+
+VOID VioLVBFill2CharsAndScroll(IN BYTE Char1,
+ IN BYTE Char2,
+ IN COORD Coord,
+ IN ULONG Length);
+
+VOID VioLVBFillCell(IN PBYTE pCell,
+ IN COORD Coord,
+ IN ULONG Length);
+
+VOID VioLVBCopyCellStr(IN PUCHAR Sour,
+ IN COORD Coord,
+ IN ULONG Length);
+
+VOID VioLVBScrollBuff(IN DWORD Count);
diff --git a/private/os2/os2ses/util.c b/private/os2/os2ses/util.c
new file mode 100644
index 000000000..47ce35dbe
--- /dev/null
+++ b/private/os2/os2ses/util.c
@@ -0,0 +1,899 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ util.c
+
+Abstract:
+
+ This module contains the common utilities used in OS2SES module
+
+Author:
+
+ Avi Nathan (avin) 17-Jul-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "os2win.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <direct.h>
+#include <string.h>
+#include <ctype.h>
+
+#if PMNT
+#define INCL_32BIT
+#include "pmnt.h"
+#endif
+
+/* ExitReason values (from os2v12.h/os2v20.h) */
+
+#define TC_EXIT 0
+#define TC_HARDERROR 1
+#define TC_TRAP 2
+#define TC_KILLPROCESS 3
+
+typedef struct _UNICODE_STRING {
+ USHORT Length;
+ USHORT MaximumLength;
+ PWSTR Buffer;
+} UNICODE_STRING, *PUNICODE_STRING;
+
+typedef struct _STRING {
+ USHORT Length;
+ USHORT MaximumLength;
+ PCHAR Buffer;
+} STRING, *PSTRING;
+
+BOOL
+Or2CreateUnicodeStringFromMBz(
+ OUT PUNICODE_STRING DestinationString,
+ IN PSZ SourceString
+ );
+
+DWORD
+Or2MBStringToUnicodeString(
+ PUNICODE_STRING DestinationString,
+ PSTRING SourceString,
+ BOOL AllocateDestinationString
+ );
+
+VOID
+RtlFreeUnicodeString(
+ PUNICODE_STRING UnicodeString
+ );
+
+DWORD
+Ow2VioReadCurPos(
+ );
+
+DWORD
+Ow2VioReadCurType();
+
+DWORD
+Ow2LvbUpdateLVBBuffer();
+
+VOID
+SetSessionParameters(
+ IN PVOID SessionStartData,
+ OUT PDWORD pCreateFlags,
+ IN PSZ ImageFileName,
+#if PMNT
+ IN ULONG IsPMApp,
+#endif // PMNT
+ OUT LPSTARTUPINFO pStartInfo
+ );
+
+int
+Ow2DisplayHardErrorPopup(
+ IN int Drive,
+ IN BOOLEAN WriteProtectError,
+ IN PUCHAR AppName
+ );
+
+DWORD
+Ow2HardErrorPopup(
+ IN int Drive,
+ IN BOOLEAN WriteProtectError,
+ OUT int * ReturnedAction,
+ IN PUCHAR AppName
+ )
+{
+ int RetVal;
+
+ RetVal = Ow2DisplayHardErrorPopup(
+ Drive,
+ WriteProtectError,
+ AppName
+ );
+
+ switch (RetVal) {
+ case IDABORT:
+ *ReturnedAction = OS2SS_IDABORT;
+ break;
+
+ case IDRETRY:
+ *ReturnedAction = OS2SS_IDRETRY;
+ break;
+
+ default:
+ *ReturnedAction = OS2SS_IDIGNORE;
+ break;
+ }
+ return (0L);
+}
+
+
+HANDLE
+Ow2GetNulDeviceHandle(
+ VOID
+ )
+//
+// NULL is returned if there is some system error
+// and we can't open the nul device
+//
+{
+ //
+ // used to hold a handle to the win32 NUL device
+ // this is needed to pass NUL redirections to win32 processes
+ //
+ static HANDLE Ow2NulDeviceHandle = NULL;
+ HANDLE Hand;
+ SECURITY_ATTRIBUTES Sa;
+
+ if (Ow2NulDeviceHandle != NULL) {
+ return(Ow2NulDeviceHandle);
+ }
+
+ Sa.nLength = sizeof(Sa);
+ Sa.lpSecurityDescriptor = NULL;
+ Sa.bInheritHandle = TRUE;
+
+ Hand = CreateFileA("NUL",
+ GENERIC_READ|GENERIC_WRITE,
+ FILE_SHARE_READ|FILE_SHARE_WRITE,
+ &Sa,
+ OPEN_EXISTING,
+ 0L,
+ NULL);
+
+ if (Hand == INVALID_HANDLE_VALUE) {
+#if DBG
+ KdPrint(("OS2SES: Ow2GetNulDeviceHandle -- can't open NUL device, Error = %lx\n", GetLastError()));
+#endif
+ return(NULL);
+ } else {
+ Ow2NulDeviceHandle = Hand;
+ return(Hand);
+ }
+}
+
+ //
+ // Interface for a direct call from client\conrqust.c
+ //
+DWORD
+Ow2ExecPgm(
+ IN ULONG Flags,
+ IN PSZ Arguments OPTIONAL,
+ IN PSZ Variables OPTIONAL,
+ IN PSZ ImageFileName,
+#if PMNT
+ IN ULONG IsPMApp,
+#endif // PMNT
+ IN PVOID SessionStartData OPTIONAL,
+ IN POS2_STDHANDLES StdStruc,
+ OUT HANDLE *pHandle,
+ OUT HANDLE *tHandle,
+ OUT ULONG *dwProcessId
+ )
+{
+ STARTUPINFO StartInfo;
+ STARTUPINFOW StartInfoW;
+ PROCESS_INFORMATION ProcessInfo;
+ BOOL b;
+ DWORD dwCreateFlags, status = 0;
+ UNICODE_STRING ImageString_U;
+ UNICODE_STRING ArgString_U;
+ UNICODE_STRING TitleString_U;
+
+ RtlZeroMemory(&StartInfo, sizeof(STARTUPINFO));
+ StartInfo.cb = sizeof(STARTUPINFO);
+ StartInfo.dwFlags = STARTF_USESHOWWINDOW;
+ StartInfo.wShowWindow = SW_SHOWDEFAULT;
+
+ dwCreateFlags = CREATE_SUSPENDED;
+
+ if (Flags & EXEC_WINDOW_PROGRAM) {
+
+ // This is a window program, so create it with CREATE_NEW_PROCESS_GROUP
+ // (it will enable us to send CTRL_EVENT to all the group)
+
+ // dwCreateFlags |= CREATE_NEW_PROCESS_GROUP;
+
+ //
+ // redirect standard handles if we need to
+ //
+
+ if (StdStruc->Flags & STDFLAG_ALL) {
+
+ if (StdStruc->Flags & STDFLAG_IN) {
+ StartInfo.hStdInput = StdStruc->StdIn;
+ } else {
+ StartInfo.hStdInput = SesGrp->StdIn;
+ }
+
+ if (StdStruc->Flags & STDFLAG_OUT) {
+ StartInfo.hStdOutput = StdStruc->StdOut;
+ } else {
+ StartInfo.hStdOutput = SesGrp->StdOut;
+ }
+
+ if (StdStruc->Flags & STDFLAG_ERR) {
+ StartInfo.hStdError = StdStruc->StdErr;
+ } else {
+ StartInfo.hStdError = SesGrp->StdErr;
+ }
+
+ StartInfo.dwFlags |= STARTF_USESTDHANDLES;
+ }
+
+ Flags &= ~EXEC_WINDOW_PROGRAM;
+ }
+
+ if (Flags == 4) {
+ // EXEC_BACKGROUND == 4
+ dwCreateFlags |= DETACHED_PROCESS;
+ }
+
+ if (SessionStartData)
+ {
+ SetSessionParameters(
+ SessionStartData,
+ &dwCreateFlags,
+ ImageFileName,
+#if PMNT
+ IsPMApp,
+#endif // PMNT
+ &StartInfo
+ );
+ }
+
+#if DBG
+ IF_OD2_DEBUG(TEMP)
+ {
+ KdPrint(("OS2SES(util-Ow2ExecPgm): CreateProcess %s\n Arg %s\n",
+ ImageFileName, Arguments));
+ }
+#endif
+
+ //
+ // Translate all the OEM parameters (MB) to Unicode
+ //
+
+ //
+ // ImageFileName
+ //
+
+ if (!(Or2CreateUnicodeStringFromMBz(
+ &ImageString_U,
+ ImageFileName
+ ))) {
+ status = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(util-Ow2ExecPgm): Fail to translate ImageFileName %s OEM to Unicode\n",
+ ImageFileName));
+#endif
+ return(status);
+ }
+
+ //
+ // Arguments
+ //
+
+ if (!(Or2CreateUnicodeStringFromMBz(
+ &ArgString_U,
+ Arguments
+ ))) {
+ status = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(util-Ow2ExecPgm): Fail to translate Arguments %s OEM to Unicode\n",
+ Arguments));
+#endif
+ if (ImageFileName)
+ RtlFreeUnicodeString(&ImageString_U);
+ return(status);
+ }
+
+ //
+ // StartupInfo
+ //
+
+ RtlMoveMemory(&StartInfoW, &StartInfo, sizeof(StartInfo));
+
+ TitleString_U.Buffer = NULL;
+ if (!(Or2CreateUnicodeStringFromMBz(
+ &TitleString_U,
+ StartInfo.lpTitle
+ ))) {
+ status = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(util-Ow2ExecPgm): Fail to translate Title %s OEM to Unicode\n",
+ StartInfo.lpTitle ));
+#endif
+ if (ImageFileName)
+ RtlFreeUnicodeString(&ImageString_U);
+ if (Arguments)
+ RtlFreeUnicodeString(&ArgString_U);
+ return(status);
+ }
+
+ StartInfoW.lpTitle = TitleString_U.Buffer;
+
+
+ b = CreateProcessW(ImageString_U.Buffer,
+ ArgString_U.Buffer,
+ NULL,
+ NULL,
+ TRUE, // inherit all handles
+ dwCreateFlags,
+ Variables,
+ NULL,
+ &StartInfoW,
+ &ProcessInfo
+ );
+
+ //
+ // Free Unicode Strings
+ //
+ if (ImageFileName)
+ RtlFreeUnicodeString(&ImageString_U);
+ if (Arguments)
+ RtlFreeUnicodeString(&ArgString_U);
+ if (TitleString_U.Buffer)
+ RtlFreeUnicodeString(&TitleString_U);
+
+ //
+ // check for error
+ //
+ if (!b) {
+ status = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(util-Ow2ExecPgm): CreateProcess of %s failed status = %x \n",
+ ImageFileName, status));
+#endif
+
+ return(status);
+ }
+
+ *pHandle = ProcessInfo.hProcess;
+ *tHandle = ProcessInfo.hThread;
+ *dwProcessId = ProcessInfo.dwProcessId;
+
+ return(status);
+}
+
+
+DWORD
+CreateOS2SRV(
+ OUT PHANDLE hProcess
+ )
+{
+ STARTUPINFOW StartInfo;
+ PROCESS_INFORMATION ProcessInfo;
+ BOOL b;
+ DWORD status = 0;
+ WCHAR Path[MAX_PATH];
+ UNICODE_STRING CdString_U;
+
+ *hProcess = NULL;
+
+ GetSystemDirectoryW((LPWSTR) &Path, MAX_PATH);
+
+ if (!(Or2CreateUnicodeStringFromMBz(
+ &CdString_U,
+ getenv("SYSTEMROOT")
+ ))) {
+ status = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(util-CreateOS2SRV): Fail to translate curdir %s to Unicode, status %lx\n",
+ getenv("SYSTEMROOT"), status));
+#endif
+ return(status);
+ }
+
+
+ /*
+ for ( i = 0 ; Path[i] ; i++ ) {
+ Path[i] = toupper(Path[i]);
+ }
+ */
+
+ wcscat(Path, L"\\OS2SRV.EXE");
+
+ RtlZeroMemory(&StartInfo, sizeof(STARTUPINFOW));
+ StartInfo.cb = sizeof(STARTUPINFOW);
+ StartInfo.wShowWindow = SW_SHOWDEFAULT;
+
+ if (fService)
+ b = CreateProcessW(Path,
+ L"OS2SRV /S",
+ NULL,
+ NULL,
+ FALSE,
+ DETACHED_PROCESS,
+ NULL,
+ CdString_U.Buffer, //getenv("SYSTEMROOT"),
+ &StartInfo,
+ &ProcessInfo
+ );
+ else
+ b = CreateProcessW(Path,
+ L"",
+ NULL,
+ NULL,
+ FALSE,
+ DETACHED_PROCESS,
+ NULL,
+ CdString_U.Buffer, //getenv("SYSTEMROOT"),
+ &StartInfo,
+ &ProcessInfo
+ );
+ if (!b) {
+ status = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(util-CreateOS2SRV): CreateProcess of OS2SRV failed status = %x \n",
+ status));
+#endif
+ return(status);
+ }
+
+ *hProcess = ProcessInfo.hProcess;
+ SetPriorityClass(*hProcess, REALTIME_PRIORITY_CLASS);
+ RtlFreeUnicodeString(&CdString_U);
+
+ return(status);
+
+}
+
+
+BOOL
+ServeWinCreateProcess(PWINEXECPGM_MSG PReq, PVOID PStatus)
+{
+ DWORD Rc = 0;
+
+#if DBG
+ IF_OD2_DEBUG( TASKING )
+ {
+ KdPrint(("OS2SES: ServeWinCreateProcess: Request: %u\n",
+ PReq->Request));
+ }
+#endif
+
+ switch (PReq->Request)
+ {
+ case RemoveConsoleThread:
+ if ( SesGrp->WinSyncProcessNumberInSession == 0 )
+ {
+ Rc = RemoveConForWinProcess();
+ }
+ if (!Rc)
+ {
+ SesGrp->WinSyncProcessNumberInSession++ ;
+ SesGrp->WinProcessNumberInSession++ ;
+ }
+ break;
+
+ case RestartConsoleThread:
+
+ // force CurPos, CurType and LVB to get updated
+
+ Ow2VioReadCurPos();
+ Ow2VioReadCurType();
+ Ow2LvbUpdateLVBBuffer();
+
+ if(SesGrp->WinSyncProcessNumberInSession == 1)
+ {
+ Rc = AddConAfterWinProcess();
+ }
+
+ SesGrp->WinSyncProcessNumberInSession--;
+ SesGrp->WinProcessNumberInSession--;
+ break;
+
+ case AddWin32ChildProcess:
+ SesGrp->WinProcessNumberInSession++;
+ break;
+
+ case RemWin32ChildProcess:
+
+ // force CurPos, CurType and LVB to get updated
+
+ Ow2VioReadCurPos();
+ Ow2VioReadCurType();
+ Ow2LvbUpdateLVBBuffer();
+
+ SesGrp->WinProcessNumberInSession--;
+ break;
+
+ default:
+ Rc = (DWORD) -1; //STATUS_INVALID_PARAMETER;
+#if DBG
+ KdPrint(("OS2SES(util-ServeWinCreateProcess): Unknown WinExec request = %X\n",
+ PReq->Request));
+#endif
+ }
+
+ if ( Rc == 1 )
+ {
+/* BUGBUG=> BUGBUG! error code and returned Status are wrong */
+ if (!(Rc = GetLastError()))
+ {
+#if DBG
+ KdPrint(("OS2SES(util-ServeWinCreateProcess): Unknown LastError\n"));
+#endif
+ Rc = (DWORD) -1;
+ }
+ }
+
+ *(PDWORD) PStatus = Rc;
+
+ return(TRUE); // Continue
+}
+
+
+VOID
+Ow2WinExitCode2ResultCode(
+ IN DWORD Status,
+ OUT PDWORD pReturnCode,
+ OUT PDWORD pExitReason)
+
+/*++
+
+Routine Description:
+
+ This routine translate the ExitCode from Win32's GetExitCodeProcess
+ to the OS/2 structure RESULTCODES fields: ExitReason and ExitResult.
+
+Arguments:
+
+ Status - the ExitCode from Win32 process.
+
+ pReturnCode - where to put the translated ExitResult
+
+ pExitReason - where to put the translated ExitReason
+
+Return Value:
+
+
+Note:
+
+
+--*/
+{
+ *pReturnCode = Status;
+ *pExitReason = TC_EXIT;
+
+ if (*pReturnCode == STATUS_WAIT_0)
+ {
+ /*
+ Success:
+
+ STATUS_WAIT_O 0x00000000L) 0
+ */
+
+ } else if (*pReturnCode == STATUS_CONTROL_C_EXIT)
+ {
+ /*
+ STATUS_CONTROL_C_EXIT 0xC000013AL) 0
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 0;
+ } else if (((ULONG)*pReturnCode >= (ULONG)STATUS_ARRAY_BOUNDS_EXCEEDED) &&
+ ((ULONG)*pReturnCode <= (ULONG)STATUS_PRIVILEGED_INSTRUCTION))
+ {
+ /*
+ STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008CL) 5
+ STATUS_FLOAT_DENORMAL_OPERAND 0xC000008DL) 16
+ STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008EL) 16
+ STATUS_FLOAT_INEXACT_RESULT 0xC000008FL) 16
+ STATUS_FLOAT_INVALID_OPERATION 0xC0000090L) 16
+ STATUS_FLOAT_OVERFLOW 0xC0000091L) 16
+ STATUS_FLOAT_STACK_CHECK 0xC0000092L) 16
+ STATUS_FLOAT_UNDERFLOW 0xC0000093L) 16
+ STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094L) 0
+ STATUS_INTEGER_OVERFLOW 0xC0000095L) 4
+ STATUS_PRIVILEGED_INSTRUCTION 0xC0000096L) 13
+ */
+
+ if (*pReturnCode == STATUS_INTEGER_DIVIDE_BY_ZERO)
+ {
+ *pReturnCode = 0;
+ } else if (*pReturnCode == STATUS_INTEGER_OVERFLOW)
+ {
+ *pReturnCode = 4;
+ } else if (*pReturnCode == STATUS_PRIVILEGED_INSTRUCTION)
+ {
+ *pReturnCode = 13;
+ } else if (*pReturnCode == STATUS_ARRAY_BOUNDS_EXCEEDED)
+ {
+ *pReturnCode = 5;
+ } else
+ {
+ *pReturnCode = 16;
+ }
+ *pExitReason = TC_TRAP;
+ } else if (*pReturnCode == STATUS_STACK_OVERFLOW)
+ {
+ /*
+ STATUS_STACK_OVERFLOW 0xC00000FDL) 12
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 12;
+ } else if (*pReturnCode == STATUS_DATATYPE_MISALIGNMENT)
+ {
+ /*
+ STATUS_DATATYPE_MISALIGNMENT 0x80000002L) 17
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 17;
+ } else if (*pReturnCode == STATUS_BREAKPOINT)
+ {
+ /*
+ STATUS_BREAKPOINT 0x80000003L) 3
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 3;
+ } else if (*pReturnCode == STATUS_SINGLE_STEP)
+ {
+ /*
+ STATUS_SINGLE_STEP 0x80000004L) 1
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 1;
+ } else if (*pReturnCode == STATUS_ACCESS_VIOLATION)
+ {
+ /*
+ STATUS_ACCESS_VIOLATION 0xC0000005L) 13
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 13;
+ } else if (*pReturnCode == STATUS_ILLEGAL_INSTRUCTION)
+ {
+ /*
+ STATUS_ILLEGAL_INSTRUCTION 0xC000001DL) 6
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 6;
+ } else if ((*pReturnCode == STATUS_ABANDONED_WAIT_0) ||
+ (*pReturnCode == STATUS_USER_APC) ||
+ (*pReturnCode == STATUS_TIMEOUT) ||
+ (*pReturnCode == STATUS_PENDING) ||
+ (*pReturnCode == STATUS_NONCONTINUABLE_EXCEPTION) ||
+ (*pReturnCode == STATUS_INVALID_DISPOSITION))
+ {
+ /*
+ STATUS_WAIT_0 0x00000000L) ??
+ STATUS_ABANDONED_WAIT_0 0x00000080L) 255
+ STATUS_USER_APC 0x000000C0L) 255
+ STATUS_TIMEOUT 0x00000102L) 255
+ STATUS_PENDING 0x00000103L) 255
+ STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025L) 255
+ STATUS_INVALID_DISPOSITION 0xC0000026L) 255
+ */
+
+ *pExitReason = TC_TRAP;
+ *pReturnCode = 255;
+ }
+#if DBG
+ IF_OD2_DEBUG3( OS2_EXE, TASKING, WIN )
+ {
+ KdPrint(("Ow2WinExitCode2ResultCode: Status %lu => Result %lu, Reason %lu\n",
+ Status, *pReturnCode, *pExitReason));
+ }
+#endif
+
+ return;
+}
+
+
+typedef struct _STARTDATA {
+ USHORT Length;
+ USHORT Related;
+ USHORT FgBg;
+ USHORT TraceOpt;
+ PSZ PgmTitle;
+ PSZ PgmName;
+ PBYTE PgmInputs;
+ PBYTE TermQ;
+ PBYTE Environment;
+ USHORT InheritOpt;
+ USHORT SessionType;
+ PSZ IconFile;
+ ULONG PgmHandle;
+ USHORT PgmControl;
+ USHORT InitXPos;
+ USHORT InitYPos;
+ USHORT InitXSize;
+ USHORT InitYSize;
+ USHORT Reserved;
+ PSZ ObjectBuffer;
+ ULONG ObjectBuffLen;
+} STARTDATA, *PSTARTDATA;
+
+
+VOID
+SetSessionParameters(
+ IN PVOID SessionStartData,
+ OUT PDWORD pCreateFlags,
+ IN PSZ ImageFileName,
+#if PMNT
+ IN ULONG IsPMApp,
+#endif // PMNT
+ OUT LPSTARTUPINFO pStartInfo
+ )
+{
+ PSTARTDATA pStartData = (PSTARTDATA)SessionStartData;
+ ULONG Length = pStartData->Length, i;
+ PUCHAR Title;
+
+#if PMNT
+ //
+ // Don't create console for PM process that is the child session of other PM
+ // process.
+ //
+ if (!ProcessIsPMApp() || (!IsPMApp) || (!pStartData->Related)) {
+#endif
+ *pCreateFlags |= CREATE_NEW_CONSOLE;
+#if PMNT
+ }
+#endif
+
+ Title = (pStartData->PgmTitle) ? pStartData->PgmTitle : ImageFileName;
+ i = strlen(Title);
+ if (i > 32)
+ {
+ Title += ( i - 32 );
+ i = 32;
+ }
+
+ if (!pStartData->PgmTitle)
+ //
+ // we give the pathname, strip out the last component
+ //
+ {
+#ifdef DBCS
+// MSKK Jun.16.1993 V-AkihiS
+ {
+ ULONG LastComponentPos = 0;
+ ULONG j;
+
+ for (j = 0; j < i; )
+ {
+ if (Ow2NlsIsDBCSLeadByte(Title[j], SesGrp->DosCP)) {
+ j++;
+ if (j < i) {
+ j++;
+ }
+ } else {
+ if ((Title[j] == '\\' ) ||
+ (Title[j] == '/' ) ||
+ (Title[j] == ':' )) {
+ LastComponentPos = j;
+ }
+ j++;
+ }
+ }
+ Title += j + 1;
+ }
+#else
+ for ( ; i ; i-- )
+ {
+ if ((Title[i - 1] == '\\' ) ||
+ (Title[i - 1] == '/' ) ||
+ (Title[i - 1] == ':' ))
+ {
+ Title += i;
+ break;
+ }
+ }
+#endif
+ }
+
+ pStartInfo->lpTitle = Title;
+ pStartInfo->dwXSize = (DWORD)SesGrp->ScreenColNum;
+ pStartInfo->dwYSize = (DWORD)SesGrp->ScreenRowNum;
+
+ if (Length > 40)
+ {
+ if (pStartData->PgmControl & 0x8000) // window position & size
+ {
+ if (Length > 42)
+ {
+ pStartInfo->dwX = (DWORD)(pStartData->InitXPos / SesGrp->CellHSize);
+ }
+ if (Length > 44)
+ {
+ pStartInfo->dwY = (DWORD)(pStartData->InitYPos / SesGrp->CellVSize);
+ }
+ if (Length > 46)
+ {
+ pStartInfo->dwXSize = (DWORD)(pStartData->InitXSize / SesGrp->CellHSize);
+ }
+ if (Length > 48)
+ {
+ pStartInfo->dwYSize = (DWORD)(pStartData->InitYSize / SesGrp->CellVSize);
+ }
+ pStartInfo->dwFlags |= (STARTF_USESIZE | STARTF_USEPOSITION);
+ }
+
+ if (!pStartData->FgBg) // window ForeGround
+ {
+ if (pStartData->PgmControl == 0) // invisible
+ {
+ //pStartInfo->dwFlags |= (STARTF_USESIZE | STARTF_USEPOSITION);
+ } else
+ {
+ if (pStartData->PgmControl & 2) // maximize
+ {
+ pStartInfo->wShowWindow = SW_SHOWMAXIMIZED;
+ }
+
+ if (pStartData->PgmControl & 4) // minimize
+ {
+ pStartInfo->wShowWindow = SW_SHOWMINIMIZED;
+ }
+ }
+ } else // window BackGround
+ {
+ if (pStartData->PgmControl == 0) // invisible
+ {
+ //pStartInfo->dwFlags |= (STARTF_USESIZE | STARTF_USEPOSITION);
+ } else
+ {
+ if (pStartData->PgmControl & 2) // maximize
+ {
+ pStartInfo->wShowWindow = SW_MAXIMIZE;
+ }
+
+ if (pStartData->PgmControl & 4) // minimize
+ {
+ pStartInfo->wShowWindow = SW_MINIMIZE;
+ }
+ }
+ }
+ } else
+ {
+ if (!pStartData->FgBg) // window ForeGround
+ {
+ //pStartInfo->wShowWindow |= STARTF_USESIZE;
+ }
+
+ }
+
+ if (pStartInfo->wShowWindow)
+ {
+ pStartInfo->dwFlags |= STARTF_USESHOWWINDOW;
+ }
+
+ // ((Length > 30 ) ? pStartData->SessionType : 0);
+ // TmpInheritOpt;
+}
diff --git a/private/os2/os2ses/vio.h b/private/os2/os2ses/vio.h
new file mode 100644
index 000000000..b3f854a96
--- /dev/null
+++ b/private/os2/os2ses/vio.h
@@ -0,0 +1,83 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ vio.h
+
+Abstract:
+
+ Prototypes for functions & macros in viorqust.c
+
+Author:
+
+ Michael Jarus (mjarus) 27-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+
+PVOID Ow2VioDataAddress;
+
+/*
+ * LVB vio routine to perform:
+ *
+ * init
+ *
+*/
+
+DWORD
+VioLVBInit();
+
+VOID
+VioLVBInitForSession();
+
+PUCHAR
+Ow2LvbGetPtr(
+ IN COORD Coord
+ );
+
+VOID
+LVBUpdateTTYCharWithAttrAndCurPos(
+ IN CHAR c,
+ IN PCHAR * LVBPtr
+ );
+
+#ifdef DBCS
+// MSKK Oct.13.1993 V-AkihiS
+VOID
+LVBUpdateTTYCharWithAttrAndCurPosDBCS(
+ IN CHAR c,
+ IN PCHAR * LVBPtr,
+ IN USHORT State
+ );
+#endif
+
+/*
+ * LVB vio routine to test LVB:
+ *
+ * VioLVBTestBuf (after VioReadCellStr)
+ * VioLVBTestScroll (after VioScrollXx)
+*/
+
+#if DBG
+VOID VioLVBTestBuff(IN PVOID DestBuffer);
+VOID VioLVBTestScroll();
+#endif
+
+#ifdef DBCS
+// MSKK Jun.23.1992 KazuM
+BOOL
+CheckBisectStringA(
+ IN DWORD CodePage,
+ IN PCHAR Buffer,
+ IN DWORD NumBytes
+ );
+#endif
+
diff --git a/private/os2/os2ses/violvb.c b/private/os2/os2ses/violvb.c
new file mode 100644
index 000000000..baab23403
--- /dev/null
+++ b/private/os2/os2ses/violvb.c
@@ -0,0 +1,770 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ violvb.c
+
+Abstract:
+
+ This module contains the Vio LVB routines
+
+Author:
+
+ Michael Jarus (mjarus) 28-Apr-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "trans.h"
+#include "vio.h"
+#include "os2win.h"
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+
+
+#define GET_LVB_PTR( row, col ) &LVBBuffer[((row) * SesGrp->ScreenColNum + (col)) << SesGrp->VioLength2CellShift]
+#define GET_LVB_ATT_PTR( row, col ) &LVBBuffer[(((row) * SesGrp->ScreenColNum + (col)) << SesGrp->VioLength2CellShift) + 1]
+
+typedef struct _attr_3_bytes
+{
+ UCHAR Attr[3];
+} ATTR_3_BYTES, *PATTR_3_BYTES;
+
+#if DBG
+//#define TEST_VIO_LVB 1
+BOOL Ow2VioLvbIgnoreTest = FALSE;
+#endif
+
+PUCHAR Ow2VioLvbTestBuff = NULL;
+
+DWORD
+VioLVBInit()
+{
+#if DBG
+#if TEST_VIO_LVB
+
+ if((Ow2VioLvbTestBuff = HeapAlloc(HandleHeap, 0, SesGrp->MaxLVBsize)) == NULL)
+ {
+ ASSERT1( "VioLVBInit: unable to allocate from heap to test VIO-LVB", FALSE );
+ return(1L);
+ }
+#endif
+#endif
+ return(0L);
+}
+
+
+VOID
+VioLVBInitForSession()
+{
+#if DBG
+#if TEST_VIO_LVB
+ ULONG Length = (ULONG)SesGrp->LVBsize;
+
+ Ow2VioGetLVBBuf(&Length);
+
+#endif
+#endif
+}
+
+
+DWORD
+Ow2VioGetLVBBuf(
+ IN PULONG Length
+ )
+{
+#if DBG
+ if ((*Length >> SesGrp->VioLength2CellShift) != SesGrp->ScreenSize)
+ KdPrint(("OS2SES(VioLVB-VioGetBuf): partial length %lu form %lu\n",
+ *Length >> SesGrp->VioLength2CellShift, SesGrp->ScreenSize));
+#endif
+
+ SesGrp->LVBOn = TRUE; // start echo to LVB buffer
+ return(Ow2VioReadCellStr(
+ Length,
+ 0,
+ 0,
+ LVBBuffer
+ ));
+}
+
+
+DWORD
+Ow2LvbUpdateLVBBuffer()
+{
+ if (SesGrp->LVBOn)
+ {
+ IN ULONG Length = SesGrp->LVBsize;
+
+ return(Ow2VioGetLVBBuf(&Length));
+ }
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+Ow2VioShowLVBBuf(
+ IN ULONG Length,
+ IN ULONG Offset
+ )
+{
+ DWORD Rc;
+ ULONG VioMask = ~(ULONG)SesGrp->VioLengthMask;
+
+ if ( Offset & VioMask )
+ {
+ Length += Offset & VioMask;
+ Offset = Offset & (ULONG)SesGrp->VioLengthMask;
+ }
+
+ if ( Length & VioMask )
+ {
+ Length = (Length + SesGrp->BytesPerCell) & SesGrp->VioLengthMask;
+ }
+
+ if (( Length + Offset) > (ULONG)SesGrp->LVBsize)
+ {
+ Length = SesGrp->LVBsize - Offset;
+ }
+
+ Rc = Ow2VioWriteCellStr(
+ Length,
+ ((Offset >> SesGrp->VioLength2CellShift) / SesGrp->ScreenColNum),
+ ((Offset >> SesGrp->VioLength2CellShift) % SesGrp->ScreenColNum),
+ ((PBYTE)LVBBuffer) + Offset
+ );
+ return(Rc);
+}
+
+
+#if DBG
+VOID
+VioLVBTestBuff(IN PVOID DestBuffer)
+{
+#if TEST_VIO_LVB
+ if(!Ow2VioLvbIgnoreTest &&
+ memcmp( DestBuffer, LVBBuffer, SesGrp->LVBsize))
+ {
+ KdPrint(("Ow2VioReadCellStr: diff buffer\n"));
+ memmove( LVBBuffer, DestBuffer, SesGrp->LVBsize);
+ }
+#else
+ UNREFERENCED_PARAMETER(DestBuffer);
+#endif
+}
+
+
+VOID
+VioLVBTestScroll()
+{
+#if TEST_VIO_LVB
+ ULONG Length = SesGrp->ScreenSize << SesGrp->VioLength2CellShift;
+ ULONG LineLength = SesGrp->ScreenColNum << SesGrp->VioLength2CellShift;
+ UCHAR *Buffer = &Ow2VioLvbTestBuff[0], *Ptr, *Ptr1, *Offset;
+ ULONG i, j, k;
+
+ if (Ow2VioLvbTestBuff)
+ {
+ Ow2VioLvbIgnoreTest = TRUE;
+ Ow2VioReadCellStr(
+ &Length,
+ 0,
+ 0,
+ Ow2VioLvbTestBuff
+ );
+ Ow2VioLvbIgnoreTest = FALSE;
+
+ for ( i = 0, Offset = &LVBBuffer[0] ;
+ i < (ULONG)SesGrp->ScreenRowNum ;
+ i++, Buffer += LineLength, Offset += LineLength )
+ {
+ if(memcmp( Buffer, Offset, LineLength))
+ {
+ Ptr = Buffer;
+ Ptr1 = Offset;
+ for (j = 0 ; j < LineLength ; j++ )
+ {
+ if (Ptr[j] != Ptr1[j])
+ {
+ break;
+ }
+ }
+ KdPrint(("VioScroll: diff buffer line %d, Pos %d\n", i, j));
+ KdPrint((" LVB: %2.2x%2.2x%2.2x%2.2x, ... %2.2x; Screen: %2.2x%2.2x%2.2x%2.2x, ... %2.2x\n",
+ Ptr1[0], Ptr1[1], Ptr1[2], Ptr1[3], Ptr1[j],
+ Ptr[0], Ptr[1], Ptr[2], Ptr[3], Ptr[j]));
+
+ for ( j = 0, k = 0 ; j < 5 ; j++, k += 0x20 )
+ {
+ Ptr = Offset + k;
+ KdPrint((" LVB-%d: %2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x\n", j,
+ Ptr[0], Ptr[1], Ptr[2], Ptr[3], Ptr[4], Ptr[5], Ptr[6], Ptr[7], Ptr[8], Ptr[9],
+ Ptr[10], Ptr[11], Ptr[12], Ptr[13], Ptr[14], Ptr[15], Ptr[16], Ptr[17], Ptr[18], Ptr[19],
+ Ptr[20], Ptr[21], Ptr[22], Ptr[23], Ptr[24], Ptr[25], Ptr[26], Ptr[27], Ptr[28], Ptr[29],
+ Ptr[30], Ptr[31]));
+ Ptr = Buffer + k;
+ KdPrint((" Scr-%d: %2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x,%2.2x%2.2x%2.2x%2.2x\n", j,
+ Ptr[0], Ptr[1], Ptr[2], Ptr[3], Ptr[4], Ptr[5], Ptr[6], Ptr[7], Ptr[8], Ptr[9],
+ Ptr[10], Ptr[11], Ptr[12], Ptr[13], Ptr[14], Ptr[15], Ptr[16], Ptr[17], Ptr[18], Ptr[19],
+ Ptr[20], Ptr[21], Ptr[22], Ptr[23], Ptr[24], Ptr[25], Ptr[26], Ptr[27], Ptr[28], Ptr[29],
+ Ptr[30], Ptr[31]));
+ }
+
+ memmove( Offset, Buffer, LineLength);
+ }
+ }
+ }
+#endif
+}
+#endif
+
+
+VOID
+VioLVBCopyStr( IN PUCHAR Sour,
+ IN COORD Coord,
+ IN ULONG Length)
+{
+
+ if(SesGrp->LVBOn && Length)
+ {
+ register UCHAR *Ptr;
+ register ULONG Offset = (ULONG)SesGrp->BytesPerCell;
+ register ULONG Len = Length;
+ register PUCHAR Sou = Sour;
+
+ Ptr = GET_LVB_PTR( Coord.Y, Coord.X );
+
+#ifdef DBCS
+// MSKK Oct.13.1993 V-AkihiS
+ if (Offset == 2)
+ {
+ for (;Len-- ; )
+ {
+ *Ptr = *Sou++;
+ Ptr += Offset;
+ }
+ } else
+ {
+ for (;Len-- ; )
+ {
+ *Ptr = *Sou; // copy character to lvb
+ Ptr += Offset-1; // skip to 3rd byte attr
+ if (Ow2NlsIsDBCSLeadByte(*Sou++, SesGrp->VioCP))
+ {
+ *Ptr++ = OS2_COMMON_LVB_LEADING_BYTE;
+ if (Len)
+ {
+ //
+ // Copy trailing byte charater, and mark
+ // this char as trailing byte
+ //
+ *Ptr = *Sou++;
+ Ptr += Offset-1; // skip to 3rd byte attr
+ *Ptr++ = OS2_COMMON_LVB_TRAILING_BYTE;
+ Len--;
+ } else
+ {
+ //
+ // If last written character was a lead byte,
+ // erase it.
+ //
+ *(Ptr-Offset) = ' ';
+ *(Ptr-1) = OS2_COMMON_LVB_SBCS;
+ }
+ } else
+ {
+ //
+ // Copy SBCS charater, and mark this char
+ // as SBCS
+ //
+ *Ptr++ = OS2_COMMON_LVB_SBCS;
+ }
+ }
+ }
+#else
+ for (;Len-- ; )
+ {
+ *Ptr = *Sou++;
+ Ptr += Offset;
+ }
+#endif
+ }
+}
+
+
+VOID
+VioLVBCopyCellStr( IN PUCHAR Sour,
+ IN COORD Coord,
+ IN ULONG LengthInCell)
+{
+ if(SesGrp->LVBOn && LengthInCell)
+ {
+#ifdef DBCS
+// MSKK Oct.13.1993 V-AkihiS
+ if (SesGrp->BytesPerCell == 2)
+ {
+ memmove(
+ GET_LVB_PTR( Coord.Y, Coord.X ),
+ Sour,
+ LengthInCell << SesGrp->VioLength2CellShift);
+ } else
+ {
+ register UCHAR *Ptr;
+ register ULONG Len = LengthInCell;
+ register PUCHAR Sou = Sour;
+
+ Ptr = GET_LVB_PTR( Coord.Y, Coord.X );
+
+ for (;Len-- ; )
+ {
+ if (Ow2NlsIsDBCSLeadByte(*Sou, SesGrp->VioCP))
+ {
+ //
+ // Copy leading byte charater, 1st attr and 2nd attr
+ // and put leading byte attr to 3rd attr
+ //
+ *Ptr++ = *Sou++; *Ptr++ = *Sou++; *Ptr++ = *Sou++;
+ *Ptr++ = OS2_COMMON_LVB_LEADING_BYTE;
+ Sou++; // skip source 3rd attr.
+ if (Len)
+ {
+ //
+ // Copy trailing byte charater, and mark
+ // this char as trailing byte
+ //
+ *Ptr++ = *Sou++; *Ptr++ = *Sou++; *Ptr++ = *Sou++;
+ *Ptr++ = OS2_COMMON_LVB_TRAILING_BYTE;
+ Sou++; // skip source 3rd attr.
+ Len--;
+ } else
+ {
+ //
+ // If last written chell was a lead byte,
+ // erase it.
+ //
+ *(Ptr-4) = ' ';
+ *(Ptr-1) = OS2_COMMON_LVB_SBCS;
+ }
+ } else
+ {
+ //
+ // Copy SBCS charater, and mark this char
+ // as SBCS
+ //
+ *Ptr++ = *Sou++; *Ptr++ = *Sou++; *Ptr++ = *Sou++;
+ *Ptr++ = OS2_COMMON_LVB_SBCS;
+ Sou++; // skip source 3rd attr.
+ }
+ }
+ }
+#else
+ memmove(
+ GET_LVB_PTR( Coord.Y, Coord.X ),
+ Sour,
+ LengthInCell << SesGrp->VioLength2CellShift);
+#endif
+ }
+}
+
+
+#ifdef DBCS
+// MSKK Oct.13.1993 V-AkihiS
+VOID VioLVBFillChar(IN PBYTE pChar,
+ IN COORD Coord,
+ IN ULONG LengthInCell)
+{
+ if(SesGrp->LVBOn && LengthInCell)
+ {
+ register UCHAR *Ptr;
+ register ULONG Offset = (ULONG)SesGrp->BytesPerCell;
+ register ULONG Len = LengthInCell;
+ register PBYTE pCha = pChar;
+
+ Ptr = GET_LVB_PTR( Coord.Y, Coord.X );
+
+ if (Offset == 2)
+ {
+ if (Ow2NlsIsDBCSLeadByte(*pCha, SesGrp->VioCP))
+ {
+ Len /= 2;
+ for ( ;Len-- ; )
+ {
+ *Ptr = *pCha;
+ Ptr += Offset;
+ *Ptr = *(pCha+1);
+ Ptr += Offset;
+ }
+ } else
+ {
+ for ( ;Len-- ; )
+ {
+ *Ptr = *pCha;
+ Ptr += Offset;
+ }
+ }
+ } else
+ {
+ if (Ow2NlsIsDBCSLeadByte(*pCha, SesGrp->VioCP))
+ {
+ Len /= 2;
+ for ( ;Len--; )
+ {
+ *Ptr = *pCha;
+ Ptr += Offset-1;
+ *Ptr++ = OS2_COMMON_LVB_LEADING_BYTE;
+ *Ptr = *(pCha+1);
+ Ptr += Offset-1;
+ *Ptr++ = OS2_COMMON_LVB_TRAILING_BYTE;
+ }
+ } else
+ {
+ for ( ;Len-- ; )
+ {
+ *Ptr = *pCha;
+ Ptr += Offset -1;
+ *Ptr++ = OS2_COMMON_LVB_SBCS;
+ }
+ }
+ }
+ }
+}
+#else
+VOID VioLVBFillChar(IN BYTE Char,
+ IN COORD Coord,
+ IN ULONG LengthInCell)
+{
+ if(SesGrp->LVBOn && LengthInCell)
+ {
+ register UCHAR *Ptr;
+ register ULONG Offset = (ULONG)SesGrp->BytesPerCell;
+ register ULONG Len = LengthInCell;
+ register BYTE Cha = Char;
+
+ Ptr = GET_LVB_PTR( Coord.Y, Coord.X );
+
+ for ( ;Len-- ; )
+ {
+ *Ptr = Cha;
+ Ptr += Offset;
+ }
+ }
+}
+#endif
+
+
+VOID VioLVBFillAtt( IN PBYTE pAttr,
+ IN COORD Coord,
+ IN ULONG LengthInCell)
+{
+ if(SesGrp->LVBOn && LengthInCell)
+ {
+ if ( SesGrp->BytesPerCell == 2 )
+ {
+ register PUCHAR Ptr;
+ register ULONG Offset = (ULONG)SesGrp->BytesPerCell;
+ register ULONG Len = LengthInCell;
+ register BYTE Att = *pAttr;
+
+ Ptr = GET_LVB_ATT_PTR( Coord.Y, Coord.X );
+
+ for ( ;Len-- ; )
+ {
+ *Ptr = Att;
+ Ptr += Offset;
+ }
+ } else
+ {
+ register PATTR_3_BYTES Ptr;
+ register ULONG Offset = (ULONG)SesGrp->BytesPerCell;
+ register ULONG Len = LengthInCell;
+ register ATTR_3_BYTES Att = *(PATTR_3_BYTES)pAttr;
+
+ Ptr = (PATTR_3_BYTES)GET_LVB_ATT_PTR( Coord.Y, Coord.X );
+
+ for ( ;Len-- ; )
+ {
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+// MSKK Oct.13.1993 V-AkihiS
+ //
+ // retain char type attribute in 3rd byte attriute.
+ //
+ Att.Attr[2] = Ptr->Attr[2];
+ *Ptr = Att;
+ Ptr = (PATTR_3_BYTES)((PUCHAR)Ptr + Offset);
+#else
+ *Ptr = Att;
+ Ptr += Offset;
+#endif
+ }
+ }
+ }
+}
+
+
+VOID VioLVBFillCell(IN PBYTE pCell,
+ IN COORD Coord,
+ IN ULONG LengthInCell)
+{
+ UCHAR *Ptr;
+ ULONG Pattern;
+
+ if(SesGrp->LVBOn && LengthInCell)
+ {
+ Ptr = GET_LVB_PTR( Coord.Y, Coord.X );
+
+#ifdef DBCS
+// MSKK Oct.14.1993 V-AkihiS
+ if ( SesGrp->BytesPerCell == 4 )
+ {
+ if (Ow2NlsIsDBCSLeadByte(pCell[0], SesGrp->VioCP))
+ {
+ register ATTR_3_BYTES LeadAttr = *(PATTR_3_BYTES)(&pCell[1]);
+ register ATTR_3_BYTES TrailAttr = *(PATTR_3_BYTES)(&pCell[5]);
+ register ULONG Len = LengthInCell / 2;
+
+ LeadAttr.Attr[2] = OS2_COMMON_LVB_LEADING_BYTE;
+ TrailAttr.Attr[2] = OS2_COMMON_LVB_TRAILING_BYTE;
+ for ( ; Len-- ; ) {
+ //
+ // Put leading byte cell
+ //
+ *Ptr++ = pCell[0];
+ *(PATTR_3_BYTES)Ptr = LeadAttr;
+ Ptr += 3;
+
+ //
+ // Put trailing byte cell
+ //
+ *Ptr++ = pCell[4];
+ *(PATTR_3_BYTES)Ptr = TrailAttr;
+ Ptr += 3;
+ }
+ } else
+ {
+ Pattern = (ULONG)((pCell[3] << 24) |
+ (pCell[2] << 16) |
+ (pCell[1] << 8) |
+ (pCell[0]));
+
+ RtlFillMemoryUlong(
+ Ptr,
+ LengthInCell << SesGrp->VioLength2CellShift,
+ Pattern);
+
+ }
+ } else {
+ if (Ow2NlsIsDBCSLeadByte(pCell[0], SesGrp->VioCP))
+ {
+ Pattern = (ULONG)((pCell[3] << 24) |
+ (pCell[2] << 16) |
+ (pCell[1] << 8) |
+ (pCell[0]));
+ } else
+ {
+ Pattern = (ULONG)((pCell[1] << 24) |
+ (pCell[0] << 16) |
+ (pCell[1] << 8) |
+ (pCell[0]));
+
+ if (LengthInCell & 1)
+ {
+ *(Ptr++) = pCell[0];
+ *(Ptr++) = pCell[1];
+ LengthInCell-- ;
+ }
+ }
+
+ RtlFillMemoryUlong(
+ Ptr,
+ LengthInCell << SesGrp->VioLength2CellShift,
+ Pattern);
+
+ }
+#else
+// for (;Length-- ; )
+// {
+// *(Ptr++) = pCell[0];
+// *(Ptr++) = pCell[1];
+// }
+
+ if ( SesGrp->BytesPerCell == 4 )
+ {
+ Pattern = (ULONG)((pCell[3] << 24) |
+ (pCell[2] << 16) |
+ (pCell[1] << 8) |
+ (pCell[0]));
+ } else
+ {
+ Pattern = (ULONG)((pCell[1] << 24) |
+ (pCell[0] << 16) |
+ (pCell[1] << 8) |
+ (pCell[0]));
+
+ if ((ULONG)Ptr & 3) {
+ LengthInCell--;
+ *(Ptr++) = pCell[0];
+ *(Ptr++) = pCell[1];
+ }
+
+ if (LengthInCell & 1)
+ {
+ LengthInCell-- ;
+ *(Ptr + (LengthInCell << 1)) = pCell[0];
+ *(Ptr + (LengthInCell << 1) + 1) = pCell[1];
+ }
+ }
+
+ RtlFillMemoryUlong(
+ Ptr,
+ LengthInCell << SesGrp->VioLength2CellShift,
+ Pattern);
+#endif
+ }
+
+}
+
+
+VOID
+VioLVBScrollBuff(IN DWORD LineNum)
+{
+ DWORD Size;
+ ULONG Pattern;
+
+ if (SesGrp->LVBOn && LineNum)
+ {
+ if ( LineNum > (DWORD)SesGrp->ScreenRowNum )
+ {
+ LineNum = SesGrp->ScreenRowNum;
+ }
+
+#ifdef DBCS
+// MSKK Oct.20.1993 V-AkihiS
+ Size = SesGrp->BytesPerCell * SesGrp->ScreenColNum * LineNum;
+ if (SesGrp->BytesPerCell == 2)
+ {
+ Pattern = (ULONG)((SesGrp->AnsiCellAttr[0] << 24) |
+ (' ' << 16) |
+ (SesGrp->AnsiCellAttr[0] << 8) |
+ (' '));
+ } else
+ {
+ Pattern = (ULONG)((SesGrp->AnsiCellAttr[2] << 24) |
+ (SesGrp->AnsiCellAttr[1] << 16) |
+ (SesGrp->AnsiCellAttr[0] << 8) |
+ (' '));
+ }
+#else
+ Size = 2 * SesGrp->ScreenColNum * LineNum;
+ Pattern = (ULONG)((SesGrp->AnsiCellAttr[0] << 24) |
+ (' ' << 16) |
+ (SesGrp->AnsiCellAttr[0] << 8) |
+ (' '));
+#endif
+
+ RtlMoveMemory(LVBBuffer,
+ LVBBuffer + Size,
+ SesGrp->LVBsize - Size);
+
+
+#ifdef DBCS
+// MSKK Oct.20.1993 V-AkihiS
+ if (SesGrp->BytesPerCell == 4)
+ {
+ Size = SesGrp->ScreenColNum * LineNum;
+ }
+#endif
+ RtlFillMemoryUlong(LVBBuffer + SesGrp->LVBsize - Size,
+ Size,
+ Pattern);
+
+ }
+}
+
+
+PUCHAR
+Ow2LvbGetPtr(
+ IN COORD Coord
+ )
+{
+ return(GET_LVB_PTR( Coord.Y, Coord.X));
+}
+
+
+VOID
+LVBUpdateTTYCharWithAttrAndCurPos(
+ IN CHAR c,
+ IN PCHAR * LVBPtr
+ )
+{
+ PCHAR Ptr = *LVBPtr;
+ USHORT i;
+
+ if(SesGrp->LVBOn)
+ {
+ *Ptr++ = c;
+
+ for ( i = 1 ; i < SesGrp->BytesPerCell ; i++ )
+ {
+ *Ptr++ = SesGrp->AnsiCellAttr[i - 1];
+ }
+
+ *LVBPtr = Ptr;
+ }
+}
+
+#ifdef DBCS
+// MSKK Oct.13.1993 V-AkihiS
+/* states of the finite state machine */
+
+#define NOCMD 1 /* type of crt state - most chars will go onto screen */
+#define ESCED 2 /* we've seen an ESC, waiting for rest of CSI */
+#define EQCMD 3 /* if '=' goto MODPARAMS else PARAMS */
+#define PARAMS 4 /* we're building the parameter list for ansicmd */
+#define MODPARAMS 5 /* we're building the parameter list for MODCMD */
+#define MODCMD 6 /* we've seen "ESC[=Num" waiting for #h or #l (# in {0..7}) */
+#define MODDBCS 7 /* we've seen DBCS lead-in char */
+
+VOID
+LVBUpdateTTYCharWithAttrAndCurPosDBCS(
+ IN CHAR c,
+ IN PCHAR * LVBPtr,
+ IN USHORT State
+ )
+{
+ PUCHAR Ptr = *LVBPtr;
+
+ if(SesGrp->LVBOn)
+ {
+ *Ptr++ = c;
+
+ if (SesGrp->BytesPerCell == 2)
+ {
+ *Ptr++ = SesGrp->AnsiCellAttr[0];
+ } else {
+ *Ptr++ = SesGrp->AnsiCellAttr[0];
+ *Ptr++ = SesGrp->AnsiCellAttr[1];
+ if (State == MODDBCS)
+ {
+ *Ptr++ = OS2_COMMON_LVB_TRAILING_BYTE;
+ } else
+ {
+ *Ptr++ = OS2_COMMON_LVB_LEADING_BYTE;
+ }
+ }
+
+ *LVBPtr = Ptr;
+ }
+}
+#endif
diff --git a/private/os2/os2ses/vionls.c b/private/os2/os2ses/vionls.c
new file mode 100644
index 000000000..a9223a88c
--- /dev/null
+++ b/private/os2/os2ses/vionls.c
@@ -0,0 +1,196 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ vionls.c
+
+Abstract:
+
+ This module contains the NLS support for Vio.
+
+Author:
+
+ KazuM 23-Jun-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#ifdef DBCS
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "trans.h"
+#include "vio.h"
+#include "event.h"
+#include "os2win.h"
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+
+// MSKK Feb.05.1993 V-AkihiS
+// If NLS module for console doesn't present, then NO_CONSOLE_NLS switch should be enable
+// difinition.
+//#define NO_CONSOLE_NLS
+
+/*
+ * internal vio routine to perform:
+ */
+
+DWORD
+Ow2VioSetCoordAndCheck(
+ OUT PCOORD pVioCoord,
+ IN ULONG ulRow,
+ IN ULONG ulColumn
+ );
+
+DWORD
+Ow2VioCheckCharType(
+ OUT PVOID pchType,
+ IN ULONG Row,
+ IN ULONG Column
+ )
+{
+ DWORD Rc;
+ COORD rwCoord;
+
+ if (Rc = Ow2VioSetCoordAndCheck(&rwCoord, Row, Column))
+ {
+ return(Rc);
+ }
+
+// MSKK Feb.05.1993 V-AkihiS
+#ifndef NO_CONSOLE_NLS
+ Rc = GetConsoleCharType(hConOut, rwCoord, pchType);
+#endif
+
+ return (!Rc);
+}
+
+BOOL
+CheckBisectStringA(
+ IN DWORD CodePage,
+ IN PCHAR Buffer,
+ IN DWORD NumBytes
+ )
+
+/*++
+
+Routine Description:
+
+ This routine check bisected on Ascii string end.
+
+Arguments:
+
+ CodePage - Value of code page.
+
+ Buffer - Pointer to Ascii string buffer.
+
+ NumBytes - Number of Ascii string.
+
+Return Value:
+
+ TRUE - Bisected character.
+
+ FALSE - Correctly.
+
+--*/
+
+{
+ UNREFERENCED_PARAMETER(CodePage);
+
+ while(NumBytes) {
+ if (Ow2NlsIsDBCSLeadByte(*Buffer, SesGrp->VioCP)) {
+ if (NumBytes <= 1)
+ return TRUE;
+ else {
+ Buffer += 2;
+ NumBytes -= 2;
+ }
+ }
+ else {
+ Buffer++;
+ NumBytes--;
+ }
+ }
+ return FALSE;
+}
+
+// MSKK Sep.29.1993 V-AkihiS
+#ifdef NO_CONSOLE_NLS
+#define OS2VIOATTRMASK 0xFFFF
+#else
+#define OS2VIOATTRMASK (FOREGROUND_BLUE | \
+ FOREGROUND_GREEN | \
+ FOREGROUND_RED | \
+ FOREGROUND_INTENSITY | \
+ BACKGROUND_BLUE | \
+ BACKGROUND_GREEN | \
+ BACKGROUND_RED | \
+ BACKGROUND_INTENSITY | \
+ COMMON_LVB_GRID_HORIZONTAL | \
+ COMMON_LVB_GRID_LVERTICAL | \
+ COMMON_LVB_REVERSE_VIDEO | \
+ COMMON_LVB_UNDERSCORE)
+#endif
+
+WORD
+MapOs2ToWinAttr(
+ IN PBYTE Os2Attr
+ )
+{
+ WORD Tmp;
+
+ if (SesGrp->VioLength2CellShift == 1) {
+ return (WORD)*(Os2Attr);
+ }
+ else {
+// MSKK Sep.29.1993 V-AKihiS
+ return (*((PWORD) Os2Attr) & OS2VIOATTRMASK);
+ }
+}
+
+VOID
+MapWin2Os2Attr(
+ IN WORD NtAttr,
+ OUT PBYTE Os2Attr
+ )
+{
+ if (SesGrp->VioLength2CellShift == 1) {
+ *(Os2Attr) = (BYTE)NtAttr;
+ }
+ else {
+// MSKK Sep.29.1993 V-AkihiS
+ *((PWORD) Os2Attr) = NtAttr & OS2VIOATTRMASK;
+
+#ifndef NO_CONSOLE_NLS
+ switch(NtAttr & COMMON_LVB_SBCSDBCS)
+ {
+ case 0: // SBCS
+ *(Os2Attr+2) = OS2_COMMON_LVB_SBCS;
+ break;
+ case COMMON_LVB_LEADING_BYTE: // DBCS leading byte
+ *(Os2Attr+2) = OS2_COMMON_LVB_LEADING_BYTE;
+ break;
+ case COMMON_LVB_TRAILING_BYTE: // DBCS trailing byte
+ *(Os2Attr+2) = OS2_COMMON_LVB_TRAILING_BYTE;
+ break;
+ default:
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(MapWin2Os2Attr): Unknown attribute\n"));
+ }
+#endif
+ *(Os2Attr+2) = OS2_COMMON_LVB_SBCS;
+ }
+#endif
+ }
+}
+#endif
diff --git a/private/os2/os2ses/viorqust.c b/private/os2/os2ses/viorqust.c
new file mode 100644
index 000000000..0aac33460
--- /dev/null
+++ b/private/os2/os2ses/viorqust.c
@@ -0,0 +1,2809 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ viorqust.c
+
+Abstract:
+
+ This module contains the Vio requests thread and
+ the handler for Vio requests.
+
+Author:
+
+ Michael Jarus (mjarus) 23-Oct-1991
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "trans.h"
+#include "event.h"
+#include "vio.h"
+#include "os2win.h"
+#include "conapi.h"
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+
+#if DBG
+BYTE VioInitStr[] = "VioInit";
+BYTE Ow2VioSetNewCpStr[] = "Ow2VioSetNewCp";
+BYTE Ow2VioPopUpStr[] = "Ow2VioPopUp";
+BYTE Ow2VioEndPopUpStr[] = "Ow2VioEndPopUp";
+BYTE Ow2VioWriteCharStrStr[] = "Ow2VioWriteCharSt";
+BYTE Ow2VioWriteCharStrAttStr[] = "Ow2VioWriteCharStrAt";
+BYTE Ow2VioWriteCellStrStr[] = "Ow2VioWriteCellStr";
+BYTE Ow2VioFillNCharStr[] = "Ow2VioFillNChar";
+BYTE Ow2VioFillNAttrStr[] = "Ow2VioFillNAttr";
+BYTE Ow2VioFillNCellStr[] = "Ow2VioFillNCell";
+BYTE Ow2ClearAllRegionStr[] = "Ow2ClearAllRegion";
+BYTE Ow2VioWriteCurPosStr[] = "Ow2VioWriteCurPos";
+BYTE Ow2VioReadCurPosStr[] = "Ow2VioReadCurPos";
+BYTE Ow2VioSetCurTypeStr[] = "Ow2VioSetCurType";
+BYTE Ow2VioReadCurTypeStr[] = "Ow2VioReadCurType";
+BYTE VioSetScreenSizeStr[] = "VioSetScreenSize";
+#endif
+
+VOID
+Od2ProbeForWrite(
+ IN PVOID Address,
+ IN ULONG Length,
+ IN ULONG Alignment
+ );
+
+VOID
+Od2ProbeForRead(
+ IN PVOID Address,
+ IN ULONG Length,
+ IN ULONG Alignment
+ );
+
+VOID
+Od2ExitGP();
+
+/*
+ * internal vio routine to perform:
+ */
+
+DWORD
+VioInit1(IN VOID);
+
+DWORD
+Ow2VioSetCoordAndCheck(
+ OUT PCOORD pVioCoord,
+ IN ULONG ulRow,
+ IN ULONG ulColumn
+ );
+
+DWORD
+Ow2VioSetCoordLengthAndCheck(
+ OUT PCOORD pVioCoord,
+ IN OUT PULONG pulLength,
+ IN ULONG ulRow,
+ IN ULONG ulColumn
+ );
+
+DWORD
+Ow2ClearAllRegion(
+ IN PSMALL_RECT ScrollRect,
+ IN PCHAR_INFO ScrollChar,
+ IN PUCHAR pCell
+ );
+
+DWORD
+Ow2VioUpdateCurPos(
+ IN COORD CurPos
+ );
+
+DWORD
+Ow2VioWriteCurPos(
+ IN COORD CurPos
+ );
+
+DWORD
+Ow2VioReadCurPos(
+ );
+
+DWORD
+Ow2VioMapOs2CurType2Win(
+ IN OUT PVIOCURSORINFO pCursorInfo,
+ OUT PCONSOLE_CURSOR_INFO lpCursorInfo
+ );
+
+DWORD
+Ow2VioReadCurType();
+
+#define OS2_VIO_MAX_ROW 100
+#define ADAPTER_MEMORY 0x40000 /* (ULONG)SesGrp->ScreenRowNum * SesGrp->ScreenColNum */
+
+/*
+ * This section is used for Vio R/W cell operation, to seperate/compine the
+ * cell into/from data and attribute bytes.
+ */
+
+#define OS2_VIO_MSG_SIZE 0x10000L
+#define OS2_VIO_SECTION_SIZE (2 * OS2_VIO_MSG_SIZE)
+#define DATA_OFFSET 0
+#define ATTR_OFFSET OS2_VIO_MSG_SIZE /* for cell's attr only */
+#define ATTR3_OFFSET (OS2_VIO_MSG_SIZE / 2) /* MSKK: 3 attr per cell */
+
+extern CONSOLE_SCREEN_BUFFER_INFO StartUpScreenInfo;
+extern CONSOLE_CURSOR_INFO StartUpCursorInfo;
+
+PVOID Ow2SessionVioDataBaseAddress;
+PVOID Ow2VioAttrAddress;
+
+WCHAR WindowTitle[256];
+SHORT OldScreenCol; /* col number (saved in PopUp) */
+SHORT OldScreenRow; /* row number (saved in PopUp) */
+COORD OldCurPos; /* CurPos (saved in PopUp) */
+VIOCURSORINFO OldCursorInfo; /* Cursor Info (saved in PopUp) */
+CONSOLE_CURSOR_INFO OldWinCursorInfo;
+
+DWORD
+VioInitForSession(IN VOID)
+{
+ SesGrp->Os2ModeInfo.fbType = VGMT_OTHER;
+ SesGrp->Os2ModeInfo.color = COLORS_16;
+ SesGrp->Os2ModeInfo.col = SesGrp->ScreenColNum;
+ SesGrp->Os2ModeInfo.row = SesGrp->ScreenRowNum;
+ SesGrp->Os2ModeInfo.hres = SesGrp->ScreenColNum * SesGrp->CellHSize;
+ SesGrp->Os2ModeInfo.vres = SesGrp->ScreenRowNum * SesGrp->CellVSize;
+ SesGrp->Os2ModeInfo.buf_addr = 0xFFFFFFFF;
+ SesGrp->Os2ModeInfo.buf_length = 0L;
+ SesGrp->Os2ModeInfo.full_length = 0L;
+ SesGrp->Os2ModeInfo.partial_length = 0L;
+ SesGrp->Os2ModeInfo.ext_data_addr = (CHAR *)0xFFFFFFFF;
+
+ SesGrp->MinRowNum = SesGrp->ScreenRowNum;
+
+ Ow2VioReadCurType();
+ StartUpCursorInfo.bVisible = SesGrp->bWinCursorVisible;
+ StartUpCursorInfo.dwSize = SesGrp->dwWinCursorSize;
+
+ SesGrp->CursorInfo.yStart = 6;
+ SesGrp->CursorInfo.cEnd = 7;
+ SesGrp->CursorInfo.cx = 1;
+
+ SesGrp->ScreenRect.Left = SesGrp->ScreenRect.Top = 0;
+ SesGrp->ScreenRect.Right = (SHORT)(SesGrp->ScreenColNum - 1);
+ SesGrp->ScreenRect.Bottom = (SHORT)(SesGrp->ScreenRowNum - 1);
+ SesGrp->ScreenSize = SesGrp->ScreenRowNum * SesGrp->ScreenColNum;
+
+ if (StartUpScreenInfo.dwCursorPosition.Y >= OS2_VIO_MAX_ROW )
+ {
+ StartUpScreenInfo.dwCursorPosition.Y = OS2_VIO_MAX_ROW - 1;
+ }
+ Ow2VioUpdateCurPos(StartUpScreenInfo.dwCursorPosition);
+
+ return (VioInit1());
+}
+
+
+DWORD
+VioInit(IN VOID)
+{
+ Or2WinGetConsoleScreenBufferInfo(
+ #if DBG
+ VioInitStr,
+ #endif
+ hConsoleOutput,
+ &StartUpScreenInfo
+ );
+
+ return (VioInit1());
+}
+
+
+DWORD
+VioInit1(IN VOID)
+{
+ if ((Ow2SessionVioDataBaseAddress = HeapAlloc(HandleHeap, 0, OS2_VIO_SECTION_SIZE)) == NULL)
+ {
+#if DBG
+ ASSERT1( "VioInit: unable to create heap for VIO", FALSE );
+#endif
+ return(1L);
+ }
+
+ Ow2VioDataAddress = ((PCHAR)Ow2SessionVioDataBaseAddress) + DATA_OFFSET;
+ Ow2VioAttrAddress = ((PCHAR)Ow2SessionVioDataBaseAddress) + ATTR_OFFSET;
+ if (VioLVBInit())
+ {
+ return(1L);
+ }
+
+ return (0L);
+}
+
+
+DWORD
+VioInitForNLS(IN ULONG VioCP)
+{
+ SesGrp->VioCP = VioCP;
+
+ SesGrp->Os2ModeInfo.fmt_ID = 0; // MSKK
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+ SesGrp->Os2ModeInfo.attrib = 1; // MSKK
+#else
+ SesGrp->Os2ModeInfo.attrib = 0; // MSKK
+#endif
+ SesGrp->BytesPerCell = 2; // MSKK
+
+ SesGrp->LVBsize = SesGrp->ScreenSize * (ULONG)SesGrp->BytesPerCell;
+ if (SesGrp->LVBsize > SesGrp->MaxLVBsize)
+ {
+ SesGrp->LVBsize = SesGrp->MaxLVBsize;
+ }
+ SesGrp->VioLengthMask = (USHORT)(0x0 - SesGrp->BytesPerCell);
+
+ if ( SesGrp->BytesPerCell == 2 )
+ {
+ SesGrp->VioLength2CellShift = 1;
+ } else /* ( SesGrp->BytesPerCell == 4 ) */
+ {
+ SesGrp->VioLength2CellShift = 2;
+ }
+
+ VioLVBInitForSession();
+ SesGrp->WinSpaceChar = L' ';
+ SesGrp->WinBlankChar = L'\0';
+ Ow2VioSetNewCp(SesGrp->VioCP);
+
+ return(0L);
+}
+
+
+DWORD
+Ow2VioSetNewCp( IN ULONG CodePage)
+{
+ UCHAR Os2Char;
+ DWORD Rc = NO_ERROR;
+
+#ifdef DBCS
+// MSKK Apr.16.1993 V-AkihiS
+// MSKK Apr.24.1993 V-AkihiS
+// Clear screen before code page is changed.
+ ULONG CPTmp;
+ CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
+ SMALL_RECT ClearRect;
+ CHAR_INFO FillChar;
+ UCHAR LVBFillCell[2] = {0x20, 0x07};
+#endif
+
+#ifdef DBCS
+// MSKK Apr.16.1993 V-AkihiS
+ CPTmp = CodePage ? CodePage : SesGrp->PrimaryCP;
+
+ if (SesGrp->VioCP != CPTmp)
+#else
+ if (SesGrp->VioCP != CodePage)
+#endif
+ {
+#ifdef DBCS
+// MSKK Apr.24.1993 V-AkihiS
+ //
+ // If code page will be changed actually,
+ // clear screen, before codepage is changed.
+ //
+
+ Ow2VioSetCurPos(0, 0);
+ if (Or2WinGetConsoleScreenBufferInfo(
+ #if DBG
+ Ow2VioSetNewCpStr,
+ #endif
+ hConOut,
+ &ConsoleScreenBufferInfo
+ ))
+ {
+ ClearRect.Top = ClearRect.Left = 0;
+ ClearRect.Right = (USHORT)( ConsoleScreenBufferInfo.dwSize.X - 1 );
+ ClearRect.Bottom = (USHORT)( ConsoleScreenBufferInfo.dwSize.Y - 1 );
+
+ FillChar.Char.AsciiChar = ' ';
+ FillChar.Attributes = MapOs2ToWinAttr(&LVBFillCell[1]);
+ Ow2ClearAllRegion(&ClearRect,
+ &FillChar,
+ LVBFillCell);
+ }
+#endif
+ Rc = !Or2WinSetConsoleOutputCP(
+ #if DBG
+ Ow2VioSetNewCpStr,
+ #endif
+#ifdef DBCS
+// MSKK Apr.16.1993 V-AkihiS
+ (UINT)CPTmp
+#else
+ (UINT)CodePage
+#endif
+ );
+
+ if (Rc)
+ {
+ ASSERT1("VioSetNewCp: Cannot set ConsoelOutputCP", FALSE);
+ } else
+ {
+ SesGrp->VioCP = CodePage;
+#ifdef DBCS
+// MSKK Jul.17.1992 KazuM
+ Os2Char = ' ';
+ MapOs2ToWinChar(Os2Char, 1, SesGrp->WinSpaceChar);
+ Os2Char = '\0';
+ MapOs2ToWinChar(Os2Char, 1, SesGrp->WinBlankChar);
+#else
+ Os2Char = ' ';
+ MapOs2ToWinChar(Os2Char, SesGrp->WinSpaceChar);
+ Os2Char = '\0';
+ MapOs2ToWinChar(Os2Char, SesGrp->WinBlankChar);
+#endif
+ }
+ }
+#ifdef DBCS
+// MSKK Apr.16.1993 V-AkihiS
+ else
+ {
+ SesGrp->VioCP = CodePage;
+ }
+#endif
+
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioGetMode(
+ IN OUT PVOID VioMode
+ )
+{
+ PVIOMODEINFO Mode = (PVIOMODEINFO) VioMode;
+
+ if (Mode->cb == 2 )
+ {
+ Mode->cb = sizeof(VIOMODEINFO);
+ } else
+ {
+
+ RtlMoveMemory(&Mode->fbType,
+ &SesGrp->Os2ModeInfo.fbType,
+ Mode->cb - 2);
+ }
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+Ow2VioSetMode(
+ IN PVOID VioMode
+ )
+{
+ PVIOMODEINFO pMode = (PVIOMODEINFO) VioMode;
+ SHORT Row, Col;
+
+ if ((pMode->cb <= 2 ) ||
+ ((pMode->cb > 4) && (pMode->cb & 1)))
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2VioSetMode): invalid mode (cb %u)\n",
+ pMode->cb));
+ }
+#endif
+ return (ERROR_VIO_INVALID_LENGTH);
+ }
+
+ IF_OD2_DEBUG( VIO )
+ ; //ASSERT((pMode->fbType & VGMT_GRAPHICS) == 0);
+
+ if (pMode->fbType > 7)
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2VioSetMode): invalid fbType %u\n",
+ pMode->fbType));
+ }
+#endif
+ return (ERROR_VIO_MODE);
+ }
+
+ if (pMode->cb == 3)
+ {
+ if ((pMode->fbType & VGMT_OTHER) == 0)
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2VioSetMode): invalid fbType %u for cb==3\n",
+ pMode->fbType));
+ }
+#endif
+ return (ERROR_VIO_MODE);
+ }
+
+ SesGrp->Os2ModeInfo.fbType = pMode->fbType;
+ }
+
+ Row = 25/*SesGrp->ScreenRowNum*/;
+ Col = 80/*SesGrp->ScreenColNum*/;
+
+ if (pMode->cb >= 4)
+ {
+ if ((((pMode->fbType & VGMT_OTHER) == 0) && pMode->color) ||
+ (((pMode->fbType & 3) == 1) && (pMode->color != COLORS_16)) ||
+ (((pMode->fbType & 3) == 3) && ((pMode->color != COLORS_16) &&
+ (pMode->color != COLORS_4))))
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2VioSetMode): error - fbType %u color %u\n",
+ pMode->fbType, pMode->color));
+ }
+#endif
+ return (ERROR_VIO_MODE);
+ }
+
+ SesGrp->Os2ModeInfo.fbType = pMode->fbType;
+ SesGrp->Os2ModeInfo.color = pMode->color;
+
+ if (pMode->cb >= 6)
+ {
+ // if ((pMode->col != 40) && (pMode->col != 80))
+ // {
+#if DBG //
+ // IF_OD2_DEBUG( VIO )
+ // {
+ // KdPrint(("OS2SES(Ow2VioSetMode): illegal col %u\n",
+ // pMode->col));
+ // }
+#endif //
+ // return (ERROR_VIO_MODE);
+ // }
+
+ if (pMode->col < 40)
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2VioSetMode): illegal col %u\n",
+ pMode->col));
+ }
+#endif
+ return (ERROR_VIO_MODE);
+ }
+
+ if (pMode->cb == 6) // no row
+ {
+ //pMode->row = SesGrp->ScreenRowNum;
+ } else if (( pMode->row < 25 ) &&
+ ( pMode->row < (USHORT)SesGrp->MinRowNum ))
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2VioSetMode): illegal row %u\n",
+ pMode->row));
+ }
+#endif
+ return (ERROR_VIO_MODE);
+ } else
+ {
+ Row = (SHORT)pMode->row;
+ }
+
+ Col = (SHORT)pMode->col;
+
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+ if (pMode->cb >= 13) {
+ if (pMode->attrib == 1 ||
+ pMode->attrib == 3 ) {
+ SesGrp->BytesPerCell = pMode->attrib+1;
+ SesGrp->Os2ModeInfo.fmt_ID = pMode->fmt_ID;
+ SesGrp->Os2ModeInfo.attrib = pMode->attrib;
+ }
+ else
+ return (ERROR_VIO_MODE);
+ }
+#endif
+
+ if ( SesGrp->BytesPerCell == 2 )
+ {
+ SesGrp->VioLength2CellShift = 1;
+ } else /* ( BytesPerCell == 4 ) */
+ {
+ SesGrp->VioLength2CellShift = 2;
+ }
+
+ // maybe update all remainming fields
+ }
+ }
+
+ if (VioSetScreenSize(Row,
+ Col,
+ hConOut))
+ {
+ return (ERROR_VIO_MODE);
+ }
+
+ if ( SesGrp->ScreenRowNum < SesGrp->MinRowNum )
+ {
+ SesGrp->MinRowNum = SesGrp->ScreenRowNum;
+ }
+
+ //BUGBUG=> keep Color#
+
+ return (NO_ERROR);
+}
+
+
+DWORD
+Ow2VioReadCharStr(
+ IN OUT PULONG pLength,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID DestBuffer
+ )
+{
+ DWORD Rc, NumToFill = *pLength;
+ COORD rwCoord;
+
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+ try
+ {
+ Od2ProbeForWrite(DestBuffer, NumToFill, 1);
+ } except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ Od2ExitGP();
+ }
+
+ if(ReadConsoleOutputCharacterA(
+ hConOut,
+ DestBuffer,
+ NumToFill,
+ rwCoord,
+ &NumToFill))
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != *pLength)
+ {
+ KdPrint(("OS2SES(VioRequest-VioReadeCharStr): partial data %lu from %lu, in Coord %u:%u\n",
+ NumToFill, *pLength, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ *pLength = NumToFill;
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioReadCharStr): Rc %lu\n", Rc));
+#endif
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioReadCellStr(
+ IN OUT PULONG pLength,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID DestBuffer
+ )
+{
+ DWORD Rc, NumToFill, NumFilled;
+ COORD rwCoord;
+
+ NumToFill = (DWORD)(*pLength >> SesGrp->VioLength2CellShift);
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+
+ if (DestBuffer != LVBBuffer)
+ {
+ try
+ {
+ Od2ProbeForWrite(DestBuffer, NumToFill << SesGrp->VioLength2CellShift, 1);
+ } except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ Od2ExitGP();
+ }
+ }
+
+ if (!(Rc = !ReadConsoleOutputCharacterA(
+ hConOut,
+ Ow2VioDataAddress,
+ NumToFill,
+ rwCoord,
+ &NumFilled)))
+ {
+#ifdef DBCS
+// MSKK Jun.24.1992 KazuM
+ DWORD NumTmp;
+
+ Rc = !ReadConsoleOutputAttribute(
+ hConOut,
+ Ow2VioAttrAddress,
+ NumToFill,
+ rwCoord,
+ &NumTmp);
+#else
+ Rc = !ReadConsoleOutputAttribute(
+ hConOut,
+ Ow2VioAttrAddress,
+ NumFilled,
+ rwCoord,
+ &NumFilled);
+#endif
+ }
+
+ if (!Rc)
+ {
+#ifdef DBCS
+// MSKK Jun.24.1992 KazuM
+ MapWin2Os2CellStr(
+ DestBuffer,
+ Ow2VioDataAddress,
+ Ow2VioAttrAddress,
+ NumFilled,
+ NumToFill);
+#else
+ MapWin2Os2CellStr(
+ DestBuffer,
+ Ow2VioDataAddress,
+ Ow2VioAttrAddress,
+ NumFilled,
+ NumFilled);
+#endif
+
+ *pLength = NumFilled << SesGrp->VioLength2CellShift;
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != NumFilled)
+ {
+ if (DestBuffer != LVBBuffer)
+ KdPrint(("OS2SES(VioRequest-VioReadCellStr): partial data %lu from %lu, in Coord %u:%u\n",
+ NumFilled, NumToFill, rwCoord.Y, rwCoord.X));
+ else
+ KdPrint(("OS2SES(VioRequest-VioGetBuffStr): partial data %lu from %lu, in Coord %u:%u\n",
+ NumFilled, NumToFill, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioReadCellStr): Rc %lu\n", Rc));
+#endif
+ }
+
+#if DBG
+ if ( !Rc && ( *pLength == SesGrp->LVBsize ) &&
+ (DestBuffer != LVBBuffer))
+ {
+ VioLVBTestBuff(DestBuffer);
+ }
+#endif
+
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioWriteCharStr(
+ IN ULONG Length,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID SourBuffer
+ )
+{
+ DWORD Rc, NumToFill = Length;
+ COORD rwCoord;
+
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+ try
+ {
+ Od2ProbeForRead(SourBuffer, NumToFill, 1);
+ } except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ Od2ExitGP();
+ }
+
+ if (Or2WinWriteConsoleOutputCharacterA(
+ #if DBG
+ Ow2VioWriteCharStrStr,
+ #endif
+ hConOut,
+ SourBuffer,
+ NumToFill,
+ rwCoord,
+ &NumToFill))
+ {
+ VioLVBCopyStr(
+ SourBuffer,
+ rwCoord,
+ NumToFill);
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != Length)
+ {
+ KdPrint(("OS2SES(VioRequest-VioWriteCharStr): partial data %lu from %lu, in Coord %u:%u\n",
+ NumToFill, Length, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioWriteCharStr): Rc %lu\n", Rc));
+#endif
+ }
+
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioWriteCharStrAtt(
+ IN ULONG Length,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID SourBuffer,
+ IN PBYTE AttrBuffer
+ )
+{
+ DWORD Rc, NumToFill = Length;
+ COORD rwCoord;
+
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+ try
+ {
+ Od2ProbeForRead(SourBuffer, NumToFill, 1);
+ } except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ Od2ExitGP();
+ }
+
+ if (!(Rc = !Or2WinWriteConsoleOutputCharacterA(
+ #if DBG
+ Ow2VioWriteCharStrAttStr,
+ #endif
+ hConOut,
+ SourBuffer,
+ NumToFill,
+ rwCoord,
+ &NumToFill)))
+
+ {
+ VioLVBCopyStr(
+ SourBuffer,
+ rwCoord,
+ NumToFill);
+
+#ifdef DBCS
+// MSKK Jan.15.1993 V-AkihiS
+ Rc = !Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2VioWriteCharStrAttStr,
+ #endif
+ hConOut,
+ MapOs2ToWinAttr(AttrBuffer),
+ NumToFill,
+ rwCoord,
+ &NumToFill);
+#else
+ Rc = !Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2VioWriteCharStrAttStr,
+ #endif
+ hConOut,
+ MapOs2ToWinAttr(*AttrBuffer), // BUGBUG: MSKK
+ NumToFill,
+ rwCoord,
+ &NumToFill);
+#endif
+ }
+
+ if (!Rc)
+ {
+ VioLVBFillAtt(
+ AttrBuffer,
+ rwCoord,
+ NumToFill);
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != Length)
+ {
+ KdPrint(("OS2SES(VioRequest-VioWriteCharStrAtt): partial data %lu from %lu, in Coord %u:%u\n",
+ NumToFill, Length, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioWriteCharStrAtt): Rc %lu\n", Rc));
+#endif
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioWriteCellStr(
+ IN ULONG Length,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID SourBuffer
+ )
+{
+ DWORD Rc, NumToFill, NumFilled;
+ COORD rwCoord;
+
+ NumToFill = (DWORD)(Length >> SesGrp->VioLength2CellShift);
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+ try
+ {
+ Od2ProbeForRead(SourBuffer, NumToFill << SesGrp->VioLength2CellShift, 1);
+ } except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ Od2ExitGP();
+ }
+
+ MapOs2ToWinCellStr(
+ Ow2VioDataAddress,
+ Ow2VioAttrAddress,
+ SourBuffer,
+ NumToFill,
+ NumFilled);
+
+ if (!(Rc = !Or2WinWriteConsoleOutputCharacterA(
+ #if DBG
+ Ow2VioWriteCellStrStr,
+ #endif
+ hConOut,
+ Ow2VioDataAddress,
+ NumFilled,
+ rwCoord,
+ &NumFilled)))
+ {
+ Rc = !Or2WinWriteConsoleOutputAttribute(
+ #if DBG
+ Ow2VioWriteCellStrStr,
+ #endif
+ hConOut,
+ Ow2VioAttrAddress,
+ NumFilled,
+ rwCoord,
+ &NumFilled);
+ }
+
+ if (!Rc)
+ {
+ if (SourBuffer != LVBBuffer)
+ {
+ VioLVBCopyCellStr(
+ SourBuffer,
+ rwCoord,
+ NumFilled);
+ }
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != NumFilled)
+ {
+ if (SourBuffer != LVBBuffer)
+ KdPrint(("OS2SES(VioRequest-VioWriteCellStr): partial data %lu from %lu, in Coord %u:%u\n",
+ NumFilled, NumToFill, rwCoord.Y, rwCoord.X));
+ else
+ KdPrint(("OS2SES(VioRequest-VioShowBuff): partial data %lu from %lu, in Coord %u:%u\n",
+ NumFilled, NumToFill, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioWriteCellStr): Rc %lu\n", Rc));
+#endif
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioFillNChar(
+ IN ULONG Number,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID SourBuffer
+ )
+{
+ DWORD Rc, NumToFill = Number;
+ COORD rwCoord;
+#ifdef DBCS
+// MSKK Nov.16.1992 V-AkihiS
+// MSKK Jan.27.1993 V-AkihiS
+ BOOL DbcsFlag = FALSE;
+ DWORD NumTmp;
+#endif
+
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+
+#ifdef DBCS
+// MSKK Nov.16.1992 V-AkihiS
+ //
+ // To output DBCS with FillConsoleOutputCharacterA,
+ // call this API twice. First time for DBCS Leadbyte,
+ // and second time for DBCS Trailbyte.
+ //
+ if (Ow2NlsIsDBCSLeadByte(*(PCHAR)SourBuffer, SesGrp->VioCP)) {
+ DbcsFlag = TRUE;
+ NumToFill *= 2;
+ }
+#endif
+
+ if (Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2VioFillNCharStr,
+ #endif
+ hConOut,
+ *(PCHAR)SourBuffer,
+ NumToFill,
+ rwCoord,
+#ifdef DBCS
+// MSKK Jan.27.1993 V-AkihiS
+ &NumTmp))
+#else
+ &NumToFill))
+#endif
+ {
+#ifdef DBCS
+// MSKK Nov.16.1992 V-AkihiS
+ if (DbcsFlag) {
+ Rc = !Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2VioFillNCharStr,
+ #endif
+ hConOut,
+ *((PCHAR)SourBuffer + 1),
+ NumToFill,
+ rwCoord,
+ &NumToFill);
+ } else {
+ NumToFill = NumTmp;
+ }
+ VioLVBFillChar(
+ (PBYTE)SourBuffer,
+ rwCoord,
+ NumToFill);
+#else
+ VioLVBFillChar(
+ *(PBYTE)SourBuffer,
+ rwCoord,
+ NumToFill);
+#endif
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != Number)
+ {
+ KdPrint(("OS2SES(VioRequest-VioFillNChar): partial data %lu from %lu, in Coord %u:%u\n",
+ NumToFill, Number, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioFillNChar): Rc %lu\n", Rc));
+#endif
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioFillNAttr(
+ IN ULONG Number,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID SourBuffer
+ )
+{
+ DWORD Rc, NumToFill = Number;
+ COORD rwCoord;
+
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+ if (Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2VioFillNAttrStr,
+ #endif
+ hConOut,
+ MapOs2ToWinAttr((PCHAR)SourBuffer),
+ NumToFill,
+ rwCoord,
+ &NumToFill))
+#else
+ if (Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2VioFillNAttrStr,
+ #endif
+ hConOut,
+ MapOs2ToWinAttr(*(PCHAR)SourBuffer),
+ NumToFill,
+ rwCoord,
+ &NumToFill))
+#endif
+ {
+ VioLVBFillAtt(
+ SourBuffer,
+ rwCoord,
+ NumToFill);
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != Number)
+ {
+ KdPrint(("OS2SES(VioRequest-VioFillNAttr): partial data %lu from %lu, in Coord %u:%u\n",
+ NumToFill, Number, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioFillNAttr): Rc %lu\n", Rc));
+#endif
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioFillNCell(
+ IN ULONG Number,
+ IN ULONG Row,
+ IN ULONG Col,
+ IN PVOID SourBuffer
+ )
+{
+ DWORD Rc, NumToFill = Number;
+ COORD rwCoord;
+#ifdef DBCS
+// MSKK Nov.16.1992 V-AkihiS
+// MSKK Jan.27.1993 V-AkihiS
+// MSKK Apr.25.1993 V-AkihiS
+ BOOL DbcsFlag = FALSE;
+ DWORD NumTmp;
+ USHORT i;
+ WORD LeadAttr, TrailAttr;
+ PWORD WinAttr;
+#endif
+
+ if (Rc = Ow2VioSetCoordLengthAndCheck(&rwCoord, &NumToFill, Row, Col))
+ {
+ return(Rc);
+ }
+
+#ifdef DBCS
+// MSKK Jun.27.1992 KazuM
+// MSKK Nov.16.1992 V-AkihiS
+ //
+ // To output DBCS with FillConsoleOutputCharacterA,
+ // call this API twice. First time for DBCS Leadbyte,
+ // and second time for DBCS Trailbyte.
+ //
+ if (Ow2NlsIsDBCSLeadByte(*(PCHAR)SourBuffer, SesGrp->VioCP)) {
+ DbcsFlag = TRUE;
+ NumToFill *= 2;
+ }
+#endif
+
+ if (!(Rc = !Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2VioFillNCellStr,
+ #endif
+ hConOut,
+ *(PCHAR)SourBuffer,
+ NumToFill,
+ rwCoord,
+#ifdef DBCS
+// MSKK Jan.27.1993 V-AkihiS
+ &NumTmp)))
+#else
+ &NumToFill)))
+#endif
+ {
+#ifdef DBCS
+// MSKK Nov.16.1992 V-AkihiS
+// MSKK Apr.26.1993 V-AkihiS
+// Bug fix.
+// When the attributes of DBCS leading byte and trailing byte are different,
+// We cannot use FillConsoleOutputAttribute. So in this kind of case,
+// We should make attributes string and use WriteConsoleOutputAttribute.
+ if (DbcsFlag) {
+ //
+ // If DBCS, Write DBCS trailing byte.
+ //
+ Rc = !Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2VioFillNCellStr,
+ #endif
+ hConOut,
+ *((PCHAR)SourBuffer + (1 << SesGrp->VioLength2CellShift)),
+ NumToFill,
+ rwCoord,
+ &NumToFill);
+
+ //
+ // Make DBCS attributes and write them.
+ //
+ LeadAttr = MapOs2ToWinAttr((PUCHAR)SourBuffer + 1);
+ TrailAttr = MapOs2ToWinAttr((PUCHAR)SourBuffer +
+ (1 << SesGrp->VioLength2CellShift) + 1);
+ WinAttr = Ow2VioAttrAddress;
+ for (i = 0; i < NumToFill / 2; i++) {
+ WinAttr[i * 2] = LeadAttr;
+ WinAttr[i * 2 + 1] = TrailAttr;
+ }
+
+ Rc = !Or2WinWriteConsoleOutputAttribute(
+ #if DBG
+ Ow2VioFillNCellStr,
+ #endif
+ hConOut,
+ Ow2VioAttrAddress,
+ NumToFill,
+ rwCoord,
+ &NumTmp);
+ } else {
+
+ NumToFill = NumTmp;
+ Rc = !Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2VioFillNCellStr,
+ #endif
+ hConOut,
+ MapOs2ToWinAttr((PUCHAR)SourBuffer + 1),
+ NumToFill,
+ rwCoord,
+ &NumTmp);
+ }
+#else
+ Rc = !Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2VioFillNCellStr,
+ #endif
+ hConOut,
+ MapOs2ToWinAttr(*((PUCHAR)SourBuffer + 1)),
+ NumToFill,
+ rwCoord,
+ &NumToFill);
+#endif
+ }
+
+ if (!Rc)
+ {
+ VioLVBFillCell(
+ SourBuffer,
+ rwCoord,
+ NumToFill);
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ if (NumToFill != Number)
+ {
+ KdPrint(("OS2SES(VioRequest-VioFillNCell): partial data %lu from %lu, in Coord %u:%u\n",
+ NumToFill, Number, rwCoord.Y, rwCoord.X));
+ }
+ }
+#endif
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioFillNAttr): Rc %lu\n", Rc));
+#endif
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioPopUp(
+ IN ULONG PopUpMode,
+ IN PUCHAR AppName
+ )
+{
+ DWORD Rc = 0;
+ DWORD NumFilledA, NumFilledC, NumToFill = SesGrp->ScreenSize;
+ DWORD Rc1, Rc2, Rc3, Rc4;
+ COORD Coord;
+ UCHAR TitleBuffer[80];
+ int size;
+ VIOCURSORINFO CurType;
+
+
+#if DBG
+ if (hConOut != hConsoleOutput)
+ IF_OD2_DEBUG( ANY )
+ KdPrint(("OS2SES(Ow2VioPopUp): hConOut != hConsoleOutPut\n"));
+#endif
+
+ hPopUpOutput = Or2WinCreateConsoleScreenBuffer(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ|FILE_SHARE_WRITE,
+ NULL, /* &SecurityAttributes, */
+ CONSOLE_TEXTMODE_BUFFER, // 1
+ NULL);
+
+ if (hPopUpOutput == INVALID_HANDLE_VALUE)
+ {
+#if DBG
+ ASSERT1( "OS2SES(Ow2VioPopUp): Can not create CONOUT for PopUp\n", FALSE );
+#endif
+ return(ERROR_VIO_NO_POPUP);
+ }
+
+ if (!Or2WinSetConsoleActiveScreenBuffer(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ hPopUpOutput
+ ))
+ {
+#if DBG
+ KdPrint(("OS2SES(Ow2VioPopUp): Can not activate CONOUT PopUp %u\n",
+ GetLastError()));
+#endif
+ }
+
+ /*
+ * save parameters for the screen: coord, cur-pos & cur-type.
+ *
+ */
+
+ OldScreenCol = SesGrp->ScreenColNum;
+ OldScreenRow = SesGrp->ScreenRowNum;
+
+ Rc = Ow2VioReadCurPos();
+ ASSERT( Rc == NO_ERROR );
+ OldCurPos = SesGrp->WinCoord;
+
+ Ow2VioGetCurType(&CurType);
+ OldCursorInfo = SesGrp->CursorInfo;
+ OldWinCursorInfo.dwSize = SesGrp->dwWinCursorSize;
+ OldWinCursorInfo.bVisible = SesGrp->bWinCursorVisible;
+
+ Coord.X = Coord.Y = 0;
+ Ow2VioUpdateCurPos(Coord);
+
+ if(PopUpMode & VP_TRANSPARENT) // VP_TRANSPARENT
+ {
+ /*
+ * Copy screen char and attr to new one
+ */
+
+ LPWSTR ScreenBuff;
+
+ if ((ScreenBuff = (LPWSTR)HeapAlloc(
+ HandleHeap,
+ 0,
+ (sizeof(WCHAR) + sizeof(WORD)) * NumToFill)) == NULL)
+ {
+ CloseHandle(hPopUpOutput);
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(Ow2VioPopUP): can't AllocHeap, Rc %lu\n", Rc));
+#endif
+ return(Rc);
+ }
+
+ Rc1 = Or2WinReadConsoleOutputCharacterW(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ hConOut,
+ ScreenBuff,
+ NumToFill,
+ Coord,
+ &NumFilledC);
+
+ ASSERT1( "OS2SES(Ow2VioPopUp): ReadConsoleOutputCharacter", Rc1 );
+ ASSERT( NumFilledC == NumToFill );
+
+ Rc2 = Or2WinReadConsoleOutputAttribute(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ hConOut,
+ (LPWORD)(ScreenBuff + NumToFill),
+ NumToFill,
+ Coord,
+ &NumFilledA);
+
+ ASSERT1( "OS2SES(Ow2VioPopUp): ReadConsoleOutputAttribute", Rc2 );
+ ASSERT( NumFilledA == NumToFill );
+
+ Rc3 = Or2WinWriteConsoleOutputCharacterW(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ hPopUpOutput,
+ ScreenBuff,
+ NumFilledC,
+ Coord,
+ &NumFilledC);
+
+ ASSERT1( "OS2SES(Ow2VioPopUp): WriteConsoleOutputCharacter", Rc3 );
+ ASSERT( NumFilledC == NumToFill );
+
+ Rc4 = Or2WinWriteConsoleOutputAttribute(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ hPopUpOutput,
+ (LPWORD)(ScreenBuff + NumToFill),
+ NumFilledA,
+ Coord,
+ &NumFilledA);
+
+ ASSERT1( "OS2SES(Ow2VioPopUp): WriteConsoleOutputAttribute", Rc4 );
+ ASSERT( NumFilledA == NumToFill );
+
+ if (!(Rc1 && Rc2 && Rc3 && Rc4))
+ {
+ CloseHandle(hPopUpOutput);
+ Rc = GetLastError();
+ HeapFree(HandleHeap, 0, (LPSTR)ScreenBuff);
+#if DBG
+ KdPrint(("OS2SES(VioPopUP): can't build PopUp screen, Rc %lu\n", Rc));
+#endif
+ return(Rc);
+ }
+
+ HeapFree(HandleHeap, 0, (LPSTR)ScreenBuff);
+
+ /*
+ * restore parameters for the screen: coord, cur-pos & cur-type.
+ *
+ */
+
+ VioSetScreenSize(OldScreenRow, OldScreenCol, hPopUpOutput);
+
+ Ow2VioWriteCurPos(OldCurPos);
+
+ Or2WinSetConsoleCursorInfo(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ hPopUpOutput,
+ &OldWinCurInfo
+ );
+
+ } else // VP_OPAQUE
+ {
+ VioSetScreenSize(25, 80, hPopUpOutput);
+ }
+
+ /*
+ * Set title
+ *
+ * "ApplName : POPUP"
+ */
+
+ Rc1 = Or2WinGetConsoleTitleW(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ WindowTitle,
+ sizeof(WindowTitle)
+ );
+
+ ASSERT1( "OS2SES(Ow2VioPopUp): GetConsoleTitle", Rc1 );
+
+ /*Rc1 = Or2WinSetConsoleTitleW(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ L"== POPUP == OS/2 PopUP Window == POPUP =="
+ );
+ */
+ strncpy(TitleBuffer, AppName, OS2_MAX_APPL_NAME);
+ size = strlen(TitleBuffer);
+ if ((size > 4 ) && !_stricmp(&TitleBuffer[size-4], ".exe")) {
+ TitleBuffer[size-4] = '\0';
+ }
+ strcat(TitleBuffer, " : POPUP" );
+ Rc1 = Or2WinSetConsoleTitleA(
+ #if DBG
+ Ow2VioPopUpStr,
+ #endif
+ TitleBuffer
+ );
+
+ ASSERT1( "OS2SES(Ow2VioPopUp): SetConsoleTitle", Rc1 );
+
+ SesGrp->hConsolePopUp = hConOut = hPopUpOutput;
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+Ow2VioEndPopUp()
+{
+ if (hConOut != hConsoleOutput)
+ {
+ if (!CloseHandle(hPopUpOutput))
+ {
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioEndPopUp): Can not close CONOUT PopUp %lu\n",
+ GetLastError()));
+#endif
+ }
+ hConOut = hConsoleOutput;
+
+ /*
+ * restore parameters for the screen: coord, cur-pos & cur-type.
+ *
+ */
+
+ SetScreenSizeParm(OldScreenRow, OldScreenCol);
+
+ SesGrp->dwWinCursorSize = OldWinCursorInfo.dwSize;
+ SesGrp->bWinCursorVisible = OldWinCursorInfo.bVisible;
+ SesGrp->CursorInfo = OldCursorInfo;
+ Ow2VioUpdateCurPos(OldCurPos);
+
+ if ( !Or2WinSetConsoleTitleW(
+ #if DBG
+ Ow2VioEndPopUpStr,
+ #endif
+ WindowTitle
+ ) )
+ {
+ ASSERT( FALSE );
+ }
+ }
+
+ SesGrp->hConsolePopUp = hPopUpOutput = (HANDLE) NULL;
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+Ow2VioScroll(
+ IN PVOID VioScroll,
+ IN ULONG ScrollDirection
+ )
+{
+ PVIOSCROLL pScroll = (PVIOSCROLL) VioScroll;
+ COORD ScrollCoord, DestCoord, SourCoord, FillCoord;
+ SMALL_RECT ScrollRect, ClearRect, Clear1Rect;
+ CHAR_INFO ScrollChar;
+// BOOL ScrollBrk;
+ USHORT cbCheck;
+ DWORD Rc, Offset;
+ UCHAR *Ptr;
+ ULONG LineLength, LineNum, i, FillLineNum, FillLineLength;
+ SHORT DestLineIndexInc;
+
+ /*
+ * 1. Set ScrollRect dimenations to their max values
+ * 2. Check ScrollRect and cbLines legalty
+ * 3. Init all parms for default (ScrollChar, *Rect, *Coord, ...)
+ * 4. Set parms according to direction
+ * 5. Scrolling: (cbCheck)
+ * 5A. Clear all ClearRect (if should)
+ * or
+ * 5B1.(if overlapped) Clear the overlapping area (Clear1Rect)
+ * 5B2.Scroll (ScrollRect & ScrollCoord)
+ * 5B3.(if LVB) Update scroll area in LVB (SourCoord, DestCoord, LineNum,
+ * LineLength, Offset, DestLineIndexInc)
+ * 5B4.(if LVB) Clear the "fill char" area in LVB (FillCoord, FillLineNum,
+ * FillLineLength)
+ * BUGBUG: we fill again the area was cleared by Ow2ClearAllRegion for overlapping
+ * 6. code for checking the LVB updated
+ *
+ * ClearRect - are for CleaAllRegion
+ * Clear1Rect - are for overlapping CleaAllRegion
+ * ScrollRect, ScrollCoord - are for Win ScrollConsoleScreenBuffer
+ * SourCoord - Coord in LVB where to start scrolling from
+ * DestCoord - Coord in LVB where to start scrolling to
+ * FillCoord - Coord in LVB where to start filling cell (clearing)
+ * cbCheck - length of the dimention of the scrolling direction
+ * (to check if Ow2ClearAllRegion or overlapping)
+ * LineNum - number of lines of scrolling region (for LVB)
+ * LineLength - length of line to move in LVB
+ * FillLineNum - number of lines of filling region (for LVB)
+ * FillLineLength - length of line to fill in LVB
+ * Offset - the offset between 2 lines in LVB (sccording to direction)
+ * DestLineIndexInc - inc value for Row when updating LVB
+ */
+
+ ScrollRect = pScroll->ScrollRect;
+// ScrollBrk = FALSE;
+
+ if ((USHORT)ScrollRect.Left >= (USHORT)SesGrp->ScreenColNum)
+ {
+ ScrollRect.Left = (SHORT)(SesGrp->ScreenColNum - 1);
+// ScrollBrk = TRUE;
+ }
+
+ if ((USHORT)ScrollRect.Right >= (USHORT)SesGrp->ScreenColNum)
+ ScrollRect.Right = (SHORT)(SesGrp->ScreenColNum - 1);
+
+ if ((USHORT)ScrollRect.Top >= (USHORT)SesGrp->ScreenRowNum)
+ {
+ ScrollRect.Top = (SHORT)(SesGrp->ScreenRowNum - 1);
+// ScrollBrk = TRUE;
+ }
+
+ if ((USHORT)ScrollRect.Bottom >= (USHORT)SesGrp->ScreenRowNum)
+ ScrollRect.Bottom = (SHORT)(SesGrp->ScreenRowNum - 1);
+
+ if (ScrollRect.Top > ScrollRect.Bottom)
+ {
+ return ERROR_VIO_ROW;
+ }
+
+ if (ScrollRect.Left > ScrollRect.Right)
+ {
+ return ERROR_VIO_COL;
+ }
+
+// if (ScrollBrk)
+// break;
+
+ if ( !pScroll->cbLines )
+ {
+ return (NO_ERROR);
+ }
+
+ ScrollChar.Char.AsciiChar = pScroll->Cell[0];
+#ifdef DBCS
+// MSKK Oct.26.1992 V-AkihiS
+ ScrollChar.Attributes = MapOs2ToWinAttr(&pScroll->Cell[1]);
+#else
+ ScrollChar.Attributes = MapOs2ToWinAttr(pScroll->Cell[1]);
+#endif
+ ScrollCoord.X = ScrollRect.Left;
+ ScrollCoord.Y = ScrollRect.Top;
+
+ FillCoord = SourCoord = DestCoord = ScrollCoord;
+ Clear1Rect = ClearRect = ScrollRect;
+
+ Offset = SesGrp->ScreenColNum << SesGrp->VioLength2CellShift;
+ DestLineIndexInc = 1;
+
+ switch (ScrollDirection)
+ {
+ case 1: /* Down */
+ cbCheck = (USHORT)(ScrollRect.Bottom - ScrollRect.Top + 1);
+ DestCoord.Y = ScrollRect.Bottom;
+ ScrollRect.Bottom -= pScroll->cbLines;
+ Clear1Rect.Top = (SHORT)(ScrollRect.Bottom + 1);
+ Clear1Rect.Bottom = (SHORT)(ScrollRect.Top + pScroll->cbLines - 1);
+ ScrollCoord.Y += pScroll->cbLines;
+ FillLineLength = LineLength = (ScrollRect.Right - ScrollRect.Left + 1);
+ LineNum = ScrollRect.Bottom - ScrollRect.Top + 1;
+ SourCoord.Y = ScrollRect.Bottom;
+ FillLineNum = (ULONG)pScroll->cbLines;
+ Offset = - (SesGrp->ScreenColNum << SesGrp->VioLength2CellShift);
+ DestLineIndexInc = -1;
+ break;
+
+ case 2: /* Right */
+ cbCheck = (USHORT)(ScrollRect.Right - ScrollRect.Left + 1);
+ ScrollRect.Right -= pScroll->cbLines;
+ Clear1Rect.Left = (SHORT)(ScrollRect.Right + 1);
+ Clear1Rect.Right = (SHORT)(ScrollRect.Left + pScroll->cbLines - 1);
+ ScrollCoord.X += pScroll->cbLines;
+ LineLength = ScrollRect.Right - ScrollRect.Left + 1;
+ FillLineNum = LineNum = (ScrollRect.Bottom - ScrollRect.Top + 1);
+ FillLineLength = pScroll->cbLines;
+ DestCoord.X += pScroll->cbLines;
+ break;
+
+ case 3: /* Up */
+ cbCheck = (USHORT)(ScrollRect.Bottom - ScrollRect.Top + 1);
+ ScrollRect.Top += pScroll->cbLines;
+ Clear1Rect.Top = (SHORT)(Clear1Rect.Bottom - pScroll->cbLines + 1);
+ Clear1Rect.Bottom = (SHORT)(ScrollRect.Top - 1);
+ FillLineLength = LineLength = (ScrollRect.Right - ScrollRect.Left + 1);
+ LineNum = ScrollRect.Bottom - ScrollRect.Top + 1;
+ SourCoord.Y += pScroll->cbLines;
+ FillCoord.Y = (USHORT)(ScrollRect.Bottom - pScroll->cbLines + 1);
+ FillLineNum = (ULONG)pScroll->cbLines;
+ break;
+
+ case 4: /* Left */
+ cbCheck = (USHORT)(ScrollRect.Right - ScrollRect.Left + 1);
+ ScrollRect.Left += pScroll->cbLines;
+ Clear1Rect.Left = (SHORT)(Clear1Rect.Right - pScroll->cbLines + 1);
+ Clear1Rect.Right = (SHORT)(ScrollRect.Left - 1);
+ LineLength = ScrollRect.Right - ScrollRect.Left + 1;
+ FillLineNum = LineNum = (ScrollRect.Bottom - ScrollRect.Top + 1);
+ SourCoord.X += pScroll->cbLines;
+ FillLineLength = pScroll->cbLines;
+ FillCoord.X = (USHORT)(ScrollRect.Right - pScroll->cbLines + 1);
+ break;
+
+ }
+
+ if ((USHORT)pScroll->cbLines >= cbCheck)
+ {
+ /* clear all region */
+
+ Rc = Ow2ClearAllRegion(&ClearRect,
+ &ScrollChar,
+ pScroll->Cell);
+ } else
+ {
+ /* scroll region */
+
+ if ((USHORT)pScroll->cbLines > (USHORT)( cbCheck / 2 ))
+ {
+ /* clear the region of overlapping before scrolling */
+
+ Rc = Ow2ClearAllRegion(&Clear1Rect,
+ &ScrollChar,
+ pScroll->Cell);
+
+ }
+
+ Rc = !ScrollConsoleScreenBufferA( hConOut,
+ &ScrollRect,
+ NULL,
+ ScrollCoord,
+ &ScrollChar);
+
+ ASSERT1("OS2SES(Ow2VioScroll): ScrollConsoleScreenBufferA", !Rc);
+
+ if (!Rc && SesGrp->LVBOn)
+ {
+ Ptr = Ow2LvbGetPtr(SourCoord);
+
+ for ( i = 0 ; i < LineNum ; i++ )
+ {
+ VioLVBCopyCellStr(
+ Ptr,
+ DestCoord,
+ LineLength);
+
+ Ptr += Offset;
+ DestCoord.Y += DestLineIndexInc;
+ }
+
+ for ( i = 0 ; i < FillLineNum ; i++ )
+ {
+ VioLVBFillCell(
+ pScroll->Cell,
+ FillCoord,
+ FillLineLength);
+
+ FillCoord.Y++ ;
+ }
+ }
+ }
+
+#if DBG
+ if ( !Rc )
+ {
+ VioLVBTestScroll();
+ }
+#endif
+
+ if (Rc)
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(VioRequest-VioScroll): Rc %lu\n", Rc));
+#endif
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2ClearAllRegion(
+ IN SMALL_RECT *ClearRect,
+ IN CHAR_INFO *FillChar,
+ IN PUCHAR pCell
+ )
+{
+ //SHORT i;
+ DWORD Rc, NumToFill, NumFilled;
+ COORD Address;
+
+ NumToFill = ClearRect->Right - ClearRect->Left + 1;
+ Address.X = ClearRect->Left;
+ Address.Y = ClearRect->Top;
+
+ if (NumToFill == (DWORD)SesGrp->ScreenColNum)
+ {
+ NumToFill *= (ClearRect->Bottom - ClearRect->Top + 1);
+
+ if (Rc = !Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2ClearAllRegionStr,
+ #endif
+ hConOut,
+ FillChar->Char.AsciiChar,
+ NumToFill,
+ Address,
+ &NumFilled
+ ))
+ {
+ ASSERT1("OS2SES(Ow2ClearAllRegion): FillConsoleOutputCharacterA1", FALSE);
+ return(Rc);
+ }
+
+ if (Rc = !Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2ClearAllRegionStr,
+ #endif
+ hConOut,
+ FillChar->Attributes,
+ NumFilled,
+ Address,
+ &NumFilled
+ ))
+ {
+ ASSERT1("OS2SES(Ow2ClearAllRegion): FillConsoleOutputAttribute1", FALSE);
+ return(Rc);
+ }
+
+#if DBG
+ if ( NumToFill != NumFilled )
+ IF_OD2_DEBUG( ANY )
+ {
+ KdPrint(("OS2SES(VioRequest-Ow2ClearAllRegion): partial data\n"));
+ ASSERT( FALSE );
+ }
+#endif
+
+ VioLVBFillCell(
+ pCell,
+ Address,
+ NumFilled);
+
+ return(NO_ERROR);
+ }
+
+ for ( ; Address.Y <= ClearRect->Bottom ; Address.Y++)
+ {
+ if (Rc = !Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2ClearAllRegionStr,
+ #endif
+ hConOut,
+ FillChar->Char.AsciiChar,
+ NumToFill,
+ Address,
+ &NumFilled
+ ))
+ {
+ ASSERT1("OS2SES(Ow2ClearAllRegion): FillConsoleOutputCharacterA2", FALSE);
+ return(Rc);
+ }
+
+ if (Rc = !Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2ClearAllRegionStr,
+ #endif
+ hConOut,
+ FillChar->Attributes,
+ NumToFill,
+ Address,
+ &NumFilled
+ ))
+ {
+ ASSERT1("OS2SES(Ow2ClearAllRegion): FillConsoleOutputAttribute2", FALSE);
+ return(Rc);
+ }
+
+ VioLVBFillCell(
+ pCell,
+ Address,
+ NumFilled);
+#if DBG
+ if ( NumToFill != NumFilled )
+ IF_OD2_DEBUG( ANY )
+ KdPrint(("OS2SES(VioRequest-Ow2ClearAllRegion): partial data1\n"));
+#endif
+
+ }
+
+ return(0L);
+}
+
+
+DWORD
+Ow2VioGetConfig(
+ IN OUT PVOID VioConfig
+ )
+{
+ VIOCONFIGINFO LocalConfig;
+ PVIOCONFIGINFO Config = (PVIOCONFIGINFO) VioConfig;
+
+ LocalConfig.cb = (Config->cb > sizeof(VIOCONFIGINFO)) ?
+ sizeof(VIOCONFIGINFO) : Config->cb;
+
+ LocalConfig.adapter = DISPLAY_VGA;
+ LocalConfig.display = MONITOR_851X_COLOR;
+ LocalConfig.cbMemory = ADAPTER_MEMORY;
+ if (LocalConfig.cb == sizeof(VIOCONFIGINFO))
+ {
+ // more to set
+ }
+
+ RtlMoveMemory(Config, &LocalConfig, LocalConfig.cb);
+ return(NO_ERROR);
+}
+
+
+/*
+ * VIO Cursor Position
+ *
+ * SesGrp->WinCoord hold the current Cursor Position for the all session
+ *
+ * Ow2VioReadCurPos - calls a Win32 API to retrive the CurPos (and update
+ * SesGrp->WinCoord)
+ * Ow2VioGetCurPos - gets CurPos from internal parameter (SesGrp->WinCoord).
+ * If there's a child Win32 process, Read it before.
+ * Ow2VioWriteCurPos - calls a Win32 API to change the CurPos
+ * Ow2VioUpdateCurPos - updates the current value (SesGrp->WinCoord)
+ * Ow2VioSetCurPos - if new CurPos (different from SesGrp->WinCoord) or
+ * there's a child Win32 process, calls Write and Update
+ *
+ * Init => Read
+ * OS/2 Get API => Get
+ * OS/2 Set API => Set
+ * TTY new Coord => Set
+ * VioPopUp => Set
+ * New screen mode (VioSetMode, VioPopup, VioWrtTTY(Set Mode)) => Write
+ * VioEndPopup => Update
+ * Last Win32 child process termination => Read
+ *
+ * Read => Update
+ * Get => Read
+ * Write => Update
+ * Set => Write
+ */
+
+
+DWORD
+Ow2VioUpdateCurPos(
+ IN COORD CurPos
+ )
+{
+ SesGrp->WinCoord = CurPos;
+ return (NO_ERROR);
+}
+
+
+DWORD
+Ow2VioWriteCurPos(
+ IN COORD CurPos
+ )
+{
+ DWORD Rc = NO_ERROR;
+
+ if(!Or2WinSetConsoleCursorPosition(
+ #if DBG
+ Ow2VioWriteCurPosStr,
+ #endif
+ hConOut,
+ CurPos
+ ))
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(Ow2VioWriteCurPos): Rc %lu (Y %d, X %d)\n",
+ Rc, CurPos.Y, CurPos.X));
+ ASSERT( FALSE ); // should not happend
+#endif
+ } else
+ {
+ Rc = Ow2VioUpdateCurPos(CurPos);
+ }
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioSetCurPos(
+ IN ULONG Row,
+ IN ULONG Col
+ )
+{
+ DWORD Rc;
+ COORD CurPos;
+
+ if (Rc = Ow2VioSetCoordAndCheck(&CurPos, Row, Col))
+ {
+ return(Rc);
+ }
+
+ if(SesGrp->WinProcessNumberInSession ||
+ (CurPos.X != SesGrp->WinCoord.X) || (CurPos.Y != SesGrp->WinCoord.Y))
+ {
+ Rc = Ow2VioWriteCurPos(CurPos);
+ }
+
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioReadCurPos(
+ )
+{
+ DWORD Rc;
+ CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
+
+ if (Or2WinGetConsoleScreenBufferInfo(
+ #if DBG
+ Ow2VioReadCurPosStr,
+ #endif
+ hConOut,
+ &ConsoleScreenBufferInfo
+ ))
+ {
+ if (ConsoleScreenBufferInfo.dwCursorPosition.Y >= SesGrp->ScreenRowNum ) {
+ ConsoleScreenBufferInfo.dwCursorPosition.Y = SesGrp->ScreenRowNum - 1;
+ }
+ Rc = Ow2VioUpdateCurPos(ConsoleScreenBufferInfo.dwCursorPosition);
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(Ow2VioReadCurPos): Rc %lu\n", Rc));
+ ASSERT( FALSE ); // should not happend
+#endif
+ }
+
+ return (Rc);
+}
+
+
+DWORD
+Ow2VioGetCurPos(
+ IN PUSHORT pRow,
+ IN PUSHORT pColumn
+ )
+{
+ DWORD Rc;
+
+ if(SesGrp->WinProcessNumberInSession)
+ {
+ if(Rc = Ow2VioReadCurPos())
+ {
+ return (Rc);
+ }
+ }
+
+ *pRow = (USHORT)SesGrp->WinCoord.Y;
+ *pColumn = (USHORT)SesGrp->WinCoord.X;
+
+ return (NO_ERROR);
+}
+
+
+/*
+ * VIO Cursor Type
+ *
+ * The current Cursor Type for the all session is held:
+ * SesGrp->dwWinCursorSize and SesGrp->bWinCursorVisible - Win32 Type
+ * SesGrp->CursorInfo - OS/2 Type
+ *
+ * Ow2VioReadCurType - calls a Win32 API to retrive the CurType (and update
+ * SesGrp->dwWinCursorSize and SesGrp->bWinCursorVisible).
+ * Ow2VioGetCurType - gets CurType from internal parameter (SesGrp->CursorInfo).
+ * If there's a child Win32 process, Reads it before.
+ * Ow2VioMapOs2CurType2Win - maps the OS/2 CurType to Win32 format
+ * Ow2VioSetCurType - if new CurType or there's a child Win32 process,
+ * maps the CurType and calls Win32 API
+ *
+ * BUGBUG - to add:
+ * Ow2VioMapWinCurType2Os2 - maps the Win32 CurType (from SesGrp) to OS/2 format
+ *
+ * Init => Read
+ * OS/2 Get API => Get
+ * OS/2 Set API => Set
+ * VioPopUp => Set
+ * New screen mode (VioSetMode, VioPopup, VioWrtTTY(Set Mode)) => Set
+ * VioEndPopup => Update SesGrp parms directly
+ * Last Win32 child process termination => Read
+ *
+ * Read =>
+ * Get => Read
+ * Map =>
+ * Set => Map
+ */
+
+
+DWORD
+Ow2VioMapOs2CurType2Win(
+ IN OUT PVIOCURSORINFO pCursorInfo,
+ OUT PCONSOLE_CURSOR_INFO lpCursorInfo)
+{
+ DWORD Diff;
+ USHORT LocalCellVSize = (USHORT)SesGrp->CellVSize;
+
+ if (pCursorInfo->cEnd >= LocalCellVSize)
+
+ if (pCursorInfo->cx > 1)
+ return (ERROR_VIO_WIDTH);
+
+ if (((pCursorInfo->yStart >= LocalCellVSize) &&
+ (pCursorInfo->yStart < 65436)) ||
+ ((pCursorInfo->cEnd >= LocalCellVSize) &&
+ (pCursorInfo->cEnd < 65436)))
+ {
+ // BUGBUG: this is a temporary fix until appl will know we're window !!!
+ // (i.e. SAF has no cursor, CT)
+ // When fix: return the error code always
+
+ if ((pCursorInfo->yStart > 15) ||
+ (pCursorInfo->cEnd > 15))
+ {
+ return (ERROR_VIO_INVALID_PARMS);
+ }
+
+ LocalCellVSize = 16;
+ }
+
+ if (pCursorInfo->yStart >= LocalCellVSize)
+ {
+ pCursorInfo->yStart = (USHORT)((((0 - pCursorInfo->yStart)) * LocalCellVSize - 1)/ 100);
+ }
+
+ if (pCursorInfo->cEnd >= LocalCellVSize)
+ {
+ pCursorInfo->cEnd = (USHORT)((((0 - pCursorInfo->cEnd)) * LocalCellVSize - 1)/ 100);
+ }
+
+ Diff = (DWORD)(pCursorInfo->cEnd - pCursorInfo->yStart);
+ if (Diff >= (DWORD)LocalCellVSize)
+ {
+ Diff += LocalCellVSize;
+ }
+ lpCursorInfo->dwSize = 100 * (Diff + 1) / LocalCellVSize;
+ if (lpCursorInfo->dwSize == 12)
+ { // avoid disappearance
+ lpCursorInfo->dwSize++;
+ }
+ lpCursorInfo->bVisible = (pCursorInfo->attr != 0xffff);
+
+ return (0L);
+}
+
+
+DWORD
+Ow2VioSetCurType(
+ IN PVOID VioCurType
+ )
+{
+ DWORD Rc;
+ PVIOCURSORINFO pCurType = (PVIOCURSORINFO) VioCurType;
+ CONSOLE_CURSOR_INFO lpCursorInfo;
+
+ if( !SesGrp->WinProcessNumberInSession &&
+ !memcmp(VioCurType, (PVOID)&SesGrp->CursorInfo.yStart, sizeof(VIOCURSORINFO)))
+ {
+ /*
+ * No change - ignore request
+ */
+
+ return (NO_ERROR);
+ }
+
+ Rc = Ow2VioMapOs2CurType2Win(
+ pCurType,
+ &lpCursorInfo
+ );
+ if (Rc)
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2VioSetCurType): Rc %lu\n", Rc));
+ }
+#endif
+ return (Rc);
+ }
+
+ if (!Or2WinSetConsoleCursorInfo(
+ #if DBG
+ Ow2VioSetCurTypeStr,
+ #endif
+ hConOut,
+ &lpCursorInfo
+ ))
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(Ow2VioSetCurType): SetConsoleCursorInfo Rc %lu\n",
+ Rc));
+ ASSERT( FALSE ); // should not happend
+#endif
+ return (Rc);
+ }
+
+ SesGrp->CursorInfo = *pCurType;
+ SesGrp->dwWinCursorSize = lpCursorInfo.dwSize;
+ SesGrp->bWinCursorVisible = lpCursorInfo.bVisible;
+
+ return (NO_ERROR);
+}
+
+
+DWORD
+Ow2VioReadCurType(
+ )
+{
+ DWORD Rc = NO_ERROR;
+ CONSOLE_CURSOR_INFO lpCursorInfo;
+
+ if (Or2WinGetConsoleCursorInfo(
+ #if DBG
+ Ow2VioReadCurTypeStr,
+ #endif
+ hConOut,
+ &lpCursorInfo
+ ))
+ {
+ SesGrp->bWinCursorVisible = lpCursorInfo.bVisible;
+ SesGrp->CursorInfo.attr = (USHORT)((lpCursorInfo.bVisible) ? 0 : 0xffff);
+
+ if ( SesGrp->dwWinCursorSize != lpCursorInfo.dwSize )
+ {
+ SesGrp->dwWinCursorSize = lpCursorInfo.dwSize;
+
+ // BUGBUG
+
+ //MapWin2Os2Cursor(lpCursorInfo, &SesGrp->CursorInfo);
+ }
+ } else
+ {
+ Rc = GetLastError();
+#if DBG
+ KdPrint(("OS2SES(Ow2VioReadCurType): Rc %lu\n", Rc));
+ ASSERT( FALSE ); // should not happend
+#endif
+ return (Rc);
+ }
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+Ow2VioGetCurType(
+ IN OUT PVOID VioCurType
+ )
+{
+ DWORD Rc = NO_ERROR;
+ PVIOCURSORINFO pCurType = (PVIOCURSORINFO) VioCurType;
+
+ if( SesGrp->WinProcessNumberInSession )
+ {
+ if(Rc = Ow2VioReadCurType())
+ {
+ return (Rc);
+ }
+ }
+
+ *pCurType = SesGrp->CursorInfo;
+ return(NO_ERROR);
+}
+
+#if DBG
+//#define DUMP_VIO_SET_MODE 1
+
+#if DUMP_VIO_SET_MODE
+VOID
+DumpScreenInfo(
+ IN PSZ String,
+ IN HANDLE hConsole
+ )
+{
+ CONSOLE_SCREEN_BUFFER_INFO ScreenInfo1;
+
+ Or2WinGetConsoleScreenBufferInfo(
+ VioSetScreenSizeStr,
+ hConsole,
+ &ScreenInfo1
+ );
+
+ KdPrint((" (%s): Size %x:%x, Pos %x:%x, Attr %x, Win %x:%x-%x:%x, Max %x:%x\n",
+ String,
+ ScreenInfo1.dwSize.Y, ScreenInfo1.dwSize.X,
+ ScreenInfo1.dwCursorPosition.Y, ScreenInfo1.dwCursorPosition.X,
+ ScreenInfo1.wAttributes,
+ ScreenInfo1.srWindow.Top, ScreenInfo1.srWindow.Left,
+ ScreenInfo1.srWindow.Bottom, ScreenInfo1.srWindow.Right,
+ ScreenInfo1.dwMaximumWindowSize.Y, ScreenInfo1.dwMaximumWindowSize.X ));
+}
+#endif
+#endif
+
+
+struct
+{
+ SHORT RowNum;
+ COORD Resolution;
+ COORD Font;
+} HW_MODE_TABLE[] =
+ {
+ {21, {640, 350}, {8, 16}},
+ {25, {720, 400}, {8, 16}},
+ {28, {720, 400}, {8, 14}},
+ {43, {640, 350}, {8, 8}},
+ {00, {720, 400}, {8, 8}} // default to 50 lines
+ };
+
+
+DWORD
+VioSetScreenSize(
+ IN SHORT Row,
+ IN SHORT Col,
+ IN HANDLE hConsole
+ )
+{
+ BOOL SetModeOn = FALSE, Rc = 0;
+ DWORD Status, Err = 0, DisplayMode, OldLVBsize;
+ int i = -1;
+ SMALL_RECT Rect;
+ COORD Coord;
+ CONSOLE_SCREEN_BUFFER_INFO lpScreenBufferInfo;
+
+ Rc = !Or2WinGetConsoleScreenBufferInfo(
+ #if DBG
+ VioSetScreenSizeStr,
+ #endif
+ hConsole,
+ &lpScreenBufferInfo
+ );
+
+ if (Rc)
+ {
+#if DBG
+ KdPrint(("OS2SES(VioSetScreenSize): error %lx\n", Rc));
+#endif
+ ASSERT(FALSE);
+ Status = GetLastError();
+
+ return(1L);
+ }
+
+ if ((Row != SesGrp->ScreenRowNum) ||
+ (Col != SesGrp->ScreenColNum) ||
+ (Row != lpScreenBufferInfo.dwMaximumWindowSize.Y) ||
+ (Col != lpScreenBufferInfo.dwMaximumWindowSize.X))
+ {
+ if ((GetConsoleDisplayMode(&DisplayMode)) &&
+ (DisplayMode & CONSOLE_FULLSCREEN))
+ {
+ for ( i = 0 ; (Row > HW_MODE_TABLE[i].RowNum) && HW_MODE_TABLE[i].RowNum ; i++ );
+ }
+#if DUMP_VIO_SET_MODE
+ KdPrint(("=============================================\n"));
+ KdPrint(("OS2SES(VioSetScreenSize): from %x:%x to %x:%x\n",
+ SesGrp->ScreenRowNum, SesGrp->ScreenColNum, Row, Col));
+ KdPrint(("---------------------------------------------\n"));
+#endif
+
+#if DUMP_VIO_SET_MODE
+ DumpScreenInfo("enter ", hConsole);
+#endif
+
+ Rect.Top = Rect.Left = 0;
+ Rect.Right = (USHORT)( lpScreenBufferInfo.dwMaximumWindowSize.X - 1 );
+ Rect.Bottom = (USHORT)( lpScreenBufferInfo.dwMaximumWindowSize.Y - 1 );
+
+ if ((lpScreenBufferInfo.dwMaximumWindowSize.X > Col) ||
+ (lpScreenBufferInfo.dwMaximumWindowSize.Y > Row ))
+ {
+ if ((lpScreenBufferInfo.dwMaximumWindowSize.X >= Col) &&
+ (lpScreenBufferInfo.dwMaximumWindowSize.Y >= Row ))
+ {
+ SetModeOn = TRUE;
+#if DUMP_VIO_SET_MODE
+ KdPrint((" set Mode ON\n"));
+#endif
+ }
+
+ if (lpScreenBufferInfo.dwMaximumWindowSize.X > Col)
+ Rect.Right = (SHORT)(Col - 1);
+
+ if (lpScreenBufferInfo.dwMaximumWindowSize.Y > Row)
+ Rect.Bottom = (SHORT)(Row - 1);
+
+#if DUMP_VIO_SET_MODE
+ KdPrint((" SetWindowInfo to Size %x:%x-%x:%x\n",
+ Rect.Top, Rect.Left, Rect.Bottom, Rect.Right));
+#endif
+
+ Rc = !Or2WinSetConsoleWindowInfo(
+ #if DBG
+ VioSetScreenSizeStr,
+ #endif
+ hConsole,
+ (BOOL)TRUE,
+ &Rect
+ );
+
+#if DUMP_VIO_SET_MODE
+ DumpScreenInfo("new size ", hConsole);
+#endif
+
+ if (Rc)
+ {
+#if DBG
+ Status = GetLastError();
+ KdPrint(("OS2SES(VioSetScreenSize): SetConsoleWindowInfo error %lu(size %x:%x-%x:%x)\n",
+ Status, Rect.Top, Rect.Left, Rect.Bottom, Rect.Right));
+#endif
+ Err = 1;
+
+// ASSERT(FALSE); // maybe FullScreen
+// return(1L);
+ }
+
+ }
+
+ Rect.Right = (SHORT)(Col - 1);
+ Rect.Bottom = (SHORT)(Row - 1);
+
+ Coord.X = Col;
+ Coord.Y = Row;
+
+#if DUMP_VIO_SET_MODE
+ KdPrint((" SetBufferSize to Size %x:%x\n",
+ Coord.Y, Coord.X));
+#endif
+
+ if (i != -1)
+ {
+ SetConsoleHardwareState(
+ hConsole,
+ HW_MODE_TABLE[i].Resolution,
+ HW_MODE_TABLE[i].Font
+ );
+
+#if DUMP_VIO_SET_MODE
+ DumpScreenInfo("new HW state ", hConsole);
+#endif
+ }
+
+ Rc = !Or2WinSetConsoleScreenBufferSize(
+ #if DBG
+ VioSetScreenSizeStr,
+ #endif
+ hConsole,
+ Coord
+ );
+
+#if DUMP_VIO_SET_MODE
+ DumpScreenInfo("new buffer", hConsole);
+#endif
+
+ if (Rc)
+ {
+#if DBG
+ Status = GetLastError();
+ KdPrint(("OS2SES(VioSetScreenSize): SetConsoleBufferSize error %lu\n", Status));
+
+ if ((Rect.Right != (USHORT)( lpScreenBufferInfo.dwMaximumWindowSize.X - 1 )) ||
+ (Rect.Bottom != (USHORT)( lpScreenBufferInfo.dwMaximumWindowSize.Y - 1 )))
+ {
+ // restore window info
+
+ Rect.Right = (USHORT)( lpScreenBufferInfo.dwMaximumWindowSize.X - 1 );
+ Rect.Bottom = (USHORT)( lpScreenBufferInfo.dwMaximumWindowSize.Y - 1 );
+
+#if DUMP_VIO_SET_MODE
+ KdPrint((" Restore WindowInfo to Size %x:%x-%x:%x\n",
+ Rect.Top, Rect.Left, Rect.Bottom, Rect.Right));
+#endif
+
+ Rc = !Or2WinSetConsoleWindowInfo(
+ #if DBG
+ VioSetScreenSizeStr,
+ #endif
+ hConsole,
+ (BOOL)TRUE,
+ &Rect
+ );
+
+#if DUMP_VIO_SET_MODE
+ DumpScreenInfo("restore size", hConsole);
+#endif
+
+ if (Rc)
+ {
+#if DBG
+ Status = GetLastError();
+ KdPrint(("OS2SES(VioSetScreenSize): restore SetConsoleWindowInfo error %lu(size %x:%x-%x:%x)\n",
+ Status, Rect.Top, Rect.Left, Rect.Bottom, Rect.Right));
+#endif
+ Err = 1;
+
+// ASSERT(FALSE); // maybe FullScreen
+// return(1L);
+ }
+
+ }
+#endif
+
+// ASSERT(FALSE);
+ return(1L);
+ }
+
+ SesGrp->ScreenColNum = Coord.X;
+ SesGrp->ScreenRowNum = Coord.Y;
+ SesGrp->ScreenRect.Right = (SHORT)(SesGrp->ScreenColNum - 1);
+ SesGrp->ScreenRect.Bottom = (SHORT)(SesGrp->ScreenRowNum - 1);
+
+ SesGrp->Os2ModeInfo.col = SesGrp->ScreenColNum;
+ SesGrp->Os2ModeInfo.row = SesGrp->ScreenRowNum;
+ SesGrp->Os2ModeInfo.hres = SesGrp->ScreenColNum * SesGrp->CellHSize;
+ SesGrp->Os2ModeInfo.vres = SesGrp->ScreenRowNum * SesGrp->CellVSize;
+
+ SesGrp->ScreenSize = SesGrp->ScreenRowNum * SesGrp->ScreenColNum;
+ OldLVBsize = SesGrp->LVBsize;
+ SesGrp->LVBsize = (USHORT)(SesGrp->ScreenSize * SesGrp->BytesPerCell);
+ //
+ // if LVB size are changed, update lvb.
+ //
+ if (SesGrp->LVBOn && (SesGrp->LVBsize > OldLVBsize))
+ {
+ ULONG Length = SesGrp->LVBsize;
+ Ow2VioGetLVBBuf(&Length);
+ }
+
+ if (!SetModeOn)
+ {
+ if (i != -1) // FULL SCREEN
+ {
+ Rect.Right = Col - 1;
+ Rect.Bottom = Row - 1;
+ } else
+ {
+ if (Rect.Right >= (StartUpScreenInfo.srWindow.Right - StartUpScreenInfo.srWindow.Left))
+ Rect.Right = StartUpScreenInfo.srWindow.Right - StartUpScreenInfo.srWindow.Left;
+
+ if (Rect.Bottom > (StartUpScreenInfo.srWindow.Bottom - StartUpScreenInfo.srWindow.Top))
+ Rect.Bottom = StartUpScreenInfo.srWindow.Bottom - StartUpScreenInfo.srWindow.Top;
+ }
+
+#if DUMP_VIO_SET_MODE
+ KdPrint((" SetWindowInfo to Size %x:%x-%x:%x\n",
+ Rect.Top, Rect.Left,
+ Rect.Bottom, Rect.Right));
+#endif
+
+ Rc = !Or2WinSetConsoleWindowInfo(
+ #if DBG
+ VioSetScreenSizeStr,
+ #endif
+ hConsole,
+ (BOOL)TRUE,
+ &Rect
+ );
+
+#if DUMP_VIO_SET_MODE
+ DumpScreenInfo("new size ", hConsole);
+#endif
+
+ if (Rc)
+ {
+#if DBG
+ Status = GetLastError();
+ DbgPrint("OS2SES(VioSetScreenSize): SetConsoleWindowInfo error %lu\n", Status);
+#endif
+
+// ASSERT(FALSE);
+// return(1L);
+ }
+ }
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+#if DUMP_VIO_SET_MODE
+ KdPrint(("=============================================\n"));
+ } else
+ {
+ SetScreenSizeParm(Row,Col);
+ KdPrint(("OS2SES(VioSetScreenSize): same screen size %x:%x\n",
+ Row, Col));
+#else
+ } else
+ {
+ SetScreenSizeParm(Row,Col);
+#endif
+#else
+#if DUMP_VIO_SET_MODE
+ KdPrint(("=============================================\n"));
+ } else
+ {
+ KdPrint(("OS2SES(VioSetScreenSize): same screen size %x:%x\n",
+ Row, Col));
+#endif
+#endif
+ }
+
+ if (!Err)
+ {
+ // init CurPos to HOME
+
+ if(Err = Ow2VioSetCurPos(0, 0))
+ {
+ ASSERT( FALSE );
+ return(Err);
+ }
+
+ //BUGBUG=> init CurType
+ }
+
+ return(Err);
+}
+
+
+DWORD
+SetScreenSizeParm(IN SHORT Row,
+ IN SHORT Col)
+{
+ DWORD Status, OldLVBsize;
+ CONSOLE_SCREEN_BUFFER_INFO lpScreenBufferInfo;
+
+ if(!GetConsoleScreenBufferInfo(hConOut,
+ &lpScreenBufferInfo))
+ {
+ ASSERT(FALSE);
+ Status = GetLastError();
+ return(1L);
+ }
+
+ ASSERT( lpScreenBufferInfo.dwSize.X == Col );
+ ASSERT( lpScreenBufferInfo.dwSize.Y == Row );
+
+ SesGrp->ScreenColNum = lpScreenBufferInfo.dwSize.X;
+ SesGrp->ScreenRowNum = lpScreenBufferInfo.dwSize.Y;
+ SesGrp->ScreenRect.Right = (SHORT)(SesGrp->ScreenColNum - 1);
+ SesGrp->ScreenRect.Bottom = (SHORT)(SesGrp->ScreenRowNum - 1);
+
+ SesGrp->Os2ModeInfo.col = SesGrp->ScreenColNum;
+ SesGrp->Os2ModeInfo.row = SesGrp->ScreenRowNum;
+ SesGrp->Os2ModeInfo.hres = SesGrp->ScreenColNum * SesGrp->CellHSize;
+ SesGrp->Os2ModeInfo.vres = SesGrp->ScreenRowNum * SesGrp->CellVSize;
+
+ SesGrp->ScreenSize = SesGrp->ScreenRowNum * SesGrp->ScreenColNum;
+ OldLVBsize = SesGrp->LVBsize;
+ SesGrp->LVBsize = SesGrp->ScreenSize * (ULONG)(SesGrp->BytesPerCell);
+ //
+ // if LVB size are changed, update lvb.
+ //
+ if (SesGrp->LVBOn && (SesGrp->LVBsize > OldLVBsize))
+ {
+ ULONG Length = SesGrp->LVBsize;
+ Ow2VioGetLVBBuf(&Length);
+ }
+
+ return(0L);
+}
+
+
+DWORD
+Ow2VioSetCoordLengthAndCheck(
+ OUT PCOORD pVioCoord,
+ IN OUT PULONG pulLength,
+ IN ULONG ulRow,
+ IN ULONG ulColumn
+ )
+/*++
+
+Routine Description:
+
+ This routine set coord and length of VioRead/Write opeartion after
+ checking argument legally.
+
+Arguments:
+
+ pVioCoord - Where to put the Win32 coordinate for the Vio R/W operation.
+
+ pulLength - Vio R/W operation length. This value is updates to its maximum
+ according the coordinate and screen parameters on output.
+
+ ulRow - Row number
+
+ ulColumn - Column number
+
+Return Value:
+
+ ERROR_VIO_COL - illegal column (returns by Ow2VioSetCoordAndCheck)
+
+ ERROR_VIO_ROW - illegal row (returns by Ow2VioSetCoordAndCheck)
+
+Note:
+
+
+--*/
+{
+ DWORD Rc;
+ ULONG MaxLength;
+
+ if (Rc = Ow2VioSetCoordAndCheck(pVioCoord, ulRow, ulColumn))
+ {
+ return(Rc);
+ }
+
+ MaxLength = SesGrp->ScreenSize - (ulRow * SesGrp->ScreenColNum + ulColumn);
+ if (MaxLength < *pulLength)
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO)
+ KdPrint(("OS2SES(VioRequest): too long %u (%u at %u:%u)\n",
+ *pulLength, MaxLength, ulRow, ulColumn));
+#endif
+ *pulLength = MaxLength;
+ }
+
+ return(NO_ERROR);
+}
+
+
+DWORD
+Ow2VioSetCoordAndCheck(
+ OUT PCOORD pVioCoord,
+ IN ULONG ulRow,
+ IN ULONG ulColumn
+ )
+/*++
+
+Routine Description:
+
+ This routine set coord Vio opeartion after checking argument legally.
+
+Arguments:
+
+ pVioCoord - Where to put the start address coordinates.
+
+ ulRow - Row number
+
+ ulColumn - Column number
+
+Return Value:
+
+ ERROR_VIO_COL - illegal column
+
+ ERROR_VIO_ROW - illegal row
+
+Note:
+
+
+--*/
+{
+ if ( ulColumn >= (ULONG)SesGrp->ScreenColNum )
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO)
+ KdPrint(("OS2SES(VioRequest): illegal Col %u (%u)\n",
+ ulColumn, SesGrp->ScreenColNum));
+#endif
+ return ERROR_VIO_COL;
+ }
+
+ if ( ulRow >= (ULONG)SesGrp->ScreenRowNum )
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO)
+ KdPrint(("OS2SES(VioRequest): illegal Row %u (%u)\n",
+ ulRow, SesGrp->ScreenRowNum));
+#endif
+ return ERROR_VIO_ROW;
+ }
+
+ pVioCoord->X = (SHORT)ulColumn;
+ pVioCoord->Y = (SHORT)ulRow;
+
+ return(NO_ERROR);
+}
+
+
+#if 0
+#if DBG
+ IF_OD2_DEBUG2( VIO, OS2_EXE )
+ {
+ if (PReq->Request == VIOWrtStdOut)
+ {
+ if (PReq->hVio != hConsoleStdOut)
+ KdPrint(("OS2SES(VioRequest): illegal StdOut handle\n"));
+ } else if (PReq->Request == VIOWrtStdErr)
+ {
+ if (PReq->hVio != hConsoleStdErr)
+ KdPrint(("OS2SES(VioRequest): illegal StdErr handle\n"));
+ } else
+ {
+ if (PReq->hVio != hConOut)
+ KdPrint(("OS2SES(VioRequest): illegal handle\n"));
+ }
+ }
+#endif
+
+ if (!EventLoop)
+ {
+#if DBG
+ IF_OD2_DEBUG3( VIO, OS2_EXE, CLEANUP )
+ {
+ KdPrint(("OS2SES(VioRequest): vio request after termination event\n"));
+ }
+#endif
+
+// *(PDWORD) PStatus = -1L; //STATUS_INVALID_PARAMETER;
+// return(TRUE); // Continue
+ }
+#endif
+
+
diff --git a/private/os2/os2ses/viotty.c b/private/os2/os2ses/viotty.c
new file mode 100644
index 000000000..feea87215
--- /dev/null
+++ b/private/os2/os2ses/viotty.c
@@ -0,0 +1,1538 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ viotty.c
+
+Abstract:
+
+ This module contains the VIO-TTY utilities procedures
+
+Author:
+
+ Michael Jarus (mjarus) 12-Apr-1992
+
+Environment:
+
+ User Mode Only
+
+Revision History:
+
+--*/
+
+#define WIN32_ONLY
+#include "os2ses.h"
+#include "event.h"
+#include "trans.h"
+#include "vio.h"
+#include "os2win.h"
+#include <io.h>
+#include <stdio.h>
+#include <limits.h>
+
+
+/*
+ * - character definitions for ANSI 3.64
+ */
+
+#define ANSI_ESC 0x1b /* ESC - escape */
+#define ANSI_CUU 0x41 /* ESC[<n>A - cursor up */
+#define ANSI_CUD 0x42 /* ESC[<n>B - cursor down */
+#define ANSI_CUF 0x43 /* ESC[<n>C - cursor forward */
+#define ANSI_CUB 0x44 /* ESC[<n>D - cursor back */
+#define ANSI_CUP 0x48 /* ESC[<row>;<col>H - cursor position */
+#define ANSI_ED 0x4a /* ESC[2J - erase display */
+#define ANSI_EL 0x4b /* ESC[K - erase line */
+#define ANSI_CUP1 0x66 /* ESC[<row>;<col>f - cursor position */
+#define ANSI_SMOD 0x68 /* ESC[=<s>h - set mode */
+#define ANSI_RMOD 0x6c /* ESC[=<s>l - reset mode */
+#define ANSI_SGR 0x6d /* ESC[<g1>;...;<gn>m - select graphic rendition */
+#define ANSI_SCP 0x73 /* ESC[s - save cursor position */
+#define ANSI_RCP 0x75 /* ESC[u - restore cursor position */
+//#define ANSI_ICH 0x40 /* ESC[@ insert character */
+//#define ANSI_CNL 0x45 /* ESC[E cursor to next line */
+//#define ANSI_CPL 0x46 /* ESC[F cursor to previous line */
+//#define ANSI_IL 0x4c /* ESC[L insert line */
+//#define ANSI_DL 0x4d /* ESC[M delete line */
+//#define ANSI_DCH 0x50 /* ESC[P delete character */
+//#define ANSI_SU 0x53 /* ESC[S scroll up */
+//#define ANSI_SD 0x54 /* ESC[T scroll down */
+//#define ANSI_ECH 0x58 /* ESC[X erase character */
+//#define ANSI_CBT 0x5a /* ESC[Z backward tabulation */
+
+/* states of the finite state machine */
+
+#define NOCMD 1 /* type of crt state - most chars will go onto screen */
+#define ESCED 2 /* we've seen an ESC, waiting for rest of CSI */
+#define EQCMD 3 /* if '=' goto MODPARAMS else PARAMS */
+#define PARAMS 4 /* we're building the parameter list for ansicmd */
+#define MODPARAMS 5 /* we're building the parameter list for MODCMD */
+#define MODCMD 6 /* we've seen "ESC[=Num" waiting for #h or #l (# in {0..7}) */
+#define MODDBCS 7 /* we've seen DBCS lead-in char */
+
+#define NPARMS 4 /* max # of params */
+
+#define BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED)
+#define FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
+#define OS2_BACKGROUND_MASK (OS2_BACKGROUND_BLUE | OS2_BACKGROUND_GREEN | OS2_BACKGROUND_RED)
+#define OS2_FOREGROUND_MASK (OS2_FOREGROUND_BLUE | OS2_FOREGROUND_GREEN | OS2_FOREGROUND_RED)
+#define OS2_BACKGROUND_WHITE (OS2_BACKGROUND_BLUE | OS2_BACKGROUND_GREEN | OS2_BACKGROUND_RED)
+#define OS2_FOREGROUND_WHITE (OS2_FOREGROUND_BLUE | OS2_FOREGROUND_GREEN | OS2_FOREGROUND_RED)
+#define OS2_BACKGROUND_BLACK 0
+#define OS2_FOREGROUND_BLACK 0
+#define OS2_DEFAULT (OS2_FOREGROUND_WHITE | OS2_BACKGROUND_BLACK)
+
+#define TTY_LAST_PARMS_MAX ((USHRT_MAX - 10) / 10)
+
+#define TTY_DEST_BUFFER ((PCHAR)Ow2VioDataAddress)
+
+extern CONSOLE_SCREEN_BUFFER_INFO StartUpScreenInfo;
+
+extern HANDLE Od2VioWriteSemHandle;
+
+DWORD
+Od2AcquireMutant(
+ IN HANDLE handle
+ );
+
+DWORD
+Od2ReleaseMutant(
+ IN HANDLE handle
+ );
+
+DWORD
+Ow2VioUpdateCurPos(
+ IN COORD CurPos
+ );
+
+COORD Ow2TtySavedCursorPosition; /* CurPos for saving */
+USHORT Ow2TtyParmList[NPARMS]; /* parameter list */
+ULONG Ow2TtyParmNum; /* index of parameter we're building */
+USHORT Ow2TtyAnsiState; /* state of machine */
+USHORT Ow2TtyIgnoreNextChar;
+COORD Ow2TtyCoord;
+DWORD Ow2TtyNumBytes;
+
+
+DWORD
+Ow2TtyScreen(
+ IN LPSTR SourStr,
+ IN DWORD cnt
+ );
+
+VOID
+Ow2TtyClrParam();
+
+DWORD
+Ow2TtyAnsiCmd(
+ IN CHAR c,
+ OUT BOOL *NewCoord
+ );
+
+USHORT
+Ow2TtyRange(
+ USHORT val,
+ USHORT def,
+ USHORT min,
+ USHORT max
+ );
+
+DWORD
+Ow2TtyFlushStr();
+
+DWORD
+Ow2TtySetAttr();
+
+
+static BYTE ColorTable[8] = { 0, /* Black */
+ 4, /* Red */
+ 2, /* Green */
+ 6, /* Yellow */
+ 1, /* Blue */
+ 5, /* Magenta */
+ 3, /* Cyan */
+ 7}; /* White */
+
+#if DBG
+BYTE Ow2TtyScreenStr[] = "Ow2TtyScreen";
+BYTE Ow2TtyAnsiCmdStr[] = "Ow2TtyAnsiCmd";
+BYTE Ow2TtySetAttrStr[] = "Ow2TtySetAttr";
+BYTE Ow2TtyFlushStrStr[] = "Ow2TtyFlushStr";
+#endif
+
+DWORD
+AnsiInitForSession()
+{
+ SesGrp->AnsiMode = ANSI_ON;
+ SesGrp->WinAttr = (USHORT)StartUpScreenInfo.wAttributes;
+#ifdef DBCS
+// MSKK Feb.2.1993 V-AkihiS
+ MapWin2Os2Attr(SesGrp->WinAttr, &(SesGrp->AnsiCellAttr[0]));
+#else
+ SesGrp->AnsiCellAttr[0] = MapWin2Os2Attr(SesGrp->WinAttr);
+ SesGrp->AnsiCellAttr[1] = SesGrp->AnsiCellAttr[2] = 0;
+#endif
+ SesGrp->ansi_background = SesGrp->AnsiCellAttr[0] & OS2_BACKGROUND_MASK;
+ SesGrp->ansi_foreground = SesGrp->AnsiCellAttr[0] & OS2_FOREGROUND_MASK;
+ SesGrp->ansi_bold = (SesGrp->AnsiCellAttr[0] & OS2_FOREGROUND_INTENSITY) ? 1 : 0;
+ SesGrp->ansi_blink = (SesGrp->AnsiCellAttr[0] & OS2_BACKGROUND_BLINKING) ? 1 : 0;
+
+ return(AnsiInit());
+}
+
+
+DWORD
+AnsiInit()
+{
+ Ow2TtySavedCursorPosition = /*ansi_coord*/SesGrp->WinCoord;
+ Ow2TtyAnsiState = NOCMD; /* state of machine */
+ Ow2TtyIgnoreNextChar = 0;
+
+ return(0L);
+}
+
+
+DWORD
+Ow2VioWriteTTYStr(
+ IN PUCHAR SourStr,
+ IN ULONG Length,
+ IN ULONG ExtRequestType
+ )
+{
+ DWORD Rc;
+ VIOREQUESTNUMBER RequestType = (VIOREQUESTNUMBER) ExtRequestType;
+ USHORT Row, Col;
+
+ if (RequestType == VIOWrtStdOut)
+ {
+ if (!hStdOutConsoleType)
+ {
+ return (ERROR_INVALID_HANDLE);
+ }
+ } else if (RequestType == VIOWrtStdErr)
+ {
+ if (!hStdErrConsoleType)
+ {
+ return (ERROR_INVALID_HANDLE);
+ }
+ }
+
+ Od2AcquireMutant(Od2VioWriteSemHandle);
+
+ if (Rc = Ow2VioGetCurPos(&Row, &Col))
+ {
+#if DBG
+ ASSERT1("OS2SES(VioTTY)-Ow2VioGetCurPos failed\n", FALSE);
+#endif
+ Od2ReleaseMutant(Od2VioWriteSemHandle);
+ return(Rc);
+ }
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ UCHAR Buffer[256], *Ptr = SourStr, *Ptr1;
+ ULONG Count = Length, CurCount, i;
+
+ for ( ; Count ; Count -= CurCount, Ptr += CurCount )
+ {
+ CurCount = ( Count > 10 ) ? 10 : Count;
+
+ sprintf(Buffer, "%s %2.2x-%2.2x-%2.2x-%2.2x-%2.2x-%2.2x-%2.2x-%2.2x-%2.2x-%2.2x ",
+ (Count == Length) ? "OS2SES(VioTTY):" : " " ,
+ Ptr[0], Ptr[1], Ptr[2], Ptr[3], Ptr[4],
+ Ptr[5], Ptr[6], Ptr[7], Ptr[8], Ptr[9]
+ );
+
+ Ptr1 = &Buffer[48];
+ for ( i = 0 ; i < 10 ; i++ )
+ {
+ if ( i >= CurCount )
+ {
+ Buffer[15 + i * 3] = Buffer[16 + i * 3] = Buffer[17 + i * 3] = ' ';
+ } else if (Ptr[i] < 0x20)
+ {
+ if (Ptr[i] == ANSI_ESC)
+ {
+ *Ptr1++ = '<';
+ *Ptr1++ = 'E';
+ *Ptr1++ = 'S';
+ *Ptr1++ = 'C';
+ *Ptr1++ = '>';
+ } else if (Ptr[i] == '\n')
+ {
+ *Ptr1++ = '<';
+ *Ptr1++ = 'N';
+ *Ptr1++ = 'L';
+ *Ptr1++ = '>';
+ } else if (Ptr[i] == '\r')
+ {
+ *Ptr1++ = '<';
+ *Ptr1++ = 'C';
+ *Ptr1++ = 'R';
+ *Ptr1++ = '>';
+ } else if (Ptr[i] == '\b')
+ {
+ *Ptr1++ = '<';
+ *Ptr1++ = 'B';
+ *Ptr1++ = 'S';
+ *Ptr1++ = '>';
+ } else if (Ptr[i] == '\t')
+ {
+ *Ptr1++ = '<';
+ *Ptr1++ = 'T';
+ *Ptr1++ = 'A';
+ *Ptr1++ = 'B';
+ *Ptr1++ = '>';
+ } else if (Ptr[i] == '\07')
+ {
+ *Ptr1++ = '<';
+ *Ptr1++ = 'B';
+ *Ptr1++ = 'E';
+ *Ptr1++ = 'L';
+ *Ptr1++ = 'L';
+ *Ptr1++ = '>';
+ } else
+ {
+ *Ptr1++ = '<';
+ *Ptr1++ = '0';
+ *Ptr1++ = 'x';
+ *Ptr1++ = ((Ptr[i] & 0xF0) >> 4) + '0';
+ *Ptr1++ = (Ptr[i] & 0x0F) + '0';
+ *Ptr1++ = '>';
+ }
+ } else
+ {
+ *Ptr1++ = Ptr[i];
+ }
+ }
+
+ *Ptr1++ = '\n';
+ *Ptr1 = '\0';
+
+ KdPrint((Buffer));
+ }
+ }
+#endif
+
+ Rc = Ow2TtyScreen(
+ SourStr,
+ Length
+ );
+
+ Od2ReleaseMutant(Od2VioWriteSemHandle);
+
+ if (Rc == 1)
+ {
+ Rc = GetLastError();
+ }
+
+ if (Rc)
+ {
+#if DBG
+ KdPrint(("OS2SES(VioTTY-VioWriteTTYStr): Rc %lu\n"));
+ ASSERT( FALSE );
+#endif
+ }
+ return (Rc);
+}
+
+
+/*
+** Basic concepts:
+** The screen consists of rows and columns
+** columns are numbered from the left, starting with one.
+** rows on the screen are numbered from the top, starting with one.
+** Thus, the home position in the upper left corner is row one, column one.
+**
+** Associated with each screen is the 'current active position'.
+** It corresponds roughly to the cursor; in fact, after each call to screen
+** the cursor will indicate the active position. Thus,
+** the cursor movements really change the active position, and
+** the cursor follows the change.
+**
+** This code implements a finite state machine that reads a stream of
+** characters, and emits commands that alter the screen. All of these
+** commands are issued via calls through the 'crtsw' array. Each element
+** of this array consists of an aggregate of functions which are
+** responsible for making the appropriate changes to the actual screen.
+**
+** The functions in the aggregate and their responsibities are:
+**
+** v_scroll(i)
+** scroll the text on the screen i lines.
+** This will move some lines off the screen, and some blank lines
+** onto the screen. i may be negative, indicating that the text
+** moves downward, and blank lines appear at the top.
+** v_copy(sr, sc, dr, dc, cnt)
+** sr and sc specify a source row and column.
+** dr and dc specify a destination row and column.
+** Count characters are copied from the source to the dest,
+** with the copy proceeding from left to right, and top to bottom.
+** If the source and destination overlap, the copy is done
+** correctly.
+** v_clear(r, c, cnt)
+** Characters starting at row r and column are cleared to the
+** space character.
+** v_pchar(r, c, ch)
+** The character ch is placed on the screen at row r, column c,
+** using the current graphic rendition.
+** return value is number of character positions to adjust active
+** position by - zero means the character has no graphic
+** representation.
+** v_scurs(r, c)
+** The cursor is moved to row r, column c.
+** v_init()
+** The screen and all data structures are initialized.
+** v_sgr(i)
+** The current graphic rendition (e. g. font, color) is set to
+** that specified by i. See ANSI x3.64 for encoding.
+*/
+
+DWORD
+Ow2TtyScreen(
+ IN LPSTR SourStr,
+ IN DWORD cnt
+ )
+/*++
+
+Routine Description:
+
+ This routine handles the TTY string and pass characters to the finite
+ state machine
+
+Arguments:
+
+ SourStr - points to the array of characters
+
+ cnt - indicates how many characters are being passed.
+
+Return Value:
+
+
+Note:
+
+
+--*/
+{
+ register CHAR c;
+ BOOL NewCoord = FALSE; // for GET_LVB_PTR
+ BOOL OldWrap, NewWrap, NewParms, ignoreBSFlag;
+ PCHAR LVBPtr;
+ SHORT LFchar = FALSE;
+ DWORD Rc;
+
+
+ Ow2TtyCoord = SesGrp->WinCoord;
+ Ow2TtyNumBytes = 0;
+ LVBPtr = Ow2LvbGetPtr(Ow2TtyCoord);
+
+ while ( cnt-- )
+ {
+ c = *SourStr++;
+
+// if (Ow2TtyIgnoreNextChar)
+// {
+// Ow2TtyIgnoreNextChar = 0;
+// continue;
+// }
+
+ switch ( Ow2TtyAnsiState )
+ {
+ case NOCMD:
+ if (( c == ANSI_ESC ) && SesGrp->AnsiMode)
+ {
+ /*
+ * Found ESC when ASNI_ON
+ * wait for remaining string
+ */
+
+ Ow2TtyAnsiState = ESCED;
+ break;
+ } else
+ {
+#ifdef DBCS
+// MSKK Nov.17.1992 V-AkihiS
+ if (Ow2NlsIsDBCSLeadByte(c, SesGrp->VioCP)) {
+ TTY_DEST_BUFFER[Ow2TtyNumBytes++] = c;
+ Ow2TtyCoord.X++;
+ LVBUpdateTTYCharWithAttrAndCurPosDBCS(c, &LVBPtr, Ow2TtyAnsiState);
+ Ow2TtyAnsiState = MODDBCS;
+ }
+ else
+#endif
+ if( c >= ' ' )
+ {
+ TTY_DEST_BUFFER[Ow2TtyNumBytes++] = c;
+ Ow2TtyCoord.X++;
+ LVBUpdateTTYCharWithAttrAndCurPos(c, &LVBPtr);
+ }else
+ {
+ ignoreBSFlag = FALSE;
+
+ switch(c)
+ {
+ /*
+ * For each char:
+ * - check if to handle (BS at first column, etc.)
+ * - update cursor position (different according to the char)
+ * - update LVB pointer
+ * - put charcater in output buffer
+ */
+
+ case '\n':
+ Ow2TtyCoord.Y++;
+ NewCoord = 1;
+ LFchar = Ow2TtyCoord.X;
+ Ow2TtyCoord.X = 0;
+ break;
+
+ case '\r':
+ if (Ow2TtyCoord.X > 0)
+ {
+ Ow2TtyCoord.X = 0;
+ NewCoord = 1;
+ }
+ break;
+
+ case '\b':
+ if ( Ow2TtyCoord.X > 0 )
+ {
+ Ow2TtyCoord.X--;
+ NewCoord = 1;
+ } else
+ {
+ // wincon move to previous line so don't
+ // pass this char.
+
+ ignoreBSFlag = TRUE;
+ }
+ break;
+
+ case '\t':
+ Ow2TtyCoord.X += (8 - (Ow2TtyCoord.X % 8));
+ NewCoord = 1;
+ break;
+
+ case '\07':
+ break;
+
+ default:
+ Ow2TtyCoord.X++;
+ LVBUpdateTTYCharWithAttrAndCurPos(c, &LVBPtr);
+ break;
+ } /* end switch */
+
+ if (!ignoreBSFlag)
+ {
+ TTY_DEST_BUFFER[Ow2TtyNumBytes++] = c;
+ }
+ }
+ }
+ break;
+
+ case ESCED:
+ switch(c)
+ {
+ case '[':
+ Ow2TtyAnsiState = EQCMD;
+ Ow2TtyClrParam();
+ break;
+
+ default:
+ Ow2TtyAnsiState = NOCMD;
+
+ /*
+ * invalid string -
+ * put back last char and handle it in NOCMD mode
+ */
+
+ cnt++ ;
+ SourStr--;
+ break;
+ }
+ break;
+
+ case EQCMD:
+ if (c == '=')
+ {
+ Ow2TtyAnsiState = MODPARAMS;
+ break;
+ }
+
+ Ow2TtyAnsiState = PARAMS;
+ NewParms = FALSE;
+
+ /* fall down into PARAMS mode */
+
+ case PARAMS:
+ if ( c >= '0' && c <= '9' )
+ {
+ if (Ow2TtyParmList[Ow2TtyParmNum] < TTY_LAST_PARMS_MAX)
+ {
+ Ow2TtyParmList[Ow2TtyParmNum] *= 10;
+ Ow2TtyParmList[Ow2TtyParmNum] += (c - '0');
+ NewParms = TRUE;
+ }
+ } else if (c == ';')
+ {
+ if ( Ow2TtyParmNum < (NPARMS - 1) )
+ {
+ NewParms = FALSE;
+ Ow2TtyParmNum++;
+ //NewParms = TRUE;
+ } else
+ { Ow2TtyAnsiState = NOCMD;
+
+ /*
+ * invalid string -
+ * put back last char and handle it in NOCMD mode
+ */
+
+ cnt++ ;
+ SourStr--;
+ }
+ } else
+ {
+ Ow2TtyAnsiState = NOCMD;
+ if (NewParms || (Ow2TtyParmNum == 0))
+ {
+ Ow2TtyParmNum++;
+ }
+
+ if ((Rc = Ow2TtyAnsiCmd(
+ c,
+ &NewCoord)) == 1)
+ {
+#if DBG
+ KdPrint(("OS2SES(VIOTTY): failed on Ow2TtyAnsiCmd\n"));
+#endif
+ return(1);
+ } else if ( Rc == 2 )
+ {
+ /*
+ * invalid string -
+ * put back last char and handle it in NOCMD mode
+ */
+
+ cnt++ ;
+ SourStr--;
+ }
+ }
+ break;
+
+ case MODPARAMS:
+ if ( c >= '0' && c <= '9' )
+ {
+ if (Ow2TtyParmList[Ow2TtyParmNum] < TTY_LAST_PARMS_MAX)
+ {
+ Ow2TtyParmList[0] *= 10;
+ Ow2TtyParmList[0] += (c - '0');
+ break;
+ }
+ }
+
+ /* fall down into MODCMD mode */
+
+ case MODCMD:
+ Ow2TtyAnsiState = NOCMD;
+ if ( c == 'h' || c == 'l' )
+ {
+ if (Ow2TtyParmList[0] == 7)
+ {
+ OldWrap = ((SesGrp->OutputModeFlags & ENABLE_WRAP_AT_EOL_OUTPUT) != 0);
+ NewWrap = (c == 'h');
+ if (OldWrap != NewWrap)
+ {
+ if(Ow2TtyFlushStr())
+ {
+#if DBG
+ KdPrint(("OS2SES(TTY): failed on FlushStr1\n"));
+#endif
+ return(1);
+ }
+
+ if (!Or2WinSetConsoleMode(
+ #if DBG
+ Ow2TtyScreenStr,
+ #endif
+ hConOut,
+ SesGrp->OutputModeFlags^ENABLE_WRAP_AT_EOL_OUTPUT))
+ {
+#if DBG
+ ASSERT1("OS2SES(TTY): failed on SetConsoleMode\n", FALSE);
+#endif
+ return (1);
+ }
+
+ SesGrp->OutputModeFlags ^= ENABLE_WRAP_AT_EOL_OUTPUT;
+ }
+ break;
+ } else if (Ow2TtyParmList[0] < 7)
+ {
+ if(Ow2TtyFlushStr())
+ {
+#if DBG
+ KdPrint(("OS2SES(TTY): failed on FlushStr2\n"));
+#endif
+ return(1);
+ }
+
+ /* According to the spec
+ =====================
+ 0 => 40x25 black and white
+ 1 => 40x25 color
+ 2 => 80x25 black and white
+ 3 => 80x25 color
+ 4 => 320x200 color
+ 5 => 320x200 black and white
+ 6 => 640x200 black and white
+
+ 0,1,4,5 => 40 col (2,3,6 => 80 col)
+ 1,3,4, => color (0,2,5,6 =>b&w)
+
+ According to OS/2 1.21 (for WIN COM)
+ ====================================
+ 0,1 => 80x50 (2-6 => 80x25)
+ */
+
+ VioSetScreenSize(
+ (SHORT)((Ow2TtyParmList[0] <= 1) ? 50 : 25),
+ (SHORT)80,
+ hConOut);
+
+ Ow2TtyCoord.X = Ow2TtyCoord.Y = 0;
+ NewCoord = TRUE;
+ break;
+ } else
+ {
+ // illegal parameter
+ break;
+ }
+ } // else - illegal character
+
+ /*
+ * invalid string -
+ * put back last char and handle it in NOCMD mode
+ */
+
+ cnt++ ;
+ SourStr--;
+ break;
+
+ case MODDBCS:
+#ifdef DBCS
+// MSKK Feb.06.1992 V-AkihiS
+ TTY_DEST_BUFFER[Ow2TtyNumBytes++] = c;
+ Ow2TtyCoord.X++;
+ LVBUpdateTTYCharWithAttrAndCurPosDBCS(c, &LVBPtr, Ow2TtyAnsiState);
+ Ow2TtyAnsiState = NOCMD;
+#else
+ TTY_DEST_BUFFER[Ow2TtyNumBytes++] = ' ';
+ Ow2TtyCoord.X++;
+ LVBPtr += SesGrp->BytesPerCell;
+ Ow2TtyAnsiState = NOCMD;
+#endif
+ break;
+
+ }
+
+ /*
+ * if past right hand edge
+ * move left and down
+ */
+
+ if ( Ow2TtyCoord.X >= SesGrp->ScreenColNum )
+ {
+ if (SesGrp->OutputModeFlags & ENABLE_WRAP_AT_EOL_OUTPUT)
+ {
+ //Ow2TtyCoord.Y += (Ow2TtyCoord.X / SesGrp->ScreenColNum);
+ //Ow2TtyCoord.X = (Ow2TtyCoord.X % SesGrp->ScreenColNum);
+
+ //if (Ow2TtyCoord.X == 0)
+ //{
+ // Ow2TtyCoord.Y++;
+ //}
+
+ /*
+ * It happends only with '\n', so only one line at a time
+ */
+
+ Ow2TtyCoord.Y++;
+ Ow2TtyCoord.X -= SesGrp->ScreenColNum;
+ } else
+ {
+ Ow2TtyCoord.X = SesGrp->ScreenColNum - 1;
+ NewCoord = TRUE;
+ }
+ } else if ( Ow2TtyCoord.X < 0 )
+ {
+ ASSERT(FALSE);
+ Ow2TtyCoord.X = 0;
+ }
+
+ /* if off screen, scroll */
+
+ if ( Ow2TtyCoord.Y >= SesGrp->ScreenRowNum )
+ {
+ //VioLVBScrollBuff((DWORD)(Ow2TtyCoord.Y - SesGrp->ScreenRowNum + 1));
+
+ /*
+ * It happends only with '\n', so only one line at a time
+ */
+
+ //ASSERT(Ow2TtyCoord.Y == SesGrp->ScreenRowNum);
+
+ VioLVBScrollBuff(1);
+
+ Ow2TtyCoord.Y = SesGrp->ScreenRowNum - 1;
+ NewCoord = TRUE;
+ }
+
+ if (LFchar)
+ {
+ /*
+ * The console doesn't support LF but treats it as CR-LF.
+ * We send LF (does the scroll if necessary) and than move
+ * to the desire column
+ */
+ if(Ow2TtyFlushStr())
+ {
+#if DBG
+ KdPrint(("OS2SES(TTY): failed on FlushStr3\n"));
+#endif
+ return(1);
+ }
+
+ if(Ow2VioSetCurPos((ULONG)Ow2TtyCoord.Y, (ULONG)LFchar))
+ {
+ ASSERT1( "OS2SES(VIOTTY): LF error on Ow2VioSetCurPos", FALSE );
+ }
+
+ Ow2TtyCoord = SesGrp->WinCoord;
+ LFchar = 0;
+ }
+
+ if ( NewCoord )
+ {
+ LVBPtr = Ow2LvbGetPtr(Ow2TtyCoord);
+ NewCoord = FALSE;
+ }
+ }
+
+ /* Flush */
+
+ if(Ow2TtyFlushStr())
+ {
+#if DBG
+ KdPrint(("OS2SES(TTY): failed on FlushStr4\n"));
+#endif
+ return(1);
+ }
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ ASSERT( Ow2TtyCoord.X == SesGrp->WinCoord.X );
+ ASSERT( Ow2TtyCoord.Y == SesGrp->WinCoord.Y );
+ }
+#endif
+
+ return(0L);
+}
+
+
+/*
+** Ow2TtyClrParam(lp) - clear the parameters for a screen
+*/
+
+VOID
+Ow2TtyClrParam()
+{
+ register USHORT i;
+
+ for ( i = 0; i < NPARMS; i += 1)
+ Ow2TtyParmList[i] = 0;
+ Ow2TtyParmNum = 0;
+}
+
+
+DWORD
+Ow2TtyAnsiCmd(
+ IN CHAR c,
+ OUT BOOL *NewCoord
+ )
+/*++
+
+Routine Description:
+
+ This routine performs some ANSI 3.64 function, using the parameters
+ we've just gathered.
+
+Arguments:
+
+ c - the character that indicates the function to be performed
+
+ NewCoord = where to flag if new coordinates were set
+
+Return Value:
+
+ Should return 0.
+
+ 1 - for any error (after ASSERT), RetCode from GetLastError().
+
+Note:
+
+ Ow2TtyParmNum - length of parameter list
+
+ Ow2TtyParmList - list of Set Graphics Rendition values
+
+ Ow2TtyCoord - pointer to current screen coordinates
+
+ Ow2TtyCoord is updated if new coordinates were set and it also calls
+ Ow2TtyFlushStr to flush the TTY output buffer to the console.
+
+ hConOut is used for console handle.
+
+ If data/attr is written to the screen (erase line/display), the
+ LVB is updated.
+
+
+--*/
+{
+ DWORD NumFilled;
+ COORD Coord = Ow2TtyCoord;
+ BYTE Cell[4];
+ BOOL ValidCmd = TRUE;
+
+ //if (((Ow2TtyParmNum >= 3) && (c != ANSI_SGR)) ||
+ // ((Ow2TtyParmNum == 2) && (c != ANSI_CUP) && (c != ANSI_CUP1)) ||
+ // ((Ow2TtyParmNum == 1) && ((c == ANSI_SCP) || (c == ANSI_RCP))))
+ //{
+ // ValidCmd = FALSE;
+ //} else
+ switch ( c )
+ {
+ case ANSI_CUB: /* cursor backward */
+ Coord.X -= Ow2TtyRange(Ow2TtyParmList[0], 1, 0, Coord.X);
+ break;
+
+ case ANSI_CUF: /* cursor forward */
+ Coord.X += (SHORT)Ow2TtyRange(Ow2TtyParmList[0], 1, 0, (USHORT)(SesGrp->ScreenColNum - Coord.X - 1));
+ break;
+
+ case ANSI_CUU: /* cursor up */
+ Coord.Y -= Ow2TtyRange(Ow2TtyParmList[0], 1, 0, Coord.Y);
+ break;
+
+ case ANSI_CUD: /* cursor down */
+ Coord.Y += (SHORT)Ow2TtyRange(Ow2TtyParmList[0], 1, 0, (USHORT)(SesGrp->ScreenRowNum - Coord.Y - 1));
+ break;
+
+ case ANSI_CUP: /* cursor position */
+ case ANSI_CUP1: /* cursor position */
+ Coord.Y = (USHORT)Ow2TtyRange(Ow2TtyParmList[0], 1, 1, SesGrp->ScreenRowNum) - 1;
+ Coord.X = (USHORT)Ow2TtyRange(Ow2TtyParmList[1], 1, 1, SesGrp->ScreenColNum) - 1;
+ break;
+
+ case ANSI_ED: /* erase display */
+#if 0
+ switch(Ow2TtyParmList[0])
+ {
+ case 2:
+#endif
+ Coord.X = Coord.Y = 0;
+ if(Ow2TtyFlushStr())
+ {
+ return(1);
+ }
+
+ if (!Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2TtyAnsiCmdStr,
+ #endif
+ hConOut,
+ ' ',
+ SesGrp->ScreenSize,
+ Coord,
+ &NumFilled))
+ {
+#if DBG
+ ASSERT1("OS2SES(Ow2TtyAnsiCmd(ED)): failed on FillConsoleOutputCharacterA\n", FALSE);
+#endif
+ return (1);
+ }
+
+ if (!Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2TtyAnsiCmdStr,
+ #endif
+ hConOut,
+ (WORD)SesGrp->WinAttr,
+ NumFilled,
+ Coord,
+ &NumFilled))
+ {
+#if DBG
+ ASSERT1("OS2SES(Ow2TtyAnsiCmd(ED)): failed on FillConsoleOutputAttribute\n", FALSE);
+#endif
+ return (1);
+ }
+#if DBG
+ ASSERT1("OS2SES(Ow2TtyAnsiCmd(ED)): partial data\n", NumFilled == SesGrp->ScreenSize );
+#endif
+ Cell[0] = ' ';
+ Cell[1] = SesGrp->AnsiCellAttr[0];
+ Cell[2] = SesGrp->AnsiCellAttr[1];
+ Cell[3] = SesGrp->AnsiCellAttr[2];
+ VioLVBFillCell(&Cell[0],
+ Coord,
+ NumFilled);
+ //return(0);
+#if 0
+ break;
+
+ case 0:
+ lclear(hConOut, Coord.X, Coord.Y,
+ ((SesGrp->ScreenRowNum - Coord.X) * SesGrp->ScreenColNum) +
+ ((SesGrp->ScreenColNum - Coord.X) + 1 ), SA_BONW);
+ break;
+ case 1:
+ lclear(hConOut, 0, 0, (Coord.Y)*SesGrp->ScreenColNum+Coord.X, SA_BONW);
+ break;
+
+ default:
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2TtyAnsiCmd): unknown value(%u) for ED\n",
+ Ow2TtyParmList[0]));
+ }
+#endif
+ ValidCmd = FALSE;
+ break;
+ }
+#endif
+ break;
+
+ case ANSI_EL:
+#if 0
+ switch(Ow2TtyParmList[0])
+ {
+ case 0:
+#endif
+ if(Ow2TtyFlushStr())
+ {
+ return(1);
+ }
+
+ if (!Or2WinFillConsoleOutputCharacterA(
+ #if DBG
+ Ow2TtyAnsiCmdStr,
+ #endif
+ hConOut,
+ ' ',
+ (DWORD)(SesGrp->ScreenColNum - Coord.X),
+ Coord,
+ &NumFilled))
+ {
+#if DBG
+ ASSERT1("OS2SES(Ow2TtyAnsiCmd(EL)): failed on FillConsoleOutputCharacterA\n", FALSE);
+#endif
+ return (1);
+ }
+
+ if (!Or2WinFillConsoleOutputAttribute(
+ #if DBG
+ Ow2TtyAnsiCmdStr,
+ #endif
+ hConOut,
+ (WORD)SesGrp->WinAttr,
+ NumFilled,
+ Coord,
+ &NumFilled))
+ {
+#if DBG
+ ASSERT1("OS2SES(Ow2TtyAnsiCmd(EL)): failed on FillConsoleOutputAttribute\n", FALSE);
+#endif
+ return (1);
+ }
+
+#if DBG
+ ASSERT1("OS2SES(Ow2TtyAnsiCmd(EL)): partial data\n",
+ NumFilled == (DWORD)(SesGrp->ScreenColNum - Coord.X));
+#endif
+ Cell[0] = ' ';
+ Cell[1] = SesGrp->AnsiCellAttr[0];
+ Cell[2] = SesGrp->AnsiCellAttr[1];
+ Cell[3] = SesGrp->AnsiCellAttr[2];
+ VioLVBFillCell(&Cell[0],
+ Coord,
+ NumFilled);
+ //return(0);
+#if 0
+ break;
+
+ break;
+ case 1: /* start to ap */
+ lclear(hConOut, 0, Coord.Y, Coord.X, SA_BONW);
+ break;
+ case 2: /* whole line */
+ lclear(hConOut, 0, Coord.Y, SesGrp->ScreenColNum, SA_BONW);
+ break;
+ default:
+
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2TtyAnsiCmd): unknown value(%u) for ED\n",
+ Ow2TtyParmList[0]));
+ }
+#endif
+ ValidCmd = FALSE;
+ break;
+ }
+#endif
+ break;
+
+ case ANSI_SGR:
+ if(Ow2TtySetAttr())
+ {
+ return(1);
+ }
+ return(0);
+
+ case ANSI_SCP:
+ Ow2TtySavedCursorPosition = Coord;
+ break;
+
+ case ANSI_RCP:
+ Coord = Ow2TtySavedCursorPosition;
+ break;
+
+#if 0
+
+ case ANSI_CPL: /* cursor to previous line */
+ Coord.Y -= Ow2TtyRange(Ow2TtyParmList[0], 1, 1, SesGrp->ScreenRowNum);
+ Coord.X = 1;
+ break;
+
+ case ANSI_CNL: /* cursor to next line */
+ Coord.Y += Ow2TtyRange(Ow2TtyParmList[0], 1, 1, SesGrp->ScreenRowNum);
+ Coord.X = 1;
+ break;
+
+ case ANSI_CBT: /* tab backwards */
+ col = Coord.X;
+ i = Ow2TtyRange(Ow2TtyParmList[0], 1, 1, (col + 7) >> 3);
+ if (col & 7)
+ {
+ Coord.X = (col & ~7) + 1;
+ --i;
+ }
+ Coord.X -= (i << 3);
+ break;
+
+ case ANSI_DCH: /* delete character */
+ Ow2TtyParmList[0] = Ow2TtyRange(Ow2TtyParmList[0], 1, 1, (SesGrp->ScreenColNum - Coord.X) + 1);
+ if ( Coord.X + Ow2TtyParmList[0] <= SesGrp->ScreenColNum ) {
+ lcopy(hConOut, Coord.X+Ow2TtyParmList[0]-1, Coord.Y-1,
+ Coord.X-1, Coord.Y-1, SesGrp->ScreenColNum-(Coord.X+Ow2TtyParmList[0]-1));
+ }
+ lclear(hConOut, SesGrp->ScreenColNum-Ow2TtyParmList[0], Coord.Y-1,
+ Ow2TtyParmList[0], SA_BONW);
+ break;
+
+ case ANSI_DL: /* delete line */
+ Ow2TtyParmList[0] = Ow2TtyRange(Ow2TtyParmList[0], 1, 1, (SesGrp->ScreenRowNum - Coord.Y) + 1);
+ /* copy lines up */
+ if ( Coord.Y + Ow2TtyParmList[0] <= SesGrp->ScreenRowNum ) {
+ lcopy(hConOut, 0, Coord.Y+Ow2TtyParmList[0]-1, 0, Coord.Y-1,
+ SesGrp->ScreenColNum*(SesGrp->ScreenRowNum-(Coord.Y+Ow2TtyParmList[0]-1)));
+ }
+ /* clear new stuff */
+ lclear(hConOut, 0, SesGrp->ScreenRowNum-Ow2TtyParmList[0],
+ SesGrp->ScreenColNum*Ow2TtyParmList[0], SA_BONW);
+ break;
+
+ case ANSI_ECH: /* erase character */
+ Ow2TtyParmList[0] = Ow2TtyRange( Ow2TtyParmList[0], 1, 1, (SesGrp->ScreenColNum - Coord.X) + 1);
+ lclear(hConOut, Coord.X-1, Coord.Y-1, Ow2TtyParmList[0], SA_BONW);
+ break;
+
+ case ANSI_ICH: /* insert character */
+ Ow2TtyParmList[0] = Ow2TtyRange( Ow2TtyParmList[0], 1, 1, (SesGrp->ScreenColNum - Coord.X) + 1);
+ if ( Coord.X + Ow2TtyParmList[0] <= SesGrp->ScreenColNum ) {
+ lcopy(hConOut, Coord.X-1, Coord.Y-1, Coord.X+Ow2TtyParmList[0]-1,
+ Coord.Y-1, SesGrp->ScreenColNum-(Coord.X+Ow2TtyParmList[0]-1));
+ }
+ lclear(hConOut, Coord.X-1, Coord.Y-1, Ow2TtyParmList[0], SA_BONW);
+ break;
+
+ case ANSI_IL: /* insert line */
+ Ow2TtyParmList[0] = Ow2TtyRange(Ow2TtyParmList[0], 1, 1, (SesGrp->ScreenRowNum - Coord.Y) + 1);
+ /* copy lines down */
+ if ( Coord.Y + Ow2TtyParmList[0] <= SesGrp->ScreenRowNum ) {
+ lcopy(hConOut, 0, Coord.Y-1, 0, Coord.Y+Ow2TtyParmList[0]-1,
+ SesGrp->ScreenColNum * ( SesGrp->ScreenRowNum-(Coord.Y+Ow2TtyParmList[0]-1)));
+ }
+ /* clear new stuff */
+ lclear(hConOut, 0, Coord.Y-1, SesGrp->ScreenColNum * Ow2TtyParmList[0], SA_BONW);
+ break;
+
+ case ANSI_SU: /* scroll up */
+ Ow2TtyParmList[0] = Ow2TtyRange(Ow2TtyParmList[0], 1, 1, SesGrp->ScreenRowNum);
+ lscroll(hConOut, Ow2TtyParmList[0], SA_BONW);
+ break;
+
+ case ANSI_SD: /* scroll down */
+ Ow2TtyParmList[0] = -Ow2TtyRange(Ow2TtyParmList[0], 1, 1, SesGrp->ScreenRowNum);
+ lscroll(hConOut, Ow2TtyParmList[0], SA_BONW);
+ break;
+#endif
+
+ default:
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("OS2SES(Ow2TtyAnsiCmd): unknown cmd 0x%x\n", c));
+ }
+#endif
+ ValidCmd = FALSE;
+ break;
+ }
+
+ if (!ValidCmd)
+ {
+ return(2);
+ } else if ((Coord.X != Ow2TtyCoord.X) ||
+ (Coord.Y != Ow2TtyCoord.Y))
+ {
+ if(Ow2TtyFlushStr())
+ {
+ return(1);
+ }
+
+ if(Ow2VioSetCurPos((ULONG)Coord.Y, (ULONG)Coord.X))
+ {
+ ASSERT1( "OS2SES(VIOTTY): AnsiCmd error on Ow2VioSetCurPos", FALSE );
+ }
+
+ Ow2TtyCoord= SesGrp->WinCoord;
+ *NewCoord = TRUE;
+ }
+
+ return (0);
+}
+
+
+USHORT
+Ow2TtyRange(
+ IN USHORT val,
+ IN USHORT def,
+ IN USHORT min,
+ IN USHORT max
+ )
+/*++
+
+Routine Description:
+
+ This routine restrict a value to range or supply a default.
+
+Arguments:
+
+ val - the value to be restricted.
+
+ default - the value to use if val is zero
+
+ min - the minimum value
+
+ max - the maximum value
+
+Return Value:
+
+
+Note:
+
+
+--*/
+{
+ if ( val == 0 )
+ val = def;
+ if ( val >= max )
+ return max;
+ if ( val < min )
+ return min;
+ return val;
+}
+
+
+DWORD
+Ow2TtySetAttr(
+ )
+/*++
+
+Routine Description:
+
+ This routine set new attribute ("ESC[g;...;gm").
+
+Arguments:
+
+
+Return Value:
+
+ Should return 0.
+
+ 1 - for any error (after ASSERT), RetCode from GetLastError().
+
+Note:
+
+ Ow2TtyParmNum - length of parameter list
+
+ Ow2TtyParmList - list of Set Graphics Rendition values
+
+ Ow2TtyCoord - pointer to current screen coordinates
+
+ If new attributes is set, it also calls Ow2TtyFlushStr to flush the TTY
+ output buffer to the console.
+
+ hConOut is used for console handle.
+
+ Uses and updates: SesGrp->AnsiCellAttr, SesGrp->ansi_bold, SesGrp->ansi_blink,
+ SesGrp->ansi_background, SesGrp->ansi_foreground, SesGrp->WinAttr
+
+--*/
+{
+ BYTE NewAttr, LastAttr = SesGrp->AnsiCellAttr[0]; /* attribute of TTY */
+ ULONG i;
+ USHORT AnsiParm;
+ WORD WinAttr;
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+ BYTE CommonAttr[3];
+#endif
+
+ for ( i = 0 ; i < Ow2TtyParmNum ; i++ )
+ {
+ AnsiParm = Ow2TtyParmList[i];
+
+ if (AnsiParm == 0)
+ {
+ /* ATTRIBUTE OFF */
+ /*****************/
+
+ // The default is according to Win. This sequence reset
+ // all the attribute only but doesn't change the color.
+ // According to VI.exe (set term-ibmans, fail on find-string
+ // and Jump to next line till end of screen, #2221, 5/2/93)
+ // and the updated os2tst\viowrt.
+
+ SesGrp->ansi_blink = SesGrp->ansi_bold = 0;
+ SesGrp->ansi_background = OS2_BACKGROUND_BLACK;
+ SesGrp->ansi_foreground = OS2_FOREGROUND_WHITE;
+
+ } else if (AnsiParm <= 8)
+ {
+ if (AnsiParm == 1)
+ {
+ /* BOLD */
+ /********/
+
+ SesGrp->ansi_bold = 1;
+
+ } else if (AnsiParm == 2)
+ {
+ /* FAINT */
+ /**********/
+
+ } else if (AnsiParm == 3)
+ {
+ /* ITALIC */
+ /**********/
+
+ } else if (AnsiParm == 4)
+ {
+ /* ?BLUE? */
+ /**********/
+
+ SesGrp->ansi_foreground = OS2_FOREGROUND_BLUE;
+
+ } else if (AnsiParm == 5)
+ {
+ /* BLINK */
+ /*********/
+
+ SesGrp->ansi_blink |= 1;
+
+ } else if (AnsiParm == 6)
+ {
+ /* RAPID-BLINK */
+ /***************/
+
+ } else if (AnsiParm == 7)
+ {
+ /* REVERSE VIDEO */
+ /*****************/
+
+ // BLACK over WHITE
+
+ SesGrp->ansi_foreground = OS2_FOREGROUND_BLACK;
+ SesGrp->ansi_background = OS2_BACKGROUND_WHITE;
+
+ } else if (AnsiParm == 8)
+ {
+ /* CONCEALED */
+ /*************/
+
+ SesGrp->ansi_background = OS2_BACKGROUND_BLACK;
+ SesGrp->ansi_foreground = OS2_FOREGROUND_BLACK;
+ }
+
+ } else if (((AnsiParm >= 30) &&
+ (AnsiParm <= 37)) ||
+ ((AnsiParm >= 40) &&
+ (AnsiParm <= 47)))
+ {
+ /* FORE/BACKGROUND COLOR */
+ /*************************/
+
+ if (AnsiParm >= 40 )
+ {
+ SesGrp->ansi_background = (BYTE)( ColorTable[AnsiParm%10] << 4);
+ } else
+ {
+ SesGrp->ansi_foreground = (BYTE)ColorTable[AnsiParm%10];
+ }
+ }
+ }
+
+ NewAttr = SesGrp->ansi_background | SesGrp->ansi_foreground;
+ if ( SesGrp->ansi_bold )
+ {
+ NewAttr |= OS2_FOREGROUND_INTENSITY;
+ }
+ if ( SesGrp->ansi_blink )
+ {
+ NewAttr |= OS2_BACKGROUND_BLINKING;
+ }
+
+ if (LastAttr != NewAttr)
+ {
+ /* new attribute */
+
+ if(Ow2TtyFlushStr())
+ {
+ return(1);
+ }
+
+#ifdef DBCS
+// MSKK Jun.28.1992 KazuM
+ CommonAttr[0] = NewAttr;
+ CommonAttr[1] = CommonAttr[2] = 0;
+ if (!Or2WinSetConsoleTextAttribute(
+ #if DBG
+ Ow2TtySetAttrStr,
+ #endif
+ hConOut,
+ (WinAttr = MapOs2ToWinAttr(&CommonAttr[0]))))
+#else
+ if (!Or2WinSetConsoleTextAttribute(
+ #if DBG
+ Ow2TtySetAttrStr,
+ #endif
+ hConOut,
+ (WinAttr = MapOs2ToWinAttr(NewAttr))))
+#endif
+ {
+#if DBG
+ ASSERT1("OS2SES(trans-TTY): failed on SetTextAttribute\n", FALSE);
+#endif
+ return (1);
+ } else
+ {
+#if DBG
+ IF_OD2_DEBUG( VIO )
+ {
+ KdPrint(("Ow2TtySetAttr: New attr %x(win %x), Last %x(win %x)\n",
+ NewAttr, WinAttr, LastAttr, SesGrp->WinAttr));
+ }
+#endif
+ SesGrp->AnsiCellAttr[0] = NewAttr;
+ SesGrp->WinAttr = (USHORT)WinAttr;
+ }
+ }
+ return (NO_ERROR);
+}
+
+
+DWORD
+Ow2TtyFlushStr(
+ )
+/*++
+
+Routine Description:
+
+ This routine flush the TTY output string (from TTY_DEST_BUFFER)
+ to the console.
+
+Arguments:
+
+
+Return Value:
+
+ Should return 0.
+
+ 1 - for any error (after ASSERT), RetCode from GetLastError().
+
+Note:
+
+ Ow2TtyCoord - pointer to current screen coordinates after the
+ flush.
+
+ According to Ow2TtyNumBytes, which is reset.
+
+ hConOut is used for console handle.
+
+--*/
+{
+ DWORD NumWritten;
+
+ if ( Ow2TtyNumBytes )
+ {
+ if(!Or2WinWriteConsoleA(
+ #if DBG
+ Ow2TtyFlushStrStr,
+ #endif
+ hConOut,
+ (LPSTR)TTY_DEST_BUFFER,
+ Ow2TtyNumBytes,
+ &NumWritten,
+ NULL))
+ {
+#if DBG
+ ASSERT1("OS2SES(VIOTTY): flush string failed on WriteConsoleA", FALSE);
+#endif
+ return (1);
+ }
+
+#if DBG
+ if ( Ow2TtyNumBytes != NumWritten )
+ {
+ ASSERT1("OS2SES(VIOTTY): flush string partial data WriteConsoleA", FALSE);
+ //IF_OD2_DEBUG2( VIO, OS2_EXE )
+ //{
+ // KdPrint(("OS2SES(VIOTTY): flush string partial data WriteConsoleA from %u to %u\n",
+ // Ow2TtyNumBytes, NumWritten));
+ //}
+ }
+#endif
+
+ Ow2TtyNumBytes = 0;
+ Ow2VioUpdateCurPos(Ow2TtyCoord);
+ }
+
+ return (0L);
+}
+