mirror of
https://github.com/reactos/reactos.git
synced 2024-08-21 10:53:15 +00:00
- 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:
parent
5cf4352021
commit
5c112af711
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue