Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ff036529
Commit
ff036529
authored
Nov 25, 2003
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of DRIVE_OpenDevice, and replaced it with Win32 equivalents.
parent
392cbdf7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
31 deletions
+30
-31
kernel32.spec
dlls/kernel/kernel32.spec
+0
-1
int13.c
dlls/winedos/int13.c
+11
-5
int25.c
dlls/winedos/int25.c
+10
-6
int26.c
dlls/winedos/int26.c
+9
-6
drive.c
files/drive.c
+0
-12
drive.h
include/drive.h
+0
-1
No files found.
dlls/kernel/kernel32.spec
View file @
ff036529
...
...
@@ -1147,7 +1147,6 @@
@ cdecl DOSMEM_GetBlock(long ptr)
@ cdecl DOSMEM_Init(long)
@ cdecl DOSMEM_ResizeBlock(ptr long long)
@ cdecl DRIVE_OpenDevice(long long)
@ cdecl FILE_Dup2(long long)
@ cdecl LOCAL_Alloc(long long long)
@ cdecl LOCAL_Compact(long long long)
...
...
dlls/winedos/int13.c
View file @
ff036529
...
...
@@ -35,8 +35,8 @@
#endif
#include "dosexe.h"
#include "wine/server.h"
#include "wine/debug.h"
#include "drive.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
@@ -98,7 +98,8 @@ static void INT13_ReadFloppyParams( CONTEXT86 *context )
int
floppy_fd
;
int
r
;
struct
floppy_drive_params
floppy_parm
;
char
root
[]
=
"A:
\\
"
;
WCHAR
root
[]
=
{
'A'
,
':'
,
'\\'
,
0
},
drive_root
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'A'
,
':'
,
0
};
HANDLE
h
;
TRACE
(
"in [ EDX=%08lx ]
\n
"
,
context
->
Edx
);
...
...
@@ -108,7 +109,7 @@ static void INT13_ReadFloppyParams( CONTEXT86 *context )
SET_DH
(
context
,
0
);
for
(
i
=
0
;
i
<
MAX_DOS_DRIVES
;
i
++
,
root
[
0
]
++
)
if
(
GetDriveType
A
(
root
)
==
DRIVE_REMOVABLE
)
nr_of_drives
++
;
if
(
GetDriveType
W
(
root
)
==
DRIVE_REMOVABLE
)
nr_of_drives
++
;
SET_DL
(
context
,
nr_of_drives
);
if
(
drive_nr
>
1
)
{
...
...
@@ -117,15 +118,20 @@ static void INT13_ReadFloppyParams( CONTEXT86 *context )
return
;
}
if
(
(
floppy_fd
=
DRIVE_OpenDevice
(
drive_nr
,
O_RDONLY
|
O_NONBLOCK
))
==
-
1
)
drive_root
[
4
]
=
'A'
+
drive_nr
;
h
=
CreateFileW
(
drive_root
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
,
NULL
);
if
(
h
==
INVALID_HANDLE_VALUE
||
wine_server_handle_to_fd
(
h
,
GENERIC_READ
,
&
floppy_fd
,
NULL
,
NULL
))
{
WARN
(
"Can't determine floppy geometry !
\n
"
);
INT13_SetStatus
(
context
,
0x07
);
/* drive parameter activity failed */
return
;
}
r
=
ioctl
(
floppy_fd
,
FDGETDRVPRM
,
&
floppy_parm
);
close
(
floppy_fd
);
CloseHandle
(
h
);
if
(
r
<
0
)
{
...
...
dlls/winedos/int25.c
View file @
ff036529
...
...
@@ -27,7 +27,6 @@
# include <unistd.h>
#endif
#include "dosexe.h"
#include "drive.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
@@ -40,17 +39,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(int);
*/
BOOL
DOSVM_RawRead
(
BYTE
drive
,
DWORD
begin
,
DWORD
nr_sect
,
BYTE
*
dataptr
,
BOOL
fake_success
)
{
int
fd
;
WCHAR
root
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'A'
,
':'
,
0
};
HANDLE
h
;
if
((
fd
=
DRIVE_OpenDevice
(
drive
,
O_RDONLY
))
!=
-
1
)
root
[
4
]
+=
drive
;
h
=
CreateFileW
(
root
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
,
NULL
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
lseek
(
fd
,
begin
*
512
,
SEEK_SET
);
SetFilePointer
(
h
,
begin
*
512
,
NULL
,
SEEK_SET
);
/* FIXME: check errors */
read
(
fd
,
dataptr
,
nr_sect
*
512
);
close
(
fd
);
ReadFile
(
h
,
dataptr
,
nr_sect
*
512
,
NULL
,
NULL
);
CloseHandle
(
h
);
}
else
{
if
(
h
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
h
);
memset
(
dataptr
,
0
,
nr_sect
*
512
);
if
(
fake_success
)
{
...
...
dlls/winedos/int26.c
View file @
ff036529
...
...
@@ -26,7 +26,6 @@
# include <unistd.h>
#endif
#include "dosexe.h"
#include "drive.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
@@ -39,14 +38,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(int);
*/
BOOL
DOSVM_RawWrite
(
BYTE
drive
,
DWORD
begin
,
DWORD
nr_sect
,
BYTE
*
dataptr
,
BOOL
fake_success
)
{
int
fd
;
WCHAR
root
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'A'
,
':'
,
0
};
HANDLE
h
;
if
((
fd
=
DRIVE_OpenDevice
(
drive
,
O_RDONLY
))
!=
-
1
)
root
[
4
]
+=
drive
;
h
=
CreateFileW
(
root
,
GENERIC_WRITE
,
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
lseek
(
fd
,
begin
*
512
,
SEEK_SET
);
SetFilePointer
(
h
,
begin
*
512
,
NULL
,
SEEK_SET
);
/* FIXME: check errors */
write
(
fd
,
dataptr
,
nr_sect
*
512
);
close
(
fd
);
WriteFile
(
h
,
dataptr
,
nr_sect
*
512
,
NULL
,
NULL
);
CloseHandle
(
h
);
}
else
if
(
!
fake_success
)
return
FALSE
;
...
...
files/drive.c
View file @
ff036529
...
...
@@ -1365,18 +1365,6 @@ BOOL WINAPI DefineDosDeviceW(DWORD flags,LPCWSTR devname,LPCWSTR targetpath)
/***********************************************************************
* DRIVE_OpenDevice
*
* Open the drive raw device and return a Unix fd (or -1 on error).
*/
int
DRIVE_OpenDevice
(
int
drive
,
int
flags
)
{
if
(
!
DRIVE_IsValid
(
drive
))
return
-
1
;
return
open
(
DOSDrives
[
drive
].
device
,
flags
);
}
/***********************************************************************
* DRIVE_GetFreeSpace
*/
static
int
DRIVE_GetFreeSpace
(
int
drive
,
PULARGE_INTEGER
size
,
...
...
include/drive.h
View file @
ff036529
...
...
@@ -51,7 +51,6 @@ extern UINT DRIVE_GetFlags( int drive );
extern
int
DRIVE_Chdir
(
int
drive
,
LPCWSTR
path
);
extern
int
DRIVE_Disable
(
int
drive
);
extern
int
DRIVE_Enable
(
int
drive
);
extern
int
DRIVE_OpenDevice
(
int
drive
,
int
flags
);
extern
WCHAR
*
DRIVE_BuildEnv
(
void
);
#endif
/* __WINE_DRIVE_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment