Huw Davies (@huw) commented about dlls/shell32/shlview_cmenu.c:
- _ILSimpleGetTextW(This->apidl[0], (LPVOID)wszFilename, MAX_PATH);
- length = lstrlenW(wszFilename) + lstrlenW(shortcutW);
- if (length > MAX_PATH) {
ERR("Path maximum length exceeded (%i>%i)\n", length, MAX_PATH);
IShellLinkW_Release(shelllink);
return;
- }
- SHGetPathFromIDListW(This->pidl, root);
- if (PathIsSystemFolderW(root, 0)) {
if (!SHGetSpecialFolderPathW(HWND_DESKTOP, root, CSIDL_DESKTOP, FALSE)) {
ERR("Target folder is System folder and Failed to get Desktop directory\n");
IShellLinkW_Release(shelllink);
return;
}
- }
I'd suggest leaving this out for now. We'd want to test whether `PathIsSystemFolderW()` is the correct way to determine this or whether the test should be on the pidl.