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(a)gmail.com>om>.
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/fastfa…
==============================================================================
--- 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;