If a delete is pending on the file queried for status, a misleading `permission_denied` error code will be returned (this is the correct mapping of the error set by GetFileAttributesW). By querying the underlying NTSTATUS code via ntdll's RtlGetLastNtStatus, this case can be disambiguated. If this underlying error code indicates a pending delete, fs::status will return a new `pending_delete` error code to be handled by callers Fixes #89137
20 lines
580 B
C++
20 lines
580 B
C++
//===-- WindowsError.h - Support for mapping windows errors to posix-------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_SUPPORT_WINDOWSERROR_H
|
|
#define LLVM_SUPPORT_WINDOWSERROR_H
|
|
|
|
#include <system_error>
|
|
|
|
namespace llvm {
|
|
std::error_code mapLastWindowsError();
|
|
std::error_code mapWindowsError(unsigned EV);
|
|
}
|
|
|
|
#endif
|