mirror of
https://github.com/reactos/reactos.git
synced 2025-06-28 10:39:49 +00:00
[SHELL32]
* Partial sync of classes.c with Wine 1.7.27. CORE-8540 svn path=/branches/shell-experiments/; revision=65290
This commit is contained in:
parent
68ba7b8c1b
commit
d6cf4f43aa
1 changed files with 216 additions and 219 deletions
|
@ -206,6 +206,11 @@ BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPW
|
|||
return ret;
|
||||
}
|
||||
|
||||
/***************************************************************************************
|
||||
* HCR_GetDefaultIcon [internal]
|
||||
*
|
||||
* Gets the icon for a filetype
|
||||
*/
|
||||
static BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
|
||||
{
|
||||
char xriid[50];
|
||||
|
@ -219,11 +224,6 @@ static BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
|
|||
return (RegOpenKeyExA(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey) == ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
/***************************************************************************************
|
||||
* HCR_GetIcon [internal]
|
||||
*
|
||||
* Gets the icon for a filetype, szName can be NULL, in which case the default icon is loaded
|
||||
*/
|
||||
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
|
||||
{
|
||||
DWORD dwType;
|
||||
|
@ -466,22 +466,22 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
|
|||
LPOLESTR pwszCLSID;
|
||||
LONG lResult;
|
||||
DWORD dwTemp, dwLen;
|
||||
static const WCHAR wszAttributes[] = L"Attributes";
|
||||
static const WCHAR wszCallForAttributes[] = L"CallForAttributes";
|
||||
WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder";
|
||||
static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 };
|
||||
static const WCHAR wszCallForAttributes[] = {
|
||||
'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 };
|
||||
WCHAR wszShellFolderKey[] = { 'C','L','S','I','D','\\','{','0','0','0','2','1','4','0','0','-',
|
||||
'0','0','0','0','-','0','0','0','0','-','C','0','0','0','-','0','0','0','0','0','0','0',
|
||||
'0','0','0','4','6','}','\\','S','h','e','l','l','F','o','l','d','e','r',0 };
|
||||
|
||||
TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
|
||||
|
||||
if (!_ILIsPidlSimple(pidlFolder))
|
||||
{
|
||||
if (!_ILIsPidlSimple(pidlFolder)) {
|
||||
ERR("should be called for simple PIDL's only!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!_ILIsDesktop(pidlFolder))
|
||||
{
|
||||
if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID)))
|
||||
return FALSE;
|
||||
if (!_ILIsDesktop(pidlFolder)) {
|
||||
if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE;
|
||||
memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR));
|
||||
CoTaskMemFree(pwszCLSID);
|
||||
}
|
||||
|
@ -495,32 +495,29 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
|
|||
|
||||
dwLen = sizeof(DWORD);
|
||||
lResult = RegQueryValueExW(hSFKey, wszCallForAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen);
|
||||
if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes))
|
||||
{
|
||||
if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
|
||||
IShellFolder *psfDesktop;
|
||||
IShellFolder *psfFolder;
|
||||
HRESULT hr;
|
||||
|
||||
RegCloseKey(hSFKey);
|
||||
hr = SHGetDesktopFolder(&psfDesktop);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder, (LPVOID*)&psfFolder);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder,
|
||||
(LPVOID*)&psfFolder);
|
||||
if (SUCCEEDED(hr))
|
||||
hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
|
||||
}
|
||||
if (FAILED(hr))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(hr)) return FALSE;
|
||||
} else {
|
||||
lResult = RegQueryValueExW(hSFKey, wszAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen);
|
||||
RegCloseKey(hSFKey);
|
||||
if (lResult == ERROR_SUCCESS)
|
||||
if (lResult == ERROR_SUCCESS) {
|
||||
*pdwAttributes &= dwTemp;
|
||||
else
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("-- *pdwAttributes == 0x%08x\n", *pdwAttributes);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue