mirror of
https://github.com/WinDurango/WinDurango.git
synced 2026-01-07 11:49:45 -06:00
This commit introduces logging statements to `QueryInterface` methods for better debugging of requested IIDs. New classes `MMDeviceCollectionWrapper` and `MMDeviceWrapper` are added to wrap existing COM interfaces, enhancing reference counting and interface querying. Additional logging is implemented in `dllmain.cpp` for specific game packages, particularly "Happy Dungeons." The `hooks.h` file is updated with detailed logging for various hooked functions to trace execution flow. New methods in the `Windows.Xbox.Multiplayer` namespace, including `Party`, `PartyChat`, and `PartyConfig`, provide multiplayer functionalities with logging for method invocations. Project files are updated to include these new classes, ensuring they are part of the build process. Overall, these changes improve debugging capabilities and introduce new device management and multiplayer features.
64 lines
1.7 KiB
C++
64 lines
1.7 KiB
C++
#include "pch.h"
|
|
#include "MMDeviceWrapper.h"
|
|
|
|
MMDeviceWrapper::MMDeviceWrapper(IMMDevice* realDevice) : m_realDevice(realDevice)
|
|
{
|
|
if (m_realDevice)
|
|
m_realDevice->AddRef();
|
|
}
|
|
|
|
HRESULT __stdcall MMDeviceWrapper::QueryInterface(REFIID riid, void** ppvObject)
|
|
{
|
|
printf("[MMDeviceWrapper] QueryInterface called\n");
|
|
LPOLESTR str = nullptr;
|
|
StringFromIID(riid, &str);
|
|
wprintf(L"[QueryInterface] IID requested: %ls\n", str);
|
|
CoTaskMemFree(str);
|
|
|
|
return m_realDevice->QueryInterface(riid, ppvObject);
|
|
}
|
|
|
|
ULONG __stdcall MMDeviceWrapper::AddRef(void)
|
|
{
|
|
printf("[MMDeviceWrapper] AddRef called\n");
|
|
return InterlockedIncrement(&m_refCount);
|
|
}
|
|
|
|
ULONG __stdcall MMDeviceWrapper::Release(void)
|
|
{
|
|
printf("[MMDeviceWrapper] Release called\n");
|
|
ULONG count = InterlockedDecrement(&m_refCount);
|
|
if (count == 0)
|
|
{
|
|
if (m_realDevice)
|
|
m_realDevice->Release();
|
|
delete this;
|
|
}
|
|
return count;
|
|
}
|
|
|
|
HRESULT __stdcall MMDeviceWrapper::Activate(REFIID iid, DWORD dwClsCtx, PROPVARIANT* pActivationParams, void** ppInterface)
|
|
{
|
|
printf("[MMDeviceWrapper] Activate called\n");
|
|
return m_realDevice->Activate(iid, dwClsCtx, pActivationParams, ppInterface);
|
|
|
|
}
|
|
|
|
|
|
HRESULT __stdcall MMDeviceWrapper::OpenPropertyStore(DWORD stgmAccess, IPropertyStore** ppProperties)
|
|
{
|
|
printf("[MMDeviceWrapper] OpenPropertyStore called\n");
|
|
return m_realDevice->OpenPropertyStore(stgmAccess, ppProperties);
|
|
}
|
|
|
|
HRESULT __stdcall MMDeviceWrapper::GetId(LPWSTR* ppstrId)
|
|
{
|
|
printf("[MMDeviceWrapper] GetId called\n");
|
|
return m_realDevice->GetId(ppstrId);
|
|
}
|
|
|
|
HRESULT __stdcall MMDeviceWrapper::GetState(DWORD* pdwState)
|
|
{
|
|
printf("[MMDeviceWrapper] GetState called\n");
|
|
return m_realDevice->GetState(pdwState);
|
|
} |