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; }