| 1 | /* | 
|---|
| 2 | * DOS drive handling declarations | 
|---|
| 3 | * | 
|---|
| 4 | * Copyright 1995 Alexandre Julliard | 
|---|
| 5 | */ | 
|---|
| 6 |  | 
|---|
| 7 | #ifndef __WINE_DRIVE_H | 
|---|
| 8 | #define __WINE_DRIVE_H | 
|---|
| 9 |  | 
|---|
| 10 | #include "windef.h" | 
|---|
| 11 | #include <direct.h> | 
|---|
| 12 |  | 
|---|
| 13 | #define MAX_DOS_DRIVES  26 | 
|---|
| 14 |  | 
|---|
| 15 | typedef enum | 
|---|
| 16 | { | 
|---|
| 17 | TYPE_FLOPPY, | 
|---|
| 18 | TYPE_HD, | 
|---|
| 19 | TYPE_CDROM, | 
|---|
| 20 | TYPE_NETWORK, | 
|---|
| 21 | TYPE_INVALID | 
|---|
| 22 | } DRIVETYPE; | 
|---|
| 23 |  | 
|---|
| 24 | /* Drive flags */ | 
|---|
| 25 |  | 
|---|
| 26 | #define DRIVE_DISABLED        0x0001  /* Drive is disabled */ | 
|---|
| 27 | #define DRIVE_SHORT_NAMES     0x0002  /* Drive fs has 8.3 file names */ | 
|---|
| 28 | #define DRIVE_CASE_SENSITIVE  0x0004  /* Drive fs is case sensitive */ | 
|---|
| 29 | #define DRIVE_CASE_PRESERVING 0x0008  /* Drive fs is case preserving */ | 
|---|
| 30 |  | 
|---|
| 31 | inline int DRIVE_SetCurrentDrive(char drive) | 
|---|
| 32 | { | 
|---|
| 33 | int ret; | 
|---|
| 34 | USHORT sel = GetFS(); | 
|---|
| 35 | ret = _chdrive(drive); | 
|---|
| 36 | SetFS(sel); | 
|---|
| 37 | return ret; | 
|---|
| 38 | } | 
|---|
| 39 |  | 
|---|
| 40 | inline int DRIVE_GetCurrentDrive() | 
|---|
| 41 | { | 
|---|
| 42 | int ret; | 
|---|
| 43 | USHORT sel = GetFS(); | 
|---|
| 44 | ret = _getdrive(); | 
|---|
| 45 | SetFS(sel); | 
|---|
| 46 | return ret; | 
|---|
| 47 | } | 
|---|
| 48 |  | 
|---|
| 49 | #define DRIVE_Chdir(a,b)             SetCurrentDirectoryA(b) | 
|---|
| 50 |  | 
|---|
| 51 | inline char *DRIVE_GetDosCwd (char *buffer, int drive, int size) | 
|---|
| 52 | { | 
|---|
| 53 | char * ret; | 
|---|
| 54 | USHORT sel = GetFS(); | 
|---|
| 55 | ret = _getdcwd(drive, buffer, size); | 
|---|
| 56 | SetFS(sel); | 
|---|
| 57 | return ret; | 
|---|
| 58 | } | 
|---|
| 59 |  | 
|---|
| 60 | #if 0 | 
|---|
| 61 | extern int DRIVE_Init(void); | 
|---|
| 62 | extern int DRIVE_IsValid( int drive ); | 
|---|
| 63 | extern int DRIVE_GetCurrentDrive(void); | 
|---|
| 64 | extern int DRIVE_SetCurrentDrive( int drive ); | 
|---|
| 65 | extern int DRIVE_FindDriveRoot( const char **path ); | 
|---|
| 66 | extern const char * DRIVE_GetRoot( int drive ); | 
|---|
| 67 | extern const char * DRIVE_GetDosCwd( int drive ); | 
|---|
| 68 | extern const char * DRIVE_GetUnixCwd( int drive ); | 
|---|
| 69 | extern const char * DRIVE_GetLabel( int drive ); | 
|---|
| 70 | extern DWORD DRIVE_GetSerialNumber( int drive ); | 
|---|
| 71 | extern int DRIVE_SetSerialNumber( int drive, DWORD serial ); | 
|---|
| 72 | extern DRIVETYPE DRIVE_GetType( int drive ); | 
|---|
| 73 | extern UINT DRIVE_GetFlags( int drive ); | 
|---|
| 74 | extern int DRIVE_Chdir( int drive, const char *path ); | 
|---|
| 75 | extern int DRIVE_Disable( int drive  ); | 
|---|
| 76 | extern int DRIVE_Enable( int drive  ); | 
|---|
| 77 | extern int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive ); | 
|---|
| 78 | extern int DRIVE_OpenDevice( int drive, int flags ); | 
|---|
| 79 | extern int DRIVE_RawRead(BYTE drive, DWORD begin, DWORD length, BYTE *dataptr, BOOL fake_success ); | 
|---|
| 80 | extern int DRIVE_RawWrite(BYTE drive, DWORD begin, DWORD length, BYTE *dataptr, BOOL fake_success ); | 
|---|
| 81 | #endif | 
|---|
| 82 |  | 
|---|
| 83 | #endif  /* __WINE_DRIVE_H */ | 
|---|