[EXPLORER][BROWSEUI][SHELL32][NETSHELL] Fix wrong usage of CComPtr

This commit is contained in:
Mark Jansen
2022-09-18 20:59:00 +02:00
parent a414c88dae
commit cd2d284142
13 changed files with 23 additions and 41 deletions

View File

@@ -60,7 +60,7 @@ typedef struct IEThreadParamBlock
UCHAR gap108[24];
DWORD dword120;
DWORD dword124;
IUnknown* offsetF8; // 0x128 instance explorer
IUnknown* pExplorerInstance; // 0x128 instance explorer
UCHAR byteflags_130;
} IE_THREAD_PARAM_BLOCK, * PIE_THREAD_PARAM_BLOCK;
#else
@@ -90,7 +90,7 @@ typedef struct IEThreadParamBlock
char offsetA4[0xD8-0xA4]; // unknown contents -- 0xA4..0xD8
LONG offsetD8;
char offsetDC[0xF8-0xDC]; // unknown contents -- 0xDC..0xF8
IUnknown * offsetF8; // instance explorer
IUnknown * pExplorerInstance; // instance explorer
LONG offsetFC; // unknown contents
} IE_THREAD_PARAM_BLOCK, *PIE_THREAD_PARAM_BLOCK;
#endif

View File

@@ -226,7 +226,8 @@ void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE)
{
if (cptr.p != NULL)
{
int nrc = cptr->Release();
T *raw = cptr.Detach();
int nrc = raw->Release();
if (nrc > 0)
{
DbgPrint("WARNING: Unexpected RefCount > 0 (%d)!\n", nrc);
@@ -234,11 +235,10 @@ void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE)
{
while (nrc > 0)
{
nrc = cptr->Release();
nrc = raw->Release();
}
}
}
cptr.Detach();
}
}