mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 13:52:30 +00:00
[KERNEL32]
- Properly copy image name in TH32CreateSnapshotSectionInitialize. Fixes truncated file names in kernel32:toolhelp test svn path=/trunk/; revision=54071
This commit is contained in:
parent
d458a31a34
commit
756c9d6dc2
1 changed files with 6 additions and 3 deletions
|
@ -409,9 +409,12 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
|
||||||
ProcessListEntry->dwFlags = 0; /* no longer used */
|
ProcessListEntry->dwFlags = 0; /* no longer used */
|
||||||
if(ProcessInfo->ImageName.Buffer != NULL)
|
if(ProcessInfo->ImageName.Buffer != NULL)
|
||||||
{
|
{
|
||||||
lstrcpynW(ProcessListEntry->szExeFile,
|
ULONG ExeFileLength = min(ProcessInfo->ImageName.Length,
|
||||||
ProcessInfo->ImageName.Buffer,
|
sizeof(ProcessListEntry->szExeFile) - sizeof(WCHAR));
|
||||||
min(ProcessInfo->ImageName.Length / sizeof(WCHAR), sizeof(ProcessListEntry->szExeFile) / sizeof(ProcessListEntry->szExeFile[0])));
|
RtlCopyMemory(ProcessListEntry->szExeFile,
|
||||||
|
ProcessInfo->ImageName.Buffer,
|
||||||
|
ExeFileLength);
|
||||||
|
ProcessListEntry->szExeFile[ExeFileLength / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue