microsoft / microsoft/WindowsAppSDK
Calling PrintManagerInterop.ShowPrintUIForWindowAsync() fails if app is run elevated
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4.7k
- Forks
- 471
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 28
Description
Describe the bug
The following occurs when calling ShowPrintUIForWindowAsync() from an elevated app:
- The print dialog is shown initially.
- A fraction of a second later it's closed without any user interaction.
- Exactly 30 seconds later a COMException is thrown.
The exception is:
Type: System.Runtime.InteropServices.COMException
Message: OLE has sent a request and is waiting for a reply. (0x80010115)
0x80010115 is RPC_S_CALLPENDING
The exception stack trace doesn't provide any extra info.
Steps to reproduce the bug
- Download provided MS demo code from https://github.com/marb2000/PrintSample
- Update project's WinAppSdk nuget package to the latest
- Build and deploy packaged target
- Right click app in start menu and select run as administrator
- Attempt to print
Expected behavior
No response
Screenshots
No response
NuGet package version
Windows App SDK 1.2.2
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
May be similar to the problems that the file pickers have when running elevated #2504
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PrintSample demo and the PrintManagerInterop.ShowPrintUIForWindowAsync() call, reproducing it as an elevated packaged app on Windows 11 22H2 with Windows App SDK 1.2.2. Compare the behavior with the related file-picker issue #2504. Done should be established once printing no longer closes the dialog immediately or ends with the 30-second RPC_S_CALLPENDING COMException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100