{"record":{"id":"9a5836f7b98968a8","repo":"wailsapp/wails","slug":"lockresource-failed","errorCode":null,"errorMessage":"LockResource failed","messagePattern":"LockResource failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/pkg/w32/kernel32.go","lineNumber":191,"sourceCode":"}\n\nfunc SizeofResource(hModule HMODULE, hResInfo HRSRC) uint32 {\n\tret, _, _ := procSizeofResource.Call(\n\t\tuintptr(hModule),\n\t\tuintptr(hResInfo))\n\n\tif ret == 0 {\n\t\tpanic(\"SizeofResource failed\")\n\t}\n\n\treturn uint32(ret)\n}\n\nfunc LockResource(hResData HGLOBAL) unsafe.Pointer {\n\tret, _, _ := procLockResource.Call(uintptr(hResData))\n\n\tif ret == 0 {\n\t\tpanic(\"LockResource failed\")\n\t}\n\n\treturn unsafe.Pointer(ret)\n}\n\nfunc LoadResource(hModule HMODULE, hResInfo HRSRC) HGLOBAL {\n\tret, _, _ := procLoadResource.Call(\n\t\tuintptr(hModule),\n\t\tuintptr(hResInfo))\n\n\tif ret == 0 {\n\t\tpanic(\"LoadResource failed\")\n\t}\n\n\treturn HGLOBAL(ret)\n}\n\nfunc GetLastError() uint32 {","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/wailsapp/wails/blob/0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3/v3/pkg/w32/kernel32.go#L173-L209","documentation":"Error \"LockResource failed\" thrown in wailsapp/wails.","triggerScenarios":"Occurs when LockResource returns NULL, typically because the resource handle is invalid or the resource data could not be loaded.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid HGLOBAL returned by LoadResource; LockResource fails on invalid or freed resource handles.","Call FindResource and LoadResource successfully first; LockResource only works on a loaded resource, and a prior failure in those steps is the usual root cause."],"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-15T17:31:12.345Z"}