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
bd0fec25
Commit
bd0fec25
authored
Mar 15, 2008
by
Andrew Talbot
Committed by
Alexandre Julliard
Mar 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Assign to structs instead of using memcpy.
parent
038169b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
20 deletions
+15
-20
devinst.c
dlls/setupapi/devinst.c
+11
-16
misc.c
dlls/setupapi/misc.c
+1
-1
setupx_main.c
dlls/setupapi/setupx_main.c
+1
-1
virtcopy.c
dlls/setupapi/virtcopy.c
+2
-2
No files found.
dlls/setupapi/devinst.c
View file @
bd0fec25
...
...
@@ -352,13 +352,11 @@ static BOOL SETUPDI_AddInterfaceInstance(PSP_DEVINFO_DATA DeviceInfoData,
iface
->
cInstances
++
;
instance
->
cbSize
=
sizeof
(
SP_DEVICE_INTERFACE_DATA
);
memcpy
(
&
instance
->
InterfaceClassGuid
,
InterfaceClassGuid
,
sizeof
(
GUID
));
instance
->
InterfaceClassGuid
=
*
InterfaceClassGuid
;
instance
->
Flags
=
SPINT_ACTIVE
;
/* FIXME */
instance
->
Reserved
=
(
ULONG_PTR
)
ifaceInfo
;
if
(
newInterface
)
memcpy
(
&
iface
->
guid
,
InterfaceClassGuid
,
sizeof
(
GUID
));
iface
->
guid
=
*
InterfaceClassGuid
;
key
=
SetupDiCreateDeviceInterfaceRegKeyW
(
devInfo
->
set
,
instance
,
0
,
KEY_WRITE
,
NULL
,
NULL
);
if
(
key
!=
INVALID_HANDLE_VALUE
)
...
...
@@ -555,7 +553,7 @@ static BOOL SETUPDI_AddDeviceToSet(struct DeviceInfoSet *set,
SP_DEVINFO_DATA
*
DeviceInfoData
=
&
set
->
devices
[
set
->
cDevices
++
];
DeviceInfoData
->
cbSize
=
sizeof
(
SP_DEVINFO_DATA
);
memcpy
(
&
DeviceInfoData
->
ClassGuid
,
guid
,
sizeof
(
GUID
))
;
DeviceInfoData
->
ClassGuid
=
*
guid
;
DeviceInfoData
->
DevInst
=
devInfo
->
devId
;
DeviceInfoData
->
Reserved
=
(
ULONG_PTR
)
devInfo
;
SETUPDI_GuidToString
(
guid
,
classGuidStr
);
...
...
@@ -1498,7 +1496,7 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(
ret
=
FALSE
;
}
else
memcpy
(
DeviceInfoData
,
dev
,
sizeof
(
SP_DEVINFO_DATA
))
;
*
DeviceInfoData
=
*
dev
;
}
}
}
...
...
@@ -2383,7 +2381,7 @@ BOOL WINAPI SetupDiGetDeviceInfoListDetailA(
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
memcpy
(
&
DevInfoData
->
ClassGuid
,
&
set
->
ClassGuid
,
sizeof
(
GUID
))
;
DevInfoData
->
ClassGuid
=
set
->
ClassGuid
;
DevInfoData
->
RemoteMachineHandle
=
NULL
;
DevInfoData
->
RemoteMachineName
[
0
]
=
'\0'
;
return
TRUE
;
...
...
@@ -2416,7 +2414,7 @@ BOOL WINAPI SetupDiGetDeviceInfoListDetailW(
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
memcpy
(
&
DevInfoData
->
ClassGuid
,
&
set
->
ClassGuid
,
sizeof
(
GUID
))
;
DevInfoData
->
ClassGuid
=
set
->
ClassGuid
;
DevInfoData
->
RemoteMachineHandle
=
NULL
;
DevInfoData
->
RemoteMachineName
[
0
]
=
'\0'
;
return
TRUE
;
...
...
@@ -2513,7 +2511,7 @@ BOOL WINAPI SetupDiCreateDeviceInterfaceW(
ret
=
FALSE
;
}
else
memcpy
(
DeviceInterfaceData
,
iface
,
sizeof
(
*
iface
))
;
*
DeviceInterfaceData
=
*
iface
;
}
}
return
ret
;
...
...
@@ -2770,8 +2768,7 @@ BOOL WINAPI SetupDiEnumDeviceInterfaces(
if
((
ret
=
SETUPDI_FindInterface
(
devInfo
,
InterfaceClassGuid
,
&
iface
)))
{
if
(
MemberIndex
<
iface
->
cInstances
)
memcpy
(
DeviceInterfaceData
,
&
iface
->
instances
[
MemberIndex
],
sizeof
(
SP_DEVICE_INTERFACE_DATA
));
*
DeviceInterfaceData
=
iface
->
instances
[
MemberIndex
];
else
{
SetLastError
(
ERROR_NO_MORE_ITEMS
);
...
...
@@ -2801,9 +2798,7 @@ BOOL WINAPI SetupDiEnumDeviceInterfaces(
{
DWORD
instanceIndex
=
MemberIndex
-
cEnumerated
;
memcpy
(
DeviceInterfaceData
,
&
iface
->
instances
[
instanceIndex
],
sizeof
(
SP_DEVICE_INTERFACE_DATA
));
*
DeviceInterfaceData
=
iface
->
instances
[
instanceIndex
];
cEnumerated
+=
instanceIndex
+
1
;
found
=
TRUE
;
ret
=
TRUE
;
...
...
@@ -2916,7 +2911,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(
else
DeviceInterfaceDetailData
->
DevicePath
[
0
]
=
'\0'
;
if
(
DeviceInfoData
&&
DeviceInfoData
->
cbSize
==
sizeof
(
SP_DEVINFO_DATA
))
memcpy
(
DeviceInfoData
,
info
->
device
,
sizeof
(
SP_DEVINFO_DATA
))
;
*
DeviceInfoData
=
*
info
->
device
;
ret
=
TRUE
;
}
else
...
...
@@ -2984,7 +2979,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(
else
DeviceInterfaceDetailData
->
DevicePath
[
0
]
=
'\0'
;
if
(
DeviceInfoData
&&
DeviceInfoData
->
cbSize
==
sizeof
(
SP_DEVINFO_DATA
))
memcpy
(
DeviceInfoData
,
info
->
device
,
sizeof
(
SP_DEVINFO_DATA
))
;
*
DeviceInfoData
=
*
info
->
device
;
ret
=
TRUE
;
}
else
...
...
dlls/setupapi/misc.c
View file @
bd0fec25
...
...
@@ -511,7 +511,7 @@ BOOL WINAPI FileExists(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFileFindData)
FindClose
(
hFind
);
if
(
lpFileFindData
)
memcpy
(
lpFileFindData
,
&
FindData
,
sizeof
(
WIN32_FIND_DATAW
))
;
*
lpFileFindData
=
FindData
;
SetErrorMode
(
uErrorMode
);
...
...
dlls/setupapi/setupx_main.c
View file @
bd0fec25
...
...
@@ -476,7 +476,7 @@ RETERR16 WINAPI CtlSetLdd16(LPLOGDISKDESC pldd)
HeapFree
(
heap
,
0
,
pCurrLDD
->
pszDiskName
);
}
memcpy
(
pCurrLDD
,
pldd
,
sizeof
(
LOGDISKDESC_S
))
;
*
pCurrLDD
=
*
pldd
;
if
(
pldd
->
pszPath
)
{
...
...
dlls/setupapi/virtcopy.c
View file @
bd0fec25
...
...
@@ -250,10 +250,10 @@ static RETERR16 VCP_VirtnodeCreate(const VCPFILESPEC *vfsSrc, const VCPFILESPEC
lpvn
->
cbSize
=
sizeof
(
VIRTNODE
);
if
(
vfsSrc
)
memcpy
(
&
lpvn
->
vfsSrc
,
vfsSrc
,
sizeof
(
VCPFILESPEC
))
;
lpvn
->
vfsSrc
=
*
vfsSrc
;
if
(
vfsDst
)
memcpy
(
&
lpvn
->
vfsDst
,
vfsDst
,
sizeof
(
VCPFILESPEC
))
;
lpvn
->
vfsDst
=
*
vfsDst
;
lpvn
->
fl
=
fl
;
lpvn
->
lParam
=
lParam
;
...
...
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