mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
- Read class name from Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID when available. Custom names like renamed MyComputer or MyDocuments are stored here
svn path=/trunk/; revision=35448
This commit is contained in:
parent
7d8e94151c
commit
524d084d4d
1 changed files with 19 additions and 6 deletions
|
@ -345,15 +345,28 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
DWORD buflen = len;
|
DWORD buflen = len;
|
||||||
|
WCHAR szName[100];
|
||||||
|
LPOLESTR pStr;
|
||||||
|
|
||||||
szDest[0] = 0;
|
szDest[0] = 0;
|
||||||
if (HCR_RegOpenClassIDKey(riid, &hkey))
|
|
||||||
|
if (StringFromCLSID(riid, &pStr) == S_OK)
|
||||||
{
|
{
|
||||||
static const WCHAR wszLocalizedString[] =
|
DWORD dwLen = buflen * sizeof(WCHAR);
|
||||||
{ 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 };
|
swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
|
||||||
if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) ||
|
if (RegGetValueW(HKEY_CURRENT_USER, szName, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szDest, &dwLen) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
CoTaskMemFree(pStr);
|
||||||
|
}
|
||||||
|
if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
|
||||||
|
{
|
||||||
|
static const WCHAR wszLocalizedString[] =
|
||||||
|
{ 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 };
|
||||||
|
if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) ||
|
||||||
!RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len))
|
!RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len))
|
||||||
{
|
{
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue