16 struct dosdirent *directory;
20 /* DTA layout for FindFirst/FindNext */
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 */
36 /* FCB layout for FindFirstFCB/FindNextFCB */
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) */
45 /* DOS directory entry for FindFirstFCB/FindNextFCB */
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;\
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 ( SetLastError(err), \
88 DOS_ErrorClass = (class), DOS_ErrorAction = (action), \
89 DOS_ErrorLocus = (locus), DOS_ExtendedError = (err) )
93 #define ER_NoError 0x00
94 #define ER_InvalidFunction 0x01
95 #define ER_FileNotFound 0x02
96 #define ER_PathNotFound 0x03
97 #define ER_TooManyOpenFiles 0x04
98 #define ER_AccessDenied 0x05
99 #define ER_InvalidHandle 0x06
100 #define ER_MCBDestroyed 0x07
101 #define ER_OutOfMemory 0x08
102 #define ER_MCBInvalid 0x09
103 #define ER_EnvironInvalid 0x0a
104 #define ER_FormatInvalid 0x0b
105 #define ER_AccessCodeInvalid 0x0c
106 #define ER_DataInvalid 0x0d
107 #define ER_InvalidDrive 0x0f
108 #define ER_CanNotRemoveCwd 0x10
109 #define ER_NotSameDevice 0x11
110 #define ER_NoMoreFiles 0x12
111 #define ER_WriteProtected 0x13
112 #define ER_UnknownUnit 0x14
113 #define ER_DriveNotReady 0x15
114 #define ER_UnknownCommand 0x16
115 #define ER_CRCError 0x17
116 #define ER_BadRqLength 0x18
117 #define ER_SeekError 0x19
118 #define ER_UnknownMedia 0x1a
119 #define ER_SectorNotFound 0x1b
120 #define ER_OutOfPaper 0x1c
121 #define ER_WriteFault 0x1d
122 #define ER_ReadFault 0x1e
123 #define ER_GeneralFailure 0x1f
124 #define ER_ShareViolation 0x20
125 #define ER_LockViolation 0x21
126 #define ER_DiskFull 0x27
127 #define ER_NoNetwork 0x49
128 #define ER_FileExists 0x50
129 #define ER_CanNotMakeDir 0x52
133 #define EC_OutOfResource 0x01
134 #define EC_Temporary 0x02
135 #define EC_AccessDenied 0x03
136 #define EC_InternalError 0x04
137 #define EC_HardwareFailure 0x05
138 #define EC_SystemFailure 0x06
139 #define EC_ProgramError 0x07
140 #define EC_NotFound 0x08
141 #define EC_MediaError 0x0b
142 #define EC_Exists 0x0c
143 #define EC_Unknown 0x0d
145 /* Suggested actions */
147 #define SA_Retry 0x01
148 #define SA_DelayedRetry 0x02
149 #define SA_Abort 0x04
150 #define SA_Ignore 0x06
151 #define SA_Ask4Retry 0x07
155 #define EL_Unknown 0x01
157 #define EL_Network 0x03
158 #define EL_Serial 0x04
159 #define EL_Memory 0x05
161 #endif /* __WINE_MSDOS_H */