v2: -fixed a misleading comment - only print fixme when needed
This fixes bug https://bugs.winehq.org/show_bug.cgi?id=44959
I also tried to write a test, that test passes on the 32-bit testbots, but somehow the last test fails on 64-bit testbots and i don`t know why. Test is at https://testbot.winehq.org/GetFile.pl?JobKey=37794&StepKey=1
Also win2003 testbot gives strange errors in a test above this one that i don`t get. See for example https://testbot.winehq.org/JobDetails.pl?Key=37794. So this goes without submitted test for now
Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/shell32/shlfolder.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index 9143f1e..c94c90e 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -607,12 +607,38 @@ HRESULT WINAPI SHOpenFolderAndSelectItems( PCIDLIST_ABSOLUTE pidlFolder, UINT ci /*********************************************************************** * SHGetSetFolderCustomSettings * - * Only Unicode above Server 2003 + * Only Unicode above Server 2003, writes/reads from a desktop.ini */ HRESULT WINAPI SHGetSetFolderCustomSettings( LPSHFOLDERCUSTOMSETTINGS fcs, PCWSTR path, DWORD flag ) { - FIXME("%p %s 0x%x: stub\n", fcs, debugstr_w(path), flag); - return E_NOTIMPL; + static const WCHAR iconresourceW[] = {'I','c','o','n','R','e','s','o','u','r','c','e',0}; + static const WCHAR desktop_iniW[] = {'D','e','s','k','t','o','p','.','i','n','i',0}; + WCHAR bufferW[MAX_PATH]= {0}; + HRESULT hr; + + hr = E_FAIL; + + if (flag & FCS_FORCEWRITE) + { + if (fcs->dwMask & FCSM_ICONFILE) + { + lstrcpyW(bufferW, path); + PathAddBackslashW(bufferW); + lstrcatW(bufferW, desktop_iniW); + + if (WritePrivateProfileStringW(wszDotShellClassInfo, iconresourceW, fcs->pszIconFile, bufferW)) + { + TRACE("Wrote an iconresource entry %s into %s\n", debugstr_w(fcs->pszIconFile), debugstr_w(bufferW)); + hr = S_OK; + } + else + ERR("Failed to write (to) Desktop.ini file\n"); + } + } + else + FIXME("%p %s 0x%x: stub\n", fcs, debugstr_w(path), flag); + + return hr; }
/***********************************************************************