Fix SHAddToRecentDocs code to properly handle native Comctl32 and
missing policies location.
This commit is contained in:
parent
58aa0a12b9
commit
5a538105d1
@ -1007,11 +1007,11 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
|||||||
pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
|
pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
|
||||||
pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
|
pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
|
||||||
pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
|
pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
|
||||||
pCreateMRUListA=(void*)GetProcAddress(hComctl32, "CreateMRUListA");
|
pCreateMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)151L /*"CreateMRUListA"*/);
|
||||||
pFreeMRUListA=(void*)GetProcAddress(hComctl32, "FreeMRUList");
|
pFreeMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)152L /*"FreeMRUList"*/);
|
||||||
pAddMRUData=(void*)GetProcAddress(hComctl32, "AddMRUData");
|
pAddMRUData=(void*)GetProcAddress(hComctl32, (LPCSTR)167L /*"AddMRUData"*/);
|
||||||
pFindMRUData=(void*)GetProcAddress(hComctl32, "FindMRUData");
|
pFindMRUData=(void*)GetProcAddress(hComctl32, (LPCSTR)169L /*"FindMRUData"*/);
|
||||||
pEnumMRUListA=(void*)GetProcAddress(hComctl32, "EnumMRUListA");
|
pEnumMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)154L /*"EnumMRUListA"*/);
|
||||||
|
|
||||||
/* initialize the common controls */
|
/* initialize the common controls */
|
||||||
if (pDLLInitComctl)
|
if (pDLLInitComctl)
|
||||||
|
@ -463,7 +463,8 @@ static INT SHADD_get_policy(LPSTR policy, LPDWORD type, LPVOID buffer, LPDWORD l
|
|||||||
if (RegOpenKeyExA(HKEY_CURRENT_USER,
|
if (RegOpenKeyExA(HKEY_CURRENT_USER,
|
||||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
|
"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
|
||||||
0, KEY_READ, &Policy_basekey)) {
|
0, KEY_READ, &Policy_basekey)) {
|
||||||
ERR("No Explorer Policies location\n");
|
TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
|
||||||
|
policy);
|
||||||
*len = 0;
|
*len = 0;
|
||||||
return ERROR_FILE_NOT_FOUND;
|
return ERROR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
@ -636,11 +637,12 @@ typedef struct tagCREATEMRULIST
|
|||||||
* and the close should be done during the _DETACH. The resulting
|
* and the close should be done during the _DETACH. The resulting
|
||||||
* key is stored in the DLL global data.
|
* key is stored in the DLL global data.
|
||||||
*/
|
*/
|
||||||
RegOpenKeyExA(HKEY_CURRENT_USER,
|
if (RegCreateKeyExA(HKEY_CURRENT_USER,
|
||||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
|
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
|
||||||
0,
|
0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
|
||||||
KEY_READ,
|
ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
|
||||||
&HCUbasekey);
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get path to user's "Recent" directory
|
/* Get path to user's "Recent" directory
|
||||||
*/
|
*/
|
||||||
@ -650,12 +652,17 @@ typedef struct tagCREATEMRULIST
|
|||||||
SHGetPathFromIDListA(pidl, link_dir);
|
SHGetPathFromIDListA(pidl, link_dir);
|
||||||
IMalloc_Free(ppM, pidl);
|
IMalloc_Free(ppM, pidl);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* serious issues */
|
||||||
|
link_dir[0] = 0;
|
||||||
|
ERR("serious issues 1\n");
|
||||||
|
}
|
||||||
IMalloc_Release(ppM);
|
IMalloc_Release(ppM);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* serious issues */
|
/* serious issues */
|
||||||
link_dir[0] = 0;
|
link_dir[0] = 0;
|
||||||
ERR("serious issues\n");
|
ERR("serious issues 2\n");
|
||||||
}
|
}
|
||||||
TRACE("Users Recent dir %s\n", link_dir);
|
TRACE("Users Recent dir %s\n", link_dir);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user