mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
GetFullPathName returns length without nul byte
svn path=/trunk/; revision=11211
This commit is contained in:
parent
85f0c7023d
commit
d24addb280
1 changed files with 1 additions and 0 deletions
|
@ -1063,6 +1063,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err
|
||||||
if (strchrW( name, '\\' ) || strchrW( name, '/' ))
|
if (strchrW( name, '\\' ) || strchrW( name, '/' ))
|
||||||
{
|
{
|
||||||
if (!(len = GetFullPathNameW( name, 0, NULL, NULL ))) return (HINF)INVALID_HANDLE_VALUE;
|
if (!(len = GetFullPathNameW( name, 0, NULL, NULL ))) return (HINF)INVALID_HANDLE_VALUE;
|
||||||
|
len++; /* Make room for terminating NUL byte */
|
||||||
if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
|
if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
|
||||||
{
|
{
|
||||||
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
|
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue