{"record":{"id":"3de78d0dd1359a54","repo":"wailsapp/wails","slug":"patblt-failed","errorCode":null,"errorMessage":"PatBlt failed","messagePattern":"PatBlt failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/pkg/w32/gdi32.go","lineNumber":128,"sourceCode":"\t\tuintptr(nYSrc),\n\t\tuintptr(dwRop))\n\n\tif ret == 0 {\n\t\tpanic(\"BitBlt failed\")\n\t}\n}\n\nfunc PatBlt(hdc HDC, nXLeft, nYLeft, nWidth, nHeight int, dwRop uint) {\n\tret, _, _ := procPatBlt.Call(\n\t\tuintptr(hdc),\n\t\tuintptr(nXLeft),\n\t\tuintptr(nYLeft),\n\t\tuintptr(nWidth),\n\t\tuintptr(nHeight),\n\t\tuintptr(dwRop))\n\n\tif ret == 0 {\n\t\tpanic(\"PatBlt failed\")\n\t}\n}\n\nfunc CloseEnhMetaFile(hdc HDC) HENHMETAFILE {\n\tret, _, _ := procCloseEnhMetaFile.Call(\n\t\tuintptr(hdc))\n\n\treturn HENHMETAFILE(ret)\n}\n\nfunc CopyEnhMetaFile(hemfSrc HENHMETAFILE, lpszFile *uint16) HENHMETAFILE {\n\tret, _, _ := procCopyEnhMetaFile.Call(\n\t\tuintptr(hemfSrc),\n\t\tuintptr(unsafe.Pointer(lpszFile)))\n\n\treturn HENHMETAFILE(ret)\n}\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/wailsapp/wails/blob/0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3/v3/pkg/w32/gdi32.go#L110-L146","documentation":"Error \"PatBlt failed\" thrown in wailsapp/wails.","triggerScenarios":"Occurs when the Win32 PatBlt GDI call returns zero, e.g. an invalid device context handle, invalid raster operation code, or coordinates outside the DC bounds during bitmap filling.","commonSituations":"See trigger scenarios.","solutions":["Ensure the HDC passed to PatBlt is valid and not already released; the device context must be a memory DC or window DC that supports raster operations.","Verify the raster operation code (dwRop) is a supported ternary raster operation such as PATCOPY, BLACKNESS, or WHITENESS.","Check that the region (nXLeft, nYLeft, nWidth, nHeight) lies within the DC's clipping region and that no prior drawing call left the DC in an error state."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3","analyzedAt":"2026-08-15T14:17:36.034Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}