reactos/subsystems/mvdm/ntvdm/ntvdm.h

114 lines
2.6 KiB
C
Raw Normal View History

/*
* COPYRIGHT: GPL - See COPYING in the top level directory
* PROJECT: ReactOS Virtual DOS Machine
* FILE: subsystems/mvdm/ntvdm/ntvdm.h
* PURPOSE: Header file to define commonly used stuff
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
*/
#ifndef _NTVDM_H_
#define _NTVDM_H_
/* INCLUDES *******************************************************************/
#include <stdio.h>
#include <stdarg.h>
#include <wchar.h>
/* PSDK/NDK Headers */
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <wincon.h>
#include <winnls.h>
#include <winreg.h>
#include <winuser.h>
#include <commdlg.h>
#include <subsys/win/vdm.h>
// Do not include stuff that is only defined
// for backwards compatibility in nt_vdd.h
#define NO_NTVDD_COMPAT
#include <vddsvc.h>
DWORD WINAPI SetLastConsoleEventActive(VOID);
#define NTOS_MODE_USER
#include <ndk/kefuncs.h>
#include <ndk/mmfuncs.h>
#include <ndk/obfuncs.h>
#include <ndk/rtlfuncs.h>
#include <ndk/rtltypes.h>
/* PSEH for SEH Support */
#include <pseh/pseh2.h>
/*
* Activate this line if you want to run NTVDM in standalone mode with:
* ntvdm.exe <program>
*/
// #define STANDALONE
/*
* Activate this line for Win2k compliancy
*/
// #define WIN2K_COMPLIANT
/*
* Activate this line if you want advanced hardcoded debug facilities
* (called interrupts, etc...), that break PC-AT compatibility.
* USE AT YOUR OWN RISK! (disabled by default)
*/
// #define ADVANCED_DEBUGGING
[NTVDM] - Add some level of "Advanced debugging" (see ntvdm.h) which one can adjust to enable/disable debugging features inside NTVDM (this can be useful as long as NTVDM is under heavy bugfixing. When it will be more perfect, this stuff will be removed). - Add the possibility to load option ROMs at a given segment. Currently their list should be specified from inside ntvdm.c (in the BiosInitialize call), but I plan to make it available from a registry option (or via command-line for NTVDM-standalone mode). - Start to separate the initialization of "static" BIOS data (stuff that lives in ROM space) and initialization of "dynamic" BIOS data (eg. initializing the interrupt vector table, the BIOS data area at segment 40h, ...) so that we may be able to reuse part of our code to be able to more-or-less run external (16-bit) BIOSes, or the Windows NTVDM BIOS that uses BOPs to run some of its stuff in ntvdm in 32-bit (as we do for our 32-bit BIOS, except that *all* of our bios is 32-bit, not just some parts). Also, some file reorganization will be in order there soon... - Add video BIOS version information in memory so that tools such as Microsoft Diagnostics can correctly recognize our video BIOS (btw, we try to emulate the functionality of Cirrus' CL-GD5434). - Correctly put video BIOS ROM header (+ checksum) in memory so that it is recognized as such by diagnostics tools. - During BIOS POST, scan for ROMs starting segment 0xC000 (where video ROMs reside). - Store statically the BIOS configuration table. - Fix INT 16h, AH=12h "Get extended shift states" so that it correctly returns the state of right Ctrl and Alt keys. - Fix bit-setting state; report that our keyboard is 101/102 enhanced keyboard. - Correctly set the error return values (AH=86h and CF set) when a function of INT 15h is unsupported. - Implement INT 15h, AH=C9h "Get CPU Type and Mask Revision"; INT 1Ah, AH=02h "Get Real-Time Clock Time" and Ah=04h "Get Real-Time Clock Date" by reading the CMOS. - Implement CMOS century register support. svn path=/trunk/; revision=68598
2015-08-04 20:17:05 +00:00
#ifdef ADVANCED_DEBUGGING
#define ADVANCED_DEBUGGING_LEVEL 1
#endif
2018-02-11 23:38:10 +00:00
#define NULL32 0
/* VARIABLES ******************************************************************/
typedef struct _NTVDM_SETTINGS
{
ANSI_STRING BiosFileName;
ANSI_STRING RomFiles;
UNICODE_STRING FloppyDisks[2];
UNICODE_STRING HardDisks[4];
} NTVDM_SETTINGS, *PNTVDM_SETTINGS;
extern NTVDM_SETTINGS GlobalSettings;
// Command line of NTVDM
extern INT NtVdmArgc;
extern WCHAR** NtVdmArgv;
extern HWND hConsoleWnd;
/* FUNCTIONS ******************************************************************/
/*
* Interface functions
*/
typedef VOID (*CHAR_PRINT)(IN CHAR Character);
VOID DisplayMessage(IN LPCWSTR Format, ...);
VOID PrintMessageAnsi(IN CHAR_PRINT CharPrint,
IN LPCSTR Format, ...);
/*static*/ VOID
UpdateVdmMenuDisks(VOID);
BOOL ConsoleAttach(VOID);
VOID ConsoleDetach(VOID);
VOID ConsoleReattach(HANDLE ConOutHandle);
BOOL IsConsoleHandle(HANDLE hHandle);
VOID MenuEventHandler(PMENU_EVENT_RECORD MenuEvent);
VOID FocusEventHandler(PFOCUS_EVENT_RECORD FocusEvent);
#endif // _NTVDM_H_
/* EOF */