mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 16:30:26 +00:00
Fix checking of return values from IoCreateDevice. Spotted by R.T.Sivakumar <rtshiva@gmail.com>.
svn path=/trunk/; revision=33448
This commit is contained in:
parent
76256a1bdd
commit
b512080393
1 changed files with 19 additions and 17 deletions
|
@ -56,26 +56,28 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue