2013-06-17 00:00:36 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: GPL - See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Virtual DOS Machine
|
2015-09-18 17:01:49 +00:00
|
|
|
* FILE: subsystems/mvdm/ntvdm/ntvdm.h
|
2013-06-17 00:00:36 +00:00
|
|
|
* PURPOSE: Header file to define commonly used stuff
|
|
|
|
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
|
|
|
*/
|
|
|
|
|
2013-06-26 22:58:41 +00:00
|
|
|
#ifndef _NTVDM_H_
|
|
|
|
#define _NTVDM_H_
|
|
|
|
|
2021-11-25 21:39:56 +00:00
|
|
|
/* BUILD CONFIGURATION ********************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 may break PC-AT compatibility.
|
|
|
|
* USE AT YOUR OWN RISK! (disabled by default)
|
|
|
|
*/
|
|
|
|
// #define ADVANCED_DEBUGGING
|
|
|
|
|
|
|
|
#ifdef ADVANCED_DEBUGGING
|
|
|
|
#define ADVANCED_DEBUGGING_LEVEL 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2013-06-17 00:00:36 +00:00
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2014-05-02 22:23:34 +00:00
|
|
|
#include <wchar.h>
|
2013-10-27 14:17:34 +00:00
|
|
|
|
2021-11-27 20:03:55 +00:00
|
|
|
#ifndef _countof
|
|
|
|
#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
|
|
|
|
#endif
|
|
|
|
|
2021-11-26 19:13:58 +00:00
|
|
|
/* String widening macro */
|
|
|
|
#define __L(x) L ## x
|
|
|
|
#define _L(x) __L(x)
|
|
|
|
#define L(x) _L(x)
|
|
|
|
|
2015-04-19 00:01:03 +00:00
|
|
|
/* PSDK/NDK Headers */
|
2013-11-03 20:31:19 +00:00
|
|
|
#define WIN32_NO_STATUS
|
2013-11-16 23:11:54 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <wingdi.h>
|
|
|
|
#include <wincon.h>
|
|
|
|
#include <winnls.h>
|
2013-12-23 18:17:29 +00:00
|
|
|
#include <winreg.h>
|
2013-11-16 23:11:54 +00:00
|
|
|
#include <winuser.h>
|
2015-09-27 15:24:26 +00:00
|
|
|
#include <commdlg.h>
|
|
|
|
|
2014-04-08 00:28:49 +00:00
|
|
|
#include <subsys/win/vdm.h>
|
2013-10-27 14:17:34 +00:00
|
|
|
|
2015-05-11 23:04:24 +00:00
|
|
|
// Do not include stuff that is only defined
|
|
|
|
// for backwards compatibility in nt_vdd.h
|
|
|
|
#define NO_NTVDD_COMPAT
|
2013-12-24 15:30:59 +00:00
|
|
|
#include <vddsvc.h>
|
2013-12-23 18:17:29 +00:00
|
|
|
|
2014-05-11 19:25:09 +00:00
|
|
|
DWORD WINAPI SetLastConsoleEventActive(VOID);
|
|
|
|
|
2015-04-19 00:01:03 +00:00
|
|
|
#define NTOS_MODE_USER
|
2021-11-25 21:39:56 +00:00
|
|
|
#include <ndk/kefuncs.h> // For NtQueryPerformanceCounter()
|
2015-04-19 00:01:03 +00:00
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
|
|
|
|
/* PSEH for SEH Support */
|
|
|
|
#include <pseh/pseh2.h>
|
|
|
|
|
2021-11-27 20:03:55 +00:00
|
|
|
#include <ntstrsafe.h>
|
|
|
|
|
2015-09-28 01:36:31 +00:00
|
|
|
|
|
|
|
/* VARIABLES ******************************************************************/
|
|
|
|
|
|
|
|
typedef struct _NTVDM_SETTINGS
|
|
|
|
{
|
|
|
|
ANSI_STRING BiosFileName;
|
|
|
|
ANSI_STRING RomFiles;
|
2015-11-07 20:19:32 +00:00
|
|
|
UNICODE_STRING FloppyDisks[2];
|
|
|
|
UNICODE_STRING HardDisks[4];
|
2015-09-28 01:36:31 +00:00
|
|
|
} NTVDM_SETTINGS, *PNTVDM_SETTINGS;
|
|
|
|
|
|
|
|
extern NTVDM_SETTINGS GlobalSettings;
|
2013-06-17 00:00:36 +00:00
|
|
|
|
2014-10-04 13:36:17 +00:00
|
|
|
// Command line of NTVDM
|
|
|
|
extern INT NtVdmArgc;
|
|
|
|
extern WCHAR** NtVdmArgv;
|
|
|
|
|
2021-11-27 20:03:55 +00:00
|
|
|
/* Full directory where NTVDM resides, or the SystemRoot\System32 path */
|
|
|
|
extern WCHAR NtVdmPath[MAX_PATH];
|
|
|
|
extern ULONG NtVdmPathSize; // Length without NULL terminator.
|
|
|
|
|
2015-09-27 15:24:26 +00:00
|
|
|
extern HWND hConsoleWnd;
|
|
|
|
|
2014-10-04 13:36:17 +00:00
|
|
|
|
2015-09-28 01:36:31 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2014-09-16 00:51:15 +00:00
|
|
|
/*
|
|
|
|
* Interface functions
|
|
|
|
*/
|
2015-10-01 00:09:24 +00:00
|
|
|
typedef VOID (*CHAR_PRINT)(IN CHAR Character);
|
2015-07-13 01:21:46 +00:00
|
|
|
VOID DisplayMessage(IN LPCWSTR Format, ...);
|
2015-10-01 00:09:24 +00:00
|
|
|
VOID PrintMessageAnsi(IN CHAR_PRINT CharPrint,
|
|
|
|
IN LPCSTR Format, ...);
|
2013-06-26 22:58:41 +00:00
|
|
|
|
2015-10-03 02:36:35 +00:00
|
|
|
/*static*/ VOID
|
|
|
|
UpdateVdmMenuDisks(VOID);
|
2014-09-14 00:43:43 +00:00
|
|
|
|
2015-03-31 21:28:40 +00:00
|
|
|
BOOL ConsoleAttach(VOID);
|
|
|
|
VOID ConsoleDetach(VOID);
|
2015-10-03 15:06:24 +00:00
|
|
|
VOID ConsoleReattach(HANDLE ConOutHandle);
|
2017-12-23 22:56:04 +00:00
|
|
|
BOOL IsConsoleHandle(HANDLE hHandle);
|
2014-09-16 00:51:15 +00:00
|
|
|
VOID MenuEventHandler(PMENU_EVENT_RECORD MenuEvent);
|
|
|
|
VOID FocusEventHandler(PFOCUS_EVENT_RECORD FocusEvent);
|
|
|
|
|
2015-10-04 11:49:28 +00:00
|
|
|
#endif // _NTVDM_H_
|
|
|
|
|
|
|
|
/* EOF */
|