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
aacc4509
Commit
aacc4509
authored
Oct 30, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid using Low/HighPart of a large integer when not necessary.
parent
1fc362ce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
21 deletions
+13
-21
cdrom.c
dlls/ntdll/cdrom.c
+3
-5
file.c
dlls/ntdll/file.c
+2
-2
tape.c
dlls/ntdll/tape.c
+2
-2
time.c
dlls/ntdll/time.c
+6
-12
No files found.
dlls/ntdll/cdrom.c
View file @
aacc4509
...
...
@@ -756,9 +756,8 @@ static NTSTATUS CDROM_GetDriveGeometry(int dev, int fd, DISK_GEOMETRY* dg)
fsize
=
FRAME_OF_TOC
(
toc
,
toc
.
LastTrack
+
1
)
-
FRAME_OF_TOC
(
toc
,
1
);
/* Total size in frames */
dg
->
Cylinders
.
u
.
LowPart
=
fsize
/
(
64
*
32
);
dg
->
Cylinders
.
u
.
HighPart
=
0
;
dg
->
Cylinders
.
QuadPart
=
fsize
/
(
64
*
32
);
dg
->
MediaType
=
RemovableMedia
;
dg
->
TracksPerCylinder
=
64
;
dg
->
SectorsPerTrack
=
32
;
...
...
@@ -2511,8 +2510,7 @@ static NTSTATUS DVD_ReadStructure(int dev, const DVD_READ_STRUCTURE *structure,
struct
dvd_manufact
manufact
;
}
s
;
if
(
structure
->
BlockByteOffset
.
u
.
HighPart
||
structure
->
BlockByteOffset
.
u
.
LowPart
)
FIXME
(
": BlockByteOffset is not handled
\n
"
);
if
(
structure
->
BlockByteOffset
.
QuadPart
)
FIXME
(
": BlockByteOffset is not handled
\n
"
);
switch
(
structure
->
Format
)
{
...
...
dlls/ntdll/file.c
View file @
aacc4509
...
...
@@ -2857,7 +2857,7 @@ NTSTATUS WINAPI NtCancelIoFileEx( HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATU
* of the queued APC, but not yet run. This is needed to ensure proper
* clean-up of allocated data.
*/
timeout
.
u
.
LowPart
=
timeout
.
u
.
High
Part
=
0
;
timeout
.
Quad
Part
=
0
;
NtDelayExecution
(
TRUE
,
&
timeout
);
return
io_status
->
u
.
Status
;
}
...
...
@@ -2889,7 +2889,7 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status )
* of the queued APC, but not yet run. This is needed to ensure proper
* clean-up of allocated data.
*/
timeout
.
u
.
LowPart
=
timeout
.
u
.
High
Part
=
0
;
timeout
.
Quad
Part
=
0
;
NtDelayExecution
(
TRUE
,
&
timeout
);
return
io_status
->
u
.
Status
;
}
...
...
dlls/ntdll/tape.c
View file @
aacc4509
...
...
@@ -223,8 +223,8 @@ static NTSTATUS TAPE_GetMediaParams( int fd, TAPE_GET_MEDIA_PARAMETERS *data )
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
data
->
Capacity
.
u
.
Low
Part
=
1024
*
1024
*
1024
;
data
->
Remaining
.
u
.
Low
Part
=
1024
*
1024
*
1024
;
data
->
Capacity
.
Quad
Part
=
1024
*
1024
*
1024
;
data
->
Remaining
.
Quad
Part
=
1024
*
1024
*
1024
;
#ifdef HAVE_STRUCT_MTGET_MT_BLKSIZ
data
->
BlockSize
=
get
.
mt_blksiz
;
#else
...
...
dlls/ntdll/time.c
View file @
aacc4509
...
...
@@ -331,10 +331,9 @@ NTSTATUS WINAPI RtlSystemTimeToLocalTime( const LARGE_INTEGER *SystemTime,
*/
BOOLEAN
WINAPI
RtlTimeToSecondsSince1970
(
const
LARGE_INTEGER
*
Time
,
LPDWORD
Seconds
)
{
ULONGLONG
tmp
=
((
ULONGLONG
)
Time
->
u
.
HighPart
<<
32
)
|
Time
->
u
.
LowPart
;
tmp
=
tmp
/
TICKSPERSEC
-
SECS_1601_TO_1970
;
ULONGLONG
tmp
=
Time
->
QuadPart
/
TICKSPERSEC
-
SECS_1601_TO_1970
;
if
(
tmp
>
0xffffffff
)
return
FALSE
;
*
Seconds
=
(
DWORD
)
tmp
;
*
Seconds
=
tmp
;
return
TRUE
;
}
...
...
@@ -353,10 +352,9 @@ BOOLEAN WINAPI RtlTimeToSecondsSince1970( const LARGE_INTEGER *Time, LPDWORD Sec
*/
BOOLEAN
WINAPI
RtlTimeToSecondsSince1980
(
const
LARGE_INTEGER
*
Time
,
LPDWORD
Seconds
)
{
ULONGLONG
tmp
=
((
ULONGLONG
)
Time
->
u
.
HighPart
<<
32
)
|
Time
->
u
.
LowPart
;
tmp
=
tmp
/
TICKSPERSEC
-
SECS_1601_TO_1980
;
ULONGLONG
tmp
=
Time
->
QuadPart
/
TICKSPERSEC
-
SECS_1601_TO_1980
;
if
(
tmp
>
0xffffffff
)
return
FALSE
;
*
Seconds
=
(
DWORD
)
tmp
;
*
Seconds
=
tmp
;
return
TRUE
;
}
...
...
@@ -374,9 +372,7 @@ BOOLEAN WINAPI RtlTimeToSecondsSince1980( const LARGE_INTEGER *Time, LPDWORD Sec
*/
void
WINAPI
RtlSecondsSince1970ToTime
(
DWORD
Seconds
,
LARGE_INTEGER
*
Time
)
{
ULONGLONG
secs
=
Seconds
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1970
;
Time
->
u
.
LowPart
=
(
DWORD
)
secs
;
Time
->
u
.
HighPart
=
(
DWORD
)(
secs
>>
32
);
Time
->
QuadPart
=
Seconds
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1970
;
}
/******************************************************************************
...
...
@@ -393,9 +389,7 @@ void WINAPI RtlSecondsSince1970ToTime( DWORD Seconds, LARGE_INTEGER *Time )
*/
void
WINAPI
RtlSecondsSince1980ToTime
(
DWORD
Seconds
,
LARGE_INTEGER
*
Time
)
{
ULONGLONG
secs
=
Seconds
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1980
;
Time
->
u
.
LowPart
=
(
DWORD
)
secs
;
Time
->
u
.
HighPart
=
(
DWORD
)(
secs
>>
32
);
Time
->
QuadPart
=
Seconds
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1980
;
}
/******************************************************************************
...
...
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