Release 960314
[wine.git] / include / msdos.h
blob094c680cb6f8c16952c3ccc463cea3f3b1c6a321
1 #ifndef __MSDOS_H
2 #define __MSDOS_H
4 #include <dirent.h>
5 #include <windows.h>
6 #include "comm.h"
8 struct fcb {
9 BYTE drive;
10 char name[8];
11 char extension[3];
12 BYTE dummy1[4];
13 int filesize;
14 WORD date_write;
15 WORD time_write;
16 struct dosdirent *directory;
17 BYTE dummy2[9];
20 /* DTA layout for FindFirst/FindNext */
21 typedef struct
23 BYTE drive; /* 00 drive letter */
24 char mask[11]; /* 01 search template */
25 BYTE search_attr; /* 0c search attributes */
26 WORD count WINE_PACKED; /* 0d entry count within directory */
27 WORD cluster WINE_PACKED; /* 0f cluster of parent directory */
28 char *unixPath WINE_PACKED; /* 11 unix path (was: reserved) */
29 BYTE fileattr; /* 15 file attributes */
30 WORD filetime; /* 16 file time */
31 WORD filedate; /* 18 file date */
32 DWORD filesize WINE_PACKED; /* 1a file size */
33 char filename[13]; /* 1e file name + extension */
34 } FINDFILE_DTA;
36 /* FCB layout for FindFirstFCB/FindNextFCB */
37 typedef struct
39 BYTE drive; /* 00 drive letter */
40 char filename[11]; /* 01 filename 8+3 format */
41 int count; /* 0c entry count (was: reserved) */
42 char *unixPath; /* 10 unix path (was: reserved) */
43 } FINDFILE_FCB;
45 /* DOS directory entry for FindFirstFCB/FindNextFCB */
46 typedef struct
48 char filename[11]; /* 00 filename 8+3 format */
49 BYTE fileattr; /* 0b file attributes */
50 BYTE reserved[10]; /* 0c reserved */
51 WORD filetime; /* 16 file time */
52 WORD filedate; /* 18 file date */
53 WORD cluster; /* 1a file first cluster */
54 DWORD filesize; /* 1c file size */
55 } DOS_DIRENTRY_LAYOUT;
57 #define DOSVERSION 0x1606 /* Major version in low byte: DOS 6.22 */
58 #define WINDOSVER 0x0616 /* Windows reports the DOS version reversed */
59 #define WINVERSION 0x0a03 /* Windows version 3.10 */
61 #define MAX_DOS_DRIVES 26
63 extern struct DosDeviceStruct COM[MAX_PORTS];
64 extern struct DosDeviceStruct LPT[MAX_PORTS];
66 #define setword(a,b) do { *(BYTE*)(a) = (b) & 0xff; \
67 *((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\
68 } while(0)
71 /* dos file attributes */
73 #define FA_NORMAL 0x00 /* Normal file, no attributes */
74 #define FA_RDONLY 0x01 /* Read only attribute */
75 #define FA_HIDDEN 0x02 /* Hidden file */
76 #define FA_SYSTEM 0x04 /* System file */
77 #define FA_LABEL 0x08 /* Volume label */
78 #define FA_DIRECTORY 0x10 /* Directory */
79 #define FA_ARCHIVE 0x20 /* Archive */
80 #define FA_UNUSED 0x40 /* Unused */
83 extern WORD DOS_ExtendedError;
84 extern BYTE DOS_ErrorClass, DOS_ErrorAction, DOS_ErrorLocus;
86 #define DOS_ERROR(err,class,action,locus) \
87 ( DOS_ErrorClass = (class), DOS_ErrorAction = (action), \
88 DOS_ErrorLocus = (locus), DOS_ExtendedError = (err) )
90 /* Error codes */
92 #define ER_NoError 0x00
93 #define ER_InvalidFunction 0x01
94 #define ER_FileNotFound 0x02
95 #define ER_PathNotFound 0x03
96 #define ER_TooManyOpenFiles 0x04
97 #define ER_AccessDenied 0x05
98 #define ER_InvalidHandle 0x06
99 #define ER_MCBDestroyed 0x07
100 #define ER_OutOfMemory 0x08
101 #define ER_MCBInvalid 0x09
102 #define ER_EnvironInvalid 0x0a
103 #define ER_FormatInvalid 0x0b
104 #define ER_AccessCodeInvalid 0x0c
105 #define ER_DataInvalid 0x0d
106 #define ER_InvalidDrive 0x0f
107 #define ER_CanNotRemoveCwd 0x10
108 #define ER_NotSameDevice 0x11
109 #define ER_NoMoreFiles 0x12
110 #define ER_WriteProtected 0x13
111 #define ER_UnknownUnit 0x14
112 #define ER_DriveNotReady 0x15
113 #define ER_UnknownCommand 0x16
114 #define ER_CRCError 0x17
115 #define ER_BadRqLength 0x18
116 #define ER_SeekError 0x19
117 #define ER_UnknownMedia 0x1a
118 #define ER_SectorNotFound 0x1b
119 #define ER_OutOfPaper 0x1c
120 #define ER_WriteFault 0x1d
121 #define ER_ReadFault 0x1e
122 #define ER_GeneralFailure 0x1f
123 #define ER_ShareViolation 0x20
124 #define ER_LockViolation 0x21
125 #define ER_DiskFull 0x27
126 #define ER_NoNetwork 0x49
127 #define ER_FileExists 0x50
128 #define ER_CanNotMakeDir 0x52
130 /* Error classes */
132 #define EC_OutOfResource 0x01
133 #define EC_Temporary 0x02
134 #define EC_AccessDenied 0x03
135 #define EC_InternalError 0x04
136 #define EC_HardwareFailure 0x05
137 #define EC_SystemFailure 0x06
138 #define EC_ProgramError 0x07
139 #define EC_NotFound 0x08
140 #define EC_MediaError 0x0b
141 #define EC_Exists 0x0c
142 #define EC_Unknown 0x0d
144 /* Suggested actions */
146 #define SA_Retry 0x01
147 #define SA_DelayedRetry 0x02
148 #define SA_Abort 0x04
149 #define SA_Ignore 0x06
150 #define SA_Ask4Retry 0x07
152 /* Error locus */
154 #define EL_Unknown 0x01
155 #define EL_Disk 0x02
156 #define EL_Network 0x03
157 #define EL_Serial 0x04
158 #define EL_Memory 0x05
160 #endif /* __MSDOS_H */