svn path=/trunk/; revision=24356
PINICACHESECTION Section = NULL;
NTSTATUS Status;
ULONG FileAttribute;
PINICACHESECTION Section = NULL;
NTSTATUS Status;
ULONG FileAttribute;
+ PWCHAR OldValue = NULL;
RtlInitUnicodeString(&Name,
BootIniPath);
RtlInitUnicodeString(&Name,
BootIniPath);
return(STATUS_UNSUCCESSFUL);
}
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);
NULL,
INSERT_LAST,
EntryName,
EntryValue);
Status = UnprotectBootIni(BootIniPath,
&FileAttribute);
Status = UnprotectBootIni(BootIniPath,
&FileAttribute);