In the pseudo code below, what's done with GetFactoryFromExtension? [code]
- User
In the pseudo code below, what's done with GetFactoryFromExtension?
c - Assistant
In the pseudo code below, what's done with GetFactoryFromExtension?
// 1800714AC: using guessed type __int64 __fastcall std::vector<winrt::Windows::Foundation::IAsyncAction>::~vector<winrt::Windows::Foundation::IAsyncAction>(_QWORD);
// 1801AE010: using guessed type __int64 __fastcall guard_dispatch_icall_thunk_10345483385596137414();
// 1801AF500: using guessed type __int64 __fastcall IsTopLevelWindow(_QWORD);
// 1801B0898: using guessed type __int64 __fastcall SHFillRectClr(_QWORD, _QWORD, _QWORD);
// 180230A28: using guessed type signed __int32 `wil::Feature<__WilFeatureTraits_Feature_OTPGTB>::GetImpl'::`2'::impl[4];
// 180230A48: using guessed type signed __int32 `wil::Feature<__WilFeatureTraits_Feature_PGTBPlaceholderPinning>::GetImpl'::`2'::impl[4];
//----- (0000000180092CA4) ----------------------------------------------------
// Hidden C++ exception states: #wind=9 #try_helpers=1
char __fastcall TaskbarHost::TryLoadTaskbarFrameFromXamlExtension(TaskbarHost *this)
{
signed int v2; // eax
__int64 *v3; // rax
__int64 *v4; // rax
__int64 *v5; // rax
__int64 *v6; // rax
__int64 *v7; // rax
void (__fastcall ***v8)(_QWORD, void *, __int64 *); // rcx
const struct winrt::Windows::UI::Xaml::UIElement *ElementVisual; // rsi
void (__fastcall ***v10)(_QWORD, void *, __int64 *); // rcx
__int64 v11; // rdx
signed int v12; // eax
__int64 *Instance; // rax
const wchar_t *v15; // [rsp+30h] [rbp-A8h] BYREF
std::_Ref_count_base *v16; // [rsp+38h] [rbp-A0h]
__int64 (__fastcall ***v17)(_QWORD, void *, __int64 *); // [rsp+40h] [rbp-98h] BYREF
__int64 v18; // [rsp+48h] [rbp-90h] BYREF
_BYTE v19[32]; // [rsp+50h] [rbp-88h] BYREF
_QWORD v20[4]; // [rsp+70h] [rbp-68h] BYREF
_QWORD v21[4]; // [rsp+90h] [rbp-48h] BYREF
__int64 v22; // [rsp+B0h] [rbp-28h] BYREF
__int64 v23; // [rsp+B8h] [rbp-20h] BYREF
__int64 v24; // [rsp+C0h] [rbp-18h] BYREF
winrt::param::hstring::hstring((winrt::param::hstring *)v19, L"com.microsoft.windows.extensions.xaml.taskbar");
winrt::WindowsUdk::ApplicationModel::AppExtensions::XamlExtensions::GetForCategory(
(const struct winrt::param::hstring *)&v18,
(__int64)v19);
v15 = L"WindowsUdk.UI.Shell.TaskbarControllerExtension";
v16 = (std::_Ref_count_base *)46;
winrt::param::hstring::hstring((__int64)v20, (__int64 *)&v15);
winrt::param::hstring::hstring((winrt::param::hstring *)v21, L"Taskbar");
winrt::impl::consume_WindowsUdk_ApplicationModel_AppExtensions_IXamlExtensions<winrt::WindowsUdk::ApplicationModel::AppExtensions::IXamlExtensions>::GetFactoryFromExtension(
&v18,
&v17,
v21,
v20);
if ( v17 )
{
v24 = 0LL;
v23 = 0LL;
v2 = (**v17)(v17, &winrt::impl::guid_v<winrt::WindowsUdk::UI::Shell::ITaskbarControllerExtensionFactory>, &v23);
if ( v2 < 0 )
winrt::throw_hresult(v2);
v3 = winrt::impl::consume_WindowsUdk_UI_Shell_INotificationAreaControllerExtensionFactory<winrt::WindowsUdk::UI::Shell::INotificationAreaControllerExtensionFactory>::CreateInstance(
&v23,
&v22,
(_QWORD *)this + 6,
&v24,
&v24);
winrt::Windows::Foundation::IUnknown::operator=((__int64 *)this + 7, v3);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v22);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v23);
v4 = winrt::impl::consume_Windows_UI_Xaml_IWindowStatics<winrt::Windows::UI::Xaml::IWindowStatics>::Current(
(__int64 *)this + 7,
&v22);
winrt::Windows::Foundation::IUnknown::operator=((__int64 *)this + 8, v4);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v22);
v5 = winrt::Windows::UI::Xaml::Window::Current((__int64 *)&v15);
v6 = winrt::impl::consume_Windows_UI_Xaml_IWindow3<winrt::Windows::UI::Xaml::Window>::Compositor(v5, &v23);
v7 = winrt::impl::consume_Windows_UI_Composition_ICompositor<winrt::Windows::UI::Composition::ICompositor>::CreateInsetClip(
v6,
&v22);
winrt::Windows::Foundation::IUnknown::operator=((__int64 *)this + 10, v7);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v22);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v23);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v15);
v8 = (void (__fastcall ***)(_QWORD, void *, __int64 *))*((_QWORD *)this + 8);
if ( v8 )
{
v22 = 0LL;
(**v8)(v8, &winrt::impl::guid_v<winrt::Windows::UI::Xaml::IUIElement>, &v22);
v23 = v22;
}
else
{
v23 = 0LL;
}
ElementVisual = winrt::Windows::UI::Xaml::Hosting::ElementCompositionPreview::GetElementVisual(
(const struct winrt::Windows::UI::Xaml::UIElement *)&v15,
&v23);
v10 = (void (__fastcall ***)(_QWORD, void *, __int64 *))*((_QWORD *)this + 10);
if ( v10 )
{
v22 = 0LL;
(**v10)(v10, &winrt::impl::guid_v<winrt::Windows::UI::Composition::ICompositionClip>, &v22);
v11 = v22;
}
else
{
v11 = 0LL;
}
v22 = v11;
v12 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)ElementVisual + 120LL))(*(_QWORD *)ElementVisual);
if ( v12 < 0 )
winrt::throw_hresult(v12);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v22);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v15);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v23);
Instance = Taskbar::Utils::ViewServices::GetInstance((__int64 *)&v15);
std::shared_ptr<SystemTrayHost>::operator=((_QWORD *)this + 13, Instance);
if ( v16 )
std::_Ref_count_base::_Decref(v16);
if ( v24 )
winrt::com_ptr<winrt::impl::IGlobalInterfaceTable>::unconditional_release_ref(&v24);
if ( v17 )
winrt::com_ptr<winrt::impl::IGlobalInterfaceTable>::unconditional_release_ref((__int64 *)&v17);
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v18);
return 1;
}
else
{
winrt::WindowsUdk::UI::Shell::ITaskbarFlyout::~ITaskbarFlyout((winrt::WindowsUdk::UI::Shell::ITaskbarFlyout *)&v18);
return 0;
}
}
In the provided pseudocode, GetFactoryFromExtension is a method used to obtain a factory object that can create instances of a specified class from a given XAML extension. Here's a breakdown of what's happening with GetFactoryFromExtension:
Retrieve the XAML Extension:
hstring with the category name "com.microsoft.windows.extensions.xaml.taskbar".GetForCategory to get the IXamlExtensions interface for that category. This interface allows interaction with XAML extensions within that category.Prepare Parameters for Factory Retrieval:
hstring is created with the class name "WindowsUdk.UI.Shell.TaskbarControllerExtension".hstring with the extension name "Taskbar" is prepared.Call GetFactoryFromExtension:
GetFactoryFromExtension method is called on the IXamlExtensions interface (v18 in the code) with the following parameters:
&v17) to receive the factory object.v21, which contains "Taskbar").v20, which contains "WindowsUdk.UI.Shell.TaskbarControllerExtension").Obtain the Factory Object:
GetFactoryFromExtension succeeds, v17 will contain a factory object that implements ITaskbarControllerExtensionFactory.TaskbarControllerExtension class.Use the Factory to Create an Instance:
v17 (the factory object) is not null.CreateInstance method to create an instance of the TaskbarControllerExtension.TaskbarHost::TryLoadTaskbarFrameFromXamlExtension method.Cleanup:
Summary:
In the pseudocode, GetFactoryFromExtension is used to obtain a factory object for the TaskbarControllerExtension class from the "Taskbar" extension within the "com.microsoft.windows.extensions.xaml.taskbar" category. This factory is then used to create an instance of TaskbarControllerExtension, which enables the TaskbarHost to integrate the taskbar frame provided by the XAML extension.
Simplified Explanation:
The GetFactoryFromExtension method fetches a factory object that knows how to create instances of a specific class (WindowsUdk.UI.Shell.TaskbarControllerExtension) from a named XAML extension ("Taskbar"). This allows the application to dynamically load and utilize components provided by XAML extensions at runtime.
Key Points:
GetFactoryFromExtension: To retrieve a factory capable of creating instances of a specified class from a given XAML extension.TaskbarHost to load and integrate the taskbar frame from the XAML extension.In essence, the code uses GetFactoryFromExtension to obtain a factory object that can create an instance of the TaskbarControllerExtension class from the "Taskbar" XAML extension.
Not yet included in a published release.