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>
11 /* DEFINES ********************************************************************/
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)
20 #if 0 // Real DOS-5 SFT entry, for reference only
21 typedef struct _DOS_FILE_DESCRIPTOR_DOS5
23 WORD RefCount
; // 0x00
24 WORD OpenMode
; // 0x02
25 BYTE Attributes
; // 0x04
26 WORD DeviceInfo
; // 0x05
27 DWORD DevicePointer
; // 0x07
28 WORD StartCluster
; // 0x0b
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
;
40 C_ASSERT(sizeof(DOS_FILE_DESCRIPTOR_DOS5
) == 0x3B);
43 // Modified DOS SFT entry, compatible for NTVDM only
44 typedef struct _DOS_FILE_DESCRIPTOR
59 BYTE Padding
[0x13 - sizeof(HANDLE
)];
60 } DOS_FILE_DESCRIPTOR
, *PDOS_FILE_DESCRIPTOR
;
62 C_ASSERT(sizeof(DOS_FILE_DESCRIPTOR
) == 0x3B);
64 typedef struct _DOS_SFT
68 DOS_FILE_DESCRIPTOR FileDescriptors
[ANYSIZE_ARRAY
];
71 /* FUNCTIONS ******************************************************************/
73 BYTE
DosFindFreeDescriptor(VOID
);
74 BYTE
DosFindWin32Descriptor(HANDLE Win32Handle
);
75 BYTE
DosFindDeviceDescriptor(DWORD DevicePointer
);
76 PDOS_FILE_DESCRIPTOR
DosGetFileDescriptor(BYTE Id
);
77 PDOS_FILE_DESCRIPTOR
DosGetHandleFileDescriptor(WORD DosHandle
);
82 LPWORD CreationStatus
,
84 BYTE AccessShareModes
,
85 WORD CreateActionFlags
,
93 DWORD CreationDisposition
,
101 BYTE AccessShareModes
128 BYTE
DosReadLineBuffered(WORD FileHandle
, DWORD Buffer
, BYTE MaxSize
);
129 BOOL
DosFlushFileBuffers(WORD FileHandle
);
130 BOOLEAN
DosLockFile(WORD DosHandle
, DWORD Offset
, DWORD Size
);
131 BOOLEAN
DosUnlockFile(WORD DosHandle
, DWORD Offset
, DWORD Size
);
133 BOOLEAN DosDeviceIoControl