{"record":{"id":"9e94a97766b15b89","repo":"dotnet/wpf","slug":"printsystemexception-printqueue-resume","errorCode":null,"errorMessage":"PrintSystemException.PrintQueue.Resume","messagePattern":"PrintSystemException\\.PrintQueue\\.Resume","errorType":"exception","errorClass":"PrintQueueException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/PrintQueue.cpp","lineNumber":1369,"sourceCode":"\n    Return Value\n        None\n--*/\nvoid\nPrintQueue::\nResume(\n    void\n    )\n{\n    VerifyAccess();\n\n    try\n    {\n        printerThunkHandler->ThunkSetPrinter(PRINTER_CONTROL_RESUME);\n    }\n    catch (InternalPrintSystemException^ internalException)\n    {\n        throw CreatePrintQueueException(internalException->HResult,\n                                        \"PrintSystemException.PrintQueue.Resume\");\n    }\n}\n\nPrintSystemJobInfo^\nPrintQueue::\nAddJob(\n    void\n    )\n{\n    VerifyAccess();\n\n    // We need to pass down a print ticket so that the job ID will be available\n    // immediately.  Since the caller did not specify a print ticket, we will use\n    // the user/default print ticket for this print queue.\n    PrintTicket^ printTicket = UserPrintTicket;\n    if(printTicket == nullptr)\n    {","sourceCodeStart":1351,"sourceCodeEnd":1387,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/PrintQueue.cpp#L1351-L1387","documentation":"PrintQueue.Resume converts a Win32 SetPrinter(PRINTER_CONTROL_RESUME) failure into a PrintSystemException tagged 'PrintSystemException.PrintQueue.Resume'. Resuming asks the spooler to restart job scheduling on a paused queue; the HResult holds the native error.","triggerScenarios":"Calling queue.Resume() when the spooler rejects SetPrinter with PRINTER_CONTROL_RESUME — access denied, queue not actually paused, printer renamed/deleted, or unreachable remote server.","commonSituations":"Resuming a queue another admin already resumed or deleted; non-admin user resuming a shared corporate printer; transient network failure to the print server.","solutions":["Run with Manage Printer permission on the queue.","Check queue state first (queue.IsPaused or queue.QueueStatus) and skip Resume when not paused.","Verify the printer still exists and is reachable on the print server.","Retry once after checking the spooler service if the error indicates a transient spooler state."],"exampleFix":"// before\nqueue.Resume();\n// after\nif ((queue.QueueStatus & PrintQueueStatus.Paused) != 0)\n{\n    try { queue.Resume(); }\n    catch (PrintSystemException ex) { throw new InvalidOperationException($\"Failed to resume '{queue.FullName}': 0x{ex.HResult:X8}\", ex); }\n}","handlingStrategy":"try-catch","validationCode":"if ((queue.QueueStatus & PrintQueueStatus.Paused) == 0) throw new InvalidOperationException(\"Queue is not paused; Resume not applicable\");","typeGuard":null,"tryCatchPattern":"try { queue.Resume(); }\ncatch (PrintSystemException ex) { throw new InvalidOperationException($\"Resume failed for '{queue.FullName}': 0x{ex.HResult:X8}\", ex); }","preventionTips":["Only Resume queues currently marked Paused in QueueStatus.","Check for rename/removal by re-resolving the queue before control operations.","Require Manage Printer permission; catch access-denied HResult explicitly.","Retry transient spooler failures once after a short delay."],"tags":["printing","wpf","win32-spooler"],"backgroundTag":"api-error-response","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}