Author: janderwald
Date: Tue Aug 19 03:34:42 2008
New Revision: 35448
URL:
http://svn.reactos.org/svn/reactos?rev=35448&view=rev
Log:
- Read class name from Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID when
available. Custom names like renamed MyComputer or MyDocuments are stored here
Modified:
trunk/reactos/dll/win32/shell32/classes.c
Modified: trunk/reactos/dll/win32/shell32/classes.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/classes.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/classes.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/classes.c [iso-8859-1] Tue Aug 19 03:34:42 2008
@@ -345,15 +345,28 @@
HKEY hkey;
BOOL ret = FALSE;
DWORD buflen = len;
-
- szDest[0] = 0;
- if (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)
||
+ WCHAR szName[100];
+ LPOLESTR pStr;
+
+ szDest[0] = 0;
+
+ if (StringFromCLSID(riid, &pStr) == S_OK)
+ {
+ DWORD dwLen = buflen * sizeof(WCHAR);
+ swprintf(szName,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
+ 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))
- {
+ {
ret = TRUE;
}
RegCloseKey(hkey);