mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 16:53:33 +00:00
[SHELL32][SHELL32_APITEST][SDK] SHIsBadInterfacePtr (#7664)
Implementing missing features... JIRA issue: CORE-19278 - Move function definition from stubs.cpp to utils.cpp. - Implement SHIsBadInterfacePtr function in utils.cpp. - Add prototype to <undocshell.h>.
This commit is contained in:
parent
e302bacd7e
commit
a58bf95914
6 changed files with 85 additions and 11 deletions
|
@ -1809,6 +1809,30 @@ SHELL_CreateShell32DefaultExtractIcon(int IconIndex, REFIID riid, LPVOID *ppvOut
|
|||
return initIcon->QueryInterface(riid, ppvOut);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHIsBadInterfacePtr [SHELL32.84]
|
||||
*
|
||||
* Retired in 6.0 from Windows Vista and higher.
|
||||
*/
|
||||
EXTERN_C
|
||||
BOOL WINAPI
|
||||
SHIsBadInterfacePtr(
|
||||
_In_ LPCVOID pv,
|
||||
_In_ UINT_PTR ucb)
|
||||
{
|
||||
struct CUnknownVtbl
|
||||
{
|
||||
HRESULT (STDMETHODCALLTYPE *QueryInterface)(REFIID riid, LPVOID *ppvObj);
|
||||
ULONG (STDMETHODCALLTYPE *AddRef)();
|
||||
ULONG (STDMETHODCALLTYPE *Release)();
|
||||
};
|
||||
struct CUnknown { CUnknownVtbl *lpVtbl; };
|
||||
const CUnknown *punk = reinterpret_cast<const CUnknown *>(pv);
|
||||
return !punk || IsBadReadPtr(punk, sizeof(punk->lpVtbl)) ||
|
||||
IsBadReadPtr(punk->lpVtbl, ucb) ||
|
||||
IsBadCodePtr((FARPROC)punk->lpVtbl->Release);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetUserDisplayName [SHELL32.241]
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue