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
9bc08be3
Commit
9bc08be3
authored
Nov 02, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix calculation of tape position offsets.
Reported by Gerald Pfeifer.
parent
cac17c45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
tape.c
dlls/ntdll/tape.c
+15
-10
No files found.
dlls/ntdll/tape.c
View file @
9bc08be3
...
...
@@ -404,11 +404,16 @@ static NTSTATUS TAPE_SetPosition( int fd, const TAPE_SET_POSITION *data )
#ifdef HAVE_SYS_MTIO_H
struct
mtop
cmd
;
TRACE
(
"fd: %d method: 0x%08x partition: 0x%08x offset: 0x%08x immediate: 0x%02x
\n
"
,
fd
,
data
->
Method
,
data
->
Partition
,
data
->
Offset
.
u
.
LowPart
,
data
->
Immediate
);
TRACE
(
"fd: %d method: 0x%08x partition: 0x%08x offset: 0x%x%08x immediate: 0x%02x
\n
"
,
fd
,
data
->
Method
,
data
->
Partition
,
(
DWORD
)(
data
->
Offset
.
QuadPart
>>
32
),
(
DWORD
)
data
->
Offset
.
QuadPart
,
data
->
Immediate
);
if
(
data
->
Offset
.
u
.
HighPart
>
0
)
if
(
sizeof
(
cmd
.
mt_count
)
<
sizeof
(
data
->
Offset
.
QuadPart
)
&&
(
int
)
data
->
Offset
.
QuadPart
!=
data
->
Offset
.
QuadPart
)
{
ERR
(
"Offset too large or too small
\n
"
);
return
STATUS_INVALID_PARAMETER
;
}
switch
(
data
->
Method
)
{
...
...
@@ -418,7 +423,7 @@ static NTSTATUS TAPE_SetPosition( int fd, const TAPE_SET_POSITION *data )
#ifdef MTSEEK
case
TAPE_ABSOLUTE_BLOCK
:
cmd
.
mt_op
=
MTSEEK
;
cmd
.
mt_count
=
data
->
Offset
.
u
.
Low
Part
;
cmd
.
mt_count
=
data
->
Offset
.
Quad
Part
;
break
;
#endif
#ifdef MTEOM
...
...
@@ -427,24 +432,24 @@ static NTSTATUS TAPE_SetPosition( int fd, const TAPE_SET_POSITION *data )
break
;
#endif
case
TAPE_SPACE_FILEMARKS
:
if
(
data
->
Offset
.
u
.
Low
Part
>=
0
)
{
if
(
data
->
Offset
.
Quad
Part
>=
0
)
{
cmd
.
mt_op
=
MTFSF
;
cmd
.
mt_count
=
data
->
Offset
.
u
.
Low
Part
;
cmd
.
mt_count
=
data
->
Offset
.
Quad
Part
;
}
else
{
cmd
.
mt_op
=
MTBSF
;
cmd
.
mt_count
=
-
data
->
Offset
.
u
.
Low
Part
;
cmd
.
mt_count
=
-
data
->
Offset
.
Quad
Part
;
}
break
;
#if defined(MTFSS) && defined(MTBSS)
case
TAPE_SPACE_SETMARKS
:
if
(
data
->
Offset
.
u
.
Low
Part
>=
0
)
{
if
(
data
->
Offset
.
Quad
Part
>=
0
)
{
cmd
.
mt_op
=
MTFSS
;
cmd
.
mt_count
=
data
->
Offset
.
u
.
Low
Part
;
cmd
.
mt_count
=
data
->
Offset
.
Quad
Part
;
}
else
{
cmd
.
mt_op
=
MTBSS
;
cmd
.
mt_count
=
-
data
->
Offset
.
u
.
Low
Part
;
cmd
.
mt_count
=
-
data
->
Offset
.
Quad
Part
;
}
break
;
#endif
...
...
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