mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:56:05 +00:00
[SETUPLIB] Don't create new INI sections or key-values if they already exist (#6815)
- If a section already exists, return the existing one. This allows avoiding different section entries with the same name in the cache. If an INI file has separate sections with the same name, their contents (key-values) get merged into a unique section. - If a key-value already exists, update its data value and return the existing one. (Note that this may be subject to behaviour change in the future.)
This commit is contained in:
parent
817c27a54e
commit
b9ca9b0061
3 changed files with 141 additions and 111 deletions
|
@ -9,8 +9,8 @@
|
|||
|
||||
typedef struct _INI_KEYWORD
|
||||
{
|
||||
PWCHAR Name;
|
||||
PWCHAR Data;
|
||||
PWSTR Name;
|
||||
PWSTR Data;
|
||||
|
||||
struct _INI_KEYWORD *Next;
|
||||
struct _INI_KEYWORD *Prev;
|
||||
|
@ -18,7 +18,7 @@ typedef struct _INI_KEYWORD
|
|||
|
||||
typedef struct _INI_SECTION
|
||||
{
|
||||
PWCHAR Name;
|
||||
PWSTR Name;
|
||||
|
||||
PINI_KEYWORD FirstKey;
|
||||
PINI_KEYWORD LastKey;
|
||||
|
@ -74,8 +74,8 @@ IniCacheDestroy(
|
|||
|
||||
PINI_SECTION
|
||||
IniGetSection(
|
||||
PINICACHE Cache,
|
||||
PWCHAR Name);
|
||||
_In_ PINICACHE Cache,
|
||||
_In_ PCWSTR Name);
|
||||
|
||||
NTSTATUS
|
||||
IniGetKey(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue