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