{"record":{"id":"a14385300de65f3f","repo":"deepseek-ai/deepseek-harness","slug":"setfilesecurityw-code-win32-win32code-p","errorCode":null,"errorMessage":"SetFileSecurityW ${code} (Win32 ${win32Code}): ${path}","messagePattern":"SetFileSecurityW (.+?) \\(Win32 (.+?)\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/fs-local/src/win32.ts","lineNumber":113,"sourceCode":"  const descriptor = Buffer.alloc(needed[0])\n  if (api.getFileSecurityW(nativePath, DACL_SECURITY_INFORMATION, descriptor, descriptor.length, needed) === 0) {\n    throw win32Error('GetFileSecurityW', api.getLastError(), path)\n  }\n  return descriptor.subarray(0, needed[0])\n}\n\n/**\n * Copy an existing file's DACL onto another file and protect it from staging-parent inheritance.\n * The destination must still be empty when confidentiality depends on this call.\n * @param source - existing file whose DACL is copied.\n * @param destination - existing file that receives the protected DACL.\n */\nexport async function copyFileDaclWin32(source: string, destination: string): Promise<void> {\n  const descriptor = await readFileDaclWin32(source)\n  const api = await win32()\n  const information = (DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION) >>> 0\n  if (api.setFileSecurityW(toNamespacedPath(destination), information, descriptor) === 0) {\n    throw win32Error('SetFileSecurityW', api.getLastError(), destination)\n  }\n}\n\n/**\n * Replace a Windows file while preserving the replaced file's ACL and other replace metadata.\n * @param replaced - existing destination file.\n * @param replacement - closed staging file on the same volume.\n */\nexport async function replaceFileWin32(replaced: string, replacement: string): Promise<void> {\n  const api = await win32()\n  if (api.replaceFileW(\n    toNamespacedPath(replaced),\n    toNamespacedPath(replacement),\n    null,\n    0,\n    null,\n    null,\n  ) === 0) {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/fs-local/src/win32.ts#L95-L131","documentation":"Error \"SetFileSecurityW ${code} (Win32 ${win32Code}): ${path}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/fs-local/src/win32.ts:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run elevated or adjust the file DACL; check the Win32 error code for access denied or an invalid descriptor."],"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"}