[SHELL32]

- CNetFolder: Use the Folder class for the items shown. The same is done in shell extensions (in windows) that use the CDefaultContextMenu and want the Open and Explore verbs to be shown. This behaviour was first discovered by gigaherz when ntobjshex was tested in windows.
CORE-12086

svn path=/trunk/; revision=72891
This commit is contained in:
Giannis Adamopoulos 2016-10-02 13:22:01 +00:00
parent 1cfbbff51a
commit 8a0defef3d
3 changed files with 21 additions and 2 deletions

View file

@ -417,8 +417,11 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CH
if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1))
{
IContextMenu * pCm = NULL;
hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
IContextMenu * pCm = NULL;
HKEY hkey;
UINT cKeys = 0;
AddClassKeyToArray(L"Folder", &hkey, &cKeys);
hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, cKeys, &hkey, &pCm);
pObj = pCm;
}
else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1))

View file

@ -83,6 +83,8 @@ static __inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags);
BOOL SHELL_FS_HideExtension(LPWSTR pwszPath);
void AddClassKeyToArray(const WCHAR * szClass, HKEY* array, UINT* cKeys);
#ifdef __cplusplus
HRESULT inline SHSetStrRet(LPSTRRET pStrRet, DWORD resId)

View file

@ -462,6 +462,20 @@ HRESULT SHELL32_CompareDetails(IShellFolder2* isf, LPARAM lParam, LPCITEMIDLIST
return MAKE_COMPARE_HRESULT(ret);
}
void AddClassKeyToArray(const WCHAR * szClass, HKEY* array, UINT* cKeys)
{
if (*cKeys >= 16)
return;
HKEY hkey;
LSTATUS result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ | KEY_QUERY_VALUE, &hkey);
if (result != ERROR_SUCCESS)
return;
array[*cKeys] = hkey;
*cKeys += 1;
}
/***********************************************************************
* SHCreateLinks
*