{"record":{"id":"bbd0663b9721d0d0","repo":"NickeManarin/ScreenToGif","slug":"the-desktop-duplication-api-is-not-supported-on-th","errorCode":null,"errorMessage":"The Desktop Duplication API is not supported on this computer.","messagePattern":"The Desktop Duplication API is not supported on this computer\\.","errorType":"exception","errorClass":"GraphicsConfigurationException","httpStatus":null,"severity":"critical","filePath":"ScreenToGif/Capture/DirectImageCapture.cs","lineNumber":194,"sourceCode":"        });\n\n        using (var factory = new Factory1())\n        {\n            //Get the Output1 based on the current capture region position.\n            using (var output1 = GetOutput(factory))\n            {\n                try\n                {\n                    //Make sure to run with the integrated graphics adapter if using a Microsoft hybrid system. https://stackoverflow.com/a/54196789/1735672\n                    DuplicatedOutput = output1.DuplicateOutput(Device);\n                }\n                catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.NotCurrentlyAvailable)\n                {\n                    throw new Exception(\"Too many applications using the Desktop Duplication API. Please close one of the applications and try again.\", e);\n                }\n                catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.Unsupported)\n                {\n                    throw new GraphicsConfigurationException(\"The Desktop Duplication API is not supported on this computer.\", e);\n                }\n                catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.InvalidCall)\n                {\n                    throw new GraphicsConfigurationException(\"The Desktop Duplication API is not supported on this screen.\", e);\n                }\n                catch (SharpDXException e) when (e.Descriptor.NativeApiCode == \"E_INVALIDARG\")\n                {\n                    throw new GraphicsConfigurationException(\"Looks like that the Desktop Duplication API is not supported on this screen.\", e);\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// Get the correct Output1 based on region to be captured.\n    /// </summary>\n    private Output1 GetOutput(Factory1 factory)\n    {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/NickeManarin/ScreenToGif/blob/a4d0a67c2131cd048ceec86cd40afc2f1a06f2fd/ScreenToGif/Capture/DirectImageCapture.cs#L176-L212","documentation":"Thrown by DirectImageCapture when DuplicateOutput raises a SharpDXException with the Unsupported DXGI result code. DDA requires Windows 8 or later and a graphics driver (WDDM 1.2+) that supports DXGI 1.2. The Unsupported code means the platform cannot provide desktop duplication at all.","triggerScenarios":"DuplicateOutput is called on a system that does not meet DDA requirements: Windows 7 or earlier, a VM without GPU acceleration, a graphics driver that predates WDDM 1.2, or a headless/session-0 environment.","commonSituations":"User is on Windows 7 (DDA was introduced in Windows 8). Graphics driver is outdated or is the Microsoft Basic Display Adapter without proper DDA support. Running inside a virtual machine or RDP session without GPU passthrough. Server SKU without a desktop compositor.","solutions":["Upgrade to Windows 8/10/11 which support the Desktop Duplication API.","Update graphics drivers to a version supporting WDDM 1.2+.","Fall back to an alternative capture method (BitBlt/GDI) when DDA is unsupported.","Detect OS version at startup and disable DDA-based capture, offering BitBlt instead."],"exampleFix":"// before\ncatch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.Unsupported)\n{\n    throw new GraphicsConfigurationException(\"The Desktop Duplication API is not supported on this computer.\", e);\n}\n\n// after: catch and switch capture mode\ntry { DuplicatedOutput = output1.DuplicateOutput(Device); }\ncatch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.Unsupported)\n{\n    CaptureMode = CaptureMode.BitBlt; // fall back\n    LogWriter.Log(\"DDA unsupported, falling back to BitBlt capture.\");\n}","handlingStrategy":"fallback","validationCode":"// Check DDA support at startup\nvar osVersion = Environment.OSVersion.Version;\nif (osVersion < new Version(6, 2)) // Windows 8\n{\n    CaptureMode = CaptureMode.BitBlt; // DDA not supported pre-Win8\n}","typeGuard":"static bool IsDesktopDuplicationSupported()\n{\n    return Environment.OSVersion.Version >= new Version(6, 2); // Windows 8+\n}","tryCatchPattern":"try\n{\n    InitializeDesktopDuplication();\n}\ncatch (GraphicsConfigurationException ex) when (ex.Message.Contains(\"not supported on this computer\"))\n{\n    CaptureMode = CaptureMode.BitBlt;\n}","preventionTips":["Check the OS version at startup and disable DDA on Windows 7 or earlier.","Verify the graphics driver supports WDDM 1.2+ before enabling DDA capture.","Always implement a BitBlt fallback path for systems without DDA support."],"tags":["dxgi","desktop-duplication","screen-capture","sharpdx","compatibility"],"backgroundTag":null,"analyzedSha":"a4d0a67c2131cd048ceec86cd40afc2f1a06f2fd","analyzedAt":"2026-08-13T11:12:06.147Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}