Shell Folders: Reject invalid characters (#2328)

Reject invalid input filename characters by using shell32!SHLimitInputEdit function and IItemNameLimits interface. Improve SHLimitInputEdit to sanitize paste.
CORE-11701
This commit is contained in:
Katayama Hirofumi MZ 2020-02-12 09:18:24 +09:00 committed by GitHub
parent 0a7a747d87
commit bc1519dd87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 219 additions and 10 deletions

View file

@ -1989,9 +1989,13 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
m_pSFParent->GetAttributesOf(1, &pidl, &dwAttr);
if (SFGAO_CANRENAME & dwAttr)
{
HWND hEdit = reinterpret_cast<HWND>(m_ListView.SendMessage(LVM_GETEDITCONTROL));
SHLimitInputEdit(hEdit, m_pSFParent);
m_isEditing = TRUE;
return FALSE;
}
return TRUE;
}