Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / arch / all-mingw32 / devs / hostdisk / hostdisk_host.h
blobe0956fb204310759e0880228c74abfcfd7296fd6
1 #ifdef __x86_64__
2 #define __stdcall __attribute__((ms_abi))
3 #else
4 #define __stdcall __attribute__((stdcall))
5 #endif
7 #define INVALID_HANDLE_VALUE (void *)-1
9 #define FILE_SHARE_READ 0x00000001
10 #define FILE_SHARE_WRITE 0x00000002
11 #define FILE_SHARE_VALID_FLAGS 0x00000007
12 #define GENERIC_READ 0x80000000
13 #define GENERIC_WRITE 0x40000000
14 #define OPEN_EXISTING 3
15 #define FILE_BEGIN 0
17 #define FILE_ATTRIBUTE_READONLY 0x00000001
18 #define FILE_ATTRIBUTE_DEVICE 0x00000040
19 #define FILE_ATTRIBUTE_NORMAL 0x00000080
21 #define ERROR_INVALID_FUNCTION 1L
22 #define ERROR_FILE_NOT_FOUND 2L
23 #define ERROR_PATH_NOT_FOUND 3L
24 #define ERROR_ACCESS_DENIED 5L
25 #define ERROR_NOT_ENOUGH_MEMORY 8L
26 #define ERROR_NO_MORE_FILES 18L
27 #define ERROR_WRITE_PROTECT 19L
28 #define ERROR_SHARING_VIOLATION 32L
29 #define ERROR_LOCK_VIOLATION 33L
30 #define ERROR_HANDLE_EOF 38L
31 #define ERROR_FILE_EXISTS 80L
32 #define ERROR_INVALID_PARAMETER 87L
33 #define ERROR_INVALID_NAME 123L
34 #define ERROR_DIR_NOT_EMPTY 145L
35 #define ERROR_IO_PENDING 997L
37 #define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m))
38 #define IOCTL_DISK_GET_DRIVE_GEOMETRY 0x00070000 //CTL_CODE(7, 0, 0, 0)
40 typedef enum _MEDIA_TYPE
42 Unknown = 0x00,
43 F5_1Pt2_512 = 0x01,
44 F3_1Pt44_512 = 0x02,
45 F3_2Pt88_512 = 0x03,
46 F3_20Pt8_512 = 0x04,
47 F3_720_512 = 0x05,
48 F5_360_512 = 0x06,
49 F5_320_512 = 0x07,
50 F5_320_1024 = 0x08,
51 F5_180_512 = 0x09,
52 F5_160_512 = 0x0a,
53 RemovableMedia = 0x0b,
54 FixedMedia = 0x0c,
55 F3_120M_512 = 0x0d,
56 F3_640_512 = 0x0e,
57 F5_640_512 = 0x0f,
58 F5_720_512 = 0x10,
59 F3_1Pt2_512 = 0x11,
60 F3_1Pt23_1024 = 0x12,
61 F5_1Pt23_1024 = 0x13,
62 F3_128Mb_512 = 0x14,
63 F3_230Mb_512 = 0x15,
64 F8_256_128 = 0x16,
65 F3_200Mb_512 = 0x17,
66 F3_240M_512 = 0x18,
67 F3_32M_512 = 0x19
68 } MEDIA_TYPE;
70 typedef struct _DISK_GEOMETRY
72 UQUAD Cylinders;
73 MEDIA_TYPE MediaType;
74 ULONG TracksPerCylinder;
75 ULONG SectorsPerTrack;
76 ULONG BytesPerSector;
77 } DISK_GEOMETRY;
79 typedef void *file_t;
81 struct HostInterface
83 void * __stdcall (*CreateFile)(char *lpFileName, ULONG dwDesiredAccess, ULONG dwShareMode, void *lpSecurityAttributes,
84 ULONG dwCreationDisposition, ULONG dwFlagsAndAttributes, void *hTemplateFile);
85 ULONG __stdcall (*CloseHandle)(void *hObject);
86 ULONG __stdcall (*ReadFile)(void *hFile, void *lpBuffer, ULONG nNumberOfBytesToRead, ULONG *lpNumberOfBytesRead, void *lpOverlapped);
87 ULONG __stdcall (*WriteFile)(void *hFile, void *lpBuffer, ULONG nNumberOfBytesToWrite, ULONG *lpNumberOfBytesWritten, void *lpOverlapped);
88 ULONG __stdcall (*SetFilePointer)(void *hFile, LONG lDistanceToMove, LONG *lpDistanceToMoveHigh, ULONG dwMoveMethod);
89 ULONG __stdcall (*GetFileAttributes)(STRPTR lpFileName);
90 ULONG __stdcall (*GetFileSize)(void *hFile, ULONG *lpFileSizeHigh);
91 ULONG __stdcall (*DeviceIoControl)(void *hDevice, ULONG dwIoControlCode, void *lpInBuffer, ULONG nInBufferSize,
92 void *lpOutBuffer, ULONG nOutBufferSize, ULONG *lpBytesReturned, void *lpOverlapped);
93 ULONG __stdcall (*GetLastError)(void);