ReactOS  0.4.15-dev-5488-ge316d61
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 
33 VOID Dem_BiosCharPrint(CHAR Character);
34 #define BiosDisplayMessage(Format, ...) \
35  PrintMessageAnsi(Dem_BiosCharPrint, (Format), ##__VA_ARGS__)
36 
37 VOID DosCharPrint(CHAR Character);
38 #define DosDisplayMessage(Format, ...) \
39  PrintMessageAnsi(DosCharPrint, (Format), ##__VA_ARGS__)
40 
41 
42 BOOLEAN DosShutdown(BOOLEAN Immediate);
43 
44 DWORD DosStartProcess32(IN LPCSTR ExecutablePath,
45  IN LPCSTR CommandLine,
47  IN DWORD ReturnAddress OPTIONAL,
48  IN BOOLEAN StartComSpec);
49 
50 DWORD
51 WINAPI
53 (
55  IN CHAR Unknown,
56  IN BOOL Flag
57 );
58 
59 DWORD
60 WINAPI
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 
85 DWORD
86 WINAPI
88  _Out_ PVOID pFindFileData,
90  _In_ WORD AttribMask);
91 
92 DWORD
93 WINAPI
95  _Inout_ PVOID pFindFileData);
96 
97 UCHAR
98 WINAPI
100 (
101  IN UCHAR DriveNumber
102 );
103 
104 BOOL
105 WINAPI
107 (
108  IN LPCSTR Path,
109  IN BOOL Unknown
110 );
111 
112 DWORD
113 WINAPI
115 (
117  OUT PUCHAR DriveNumber
118 );
119 
120 #endif // _DEM_H_
121 
122 /* EOF */
UCHAR WINAPI demGetPhysicalDriveType(IN UCHAR DriveNumber)
Definition: dem.c:1634
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:47
#define IN
Definition: typedefs.h:39
VOID Dem_BiosCharPrint(CHAR Character)
Definition: dem.c:57
#define _Inout_
Definition: ms_sal.h:378
#define _Out_
Definition: ms_sal.h:345
WCHAR CurrentDirectory[1024]
Definition: chkdsk.c:74
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
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 char BOOLEAN
#define _In_
Definition: ms_sal.h:308
const char * LPCSTR
Definition: xmlstorage.h:183
#define WINAPI
Definition: msvc.h:6
Definition: xml2sdb.h:79
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOLEAN DosShutdown(BOOLEAN Immediate)
Definition: dem.c:1331
DWORD WINAPI demFileDelete(IN LPCSTR FileName)
Definition: dem.c:1402
unsigned char UCHAR
Definition: xmlstorage.h:181
DWORD WINAPI demFileFindNext(_Inout_ PVOID pFindFileData)
Definition: dem.c:1592
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1230
DWORD WINAPI demFileFindFirst(_Out_ PVOID pFindFileData, _In_ PCSTR FileName, _In_ WORD AttribMask)
Definition: dem.c:1515
PRTL_UNICODE_STRING_BUFFER Path
#define OUT
Definition: typedefs.h:40
DWORD DosStartProcess32(IN LPCSTR ExecutablePath, IN LPCSTR CommandLine, IN LPCSTR Environment OPTIONAL, IN DWORD ReturnAddress OPTIONAL, IN BOOLEAN StartComSpec)
Definition: dem.c:916
const char * PCSTR
Definition: typedefs.h:52
BOOL WINAPI demIsShortPathName(IN LPCSTR Path, IN BOOL Unknown)
Definition: dem.c:1642
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68