Fix SHAddToRecentDocs code to properly handle native Comctl32 and

missing policies location.
This commit is contained in:
Guy Albertelli 2001-10-03 18:42:16 +00:00 committed by Alexandre Julliard
parent 58aa0a12b9
commit 5a538105d1
2 changed files with 19 additions and 12 deletions

View File

@ -1007,11 +1007,11 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
pCreateMRUListA=(void*)GetProcAddress(hComctl32, "CreateMRUListA");
pFreeMRUListA=(void*)GetProcAddress(hComctl32, "FreeMRUList");
pAddMRUData=(void*)GetProcAddress(hComctl32, "AddMRUData");
pFindMRUData=(void*)GetProcAddress(hComctl32, "FindMRUData");
pEnumMRUListA=(void*)GetProcAddress(hComctl32, "EnumMRUListA");
pCreateMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)151L /*"CreateMRUListA"*/);
pFreeMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)152L /*"FreeMRUList"*/);
pAddMRUData=(void*)GetProcAddress(hComctl32, (LPCSTR)167L /*"AddMRUData"*/);
pFindMRUData=(void*)GetProcAddress(hComctl32, (LPCSTR)169L /*"FindMRUData"*/);
pEnumMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)154L /*"EnumMRUListA"*/);
/* initialize the common controls */
if (pDLLInitComctl)

View File

@ -463,7 +463,8 @@ static INT SHADD_get_policy(LPSTR policy, LPDWORD type, LPVOID buffer, LPDWORD l
if (RegOpenKeyExA(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
0, KEY_READ, &Policy_basekey)) {
ERR("No Explorer Policies location\n");
TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
policy);
*len = 0;
return ERROR_FILE_NOT_FOUND;
}
@ -636,11 +637,12 @@ typedef struct tagCREATEMRULIST
* and the close should be done during the _DETACH. The resulting
* key is stored in the DLL global data.
*/
RegOpenKeyExA(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
0,
KEY_READ,
&HCUbasekey);
if (RegCreateKeyExA(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
return 0;
}
/* Get path to user's "Recent" directory
*/
@ -650,12 +652,17 @@ typedef struct tagCREATEMRULIST
SHGetPathFromIDListA(pidl, link_dir);
IMalloc_Free(ppM, pidl);
}
else {
/* serious issues */
link_dir[0] = 0;
ERR("serious issues 1\n");
}
IMalloc_Release(ppM);
}
else {
/* serious issues */
link_dir[0] = 0;
ERR("serious issues\n");
ERR("serious issues 2\n");
}
TRACE("Users Recent dir %s\n", link_dir);