-
Notifications
You must be signed in to change notification settings - Fork 309
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
Dynamic Dependencies doesn't support Elevation #567
Comments
when will this bug be fixed? |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dynamic Dependencies relies on PackagedCOM, but PackagedCOM types are not visible to elevated processes. Thus the Dynamic Depednencies and Bootstrapper APIs fail when called by an elevated process.
Elevated processes need to be supported.
DynDep uses of PackagedCOM:
ApplicationData
ifMddCreatePackageDependencyOptions::ScopeIsSystem
is not specified (definitions are directly written to a location underProgram Data
ifScopeIsSystem
is specified, and nothing's persisted ifMddPackageDependencyLifetimeKind::Process
is specified).MddCore::DataStore::GetDataStorePathForUser()
can be changed to get the path to PRmain'sApplicationData
viaWindows.ApplicationModel.ApplicationDataManager
rather than asking the PackagedCOM if the process is elevated (or possibly in all cases).The LifetimeManager isn't so easily solved. DynDep needs a process running with PRddlm's identity from the call to
MddBootstrapInitialize
untilMddBootstrapShutdown
(or process death). PackagedCOM provides a convenient solution to reliable lifetime management e.g. what if someone doesn't callMddBootstrapShutdown
. An alternative mechanism is needed.One option is a defining the DDLM process as an application with full-trust RuntimeBehavior=packagedClassicApp. ActivateApplication would be needed with a parameter (e.g. process id) so the process can
WaitOnSingleObject(OpenProcess(ProcessIdToHandle(args.pid)), INFINITE)
to detect if theMddBootstrapInitialize
caller terminates without callingMddBootstrapShutdown
and self-terminate.ProcessId isn't a great answer as Windows can reuse them e.g. caller terminates and a new process created between
CreateProcess(ddlm)
andOpenProcess(ProcesIdToHandle(args.pid))
. A better answer is a uniquely named IPC mechanism e.g.CreateNamedPipe(name); CreateProcess(ddlm.exe, cmdline=name);
.It's possible for Deployment to terminate the DDLM process (if a
DeploymentOptions
'Force' option is specified). The termination semantics have changed over the years so we'd need to make sure our PackagedCOM replacement provides the expected outcome regardless the Windows version we run on.It seems plausible an alternative to PackagedCOM can be found. Further investigation into the fine print is needed.
The text was updated successfully, but these errors were encountered: