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>
9 /* DEFINES ********************************************************************/
11 #define FILE_INFO_STDIN (1 << 0)
12 #define FILE_INFO_STDOUT (1 << 1)
13 #define FILE_INFO_BINARY (1 << 5)
14 #define FILE_INFO_DEVICE (1 << 7)
18 #if 0 // Real DOS-5 SFT entry, for reference only
19 typedef struct _DOS_FILE_DESCRIPTOR_DOS5
21 WORD RefCount
; // 0x00
22 WORD OpenMode
; // 0x02
23 BYTE Attributes
; // 0x04
24 WORD DeviceInfo
; // 0x05
25 DWORD DevicePointer
; // 0x07
26 WORD StartCluster
; // 0x0b
30 DWORD Position
; // 0x15
31 BYTE Reserved0
[7]; // 0x19
32 CHAR FileName
[11]; // 0x20
33 BYTE Reserved1
[6]; // 0x2b
34 WORD OwnerPsp
; // 0x31
35 BYTE Reserved2
[8]; // 0x33
36 } DOS_FILE_DESCRIPTOR_DOS5
, *PDOS_FILE_DESCRIPTOR_DOS5
;
38 C_ASSERT(sizeof(DOS_FILE_DESCRIPTOR_DOS5
) == 0x3B);
41 // Modified DOS SFT entry, compatible for NTVDM only
42 typedef struct _DOS_FILE_DESCRIPTOR
57 BYTE Padding
[0x13 - sizeof(HANDLE
)];
58 } DOS_FILE_DESCRIPTOR
, *PDOS_FILE_DESCRIPTOR
;
60 C_ASSERT(sizeof(DOS_FILE_DESCRIPTOR
) == 0x3B);
62 typedef struct _DOS_SFT
66 DOS_FILE_DESCRIPTOR FileDescriptors
[ANYSIZE_ARRAY
];
69 /* FUNCTIONS ******************************************************************/
71 BYTE
DosFindFreeDescriptor(VOID
);
72 BYTE
DosFindWin32Descriptor(HANDLE Win32Handle
);
73 BYTE
DosFindDeviceDescriptor(DWORD DevicePointer
);
74 PDOS_FILE_DESCRIPTOR
DosGetFileDescriptor(BYTE Id
);
75 PDOS_FILE_DESCRIPTOR
DosGetHandleFileDescriptor(WORD DosHandle
);
80 LPWORD CreationStatus
,
82 BYTE AccessShareModes
,
83 WORD CreateActionFlags
,
91 DWORD CreationDisposition
,
126 BYTE
DosReadLineBuffered(WORD FileHandle
, DWORD Buffer
, BYTE MaxSize
);
127 BOOL
DosFlushFileBuffers(WORD FileHandle
);
128 BOOLEAN
DosLockFile(WORD DosHandle
, DWORD Offset
, DWORD Size
);
129 BOOLEAN
DosUnlockFile(WORD DosHandle
, DWORD Offset
, DWORD Size
);
131 BOOLEAN DosDeviceIoControl