{"record":{"id":"8456cdfc1a608d49","repo":"deepseek-ai/deepseek-harness","slug":"name-failed-win32-win32code-detail-e","errorCode":null,"errorMessage":"${name} failed (Win32 ${win32Code}): ${detail ?? errorText(api, win32Code)}","messagePattern":"(.+?) failed \\(Win32 (.+?)\\): (.+?)","errorType":"exception","errorClass":"Win32Error","httpStatus":null,"severity":"error","filePath":"packages/sandbox/sandbox-windows-acl/src/ffi.ts","lineNumber":499,"sourceCode":"  const length = api.getTempPathW(buffer.length / 2, buffer)\n  if (length === 0) throwLastError(api, 'GetTempPathW')\n  if (length > buffer.length / 2) {\n    throw new Win32Error('GetTempPathW', abi.ERROR_INSUFFICIENT_BUFFER, `required ${length} chars exceed the ${buffer.length / 2}-char buffer; nothing was written`)\n  }\n  return buffer.subarray(0, length * 2).toString('utf16le')\n}\n\n/**\n * Throw a Win32Error for a BOOL-style API failure. MUST be called immediately\n * after the failed call so GetLastError is not clobbered by other Win32 calls.\n * @param api - the binding table.\n * @param name - the failed API's name for the error message.\n * @param detail - optional detail overriding the formatted system message.\n * @returns never — always throws.\n */\nexport function throwLastError(api: Win32Bindings, name: string, detail?: string): never {\n  const win32Code = api.getLastError()\n  throw new Win32Error(name, win32Code, detail ?? errorText(api, win32Code))\n}\n\n/**\n * Throw a Win32Error for an HRESULT-style API return value (the value IS the error code).\n * @param api - the binding table.\n * @param name - the failed API's name for the error message.\n * @param win32Code - the API's returned error code.\n * @param detail - optional detail overriding the formatted system message.\n * @returns never — always throws.\n */\nexport function throwWin32(api: Win32Bindings, name: string, win32Code: number, detail?: string): never {\n  throw new Win32Error(name, win32Code, detail ?? errorText(api, win32Code))\n}\n","sourceCodeStart":481,"sourceCodeEnd":513,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/sandbox/sandbox-windows-acl/src/ffi.ts#L481-L513","documentation":"Error \"${name} failed (Win32 ${win32Code}): ${detail ?? errorText(api, win32Code)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/sandbox/sandbox-windows-acl/src/ffi.ts:499 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Win32 error code against the API documentation and fix the invalid argument or state that caused the call to fail.","Call GetLastError/FormatMessage for the code and address the reported condition before retrying."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}