Printing in UWP apps fails with security patch KB5008212

Edgar Martínez Serrano 1 Reputation point
2022-05-25T04:34:50.667+00:00

Since patch KB5008212 was installed, printing has stopped working in the UWP app I'm developing. Also the official microsoft samples to print doesn't work either (https://github.com/microsoft/windows-universal-samples/tree/main/Samples/Printing). Uninstalling the patch got it working again until Windows automatically reinstalled it.

I use appPOS58PORTABLE+ printer (https://www.approxtpv.es/es/impresoras-58mm/124-apppos58portable.html) connected by Bluetooth, but it also fails with other portable printers of the same type.

I will describe how the error occurs and the solutions that I have tried and have not worked:

When I try to print something from the UWP app, I get this error notification:
205315-image.png

When opening the print queue, you can see that there is a document that is pending to print with an error status:
205298-image.png

At the time this error occurs, a "Warning" is logged in the "Event Viewer", in the "Administrative Events" view:
205299-image.png

Event content:

Log Name: System
Source: Microsoft-Windows-DistributedCOM
Date: 5/24/2022 1:31:47 PM
Event ID: 10016
Task Category: None
Level: Warning
Keywords: Classic
User: DESKTOP-5LRC872\User
Computer: DESKTOP-5LRC872
Description:
The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID
{C2F03A33-21F5-47FA-B4BB-156362A2F239}
and APPID
{316CDED5-E4AE-4B15-9113-7055D84DCC97}
to the user DESKTOP-5LRC872\User SID (S-1-5-21-2115282427-3345914188-1249518056-1002) from address LocalHost (Using LRPC) running in the application container Microsoft.Windows.ShellExperienceHost_10.0.19041.1320_neutral_neutral_cw5n1h2txyewy SID (S-1-15-2-155514346-2573954481-755741238-1654018636-1233331829-3075935687-2861478708). This security permission can be modified using the Component Services administrative tool.

Due to this error that is recorded in the "Event Viewer", I have followed the steps of a forum where a similar case occurred (https://answers.microsoft.com/es-es/windows/forum/all/la-configuraci%C3%B3n-de-permisos-espec%C3%ADfico/d2d7d947-ad76-4069-af19-47d61be8b4ad). After following these steps, it still doesn't work. However the message changes slightly. Now instead of saying "The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID..." it says: "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID...".

I am attaching screenshots of how the permissions configuration has been after following these steps:
205316-image.png
205372-image.png

As you can see, the user "User" that describes the error does have "Local Activation" permission.

Other things I've tried and don't work: https://answers.microsoft.com/es-es/windows/forum/all/no-conecta-impresora-compartida-version-windows/6e36987f-0d1f-4475-b93e-a6de8a906623

I have also tried different settings in the printer properties, like these:
205381-image.png
but it doesn't help either

Important: if in the print queue (where the error occurs) we right click and restart on the document that has failed, the problem is "solved" and the document prints correctly. However, doing this causes errors to be logged in "Event Viewer":
205258-image.png

In the attached image you can see that after the printing error (the DistributedCOM Warning) that I mentioned before, if you right click and restart, two new errors of source "PrintService" are registered. The first one reports that " No printers were found." and the second that "The system cannot find the file specified." even though the document prints correctly in this case.

Events content:

Log Name: Microsoft-Windows-PrintService/Admin
Source: Microsoft-Windows-PrintService
Date: 5/24/2022 1:34:38 PM
Event ID: 372
Task Category: Printing a document
Level: Error
Keywords: Classic Spooler Event,Document Print Job
User: DESKTOP-5LRC872\User
Computer: DESKTOP-5LRC872
Description:
The document Print Document, owned by User, failed to print on printer appPOS58PORTABLE+. Try to print the document again, or restart the print spooler.
Data type: XPS2GDI. Size of the spool file in bytes: 635092. Number of bytes printed: 0. Total number of pages in the document: 10. Number of pages printed: 0. Client computer: \DESKTOP-5LRC872. Win32 error code returned by the print processor: 3012. No printers were found.

Log Name: Microsoft-Windows-PrintService/Admin
Source: Microsoft-Windows-PrintService
Date: 5/24/2022 1:34:40 PM
Event ID: 372
Task Category: Printing a document
Level: Error
Keywords: Classic Spooler Event,Document Print Job
User: DESKTOP-5LRC872\User
Computer: DESKTOP-5LRC872
Description:
The document Print Document, owned by User, failed to print on printer appPOS58PORTABLE+. Try to print the document again, or restart the print spooler.
Data type: XPS2GDI. Size of the spool file in bytes: 635092. Number of bytes printed: 351623. Total number of pages in the document: 10. Number of pages printed: 0. Client computer: \DESKTOP-5LRC872. Win32 error code returned by the print processor: 2. The system cannot find the file specified.

However, although this way works, it is not a viable solution for me, I need it to work without errors the first time, and not have to restart every time a document is printed from the UWP application.

Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2022-05-26T07:52:33.727+00:00

    Hello Edgarlives,

    In this scenario, it is possibe that that there is some change in the code for Spool service that is not aligned with the UWP settings, but as a workaround, I can suggest the next:

    1.Type RegEdit and press Enter. In the Registry Editor, expand the HKEY_CLASSES_ROOT folder, and the CLSID folder inside
    2. Find the folder with the CLSID you received in the Error 10016 DCOM message. Right-click on it, select permissions and click on Advanced
    3. Change the owner to the Administrators group. Select Replace all child object permission entries. Click Ok to go back to the permissions withdow
    4. click Add, enter Everyone and click OK. Again in the main permissions Window, select Everyone from the list of users in the top, and select Full Control from the Allow column in the bottom half. Click OK, apply full control
    5. Expand the HKEY_LOCAL_MACHINE inside, expand these folders: Software, Classes, AppID. Go to the folder which has the same APPID you received in your error message. Right-click, choose permissions and select Advanced. Give the app sufficient permissions


    --If the reply is helpful, please Upvote and Accept as answer--


  2. EckiS 916 Reputation points
    2022-05-30T13:39:56.147+00:00

    This sounds similar to your problem:
    HP+ printers - Unable to print from Apps after updating Windows
    After updating Windows with KB5008215 or KB5008212, a print job sent from a Universal Windows Platform app does not print.
    and seems to indicate there is already a fix:
    Microsoft released KB5010415 (Windows 10) and KB5010414 (Windows 11) to fix the issue.


  3. Eric Helfgott 1 Reputation point
    2022-08-30T22:15:56.207+00:00

    Here is the fix. In my testing, the fix takes care of both Bluetooth and serial printing issue in Windows with the symptoms as described above. In an elevated command prompt:

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers" /v {CA791BB3-9742-4A0F-87B8-B3C4B1065856} /t REG_DWORD /d 1 /f

    After issuing this command, reboot the PC. The fix works for both Windows 10 and 11.

    I’m hopeful that Microsoft is going to patch the issue in the near future.

    Regards,

    -- Eric

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.