Files
WinDurango/dlls/kernelx/FrameworkViewWrapper.cpp
Serenity 2ae935a199 Refactor logging system and remove deprecated methods
This commit introduces a new `Logger` class to replace all instances of `printf` and `DEBUG_LOG` throughout the codebase. Key changes include:

- Replaced logging calls in `Audio2.cpp` and `appmodel.cpp` with structured log levels (`LOG_WARNING`, `LOG_DEBUG`, etc.).
- Removed `DebugLogger.h` and `Logger.cpp`, consolidating logging functionality into `Logger.h`.
- Added `Config.h` for configuration management using TOML files.
- Updated project files to reflect the removal of old logging files and inclusion of the new logging system.

These changes enhance logging capabilities, improve code maintainability, and standardize logging practices across the codebase.
2025-07-01 21:25:24 -04:00

90 lines
2.2 KiB
C++

#include "pch.h"
#include "FrameworkViewWrapper.h"
HRESULT __stdcall FrameworkViewWrapper::Initialize(ABI::Windows::ApplicationModel::Core::ICoreApplicationView* applicationView)
{
return m_realView->Initialize(applicationView);
}
HRESULT __stdcall FrameworkViewWrapper::SetWindow(ABI::Windows::UI::Core::ICoreWindow* window)
{
// Finally Wraps the coreWindow with xbox CoreWindow
window = reinterpret_cast<ICoreWindow*>(new CoreWindowWrapperX((CoreWindow*)window));
return m_realView->SetWindow(window);
}
HRESULT __stdcall FrameworkViewWrapper::Load(HSTRING entryPoint)
{
return m_realView->Load(entryPoint);
}
HRESULT __stdcall FrameworkViewWrapper::Run(void)
{
return m_realView->Run();
}
HRESULT __stdcall FrameworkViewWrapper::Uninitialize(void)
{
return m_realView->Uninitialize();
}
HRESULT FrameworkViewWrapper::QueryInterface(const IID& riid, void** ppvObject)
{
LPOLESTR str = nullptr;
StringFromIID(riid, &str);
LOG_INFO_W(L"FrameworkViewWrapper [QI] IID Requested: %s\n", str);
CoTaskMemFree(str);
if (riid == __uuidof(IFrameworkView) ||
riid == __uuidof(ICoreApplicationExit) ||
riid == __uuidof(IUnknown) ||
riid == __uuidof(IInspectable))
{
*ppvObject = this;
AddRef();
return S_OK;
}
else
{
/*/ DEBUG
char iidstr[sizeof("{AAAAAAAA-BBBB-CCCC-DDEE-FFGGHHIIJJKK}")];
OLECHAR iidwstr[sizeof(iidstr)];
StringFromGUID2(riid, iidwstr, ARRAYSIZE(iidwstr));
WideCharToMultiByte(CP_UTF8, 0, iidwstr, -1, iidstr, sizeof(iidstr), nullptr, nullptr);
MessageBoxA(nullptr, iidstr, typeid(*this).name(), MB_OK);*/
}
return m_realView->QueryInterface(riid, ppvObject);
}
ULONG FrameworkViewWrapper::AddRef()
{
return InterlockedIncrement(&m_RefCount);
}
ULONG FrameworkViewWrapper::Release()
{
ULONG refCount = InterlockedDecrement(&m_RefCount);
if (refCount == 0)
delete this;
return refCount;
}
HRESULT FrameworkViewWrapper::GetIids(ULONG* iidCount, IID** iids)
{
return m_realView->GetIids(iidCount, iids);
}
HRESULT FrameworkViewWrapper::GetRuntimeClassName(HSTRING* className)
{
return m_realView->GetRuntimeClassName(className);
}
HRESULT FrameworkViewWrapper::GetTrustLevel(TrustLevel* trustLevel)
{
return m_realView->GetTrustLevel(trustLevel);
}