Release 950522
[wine/gsoc_dplay.git] / include / msdos.h
blob7b2bda783157c74d2377dad7dc557878fd2e5b62
1 #ifndef __MSDOS_H
2 #define __MSDOS_H
4 #include <dirent.h>
5 #include <windows.h>
6 #include "comm.h"
8 struct dosdirent {
9 int inuse;
10 DIR *ds;
11 char unixpath[256];
12 char filename[256];
13 char filemask[12];
14 char attribute;
15 char search_attribute;
16 long filesize;
17 long filetime;
18 short entnum; /* Directory entry number */
21 struct fcb {
22 BYTE drive;
23 char name[8];
24 char extension[3];
25 BYTE dummy1[4];
26 int filesize;
27 WORD date_write;
28 WORD time_write;
29 struct dosdirent *directory;
30 BYTE dummy2[9];
33 #define DOSVERSION 0x0005; /* Major version in low byte: DOS 5.00 */
34 #define MAX_DOS_DRIVES 26
36 extern WORD ExtendedError;
37 extern struct DosDeviceStruct COM[MAX_PORTS];
38 extern struct DosDeviceStruct LPT[MAX_PORTS];
40 #define setword(a,b) *(BYTE*)(a) = (b) & 0xff; \
41 *((BYTE*)((a)+1)) = ((b)>>8) & 0xff;
43 #define setdword(a,b) *(BYTE*)(a) = (b) & 0xff; \
44 *((BYTE*)(a)+1) = ((b)>>8) & 0xff; \
45 *((BYTE*)(a)+2) = ((b)>>16) & 0xff; \
46 *((BYTE*)(a)+3) = ((b)>>24) & 0xff;
48 #define getword(a) (WORD) *(BYTE*)(a) + \
49 (*((BYTE*)(a) + 1) << 8)
51 #define getdword(a) (DWORD) (*(BYTE*)(a) + \
52 (*((BYTE*)(a) + 1) << 8) + \
53 (*((BYTE*)(a) + 2) << 16) + \
54 (*((BYTE*)(a) + 3) << 24))
56 /* dos file attributes */
58 #define FA_NORMAL 0x00 /* Normal file, no attributes */
59 #define FA_RDONLY 0x01 /* Read only attribute */
60 #define FA_HIDDEN 0x02 /* Hidden file */
61 #define FA_SYSTEM 0x04 /* System file */
62 #define FA_LABEL 0x08 /* Volume label */
63 #define FA_DIREC 0x10 /* Directory */
64 #define FA_ARCH 0x20 /* Archive */
66 /* extended error codes */
68 #define NoError 0x00
69 #define InvalidFunction 0x01
70 #define FileNotFound 0x02
71 #define PathNotFound 0x03
72 #define AccessDenied 0x05
73 #define InvalidHandle 0x06
74 #define MCBDestroyed 0x07
75 #define OutOfMemory 0x08
76 #define MCBInvalid 0x09
77 #define DataInvalid 0x0d
78 #define InvalidDrive 0x0f
79 #define CanNotRemoveCwd 0x10
80 #define NotSameDevice 0x11
81 #define NoMoreFiles 0x12
82 #define WriteProtected 0x13
83 #define UnknownUnit 0x14
84 #define DriveNotReady 0x15
85 #define UnknownCommand 0x16
86 #define CRCError 0x17
87 #define BadRqLength 0x18
88 #define SeekError 0x19
89 #define UnknownMedia 0x1a
90 #define SectorNotFound 0x1b
91 #define OutOfPaper 0x1c
92 #define WriteFault 0x1d
93 #define ReadFault 0x1e
94 #define GeneralFailure 0x1f
95 #define ShareViolation 0x20
96 #define LockViolation 0x21
97 #define DiskFull 0x27
98 #define NoNetwork 0x49
99 #define FileExists 0x50
100 #define CanNotMakeDir 0x52
102 /* Error classes */
104 #define EC_Temporary 0x02
105 #define EC_AccessDenied 0x03
106 #define EC_AppError 0x04
107 #define EC_SystemFailure 0x06
108 #define EC_NotFound 0x08
109 #define EC_MediaError 0x0b
110 #define EC_Exists 0x0c
111 #define EC_Unknown 0x0d
113 /* Suggested actions */
115 #define SA_Retry 0x01
116 #define SA_Abort 0x04
117 #define SA_Ignore 0x06
118 #define SA_Ask4Retry 0x07
120 /* Error locus */
122 #define EL_Unknown 0x01
123 #define EL_Disk 0x02
124 #define EL_Network 0x03
125 #define EL_Memory 0x05
127 #endif /* __MSDOS_H */