Author: akhaldi Date: Wed Jan 13 16:06:09 2016 New Revision: 70586
URL: http://svn.reactos.org/svn/reactos?rev=70586&view=rev Log: [0.4.0] * Merge the usetup work by Hermès in revisions 70468, 70557 and 70558.
Modified: branches/ros-branch-0_4_0/ (props changed) branches/ros-branch-0_4_0/reactos/ (props changed) branches/ros-branch-0_4_0/reactos/base/setup/usetup/inicache.c
Propchange: branches/ros-branch-0_4_0/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jan 13 16:06:09 2016 @@ -1 +1 @@ -/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70464,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70576,70583 +/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70464,70468,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70557-70558,70576,70583
Propchange: branches/ros-branch-0_4_0/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jan 13 16:06:09 2016 @@ -20,4 +20,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70464,70470,70480,70497,70501,70507-70510,70523,70527-70530,70576,70583 +/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70464,70468,70470,70480,70497,70501,70507-70510,70523,70527-70530,70557-70558,70576,70583
Modified: branches/ros-branch-0_4_0/reactos/base/setup/usetup/inicache.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/base/se... ============================================================================== --- branches/ros-branch-0_4_0/reactos/base/setup/usetup/inicache.c [iso-8859-1] (original) +++ branches/ros-branch-0_4_0/reactos/base/setup/usetup/inicache.c [iso-8859-1] Wed Jan 13 16:06:09 2016 @@ -42,9 +42,7 @@ PINICACHEKEY Next;
if (Key == NULL) - { - return NULL; - } + return NULL;
Next = Key->Next; if (Key->Name != NULL) @@ -73,9 +71,7 @@ PINICACHESECTION Next;
if (Section == NULL) - { - return NULL; - } + return NULL;
Next = Section->Next; while (Section->FirstKey != NULL) @@ -146,16 +142,13 @@ }
Key = (PINICACHEKEY)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHEKEY)); if (Key == NULL) { DPRINT("RtlAllocateHeap() failed\n"); return NULL; } - - RtlZeroMemory(Key, - sizeof(INICACHEKEY));
Key->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap, 0, @@ -207,42 +200,6 @@
return Key; } - - -#if 0 -static -PINICACHESECTION -IniCacheFindSection( - PINICACHE Cache, - PWCHAR Name, - ULONG NameLength) -{ - PINICACHESECTION Section = NULL; - - if (Cache == NULL || Name == NULL || NameLength == 0) - { - return NULL; - } - - Section = Cache->FirstSection; - - /* iterate through list of sections */ - while (Section != NULL) - { - if (NameLength == wcslen(Section->Name)) - { - /* are the contents the same too? */ - if (_wcsnicmp(Section->Name, Name, NameLength) == 0) - break; - } - - /* get the next section*/ - Section = Section->Next; - } - - return Section; -} -#endif
static @@ -262,15 +219,13 @@ }
Section = (PINICACHESECTION)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHESECTION)); if (Section == NULL) { DPRINT("RtlAllocateHeap() failed\n"); return NULL; } - - RtlZeroMemory(Section, sizeof(INICACHESECTION));
/* Allocate and initialize section name */ Section->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap, @@ -351,7 +306,7 @@ *NamePtr = NULL; *NameSize = 0;
- /* skip whitespace */ + /* Skip whitespace */ while (*Ptr != 0 && isspace(*Ptr)) { Ptr++; @@ -401,7 +356,7 @@ *NameSize = 0; Size = 0;
- /* skip whitespace and empty lines */ + /* Skip whitespace and empty lines */ while (isspace(*Ptr) || *Ptr == '\n' || *Ptr == '\r') { Ptr++; @@ -579,7 +534,7 @@
DPRINT("File size: %lu\n", FileLength);
- /* Allocate file buffer */ + /* Allocate file buffer with NULL-terminator */ FileBuffer = (CHAR*)RtlAllocateHeap(ProcessHeap, 0, FileLength + 1); @@ -602,7 +557,7 @@ &FileOffset, NULL);
- /* Append string terminator */ + /* Append NULL-terminator */ FileBuffer[FileLength] = 0;
NtClose(FileHandle); @@ -616,16 +571,13 @@
/* Allocate inicache header */ *Cache = (PINICACHE)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHE)); if (*Cache == NULL) { DPRINT("RtlAllocateHeap() failed\n"); return STATUS_INSUFFICIENT_RESOURCES; } - - /* Initialize inicache header */ - RtlZeroMemory(*Cache, sizeof(INICACHE));
/* Parse ini file */ Section = NULL; @@ -700,9 +652,7 @@ PINICACHE Cache) { if (Cache == NULL) - { return; - }
while (Cache->FirstSection != NULL) { @@ -881,15 +831,13 @@
/* Allocate key buffer */ Key = (PINICACHEKEY)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHEKEY)); if (Key == NULL) { DPRINT("RtlAllocateHeap() failed\n"); return NULL; } - - RtlZeroMemory(Key, sizeof(INICACHEKEY));
/* Allocate name buffer */ Key->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap, @@ -969,16 +917,13 @@
/* Allocate inicache header */ Cache = (PINICACHE)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHE)); if (Cache == NULL) { DPRINT("RtlAllocateHeap() failed\n"); return NULL; } - - /* Initialize inicache header */ - RtlZeroMemory(Cache, sizeof(INICACHE));
return Cache; } @@ -1023,23 +968,20 @@
Section = Section->Next; if (Section != NULL) - BufferSize += 2; /* extra "\r\n" at end of each section */ - } - BufferSize++; /* Null-terminator */ + BufferSize += 2; /* Extra "\r\n" at end of each section */ + }
DPRINT("BufferSize: %lu\n", BufferSize);
- /* Allocate file buffer */ + /* Allocate file buffer with NULL-terminator */ Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap, - 0, - BufferSize); + HEAP_ZERO_MEMORY, + BufferSize + 1); if (Buffer == NULL) { DPRINT1("RtlAllocateHeap() failed\n"); return STATUS_INSUFFICIENT_RESOURCES; } - - RtlZeroMemory(Buffer, BufferSize);
/* Fill file buffer */ Ptr = Buffer; @@ -1133,15 +1075,13 @@ }
Section = (PINICACHESECTION)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHESECTION)); if (Section == NULL) { DPRINT("RtlAllocateHeap() failed\n"); return NULL; } - - RtlZeroMemory(Section, sizeof(INICACHESECTION));
/* Allocate and initialize section name */ Section->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap,