From: Thomas Faber Date: Tue, 18 Apr 2017 14:31:33 +0000 (+0000) Subject: [USER32] X-Git-Tag: ReactOS-0.4.5~64 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=202ae322fbd378e080bcb8cfca6a3cc2c05225da [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 svn path=/trunk/; revision=74370 --- diff --git a/reactos/win32ss/user/user32/misc/desktop.c b/reactos/win32ss/user/user32/misc/desktop.c index 25e2e4b9597..49f23c248c1 100644 --- a/reactos/win32ss/user/user32/misc/desktop.c +++ b/reactos/win32ss/user/user32/misc/desktop.c @@ -306,10 +306,8 @@ RealSystemParametersInfoA(UINT uiAction, 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; }