mirror of
https://github.com/reactos/reactos.git
synced 2025-05-01 19:50:36 +00:00
[KERNEL32] sync GetTempPathW with wine wine-1.7.50
svn path=/trunk/; revision=68797
This commit is contained in:
parent
c652a5f2c9
commit
190095e160
1 changed files with 11 additions and 6 deletions
|
@ -2116,13 +2116,18 @@ GetTempPathW(IN DWORD count,
|
||||||
|
|
||||||
ret++; /* add space for terminating 0 */
|
ret++; /* add space for terminating 0 */
|
||||||
|
|
||||||
if (count)
|
|
||||||
{
|
|
||||||
lstrcpynW(path, full_tmp_path, count);
|
|
||||||
if (count >= ret)
|
if (count >= ret)
|
||||||
|
{
|
||||||
|
lstrcpynW(path, tmp_path, count);
|
||||||
|
/* the remaining buffer must be zeroed up to 32766 bytes in XP or 32767
|
||||||
|
* bytes after it, we will assume the > XP behavior for now */
|
||||||
|
memset(path + ret, 0, (min(count, 32767) - ret) * sizeof(WCHAR));
|
||||||
ret--; /* return length without 0 */
|
ret--; /* return length without 0 */
|
||||||
else if (count < 4)
|
}
|
||||||
path[0] = 0; /* avoid returning ambiguous "X:" */
|
else if (count)
|
||||||
|
{
|
||||||
|
/* the buffer must be cleared if contents will not fit */
|
||||||
|
memset(path, 0, count * sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("GetTempPathW returning %u, %S\n", ret, path);
|
DPRINT("GetTempPathW returning %u, %S\n", ret, path);
|
||||||
|
|
Loading…
Reference in a new issue