Author: tfaber
Date: Tue Apr 18 14:31:33 2017
New Revision: 74370
URL:
http://svn.reactos.org/svn/reactos?rev=74370&view=rev
Log:
[USER32]
- In RealSystemParametersInfoA/SPI_GETDESKWALLPAPER, write the ansi wallpaper path
directly into the user's buffer instead of using an allocation (and overrunning it).
Fixes crash when running user32_winetest:sysparams with DPH.
Tangential to CORE-13097
Modified:
trunk/reactos/win32ss/user/user32/misc/desktop.c
Modified: trunk/reactos/win32ss/user/user32/misc/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/desktop.c [iso-8859-1] Tue Apr 18 14:31:33
2017
@@ -306,10 +306,8 @@
Ret = NtUserSystemParametersInfo(SPI_GETDESKWALLPAPER, MAX_PATH, awc, fWinIni);
RtlInitUnicodeString(&ustrWallpaper, awc);
- RtlUnicodeStringToAnsiString(&astrWallpaper, &ustrWallpaper, TRUE);
-
- RtlCopyMemory(pvParam, astrWallpaper.Buffer, uiParam);
- RtlFreeAnsiString(&astrWallpaper);
+ RtlInitEmptyAnsiString(&astrWallpaper, pvParam, uiParam);
+ RtlUnicodeStringToAnsiString(&astrWallpaper, &ustrWallpaper, FALSE);
return Ret;
}