diff --git a/dlls/shell32/classes.c b/dlls/shell32/classes.c index a7d329818a..bcb321aa7b 100644 --- a/dlls/shell32/classes.c +++ b/dlls/shell32/classes.c @@ -15,12 +15,18 @@ DEFAULT_DEBUG_CHANNEL(shell) +#define MAX_EXTENSION_LENGTH 20 + BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len) { HKEY hkey; + char szTemp[MAX_EXTENSION_LENGTH + 2]; TRACE("%s %p\n",szExtension, szFileType ); - if (RegOpenKeyExA(HKEY_CLASSES_ROOT,szExtension,0,0x02000000,&hkey)) + strcpy(szTemp, "."); + strncat(szTemp, szExtension, MAX_EXTENSION_LENGTH); + + if (RegOpenKeyExA(HKEY_CLASSES_ROOT,szTemp,0,0x02000000,&hkey)) { return FALSE; } @@ -92,6 +98,72 @@ BOOL HCR_GetDefaultIcon (LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr) TRACE("-- %s %li\n", szDest, *dwNr ); return TRUE; - +} + +/*************************************************************************************** +* HCR_GetClassName [internal] +* +* Gets the name of a registred class +*/ +BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len) +{ HKEY hkey; + char xriid[50]; + + strcpy(xriid,"CLSID\\"); + WINE_StringFromCLSID(riid,&xriid[strlen(xriid)]); + + TRACE("%s\n",xriid ); + + if (RegOpenKeyExA(HKEY_CLASSES_ROOT,xriid,0,KEY_READ,&hkey)) + { return FALSE; + } + + if (RegQueryValueExA(hkey,"",0,NULL,szDest,&len)) + { RegCloseKey(hkey); + return FALSE; + } + + RegCloseKey(hkey); + + TRACE("-- %s\n", szDest); + + return TRUE; +} + +/*************************************************************************************** +* HCR_GetFolderAttributes [internal] +* +* gets the folder attributes of a class +*/ +BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest) +{ HKEY hkey; + char xriid[60]; + DWORD attributes; + DWORD len = 4; + + strcpy(xriid,"CLSID\\"); + WINE_StringFromCLSID(riid,&xriid[strlen(xriid)]); + TRACE("%s\n",xriid ); + + strcat (xriid, "\\ShellFolder"); + + if (RegOpenKeyExA(HKEY_CLASSES_ROOT,xriid,0,KEY_READ,&hkey)) + { + return FALSE; + } + + if (RegQueryValueExA(hkey,"Attributes",0,NULL,(LPBYTE)&attributes,&len)) + { + RegCloseKey(hkey); + return FALSE; + } + + RegCloseKey(hkey); + + TRACE("-- 0x%08lx\n", attributes); + + *szDest = attributes; + + return TRUE; }