- Add a check to the boot.ini-changing code, to prevent creation of a new ReactOS entry after each installation.

svn path=/trunk/; revision=24356
This commit is contained in:
Aleksey Bragin 2006-10-01 21:48:05 +00:00
parent 5cf4352021
commit 5c112af711

View file

@ -1665,6 +1665,7 @@ UpdateBootIni(PWSTR BootIniPath,
PINICACHESECTION Section = NULL;
NTSTATUS Status;
ULONG FileAttribute;
PWCHAR OldValue = NULL;
RtlInitUnicodeString(&Name,
BootIniPath);
@ -1685,11 +1686,20 @@ UpdateBootIni(PWSTR BootIniPath,
return(STATUS_UNSUCCESSFUL);
}
IniCacheInsertKey(Section,
/* Check - maybe record already exists */
Status = IniCacheGetKey(Section,
EntryName,
&OldValue);
/* If either key was not found, or contains something else - add new one */
if (!NT_SUCCESS(Status) || wcscmp(OldValue, EntryValue))
{
IniCacheInsertKey(Section,
NULL,
INSERT_LAST,
EntryName,
EntryValue);
}
Status = UnprotectBootIni(BootIniPath,
&FileAttribute);