Starting a process from within a OOP BG task is not possible in Windows Enterprise #4205
Unanswered
JosHuybrighs
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My WinUI/WinAppSDK desktop application uses a background task that is triggered when a portable storage device, e.g. a USB flashdrive, is inserted (task type
deviceUse
in the manifest file). If the device is recognized as one that is configured in the app the task starts the main app without a window being created to sync a source location to the USB device. The sync operation is done in the main app and not in the background task because it can take longer than 30s to complete.The issue is that this works without problems on Windows Home and Pro but not on Windows Enterprise.
The background task is an OOP C#/WinRT BG task because task type
deviceUse
is not supported in Inproc COM background tasks.The main app is started using
LaunchFullTrustProcessForCurrentAppAsync
. I tried to do the same usingProcess.Start()
which returns successfully but doesn't start the process on none of the 3 Windows types. I also tried to logon the user in code by means ofLogonUser
(in advapi32.dll) but that of course is not supported in a C#/WinRT component.I have a number of questions/remarks about this:
IsAuthorized
inWindowsIdentity.GetCurrent()
is set to False. I assume that this is the reason that it doesn't work in Windows Enterprise but why is it then OK in Windows Home and Pro? Is this by accident?IsAuthorized
will be True then. I have tested this with a InProc COM BG task that is triggered on a timer.Beta Was this translation helpful? Give feedback.
All reactions