mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[SHELL32][VFDLIB] Handle size check of CMINVOKECOMMANDINFOEX correctly (#6767)
Older NT versions (< IE4) had a smaller CMINVOKECOMMANDINFOEX struct. Places where 3rd-party code passes in the struct needs to accept the small size.
This commit is contained in:
parent
5c3b1c78a7
commit
db93cb1709
2 changed files with 8 additions and 3 deletions
|
@ -2595,9 +2595,10 @@ HRESULT CShellLink::DoOpen(LPCMINVOKECOMMANDINFO lpici)
|
|||
HRESULT hr;
|
||||
LPWSTR args = NULL;
|
||||
LPWSTR path = strdupW(m_sPath);
|
||||
BOOL unicode = lpici->cbSize >= FIELD_OFFSET(CMINVOKECOMMANDINFOEX, ptInvoke) &&
|
||||
(lpici->fMask & CMIC_MASK_UNICODE);
|
||||
|
||||
if ( lpici->cbSize == sizeof(CMINVOKECOMMANDINFOEX) &&
|
||||
(lpici->fMask & CMIC_MASK_UNICODE) )
|
||||
if (unicode)
|
||||
{
|
||||
LPCMINVOKECOMMANDINFOEX iciex = (LPCMINVOKECOMMANDINFOEX)lpici;
|
||||
SIZE_T len = 2;
|
||||
|
|
|
@ -339,12 +339,16 @@ STDMETHODIMP CVfdShExt::InvokeCommand(
|
|||
DWORD ret;
|
||||
CMINVOKECOMMANDINFOEX *excmi = (CMINVOKECOMMANDINFOEX *)lpcmi;
|
||||
|
||||
#ifdef __REACTOS__
|
||||
unicode = lpcmi->cbSize >= FIELD_OFFSET(CMINVOKECOMMANDINFOEX, ptInvoke) &&
|
||||
(lpcmi->fMask & CMIC_MASK_UNICODE);
|
||||
#else
|
||||
if (lpcmi->cbSize >= sizeof(CMINVOKECOMMANDINFOEX) &&
|
||||
(lpcmi->fMask & CMIC_MASK_UNICODE)) {
|
||||
|
||||
unicode = TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (!unicode && HIWORD(lpcmi->lpVerb)) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue