mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[SHELL32] Add two missing GlobalUnlock() calls (#5625)
* [SHELL32] Release DROPFILES structures * [SHELL32] Release the STGMEDIUM when returning on error
This commit is contained in:
parent
29fbe60abe
commit
bea7848fa9
2 changed files with 7 additions and 1 deletions
|
@ -46,6 +46,7 @@ class CRecyclerDropTarget :
|
||||||
if (!lpdf)
|
if (!lpdf)
|
||||||
{
|
{
|
||||||
ERR("Error locking global\n");
|
ERR("Error locking global\n");
|
||||||
|
ReleaseStgMedium(&medium);
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +66,7 @@ class CRecyclerDropTarget :
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GlobalUnlock(medium.hGlobal);
|
||||||
ReleaseStgMedium(&medium);
|
ReleaseStgMedium(&medium);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
|
@ -72,6 +72,7 @@ HRESULT WINAPI CExeDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState,
|
||||||
if (!lpdf)
|
if (!lpdf)
|
||||||
{
|
{
|
||||||
ERR("Error locking global\n");
|
ERR("Error locking global\n");
|
||||||
|
ReleaseStgMedium(&medium);
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
pszSrcList = (LPWSTR) (((byte*) lpdf) + lpdf->pFiles);
|
pszSrcList = (LPWSTR) (((byte*) lpdf) + lpdf->pFiles);
|
||||||
|
@ -84,6 +85,9 @@ HRESULT WINAPI CExeDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState,
|
||||||
|
|
||||||
pszSrcList += wcslen(pszSrcList) + 1;
|
pszSrcList += wcslen(pszSrcList) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GlobalUnlock(medium.hGlobal);
|
||||||
|
ReleaseStgMedium(&medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShellExecuteW(NULL, L"open", sPathTarget, wszBuf, NULL,SW_SHOWNORMAL);
|
ShellExecuteW(NULL, L"open", sPathTarget, wszBuf, NULL,SW_SHOWNORMAL);
|
||||||
|
@ -138,4 +142,4 @@ HRESULT WINAPI CExeDropHandler::GetClassID(CLSID * lpClassId)
|
||||||
*lpClassId = *pclsid;
|
*lpClassId = *pclsid;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue