mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user