#include "setuplib.h"
-// HACK!
-#include <strsafe.h>
-
#define NDEBUG
#include <debug.h>
DPRINT("INF_GetData() failed for key 'InstallationDirectory'\n");
goto Quit;
}
- wcscpy(pSetupData->InstallationDirectory, Value);
+
+ RtlStringCchCopyW(pSetupData->InstallationDirectory,
+ ARRAYSIZE(pSetupData->InstallationDirectory),
+ Value);
+
INF_FreeData(Value);
}
if (INF_GetData(&Context, NULL, &Value))
{
LONG Id = wcstol(Value, NULL, 16);
- swprintf(pSetupData->LocaleID, L"%08lx", Id);
+ RtlStringCchPrintfW(pSetupData->LocaleID,
+ ARRAYSIZE(pSetupData->LocaleID),
+ L"%08lx", Id);
INF_FreeData(Value);
}
}
if (IniSection)
{
/* Key "skipmissingfiles" */
- // StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
- // L"\"%s\"", L"WinNt5.2");
+ // RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ // L"\"%s\"", L"WinNt5.2");
// IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
// L"Version", PathBuffer);
}
IniSection = IniCacheAppendSection(IniCache, L"Data");
if (IniSection)
{
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
- L"\"%s\"", IsUnattendedSetup ? L"yes" : L"no");
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ L"\"%s\"", IsUnattendedSetup ? L"yes" : L"no");
IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
L"UnattendedInstall", PathBuffer);
// "floppylessbootpath" (yes/no)
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
- L"\"%s\"", L"winnt");
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ L"\"%s\"", L"winnt");
IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
L"ProductType", PathBuffer);
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
- L"\"%s\\\"", pSetupData->SourceRootPath.Buffer);
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ L"\"%s\\\"", pSetupData->SourceRootPath.Buffer);
IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
L"SourcePath", PathBuffer);
if (!INF_GetData(&Context, NULL, &Value))
return ERROR_CORRUPT_TXTSETUPSIF;
- wcscpy(pSetupData->InstallationDirectory, Value);
+ RtlStringCchCopyW(pSetupData->InstallationDirectory,
+ ARRAYSIZE(pSetupData->InstallationDirectory),
+ Value);
+
INF_FreeData(Value);
}