Release 990226.
[wine/gsoc-2012-control.git] / include / msdos.h
blob052cffa8a6ea90ab0cf64c05f16148770862414c
1 #ifndef __WINE_MSDOS_H
2 #define __WINE_MSDOS_H
4 #include "winnt.h"
5 #include "comm.h"
7 struct fcb {
8 BYTE drive;
9 char name[8];
10 char extension[3];
11 BYTE dummy1[4];
12 int filesize;
13 WORD date_write;
14 WORD time_write;
15 struct dosdirent *directory;
16 BYTE dummy2[9];
19 /* DTA layout for FindFirst/FindNext */
20 typedef struct
22 BYTE drive; /* 00 drive letter */
23 char mask[11]; /* 01 search template */
24 BYTE search_attr; /* 0c search attributes */
25 WORD count WINE_PACKED; /* 0d entry count within directory */
26 WORD cluster WINE_PACKED; /* 0f cluster of parent directory */
27 char *unixPath WINE_PACKED; /* 11 unix path (was: reserved) */
28 BYTE fileattr; /* 15 file attributes */
29 WORD filetime; /* 16 file time */
30 WORD filedate; /* 18 file date */
31 DWORD filesize WINE_PACKED; /* 1a file size */
32 char filename[13]; /* 1e file name + extension */
33 } FINDFILE_DTA;
35 /* FCB layout for FindFirstFCB/FindNextFCB */
36 typedef struct
38 BYTE drive; /* 00 drive letter */
39 char filename[11]; /* 01 filename 8+3 format */
40 int count; /* 0c entry count (was: reserved) */
41 char *unixPath; /* 10 unix path (was: reserved) */
42 } FINDFILE_FCB;
44 /* DOS directory entry for FindFirstFCB/FindNextFCB */
45 typedef struct
47 char filename[11]; /* 00 filename 8+3 format */
48 BYTE fileattr; /* 0b file attributes */
49 BYTE reserved[10]; /* 0c reserved */
50 WORD filetime; /* 16 file time */
51 WORD filedate; /* 18 file date */
52 WORD cluster; /* 1a file first cluster */
53 DWORD filesize; /* 1c file size */
54 } DOS_DIRENTRY_LAYOUT;
56 typedef struct
58 WORD CX_Int21_5e01; /* contents of CX from INT 21/AX=5E01h */
59 WORD LRU_count_FCB_cache;
60 WORD LRU_count_FCB_open;
61 DWORD OEM_func_handler WINE_PACKED; /* OEM function of INT 21/AH=F8h */
62 WORD INT21_offset;/* offset in DOS CS of code to return from INT 21 call */
63 WORD sharing_retry_count;
64 WORD sharing_retry_delay;
65 DWORD ptr_disk_buf; /* ptr to current disk buf */
66 WORD offs_unread_CON; /* pointer in DOS data segment of unread CON input */
67 WORD seg_first_MCB;
68 DWORD ptr_first_DPB;
69 DWORD ptr_first_SysFileTable;
70 DWORD ptr_clock_dev_hdr;
71 DWORD ptr_CON_dev_hdr;
72 WORD max_byte_per_sec; /* maximum bytes per sector of any block device */
73 DWORD ptr_disk_buf_info WINE_PACKED;
74 DWORD ptr_array_CDS WINE_PACKED; /* current directory structure */
75 DWORD ptr_sys_FCB WINE_PACKED;
76 WORD nr_protect_FCB;
77 BYTE nr_block_dev;
78 BYTE nr_avail_drive_letters;
79 BYTE NUL_dev_header[18];
80 BYTE nr_drives_JOINed;
81 WORD ptr_spec_prg_names WINE_PACKED;
82 DWORD ptr_SETVER_prg_list WINE_PACKED;
83 WORD DOS_HIGH_A20_func_offs WINE_PACKED;
84 WORD PSP_last_exec WINE_PACKED; /* if DOS in HMA: PSP of program executed last; if DOS low: 0000h */
85 WORD BUFFERS_val WINE_PACKED;
86 WORD BUFFERS_nr_lookahead WINE_PACKED;
87 BYTE boot_drive WINE_PACKED;
88 BYTE flag_DWORD_moves WINE_PACKED; /* 01h for 386+, 00h otherwise */
89 WORD size_extended_mem WINE_PACKED; /* size of extended mem in KB */
90 } DOS_LISTOFLISTS;
92 #define MAX_DOS_DRIVES 26
94 extern struct DosDeviceStruct COM[MAX_PORTS];
95 extern struct DosDeviceStruct LPT[MAX_PORTS];
97 #define setword(a,b) do { *(BYTE*)(a) = (b) & 0xff; \
98 *((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\
99 } while(0)
102 /* dos file attributes */
104 #define FA_NORMAL 0x00 /* Normal file, no attributes */
105 #define FA_RDONLY 0x01 /* Read only attribute */
106 #define FA_HIDDEN 0x02 /* Hidden file */
107 #define FA_SYSTEM 0x04 /* System file */
108 #define FA_LABEL 0x08 /* Volume label */
109 #define FA_DIRECTORY 0x10 /* Directory */
110 #define FA_ARCHIVE 0x20 /* Archive */
111 #define FA_UNUSED 0x40 /* Unused */
113 /* Error codes */
115 #define ER_NoError 0x00
116 #define ER_InvalidFunction 0x01
117 #define ER_FileNotFound 0x02
118 #define ER_PathNotFound 0x03
119 #define ER_TooManyOpenFiles 0x04
120 #define ER_AccessDenied 0x05
121 #define ER_InvalidHandle 0x06
122 #define ER_MCBDestroyed 0x07
123 #define ER_OutOfMemory 0x08
124 #define ER_MCBInvalid 0x09
125 #define ER_EnvironInvalid 0x0a
126 #define ER_FormatInvalid 0x0b
127 #define ER_AccessCodeInvalid 0x0c
128 #define ER_DataInvalid 0x0d
129 #define ER_InvalidDrive 0x0f
130 #define ER_CanNotRemoveCwd 0x10
131 #define ER_NotSameDevice 0x11
132 #define ER_NoMoreFiles 0x12
133 #define ER_WriteProtected 0x13
134 #define ER_UnknownUnit 0x14
135 #define ER_DriveNotReady 0x15
136 #define ER_UnknownCommand 0x16
137 #define ER_CRCError 0x17
138 #define ER_BadRqLength 0x18
139 #define ER_SeekError 0x19
140 #define ER_UnknownMedia 0x1a
141 #define ER_SectorNotFound 0x1b
142 #define ER_OutOfPaper 0x1c
143 #define ER_WriteFault 0x1d
144 #define ER_ReadFault 0x1e
145 #define ER_GeneralFailure 0x1f
146 #define ER_ShareViolation 0x20
147 #define ER_LockViolation 0x21
148 #define ER_DiskFull 0x27
149 #define ER_NoNetwork 0x49
150 #define ER_FileExists 0x50
151 #define ER_CanNotMakeDir 0x52
153 /* Error classes */
155 #define EC_OutOfResource 0x01
156 #define EC_Temporary 0x02
157 #define EC_AccessDenied 0x03
158 #define EC_InternalError 0x04
159 #define EC_HardwareFailure 0x05
160 #define EC_SystemFailure 0x06
161 #define EC_ProgramError 0x07
162 #define EC_NotFound 0x08
163 #define EC_MediaError 0x0b
164 #define EC_Exists 0x0c
165 #define EC_Unknown 0x0d
167 /* Suggested actions */
169 #define SA_Retry 0x01
170 #define SA_DelayedRetry 0x02
171 #define SA_Abort 0x04
172 #define SA_Ignore 0x06
173 #define SA_Ask4Retry 0x07
175 /* Error locus */
177 #define EL_Unknown 0x01
178 #define EL_Disk 0x02
179 #define EL_Network 0x03
180 #define EL_Serial 0x04
181 #define EL_Memory 0x05
183 void WINAPI DOS3Call( CONTEXT *context );
185 #define DOSCONF_MEM_HIGH 0x0001
186 #define DOSCONF_MEM_UMB 0x0002
187 #define DOSCONF_NUMLOCK 0x0004
188 #define DOSCONF_KEYB_CONV 0x0008
190 typedef struct {
191 char lastdrive;
192 int brk_flag;
193 int files;
194 int stacks_nr;
195 int stacks_sz;
196 int buf;
197 int buf2;
198 int fcbs;
199 int flags;
200 char *shell;
201 char *country;
202 } DOSCONF;
204 extern DOSCONF DOSCONF_config;
206 #endif /* __WINE_MSDOS_H */