Author: dchapyshev
Date: Sat Jul 18 21:22:12 2009
New Revision: 42064
URL:
http://svn.reactos.org/svn/reactos?rev=42064&view=rev
Log:
- Add SEH protection at memory copying. Fixes crash at "setupapi_winetest
devinst"
Modified:
trunk/reactos/dll/win32/setupapi/devinst.c
Modified: trunk/reactos/dll/win32/setupapi/devinst.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Sat Jul 18 21:22:12 2009
@@ -4137,8 +4137,19 @@
Source = &((struct DeviceInfo
*)DeviceInfoData->Reserved)->InstallParams;
else
Source = &list->InstallParams;
- memcpy(DeviceInstallParams, Source, Source->cbSize);
+
ret = TRUE;
+
+ _SEH2_TRY
+ {
+ memcpy(DeviceInstallParams, Source, Source->cbSize);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ SetLastError(RtlNtStatusToDosError(_SEH2_GetExceptionCode()));
+ ret = FALSE;
+ }
+ _SEH2_END;
}
TRACE("Returning %d\n", ret);