Skip to content

Undocked Reg-Free WinRT Activation isn’t enabled for Packaged Self-Contained apps on < 19H1 devices #5623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ssparach
Copy link
Contributor

@ssparach ssparach commented Jul 15, 2025

Bug fix for #3133

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@ssparach ssparach changed the title bug fix Undocked Reg-Free WinRT Activation isn’t enabled for Packaged Self-Contained apps on < 19H1 devices Jul 15, 2025
@ssparach ssparach linked an issue Jul 15, 2025 that may be closed by this pull request
@ssparach ssparach requested a review from Scottj1s July 15, 2025 20:01
@@ -13,10 +13,13 @@

#include <../Detours/detours.h>

static bool isPackaged = AppModel::Identity::IsPackagedProcess();
static bool is19H1OrGreater = WindowsVersion::IsWindows10_19H1OrGreater();

static HRESULT DetoursInitialize()
{
// Only detour APIs for not-packaged processes
Copy link
Member

@Scottj1s Scottj1s Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Only detour APIs for not-packaged processes
// Detours needed for Lifted Reg-Free WinRT Activation before 19H1, and Dynamic Dependencies in unpackaged apps

Comment on lines +36 to +40
if (!isPackaged && !is19H1OrGreater)
{
FAIL_FAST_IF_FAILED(MddDetourPackageGraphInitialize());
FAIL_FAST_IF_FAILED(UrfwInitialize());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!isPackaged && !is19H1OrGreater)
{
FAIL_FAST_IF_FAILED(MddDetourPackageGraphInitialize());
FAIL_FAST_IF_FAILED(UrfwInitialize());
}
if (!isPackaged)
{
FAIL_FAST_IF_FAILED(MddDetourPackageGraphInitialize());
}
if (!is19H1OrGreater)
{
FAIL_FAST_IF_FAILED(UrfwInitialize());
}

{
FAIL_FAST_IF_FAILED(MddDetourPackageGraphInitialize());
FAIL_FAST_IF_FAILED(UrfwInitialize());
}
FAIL_FAST_IF_WIN32_ERROR(DetourTransactionCommit());
return S_OK;
}

static HRESULT DetoursShutdown()
{
// Only detour APIs for not-packaged processes
Copy link
Member

@Scottj1s Scottj1s Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Only detour APIs for not-packaged processes
// Detours needed for Lifted Reg-Free WinRT Activation before 19H1, and Dynamic Dependencies in unpackaged apps

Comment on lines +62 to +66
if (!isPackaged && !is19H1OrGreater)
{
UrfwShutdown();
MddDetourPackageGraphShutdown();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!isPackaged && !is19H1OrGreater)
{
UrfwShutdown();
MddDetourPackageGraphShutdown();
}
if (!is19H1OrGreater)
{
UrfwShutdown();
}
if (!isPackaged)
{
MddDetourPackageGraphShutdown();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants