From 55532b15d9a01e98eabc58f5cb3fe3701df14aaa Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sat, 29 May 2004 21:28:28 +0000 Subject: [PATCH] - When checking for ReactOS cd-rom, in addition to 'reactos/ntoskrnl.exe' check also for 'reactos/system32/ntoskrnl.exe'. svn path=/trunk/; revision=9554 --- reactos/ntoskrnl/io/arcname.c | 36 ++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/io/arcname.c b/reactos/ntoskrnl/io/arcname.c index 19e8afee493..5f68734b25c 100644 --- a/reactos/ntoskrnl/io/arcname.c +++ b/reactos/ntoskrnl/io/arcname.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: arcname.c,v 1.17 2004/05/02 22:49:24 hbirr Exp $ +/* $Id: arcname.c,v 1.18 2004/05/29 21:28:28 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -258,6 +258,10 @@ IopCheckCdromDevices(PULONG DeviceNumber) } #endif + /* + * Check for 'reactos/ntoskrnl.exe' first... + */ + swprintf(DeviceNameBuffer, L"\\Device\\CdRom%lu\\reactos\\ntoskrnl.exe", i); @@ -285,6 +289,36 @@ IopCheckCdromDevices(PULONG DeviceNumber) return(STATUS_SUCCESS); } + /* + * ...and for 'reactos/system32/ntoskrnl.exe' also. + */ + + swprintf(DeviceNameBuffer, + L"\\Device\\CdRom%lu\\reactos\\system32\\ntoskrnl.exe", + i); + RtlInitUnicodeString(&DeviceName, + DeviceNameBuffer); + + InitializeObjectAttributes(&ObjectAttributes, + &DeviceName, + 0, + NULL, + NULL); + + Status = NtOpenFile(&Handle, + FILE_ALL_ACCESS, + &ObjectAttributes, + &IoStatusBlock, + 0, + 0); + DPRINT("NtOpenFile() DeviceNumber %lu Status %lx\n", i, Status); + if (NT_SUCCESS(Status)) + { + DPRINT("Found ntoskrnl.exe on Cdrom%lu\n", i); + NtClose(Handle); + *DeviceNumber = i; + return(STATUS_SUCCESS); + } } DPRINT("Could not find ntoskrnl.exe\n");