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
54a376f2
Commit
54a376f2
authored
Mar 03, 2008
by
Andrew Talbot
Committed by
Alexandre Julliard
Mar 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Assign to structs instead of using memcpy.
parent
90b7baa2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
18 deletions
+20
-18
comm.c
dlls/kernel32/comm.c
+7
-5
cpu.c
dlls/kernel32/cpu.c
+3
-3
environ.c
dlls/kernel32/environ.c
+2
-2
heap.c
dlls/kernel32/heap.c
+2
-2
thunk.c
dlls/kernel32/thunk.c
+4
-4
time.c
dlls/kernel32/time.c
+2
-2
No files found.
dlls/kernel32/comm.c
View file @
54a376f2
...
...
@@ -477,17 +477,19 @@ BOOL WINAPI BuildCommDCBAndTimeoutsW(
COMMTIMEOUTS
timeouts
;
BOOL
result
;
LPCWSTR
ptr
=
devid
;
TRACE
(
"(%s,%p,%p)
\n
"
,
debugstr_w
(
devid
),
lpdcb
,
lptimeouts
);
memset
(
&
timeouts
,
0
,
sizeof
timeouts
);
/* Set DCBlength. (Windows NT does not do this, but 9x does) */
lpdcb
->
DCBlength
=
sizeof
(
DCB
);
/* Make a copy of the original data structures to work with since if
if there is an error in the device control string the originals
should not be modified (except possibly DCBlength) */
memcpy
(
&
dcb
,
lpdcb
,
sizeof
(
DCB
))
;
if
(
lptimeouts
)
memcpy
(
&
timeouts
,
lptimeouts
,
sizeof
(
COMMTIMEOUTS
))
;
dcb
=
*
lpdcb
;
if
(
lptimeouts
)
timeouts
=
*
lptimeouts
;
ptr
=
COMM_ParseStart
(
ptr
);
...
...
@@ -500,8 +502,8 @@ BOOL WINAPI BuildCommDCBAndTimeoutsW(
if
(
result
)
{
memcpy
(
lpdcb
,
&
dcb
,
sizeof
(
DCB
))
;
if
(
lptimeouts
)
memcpy
(
lptimeouts
,
&
timeouts
,
sizeof
(
COMMTIMEOUTS
))
;
*
lpdcb
=
dcb
;
if
(
lptimeouts
)
*
lptimeouts
=
timeouts
;
return
TRUE
;
}
else
...
...
dlls/kernel32/cpu.c
View file @
54a376f2
...
...
@@ -370,7 +370,7 @@ VOID WINAPI GetSystemInfo(
TRACE
(
"si=0x%p
\n
"
,
si
);
if
(
cache
)
{
memcpy
(
si
,
&
cachedsi
,
sizeof
(
*
si
))
;
*
si
=
cachedsi
;
return
;
}
memset
(
PF
,
0
,
sizeof
(
PF
));
...
...
@@ -392,7 +392,7 @@ VOID WINAPI GetSystemInfo(
cachedsi
.
wProcessorRevision
=
0
;
cache
=
1
;
/* even if there is no more info, we now have a cache entry */
memcpy
(
si
,
&
cachedsi
,
sizeof
(
*
si
))
;
*
si
=
cachedsi
;
/* Hmm, reasonable processor feature defaults? */
...
...
@@ -788,7 +788,7 @@ VOID WINAPI GetSystemInfo(
if
(
!
cachedsi
.
dwActiveProcessorMask
)
cachedsi
.
dwActiveProcessorMask
=
(
1
<<
cachedsi
.
dwNumberOfProcessors
)
-
1
;
memcpy
(
si
,
&
cachedsi
,
sizeof
(
*
si
))
;
*
si
=
cachedsi
;
TRACE
(
"<- CPU arch %d, res'd %d, pagesize %d, minappaddr %p, maxappaddr %p,"
" act.cpumask %08x, numcpus %d, CPU type %d, allocgran. %d, CPU level %d, CPU rev %d
\n
"
,
...
...
dlls/kernel32/environ.c
View file @
54a376f2
...
...
@@ -421,7 +421,7 @@ BOOL WINAPI SetStdHandle( DWORD std_handle, HANDLE handle )
*/
VOID
WINAPI
GetStartupInfoA
(
LPSTARTUPINFOA
info
)
{
memcpy
(
info
,
&
startup_infoA
,
sizeof
(
startup_infoA
))
;
*
info
=
startup_infoA
;
}
...
...
@@ -430,7 +430,7 @@ VOID WINAPI GetStartupInfoA( LPSTARTUPINFOA info )
*/
VOID
WINAPI
GetStartupInfoW
(
LPSTARTUPINFOW
info
)
{
memcpy
(
info
,
&
startup_infoW
,
sizeof
(
startup_infoW
))
;
*
info
=
startup_infoW
;
}
/******************************************************************
...
...
dlls/kernel32/heap.c
View file @
54a376f2
...
...
@@ -1227,7 +1227,7 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
}
if
(
time
(
NULL
)
==
cache_lastchecked
)
{
memcpy
(
lpmemex
,
&
cached_memstatus
,
sizeof
(
*
lpmemex
))
;
*
lpmemex
=
cached_memstatus
;
return
TRUE
;
}
cache_lastchecked
=
time
(
NULL
);
...
...
@@ -1347,7 +1347,7 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
*/
lpmemex
->
ullAvailExtendedVirtual
=
0
;
memcpy
(
&
cached_memstatus
,
lpmemex
,
sizeof
(
*
lpmemex
))
;
cached_memstatus
=
*
lpmemex
;
TRACE
(
"<-- LPMEMORYSTATUSEX: dwLength %d, dwMemoryLoad %d, ullTotalPhys %s, ullAvailPhys %s,"
" ullTotalPageFile %s, ullAvailPageFile %s, ullTotalVirtual %s, ullAvailVirtual %s
\n
"
,
...
...
dlls/kernel32/thunk.c
View file @
54a376f2
...
...
@@ -454,7 +454,7 @@ void WINAPI __regs_QT_Thunk( CONTEXT86 *context )
CONTEXT86
context16
;
DWORD
argsize
;
memcpy
(
&
context16
,
context
,
sizeof
(
context16
))
;
context16
=
*
context
;
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
...
...
@@ -588,7 +588,7 @@ void WINAPI __regs_FT_Thunk( CONTEXT86 *context )
DWORD
newstack
[
32
];
LPBYTE
oldstack
;
memcpy
(
&
context16
,
context
,
sizeof
(
context16
))
;
context16
=
*
context
;
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
...
...
@@ -753,7 +753,7 @@ void WINAPI __regs_Common32ThkLS( CONTEXT86 *context )
CONTEXT86
context16
;
DWORD
argsize
;
memcpy
(
&
context16
,
context
,
sizeof
(
context16
))
;
context16
=
*
context
;
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
...
...
@@ -814,7 +814,7 @@ void WINAPI __regs_OT_32ThkLSF( CONTEXT86 *context )
CONTEXT86
context16
;
DWORD
argsize
;
memcpy
(
&
context16
,
context
,
sizeof
(
context16
))
;
context16
=
*
context
;
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
...
...
dlls/kernel32/time.c
View file @
54a376f2
...
...
@@ -453,7 +453,7 @@ BOOL WINAPI SystemTimeToTzSpecificLocalTime(
if
(
lpTimeZoneInformation
!=
NULL
)
{
memcpy
(
&
tzinfo
,
lpTimeZoneInformation
,
sizeof
(
TIME_ZONE_INFORMATION
))
;
tzinfo
=
*
lpTimeZoneInformation
;
}
else
{
...
...
@@ -499,7 +499,7 @@ BOOL WINAPI TzSpecificLocalTimeToSystemTime(
if
(
lpTimeZoneInformation
!=
NULL
)
{
memcpy
(
&
tzinfo
,
lpTimeZoneInformation
,
sizeof
(
TIME_ZONE_INFORMATION
))
;
tzinfo
=
*
lpTimeZoneInformation
;
}
else
{
...
...
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