ReactOS 0.4.16-dev-250-g3ecd236
dem.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/dos/dem.h
5 * PURPOSE: DOS 32-bit Emulation Support Library -
6 * This library is used by the built-in NTVDM DOS32 and by
7 * the NT 16-bit DOS in Windows (via BOPs). It also exposes
8 * exported functions that can be used by VDDs.
9 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
10 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
11 */
12
13#ifndef _DEM_H_
14#define _DEM_H_
15
16/* INCLUDES *******************************************************************/
17
18#include <crt/dos.h> // For _A_NORMAL etc.
19#include "dos32krnl/dos.h"
20
21/* DEFINES ********************************************************************/
22
23/* BOP Identifiers */
24#define BOP_LOAD_DOS 0x2B // DOS Loading and Initializing BOP. In parameter (following bytes) we take a NULL-terminated string indicating the name of the DOS kernel file.
25#define BOP_START_DOS 0x2C // DOS Starting BOP. In parameter (following bytes) we take a NULL-terminated string indicating the name of the DOS kernel file.
26#define BOP_DOS 0x50 // DOS System BOP (for NTIO.SYS and NTDOS.SYS)
27#define BOP_CMD 0x54 // DOS Command Interpreter BOP (for COMMAND.COM)
28
29/* VARIABLES ******************************************************************/
30
31/* FUNCTIONS ******************************************************************/
32
33VOID Dem_BiosCharPrint(CHAR Character);
34#define BiosDisplayMessage(Format, ...) \
35 PrintMessageAnsi(Dem_BiosCharPrint, (Format), ##__VA_ARGS__)
36
37VOID DosCharPrint(CHAR Character);
38#define DosDisplayMessage(Format, ...) \
39 PrintMessageAnsi(DosCharPrint, (Format), ##__VA_ARGS__)
40
41
42BOOLEAN DosShutdown(BOOLEAN Immediate);
43
44DWORD DosStartProcess32(IN LPCSTR ExecutablePath,
45 IN LPCSTR CommandLine,
47 IN DWORD ReturnAddress OPTIONAL,
48 IN BOOLEAN StartComSpec);
49
53(
57);
58
62(
64);
65
69#define FA_NORMAL _A_NORMAL // 0x0000
70#define FA_READONLY _A_RDONLY // 0x0001 // FILE_ATTRIBUTE_READONLY
71#define FA_HIDDEN _A_HIDDEN // 0x0002 // FILE_ATTRIBUTE_HIDDEN
72#define FA_SYSTEM _A_SYSTEM // 0x0004 // FILE_ATTRIBUTE_SYSTEM
73#define FA_VOLID _A_VOLID // 0x0008
74#define FA_LABEL FA_VOLID
75#define FA_DIRECTORY _A_SUBDIR // 0x0010 // FILE_ATTRIBUTE_DIRECTORY
76#define FA_ARCHIVE _A_ARCH // 0x0020 // FILE_ATTRIBUTE_ARCHIVE
77#define FA_DEVICE 0x0040 // FILE_ATTRIBUTE_DEVICE
78
79#define FA_VALID (FA_ARCHIVE | FA_DIRECTORY | FA_SYSTEM | FA_HIDDEN | FA_READONLY | FA_NORMAL)
80
82#define NT_TO_DOS_FA(Attrs) \
83 ( ((Attrs) == FILE_ATTRIBUTE_NORMAL) ? FA_NORMAL : (LOBYTE(Attrs) & FA_VALID) )
84
88 _Out_ PVOID pFindFileData,
90 _In_ WORD AttribMask);
91
95 _Inout_ PVOID pFindFileData);
96
100(
101 IN UCHAR DriveNumber
102);
103
104BOOL
105WINAPI
107(
108 IN LPCSTR Path,
110);
111
112DWORD
113WINAPI
115(
117 OUT PUCHAR DriveNumber
118);
119
120#endif // _DEM_H_
121
122/* EOF */
unsigned char BOOLEAN
PRTL_UNICODE_STRING_BUFFER Path
WCHAR CurrentDirectory[1024]
Definition: chkdsk.c:74
DWORD WINAPI demFileFindFirst(_Out_ PVOID pFindFileData, _In_ PCSTR FileName, _In_ WORD AttribMask)
Definition: dem.c:1515
BOOLEAN DosShutdown(BOOLEAN Immediate)
Definition: dem.c:1331
DWORD WINAPI demFileFindNext(_Inout_ PVOID pFindFileData)
Definition: dem.c:1592
UCHAR WINAPI demGetPhysicalDriveType(IN UCHAR DriveNumber)
Definition: dem.c:1634
BOOL WINAPI demIsShortPathName(IN LPCSTR Path, IN BOOL Unknown)
Definition: dem.c:1642
DWORD WINAPI demFileDelete(IN LPCSTR FileName)
Definition: dem.c:1402
VOID Dem_BiosCharPrint(CHAR Character)
Definition: dem.c:57
DWORD DosStartProcess32(IN LPCSTR ExecutablePath, IN LPCSTR CommandLine, IN LPCSTR Environment OPTIONAL, IN DWORD ReturnAddress OPTIONAL, IN BOOLEAN StartComSpec)
Definition: dem.c:916
VOID DosCharPrint(CHAR Character)
Definition: dem.c:82
DWORD WINAPI demSetCurrentDirectoryGetDrive(IN LPCSTR CurrentDirectory, OUT PUCHAR DriveNumber)
Definition: dem.c:1651
DWORD WINAPI demClientErrorEx(IN HANDLE FileHandle, IN CHAR Unknown, IN BOOL Flag)
Definition: dem.c:1392
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
@ Unknown
Definition: i8042prt.h:114
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:47
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: xml2sdb.h:80
const char * PCSTR
Definition: typedefs.h:52
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
#define OUT
Definition: typedefs.h:40
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175