mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[SHELL32] Prevent a second call to Drive Properties dialog (#4888)
CDefaultContextMenu::DoProperties provides a fallback call to the property sheet testing the return value of the _DoCallback method, which is ultimately the return value of SH_ShowDriveProperties(). SH_ShowDriveProperties() sometimes returns an HRESULT, however it is marked as returning a BOOL. Then, DrivesContextMenuCallback() always handles this result as an HRESULT. Fix SH_ShowDriveProperties() to always return a BOOL as it is intended, and in DrivesContextMenuCallback() handle the result accordingly. CORE-18537
This commit is contained in:
parent
c093d4f803
commit
685728bc24
2 changed files with 2 additions and 2 deletions
|
@ -175,7 +175,7 @@ SH_ShowDriveProperties(WCHAR *pwszDrive, IDataObject *pDataObj)
|
|||
|
||||
CDataObjectHIDA cida(pDataObj);
|
||||
if (FAILED_UNEXPECTEDLY(cida.hr()))
|
||||
return cida.hr();
|
||||
return FAILED(cida.hr());
|
||||
|
||||
RECT rcPosition = {CW_USEDEFAULT, CW_USEDEFAULT, 0, 0};
|
||||
POINT pt;
|
||||
|
|
|
@ -345,7 +345,7 @@ HRESULT CALLBACK DrivesContextMenuCallback(IShellFolder *psf,
|
|||
{
|
||||
// pdtobj should be valid at this point!
|
||||
ATLASSERT(pdtobj);
|
||||
hr = SH_ShowDriveProperties(wszBuf, pdtobj);
|
||||
hr = SH_ShowDriveProperties(wszBuf, pdtobj) ? S_OK : E_UNEXPECTED;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
dwError = ERROR_CAN_NOT_COMPLETE;
|
||||
|
|
Loading…
Reference in a new issue