diff --git a/reactos/base/setup/usetup/inicache.c b/reactos/base/setup/usetup/inicache.c index c2f7f99b47f..955712a7ddc 100644 --- a/reactos/base/setup/usetup/inicache.c +++ b/reactos/base/setup/usetup/inicache.c @@ -142,7 +142,7 @@ IniCacheAddKey( } Key = (PINICACHEKEY)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHEKEY)); if (Key == NULL) { @@ -150,9 +150,6 @@ IniCacheAddKey( return NULL; } - RtlZeroMemory(Key, - sizeof(INICACHEKEY)); - Key->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap, 0, (NameLength + 1) * sizeof(WCHAR)); @@ -222,7 +219,7 @@ IniCacheAddSection( } Section = (PINICACHESECTION)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHESECTION)); if (Section == NULL) { @@ -230,8 +227,6 @@ IniCacheAddSection( return NULL; } - RtlZeroMemory(Section, sizeof(INICACHESECTION)); - /* Allocate and initialize section name */ Section->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap, 0, @@ -579,7 +574,7 @@ IniCacheLoad( /* Allocate inicache header */ *Cache = (PINICACHE)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHE)); if (*Cache == NULL) { @@ -587,9 +582,6 @@ IniCacheLoad( return STATUS_INSUFFICIENT_RESOURCES; } - /* Initialize inicache header */ - RtlZeroMemory(*Cache, sizeof(INICACHE)); - /* Parse ini file */ Section = NULL; Ptr = FileBuffer; @@ -842,7 +834,7 @@ IniCacheInsertKey( /* Allocate key buffer */ Key = (PINICACHEKEY)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHEKEY)); if (Key == NULL) { @@ -850,8 +842,6 @@ IniCacheInsertKey( return NULL; } - RtlZeroMemory(Key, sizeof(INICACHEKEY)); - /* Allocate name buffer */ Key->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap, 0, @@ -930,7 +920,7 @@ IniCacheCreate(VOID) /* Allocate inicache header */ Cache = (PINICACHE)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHE)); if (Cache == NULL) { @@ -938,9 +928,6 @@ IniCacheCreate(VOID) return NULL; } - /* Initialize inicache header */ - RtlZeroMemory(Cache, sizeof(INICACHE)); - return Cache; } @@ -992,7 +979,7 @@ IniCacheSave( /* Allocate file buffer */ Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, BufferSize); if (Buffer == NULL) { @@ -1000,8 +987,6 @@ IniCacheSave( return STATUS_INSUFFICIENT_RESOURCES; } - RtlZeroMemory(Buffer, BufferSize); - /* Fill file buffer */ Ptr = Buffer; Section = Cache->FirstSection; @@ -1093,7 +1078,7 @@ IniCacheAppendSection( } Section = (PINICACHESECTION)RtlAllocateHeap(ProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(INICACHESECTION)); if (Section == NULL) { @@ -1101,8 +1086,6 @@ IniCacheAppendSection( return NULL; } - RtlZeroMemory(Section, sizeof(INICACHESECTION)); - /* Allocate and initialize section name */ Section->Name = (WCHAR*)RtlAllocateHeap(ProcessHeap, 0,