mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 11:31:40 +00:00
[FREELDR] Use strsafe functions in the PE loader.
This commit is contained in:
parent
313e6b6cbb
commit
cfbec70e04
1 changed files with 5 additions and 5 deletions
|
@ -245,9 +245,9 @@ PeLdrpBindImportName(
|
||||||
((ULONG_PTR)ForwarderName < ((ULONG_PTR)ExportDirectory + ExportSize)))
|
((ULONG_PTR)ForwarderName < ((ULONG_PTR)ExportDirectory + ExportSize)))
|
||||||
{
|
{
|
||||||
PLDR_DATA_TABLE_ENTRY DataTableEntry;
|
PLDR_DATA_TABLE_ENTRY DataTableEntry;
|
||||||
CHAR ForwardDllName[255];
|
|
||||||
PIMAGE_EXPORT_DIRECTORY RefExportDirectory;
|
PIMAGE_EXPORT_DIRECTORY RefExportDirectory;
|
||||||
ULONG RefExportSize;
|
ULONG RefExportSize;
|
||||||
|
CHAR ForwardDllName[256];
|
||||||
|
|
||||||
TRACE("PeLdrpBindImportName(): ForwarderName %s\n", ForwarderName);
|
TRACE("PeLdrpBindImportName(): ForwarderName %s\n", ForwarderName);
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ PeLdrpBindImportName(
|
||||||
RtlCopyMemory(ForwardDllName, ForwarderName, sizeof(ForwardDllName));
|
RtlCopyMemory(ForwardDllName, ForwarderName, sizeof(ForwardDllName));
|
||||||
|
|
||||||
/* Strip out the symbol name */
|
/* Strip out the symbol name */
|
||||||
*strrchr(ForwardDllName,'.') = '\0';
|
*strrchr(ForwardDllName, '.') = ANSI_NULL;
|
||||||
|
|
||||||
/* Check if the target image is already loaded */
|
/* Check if the target image is already loaded */
|
||||||
if (!PeLdrCheckForLoadedDll(ModuleListHead, ForwardDllName, &DataTableEntry))
|
if (!PeLdrCheckForLoadedDll(ModuleListHead, ForwardDllName, &DataTableEntry))
|
||||||
|
@ -264,7 +264,7 @@ PeLdrpBindImportName(
|
||||||
if (strchr(ForwardDllName, '.') == NULL)
|
if (strchr(ForwardDllName, '.') == NULL)
|
||||||
{
|
{
|
||||||
/* Name does not have an extension, append '.dll' */
|
/* Name does not have an extension, append '.dll' */
|
||||||
strcat(ForwardDllName, ".dll");
|
RtlStringCbCatA(ForwardDllName, sizeof(ForwardDllName), ".dll");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now let's try to load it! */
|
/* Now let's try to load it! */
|
||||||
|
@ -351,8 +351,8 @@ PeLdrpLoadAndScanReferencedDll(
|
||||||
PVOID BasePA = NULL;
|
PVOID BasePA = NULL;
|
||||||
|
|
||||||
/* Prepare the full path to the file to be loaded */
|
/* Prepare the full path to the file to be loaded */
|
||||||
strcpy(FullDllName, DirectoryPath);
|
RtlStringCbCopyA(FullDllName, sizeof(FullDllName), DirectoryPath);
|
||||||
strcat(FullDllName, ImportName);
|
RtlStringCbCatA(FullDllName, sizeof(FullDllName), ImportName);
|
||||||
|
|
||||||
TRACE("Loading referenced DLL: %s\n", FullDllName);
|
TRACE("Loading referenced DLL: %s\n", FullDllName);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue