mirror of
https://github.com/reactos/reactos.git
synced 2025-06-28 02:39:42 +00:00
[SHELL32] Exclude executable extensions from File Types dialog (#7452)
PathIsExeW is used and will exclude exe, com, pif, cmd, bat, scf and scr. The previous #6122 PR added support for the FTA_Exclude flag and that will exclude .lnk files. CORE-19805
This commit is contained in:
parent
54433319af
commit
f271bebb71
1 changed files with 12 additions and 10 deletions
|
@ -28,6 +28,8 @@ WINE_DEFAULT_DEBUG_CHANNEL (fprop);
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
EXTERN_C BOOL PathIsExeW(LPCWSTR lpszPath);
|
||||||
|
|
||||||
#define FTA_MODIFYMASK (FTA_OpenIsSafe) // Bits modified by EditTypeDlg
|
#define FTA_MODIFYMASK (FTA_OpenIsSafe) // Bits modified by EditTypeDlg
|
||||||
#define NOASSOCRESID IDI_SHELL_DOCUMENT
|
#define NOASSOCRESID IDI_SHELL_DOCUMENT
|
||||||
#define SUPPORT_EXTENSIONWITHOUTPROGID 1 // NT5 does not support these but NT6 does
|
#define SUPPORT_EXTENSIONWITHOUTPROGID 1 // NT5 does not support these but NT6 does
|
||||||
|
@ -741,6 +743,14 @@ FileTypesDlg_InsertToLV(HWND hListView, LPCWSTR Assoc, INT iItem, PFILE_TYPE_GLO
|
||||||
|
|
||||||
if (Assoc[0] == L'.')
|
if (Assoc[0] == L'.')
|
||||||
{
|
{
|
||||||
|
if (PathIsExeW(Assoc))
|
||||||
|
{
|
||||||
|
exclude:
|
||||||
|
HeapFree(pG->hHeap, 0, Entry);
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
dwSize = sizeof(Entry->ClassKey);
|
dwSize = sizeof(Entry->ClassKey);
|
||||||
if (RegQueryValueExW(hKey, NULL, NULL, NULL, LPBYTE(Entry->ClassKey), &dwSize))
|
if (RegQueryValueExW(hKey, NULL, NULL, NULL, LPBYTE(Entry->ClassKey), &dwSize))
|
||||||
{
|
{
|
||||||
|
@ -754,21 +764,13 @@ FileTypesDlg_InsertToLV(HWND hListView, LPCWSTR Assoc, INT iItem, PFILE_TYPE_GLO
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (!Entry->ClassKey[0])
|
if (!Entry->ClassKey[0])
|
||||||
{
|
goto exclude;
|
||||||
HeapFree(pG->hHeap, 0, Entry);
|
|
||||||
RegCloseKey(hKey);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry->EditFlags = GetRegDWORD(hKey, L"EditFlags", 0);
|
Entry->EditFlags = GetRegDWORD(hKey, L"EditFlags", 0);
|
||||||
if (Entry->EditFlags & FTA_Exclude)
|
if (Entry->EditFlags & FTA_Exclude)
|
||||||
{
|
goto exclude;
|
||||||
HeapFree(pG->hHeap, 0, Entry);
|
|
||||||
RegCloseKey(hKey);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
wcscpy(Entry->FileExtension, Assoc);
|
wcscpy(Entry->FileExtension, Assoc);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue