mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 02:53:10 +00:00
[SETUPLIB][USETUP] Use NT RTL String Safe functions instead of Win32-oriented ones (and remove usage of HRESULT too).
Based on: svn path=/branches/setup_improvements/; revision=75755 svn path=/branches/setup_improvements/; revision=75757
This commit is contained in:
parent
254aa472e8
commit
48aab0fb20
10 changed files with 69 additions and 70 deletions
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include <ntstatus.h>
|
||||
|
||||
#include <strsafe.h>
|
||||
|
||||
#include "arcname.h"
|
||||
|
||||
#define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
|
||||
|
|
|
@ -21,9 +21,7 @@ CreateGenericList(VOID)
|
|||
{
|
||||
PGENERIC_LIST List;
|
||||
|
||||
List = (PGENERIC_LIST)RtlAllocateHeap(ProcessHeap,
|
||||
0,
|
||||
sizeof(GENERIC_LIST));
|
||||
List = RtlAllocateHeap(ProcessHeap, 0, sizeof(GENERIC_LIST));
|
||||
if (List == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@ -70,15 +68,15 @@ AppendGenericListEntry(
|
|||
IN BOOLEAN Current)
|
||||
{
|
||||
PGENERIC_LIST_ENTRY Entry;
|
||||
SIZE_T TextSize;
|
||||
|
||||
Entry = (PGENERIC_LIST_ENTRY)RtlAllocateHeap(ProcessHeap,
|
||||
0,
|
||||
sizeof(GENERIC_LIST_ENTRY) +
|
||||
(wcslen(Text) + 1) * sizeof(WCHAR));
|
||||
TextSize = (wcslen(Text) + 1) * sizeof(WCHAR);
|
||||
Entry = RtlAllocateHeap(ProcessHeap, 0,
|
||||
sizeof(GENERIC_LIST_ENTRY) + TextSize);
|
||||
if (Entry == NULL)
|
||||
return FALSE;
|
||||
|
||||
wcscpy(Entry->Text, Text);
|
||||
RtlStringCbCopyW(Entry->Text, TextSize, Text);
|
||||
Entry->List = List;
|
||||
Entry->UserData = UserData;
|
||||
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
|
||||
#include "regutil.h"
|
||||
|
||||
// HACK!
|
||||
#include <strsafe.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -180,7 +177,8 @@ CreateRegistryFile(
|
|||
|
||||
// i = 1;
|
||||
/* Try first by just appending the '.old' extension */
|
||||
StringCchPrintfW(PathBuffer2, ARRAYSIZE(PathBuffer2), L"%s.%s", PathBuffer, Extension);
|
||||
RtlStringCchPrintfW(PathBuffer2, ARRAYSIZE(PathBuffer2),
|
||||
L"%s.%s", PathBuffer, Extension);
|
||||
#if 0
|
||||
while (DoesFileExist(NULL, PathBuffer2))
|
||||
{
|
||||
|
@ -188,7 +186,8 @@ CreateRegistryFile(
|
|||
if (i <= 0xFFFF)
|
||||
{
|
||||
/* Append '_N.old' extension */
|
||||
StringCchPrintfW(PathBuffer2, ARRAYSIZE(PathBuffer2), L"%s_%lu.%s", PathBuffer, i, Extension);
|
||||
RtlStringCchPrintfW(PathBuffer2, ARRAYSIZE(PathBuffer2),
|
||||
L"%s_%lu.%s", PathBuffer, i, Extension);
|
||||
++i;
|
||||
}
|
||||
else
|
||||
|
@ -197,7 +196,8 @@ CreateRegistryFile(
|
|||
* Too many old files exist, we will rename the file
|
||||
* using the name of the oldest one.
|
||||
*/
|
||||
StringCchPrintfW(PathBuffer2, ARRAYSIZE(PathBuffer2), L"%s.%s", PathBuffer, Extension);
|
||||
RtlStringCchPrintfW(PathBuffer2, ARRAYSIZE(PathBuffer2),
|
||||
L"%s.%s", PathBuffer, Extension);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue