mirror of
https://github.com/vxunderground/VX-API
synced 2026-06-06 16:54:55 +00:00
general enhancements
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
#include <shlwapi.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
#pragma comment(lib, "shlwapi.lib")
|
||||
|
||||
HRESULT UnusedSubroutineGetShellDispatchFromView(IShellView* ShellView, REFIID Riid, PVOID* Dispatch2)
|
||||
{
|
||||
HRESULT Result = S_OK;
|
||||
@@ -49,6 +47,9 @@ EXIT_ROUTINE:
|
||||
|
||||
HRESULT UnusedSubroutineGetShellViewForDesktop(REFIID Riid, PVOID* ShellView)
|
||||
{
|
||||
typedef HRESULT(WINAPI* IUNKNOWN_QUERYSERVICE)(IUnknown*, REFGUID, REFIID, PVOID*);
|
||||
IUNKNOWN_QUERYSERVICE QueryServiceUsingIUnknown = NULL;
|
||||
HMODULE hModule = NULL;
|
||||
HRESULT Result = S_OK;
|
||||
IShellWindows* Windows = NULL;
|
||||
HWND hWnd;
|
||||
@@ -58,6 +59,14 @@ HRESULT UnusedSubroutineGetShellViewForDesktop(REFIID Riid, PVOID* ShellView)
|
||||
IShellView* View = NULL;
|
||||
*ShellView = NULL;
|
||||
|
||||
hModule = LoadLibraryW(L"Shlwapi.dll");
|
||||
if (hModule == NULL)
|
||||
return E_FAIL;
|
||||
|
||||
QueryServiceUsingIUnknown = (IUNKNOWN_QUERYSERVICE)GetProcAddressA((DWORD64)hModule, (PCHAR)"IUnknown_QueryService");
|
||||
if(QueryServiceUsingIUnknown == NULL)
|
||||
return E_FAIL;
|
||||
|
||||
Result = CoCreateInstance(CLSID_ShellWindows, NULL, CLSCTX_LOCAL_SERVER, IID_PPV_ARGS(&Windows));
|
||||
if (!SUCCEEDED(Result))
|
||||
return Result;
|
||||
@@ -66,7 +75,7 @@ HRESULT UnusedSubroutineGetShellViewForDesktop(REFIID Riid, PVOID* ShellView)
|
||||
if (!SUCCEEDED(Result))
|
||||
goto EXIT_ROUTINE;
|
||||
|
||||
Result = IUnknown_QueryService(Dispatch, SID_STopLevelBrowser, IID_PPV_ARGS(&Browser));
|
||||
Result = QueryServiceUsingIUnknown(Dispatch, SID_STopLevelBrowser, IID_PPV_ARGS(&Browser));
|
||||
if (!SUCCEEDED(Result))
|
||||
goto EXIT_ROUTINE;
|
||||
|
||||
@@ -81,6 +90,9 @@ HRESULT UnusedSubroutineGetShellViewForDesktop(REFIID Riid, PVOID* ShellView)
|
||||
|
||||
EXIT_ROUTINE:
|
||||
|
||||
if (hModule)
|
||||
FreeLibrary(hModule);
|
||||
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 6001)
|
||||
if (Windows)
|
||||
|
||||
Reference in New Issue
Block a user