{"record":{"id":"3f47de76a9cf52e3","repo":"deepseek-ai/deepseek-harness","slug":"getfilesecurityw-code-win32-win32code-p","errorCode":null,"errorMessage":"GetFileSecurityW ${code} (Win32 ${win32Code}): ${path}","messagePattern":"GetFileSecurityW (.+?) \\(Win32 (.+?)\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/fs-local/src/win32.ts","lineNumber":93,"sourceCode":"  error.code = code\n  error.errno = win32Code\n  error.syscall = syscall\n  error.path = path\n  error.win32Code = win32Code\n  return error\n}\n\n/**\n * Read a file's self-relative DACL security descriptor.\n * @param path - existing file whose DACL is read.\n * @returns a descriptor buffer accepted by `SetFileSecurityW`.\n */\nexport async function readFileDaclWin32(path: string): Promise<Buffer> {\n  const api = await win32()\n  const nativePath = toNamespacedPath(path)\n  const needed: [number] = [0]\n  api.getFileSecurityW(nativePath, DACL_SECURITY_INFORMATION, null, 0, needed)\n  if (needed[0] === 0) throw win32Error('GetFileSecurityW', api.getLastError(), path)\n\n  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","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/fs-local/src/win32.ts#L75-L111","documentation":"Error \"GetFileSecurityW ${code} (Win32 ${win32Code}): ${path}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/fs-local/src/win32.ts:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run with sufficient privileges and verify the path exists; check the Win32 error code for the cause."],"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"}