Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6c3ef7e7
Commit
6c3ef7e7
authored
Sep 07, 2004
by
Andreas Mohr
Committed by
Alexandre Julliard
Sep 07, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix int21 block device read/write
- moved device block access log messages to inner function used by two different places - removed bogus CloseHandle()
parent
d324ccfc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
24 deletions
+62
-24
int21.c
dlls/winedos/int21.c
+53
-14
int25.c
dlls/winedos/int25.c
+4
-5
int26.c
dlls/winedos/int26.c
+5
-5
No files found.
dlls/winedos/int21.c
View file @
6c3ef7e7
...
...
@@ -2408,6 +2408,12 @@ static void CreateBPB(int drive, BYTE *data, BOOL16 limited)
}
}
inline
DWORD
INT21_Ioctl_CylHeadSect2Lin
(
DWORD
cyl
,
WORD
head
,
WORD
sec
,
WORD
cyl_cnt
,
WORD
head_cnt
,
WORD
sec_cnt
)
{
DWORD
res
=
(
cyl
*
head_cnt
*
sec_cnt
+
head
*
sec_cnt
+
sec
);
return
res
;
}
/***********************************************************************
* INT21_Ioctl_Block
*
...
...
@@ -2462,7 +2468,7 @@ static void INT21_Ioctl_Block( CONTEXT86 *context )
break
;
case
0x0d
:
/* GENERIC BLOCK DEVICE REQUEST */
/* Get pointer to IOCTL parameter block
.
*/
/* Get pointer to IOCTL parameter block */
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
context
->
SegDs
,
context
->
Edx
);
switch
(
CX_reg
(
context
))
...
...
@@ -2471,13 +2477,31 @@ static void INT21_Ioctl_Block( CONTEXT86 *context )
TRACE
(
"GENERIC IOCTL - Write logical device track - %c:
\n
"
,
'A'
+
drive
);
{
WORD
head
=
*
(
WORD
*
)
dataptr
+
1
;
WORD
cyl
=
*
(
WORD
*
)
dataptr
+
3
;
WORD
sect
=
*
(
WORD
*
)
dataptr
+
5
;
WORD
nrsect
=
*
(
WORD
*
)
dataptr
+
7
;
BYTE
*
data
=
(
BYTE
*
)
dataptr
+
9
;
/* FIXME: is this correct? */
WORD
head
=
*
(
WORD
*
)(
dataptr
+
1
);
WORD
cyl
=
*
(
WORD
*
)(
dataptr
+
3
);
WORD
sect
=
*
(
WORD
*
)(
dataptr
+
5
);
WORD
nrsect
=
*
(
WORD
*
)(
dataptr
+
7
);
BYTE
*
data
=
CTX_SEG_OFF_TO_LIN
(
context
,
*
(
WORD
*
)(
dataptr
+
11
),
*
(
WORD
*
)(
dataptr
+
9
));
WORD
cyl_cnt
,
head_cnt
,
sec_cnt
;
/* FIXME: we're faking some values here */
if
(
drive
>
1
)
{
/* cyl_cnt = 0x300;
head_cnt = 16;
sec_cnt = 255; */
SET_AX
(
context
,
ERROR_WRITE_FAULT
);
SET_CFLAG
(
context
);
break
;
}
else
{
/* floppy */
cyl_cnt
=
80
;
head_cnt
=
2
;
sec_cnt
=
18
;
}
if
(
!
DOSVM_RawWrite
(
drive
,
head
*
cyl
*
sect
,
nrsect
,
data
,
FALSE
))
if
(
!
DOSVM_RawWrite
(
drive
,
INT21_Ioctl_CylHeadSect2Lin
(
cyl
,
head
,
sect
,
cyl_cnt
,
head_cnt
,
sec_cnt
)
,
nrsect
,
data
,
FALSE
))
{
SET_AX
(
context
,
ERROR_WRITE_FAULT
);
SET_CFLAG
(
context
);
...
...
@@ -2516,13 +2540,28 @@ static void INT21_Ioctl_Block( CONTEXT86 *context )
TRACE
(
"GENERIC IOCTL - Read logical device track - %c:
\n
"
,
'A'
+
drive
);
{
WORD
head
=
*
(
WORD
*
)
dataptr
+
1
;
WORD
cyl
=
*
(
WORD
*
)
dataptr
+
3
;
WORD
sect
=
*
(
WORD
*
)
dataptr
+
5
;
WORD
nrsect
=
*
(
WORD
*
)
dataptr
+
7
;
BYTE
*
data
=
(
BYTE
*
)
dataptr
+
9
;
/* FIXME: is this correct? */
WORD
head
=
*
(
WORD
*
)(
dataptr
+
1
);
WORD
cyl
=
*
(
WORD
*
)(
dataptr
+
3
);
WORD
sect
=
*
(
WORD
*
)(
dataptr
+
5
);
WORD
nrsect
=
*
(
WORD
*
)(
dataptr
+
7
);
BYTE
*
data
=
CTX_SEG_OFF_TO_LIN
(
context
,
*
(
WORD
*
)(
dataptr
+
11
),
*
(
WORD
*
)(
dataptr
+
9
));
WORD
cyl_cnt
,
head_cnt
,
sec_cnt
;
/* FIXME: we're faking some values here */
if
(
drive
>
1
)
{
cyl_cnt
=
0x300
;
head_cnt
=
16
;
sec_cnt
=
255
;
}
else
{
/* floppy */
cyl_cnt
=
80
;
head_cnt
=
2
;
sec_cnt
=
18
;
}
if
(
!
DOSVM_RawRead
(
drive
,
head
*
cyl
*
sect
,
nrsect
,
data
,
FALSE
))
if
(
!
DOSVM_RawRead
(
drive
,
INT21_Ioctl_CylHeadSect2Lin
(
cyl
,
head
,
sect
,
cyl_cnt
,
head_cnt
,
sec_cnt
)
,
nrsect
,
data
,
FALSE
))
{
SET_AX
(
context
,
ERROR_READ_FAULT
);
SET_CFLAG
(
context
);
...
...
@@ -2557,7 +2596,7 @@ static void INT21_Ioctl_Block( CONTEXT86 *context )
break
;
case
0x0872
:
/* Tr
ail on
error implementation */
/* Tr
ial and
error implementation */
SET_AX
(
context
,
drivetype
==
DRIVE_UNKNOWN
?
0x0f
:
0x01
);
SET_CFLAG
(
context
);
/* Seems to be set all the time */
break
;
...
...
dlls/winedos/int25.c
View file @
6c3ef7e7
...
...
@@ -43,6 +43,10 @@ BOOL DOSVM_RawRead(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL f
WCHAR
root
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'A'
,
':'
,
0
};
HANDLE
h
;
TRACE
(
"abs diskread, drive %d, sector %ld, "
"count %ld, buffer %p
\n
"
,
drive
,
begin
,
nr_sect
,
dataptr
);
root
[
4
]
+=
drive
;
h
=
CreateFileW
(
root
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
,
NULL
);
...
...
@@ -55,7 +59,6 @@ BOOL DOSVM_RawRead(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL f
}
else
{
if
(
h
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
h
);
memset
(
dataptr
,
0
,
nr_sect
*
512
);
if
(
fake_success
)
{
...
...
@@ -107,10 +110,6 @@ void WINAPI DOSVM_Int25Handler( CONTEXT86 *context )
length
=
CX_reg
(
context
);
}
TRACE
(
"abs diskread, drive %d, sector %ld, "
"count %ld, buffer %p
\n
"
,
AL_reg
(
context
),
begin
,
length
,
dataptr
);
DOSVM_RawRead
(
AL_reg
(
context
),
begin
,
length
,
dataptr
,
TRUE
);
RESET_CFLAG
(
context
);
}
dlls/winedos/int26.c
View file @
6c3ef7e7
...
...
@@ -42,6 +42,10 @@ BOOL DOSVM_RawWrite(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL
WCHAR
root
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'A'
,
':'
,
0
};
HANDLE
h
;
TRACE
(
"abs diskwrite, drive %d, sector %ld, "
"count %ld, buffer %p
\n
"
,
drive
,
begin
,
nr_sect
,
dataptr
);
root
[
4
]
+=
drive
;
h
=
CreateFileW
(
root
,
GENERIC_WRITE
,
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
...
...
@@ -62,7 +66,7 @@ BOOL DOSVM_RawWrite(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL
/**********************************************************************
* DOSVM_Int26Handler (WINEDOS16.138)
*
* Handler for int 26h (absolute disk
read
).
* Handler for int 26h (absolute disk
write
).
*/
void
WINAPI
DOSVM_Int26Handler
(
CONTEXT86
*
context
)
{
...
...
@@ -95,10 +99,6 @@ void WINAPI DOSVM_Int26Handler( CONTEXT86 *context )
length
=
CX_reg
(
context
);
}
TRACE
(
"abs diskwrite, drive %d, sector %ld, "
"count %ld, buffer %p
\n
"
,
AL_reg
(
context
),
begin
,
length
,
dataptr
);
DOSVM_RawWrite
(
AL_reg
(
context
),
begin
,
length
,
dataptr
,
TRUE
);
RESET_CFLAG
(
context
);
}
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