mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 07:33:27 +00:00
[SHELL32] SHAddToRecentDocs(): Just use SHRestricted() to get the NoRecentDocsHistory policy...
... instead of redoing the manual work.
This commit is contained in:
parent
fc1712e494
commit
72b405549c
1 changed files with 8 additions and 20 deletions
|
@ -631,6 +631,8 @@ SignalFileOpen (PCIDLIST_ABSOLUTE pidl)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __REACTOS__
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHADD_get_policy - helper function for SHAddToRecentDocs
|
* SHADD_get_policy - helper function for SHAddToRecentDocs
|
||||||
*
|
*
|
||||||
|
@ -672,6 +674,7 @@ static INT SHADD_get_policy(LPCSTR policy, LPDWORD type, LPVOID buffer, LPDWORD
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // __REACTOS__
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHADD_compare_mru - helper function for SHAddToRecentDocs
|
* SHADD_compare_mru - helper function for SHAddToRecentDocs
|
||||||
|
@ -813,7 +816,7 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
|
||||||
INT ret;
|
INT ret;
|
||||||
WCHAR szTargetPath[MAX_PATH], szLinkDir[MAX_PATH], szLinkFile[MAX_PATH], szDescription[80];
|
WCHAR szTargetPath[MAX_PATH], szLinkDir[MAX_PATH], szLinkFile[MAX_PATH], szDescription[80];
|
||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
DWORD cbBuffer, data[64], datalen, type;
|
DWORD cbBuffer;
|
||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
WIN32_FIND_DATAW find;
|
WIN32_FIND_DATAW find;
|
||||||
HKEY hExplorerKey;
|
HKEY hExplorerKey;
|
||||||
|
@ -829,25 +832,10 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
|
||||||
TRACE("%04x %p\n", uFlags, pv);
|
TRACE("%04x %p\n", uFlags, pv);
|
||||||
|
|
||||||
/* check policy */
|
/* check policy */
|
||||||
ret = SHADD_get_policy("NoRecentDocsHistory", &type, data, &datalen);
|
ret = SHRestricted(REST_NORECENTDOCSHISTORY);
|
||||||
if (ret > 0 && ret != ERROR_FILE_NOT_FOUND)
|
TRACE("policy value for NoRecentDocsHistory = %08x\n", ret);
|
||||||
{
|
if (ret != 0)
|
||||||
ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
|
return;
|
||||||
}
|
|
||||||
else if (ret == ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
if (!(type == REG_DWORD || (type == REG_BINARY && datalen == 4)))
|
|
||||||
{
|
|
||||||
ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
|
|
||||||
type, datalen);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
|
|
||||||
/* now test the actual policy value */
|
|
||||||
if (data[0] != 0)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* store to szTargetPath */
|
/* store to szTargetPath */
|
||||||
szTargetPath[0] = 0;
|
szTargetPath[0] = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue