ReactOS 0.4.15-dev-7906-g1b85a5f
dosfiles.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/dos32krnl/dosfiles.h
5 * PURPOSE: DOS32 Files Support
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9#pragma once
10
11/* DEFINES ********************************************************************/
12
13#define FILE_INFO_STDIN (1 << 0)
14#define FILE_INFO_STDOUT (1 << 1)
15#define FILE_INFO_BINARY (1 << 5)
16#define FILE_INFO_DEVICE (1 << 7)
17
18#pragma pack(push, 1)
19
20#if 0 // Real DOS-5 SFT entry, for reference only
21typedef struct _DOS_FILE_DESCRIPTOR_DOS5
22{
23 WORD RefCount; // 0x00
24 WORD OpenMode; // 0x02
25 BYTE Attributes; // 0x04
26 WORD DeviceInfo; // 0x05
27 DWORD DevicePointer; // 0x07
28 WORD StartCluster; // 0x0b
29 WORD Time; // 0x0d
30 WORD Date; // 0x0f
31 DWORD Size; // 0x11
32 DWORD Position; // 0x15
33 BYTE Reserved0[7]; // 0x19
34 CHAR FileName[11]; // 0x20
35 BYTE Reserved1[6]; // 0x2b
36 WORD OwnerPsp; // 0x31
37 BYTE Reserved2[8]; // 0x33
38} DOS_FILE_DESCRIPTOR_DOS5, *PDOS_FILE_DESCRIPTOR_DOS5;
39
40C_ASSERT(sizeof(DOS_FILE_DESCRIPTOR_DOS5) == 0x3B);
41#endif
42
43// Modified DOS SFT entry, compatible for NTVDM only
45{
59 BYTE Padding[0x13 - sizeof(HANDLE)];
61
63
64typedef struct _DOS_SFT
65{
70
71/* FUNCTIONS ******************************************************************/
72
78
80(
82 LPWORD CreationStatus,
84 BYTE AccessShareModes,
85 WORD CreateActionFlags,
87);
88
90(
93 DWORD CreationDisposition,
95);
96
98(
101 BYTE AccessShareModes
102);
103
105(
108 WORD Count,
110);
111
113(
116 WORD Count,
118);
119
121(
123 LONG Offset,
124 BYTE Origin,
125 LPDWORD NewOffset
126);
127
132
134(
139);
140
141#pragma pack(pop)
DWORD Id
PCWSTR FilePath
unsigned char BOOLEAN
@ Reserved2
Definition: bcd.h:202
@ Reserved1
Definition: bcd.h:201
Definition: bufpool.h:45
WORD DosReadFile(WORD FileHandle, DWORD Buffer, WORD Count, LPWORD BytesRead)
Definition: dosfiles.c:768
struct _DOS_SFT DOS_SFT
PDOS_FILE_DESCRIPTOR DosGetHandleFileDescriptor(WORD DosHandle)
Definition: dosfiles.c:173
WORD DosOpenFile(LPWORD Handle, LPCSTR FilePath, BYTE AccessShareModes)
Definition: dosfiles.c:521
WORD DosCreateFileEx(LPWORD Handle, LPWORD CreationStatus, LPCSTR FilePath, BYTE AccessShareModes, WORD CreateActionFlags, WORD Attributes)
Definition: dosfiles.c:181
WORD DosCreateFile(LPWORD Handle, LPCSTR FilePath, DWORD CreationDisposition, WORD Attributes)
Definition: dosfiles.c:442
BYTE DosReadLineBuffered(WORD FileHandle, DWORD Buffer, BYTE MaxSize)
Definition: dosfiles.c:674
struct _DOS_SFT * PDOS_SFT
BYTE DosFindWin32Descriptor(HANDLE Win32Handle)
Definition: dosfiles.c:93
struct _DOS_FILE_DESCRIPTOR DOS_FILE_DESCRIPTOR
PDOS_FILE_DESCRIPTOR DosGetFileDescriptor(BYTE Id)
Definition: dosfiles.c:153
BOOLEAN DosUnlockFile(WORD DosHandle, DWORD Offset, DWORD Size)
Definition: dosfiles.c:1105
BOOL DosFlushFileBuffers(WORD FileHandle)
Definition: dosfiles.c:1056
WORD DosSeekFile(WORD FileHandle, LONG Offset, BYTE Origin, LPDWORD NewOffset)
Definition: dosfiles.c:1001
BOOLEAN DosLockFile(WORD DosHandle, DWORD Offset, DWORD Size)
Definition: dosfiles.c:1082
BYTE DosFindFreeDescriptor(VOID)
Definition: dosfiles.c:69
WORD DosWriteFile(WORD FileHandle, DWORD Buffer, WORD Count, LPWORD BytesWritten)
Definition: dosfiles.c:915
BYTE DosFindDeviceDescriptor(DWORD DevicePointer)
Definition: dosfiles.c:123
BOOLEAN DosDeviceIoControl(WORD FileHandle, BYTE ControlCode, DWORD Buffer, PWORD Length)
Definition: dosfiles.c:1185
struct _DOS_FILE_DESCRIPTOR * PDOS_FILE_DESCRIPTOR
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
ULONG Handle
Definition: gdb_input.c:15
#define C_ASSERT(e)
Definition: intsafe.h:73
static PLARGE_INTEGER Time
Definition: time.c:105
int Count
Definition: noreturn.cpp:7
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
WORD * PWORD
Definition: pedump.c:67
long LONG
Definition: pedump.c:60
BYTE Padding[0x13 - sizeof(HANDLE)]
Definition: dosfiles.h:59
WORD NumDescriptors
Definition: dosfiles.h:67
DOS_FILE_DESCRIPTOR FileDescriptors[ANYSIZE_ARRAY]
Definition: dosfiles.h:68
DWORD Link
Definition: dosfiles.h:66
static COORD Position
Definition: mouse.c:34
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
uint16_t * LPWORD
Definition: typedefs.h:56
PVOID HANDLE
Definition: typedefs.h:73
uint32_t * LPDWORD
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:870
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
const char * LPCSTR
Definition: xmlstorage.h:183
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193