[ros-diffs] [navaraf] 33448: Fix checking of return values from IoCreateDevice. Spotted by R.T.Sivakumar <rtshiva at gmail.com>.
navaraf at svn.reactos.org
navaraf at svn.reactos.org
Sun May 11 21:47:51 CEST 2008
Author: navaraf
Date: Sun May 11 14:47:50 2008
New Revision: 33448
URL: http://svn.reactos.org/svn/reactos?rev=33448&view=rev
Log:
Fix checking of return values from IoCreateDevice. Spotted by R.T.Sivakumar <rtshiva at gmail.com>.
Modified:
trunk/reactos/drivers/filesystems/fastfat/iface.c
Modified: trunk/reactos/drivers/filesystems/fastfat/iface.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/iface.c?rev=33448&r1=33447&r2=33448&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/iface.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/iface.c [iso-8859-1] Sun May 11 14:47:50 2008
@@ -56,26 +56,28 @@
0,
FALSE,
&DeviceObject);
+
+ if (Status == STATUS_OBJECT_NAME_EXISTS ||
+ Status == STATUS_OBJECT_NAME_COLLISION)
+ {
+ /* Try an other name, if 'Fat' is already in use. 'Fat' is also used by fastfat.sys on W2K */
+ RtlInitUnicodeString(&DeviceName, L"\\RosFat");
+ Status = IoCreateDevice(DriverObject,
+ sizeof(VFAT_GLOBAL_DATA),
+ &DeviceName,
+ FILE_DEVICE_DISK_FILE_SYSTEM,
+ 0,
+ FALSE,
+ &DeviceObject);
+ }
+
+
+
if (!NT_SUCCESS(Status))
{
- if (Status == STATUS_OBJECT_NAME_EXISTS ||
- Status == STATUS_OBJECT_NAME_COLLISION)
- {
- /* Try an other name, if 'Fat' is already in use. 'Fat' is also used by fastfat.sys on W2K */
- RtlInitUnicodeString(&DeviceName, L"\\RosFat");
- Status = IoCreateDevice(DriverObject,
- sizeof(VFAT_GLOBAL_DATA),
- &DeviceName,
- FILE_DEVICE_DISK_FILE_SYSTEM,
- 0,
- FALSE,
- &DeviceObject);
- if (!NT_SUCCESS(Status))
- {
- return (Status);
- }
- }
+ return (Status);
}
+
VfatGlobalData = DeviceObject->DeviceExtension;
RtlZeroMemory (VfatGlobalData, sizeof(VFAT_GLOBAL_DATA));
VfatGlobalData->DriverObject = DriverObject;
More information about the Ros-diffs
mailing list