mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +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;
|
HRESULT hr;
|
||||||
LPWSTR args = NULL;
|
LPWSTR args = NULL;
|
||||||
LPWSTR path = strdupW(m_sPath);
|
LPWSTR path = strdupW(m_sPath);
|
||||||
|
BOOL unicode = lpici->cbSize >= FIELD_OFFSET(CMINVOKECOMMANDINFOEX, ptInvoke) &&
|
||||||
|
(lpici->fMask & CMIC_MASK_UNICODE);
|
||||||
|
|
||||||
if ( lpici->cbSize == sizeof(CMINVOKECOMMANDINFOEX) &&
|
if (unicode)
|
||||||
(lpici->fMask & CMIC_MASK_UNICODE) )
|
|
||||||
{
|
{
|
||||||
LPCMINVOKECOMMANDINFOEX iciex = (LPCMINVOKECOMMANDINFOEX)lpici;
|
LPCMINVOKECOMMANDINFOEX iciex = (LPCMINVOKECOMMANDINFOEX)lpici;
|
||||||
SIZE_T len = 2;
|
SIZE_T len = 2;
|
||||||
|
|
|
@ -339,12 +339,16 @@ STDMETHODIMP CVfdShExt::InvokeCommand(
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
CMINVOKECOMMANDINFOEX *excmi = (CMINVOKECOMMANDINFOEX *)lpcmi;
|
CMINVOKECOMMANDINFOEX *excmi = (CMINVOKECOMMANDINFOEX *)lpcmi;
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
unicode = lpcmi->cbSize >= FIELD_OFFSET(CMINVOKECOMMANDINFOEX, ptInvoke) &&
|
||||||
|
(lpcmi->fMask & CMIC_MASK_UNICODE);
|
||||||
|
#else
|
||||||
if (lpcmi->cbSize >= sizeof(CMINVOKECOMMANDINFOEX) &&
|
if (lpcmi->cbSize >= sizeof(CMINVOKECOMMANDINFOEX) &&
|
||||||
(lpcmi->fMask & CMIC_MASK_UNICODE)) {
|
(lpcmi->fMask & CMIC_MASK_UNICODE)) {
|
||||||
|
|
||||||
unicode = TRUE;
|
unicode = TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!unicode && HIWORD(lpcmi->lpVerb)) {
|
if (!unicode && HIWORD(lpcmi->lpVerb)) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue