@@ -1104,7 +1104,7 @@ void fs__write(uv_fs_t* req) {
11041104static void fs__unlink_rmdir (uv_fs_t * req , BOOL isrmdir ) {
11051105 const WCHAR * pathw = req -> file .pathw ;
11061106 HANDLE handle ;
1107- BY_HANDLE_FILE_INFORMATION info ;
1107+ FILE_BASIC_INFO info ;
11081108 FILE_DISPOSITION_INFORMATION disposition ;
11091109 FILE_DISPOSITION_INFORMATION_EX disposition_ex ;
11101110 IO_STATUS_BLOCK iosb ;
@@ -1124,27 +1124,27 @@ static void fs__unlink_rmdir(uv_fs_t* req, BOOL isrmdir) {
11241124 return ;
11251125 }
11261126
1127- if (!GetFileInformationByHandle (handle , & info )) {
1127+ if (!GetFileInformationByHandleEx (handle , FileBasicInfo , & info , sizeof info )) {
11281128 SET_REQ_WIN32_ERROR (req , GetLastError ());
11291129 CloseHandle (handle );
11301130 return ;
11311131 }
11321132
1133- if (isrmdir && !(info .dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )) {
1133+ if (isrmdir && !(info .FileAttributes & FILE_ATTRIBUTE_DIRECTORY )) {
11341134 /* Error if we're in rmdir mode but it is not a dir.
11351135 * TODO: change it to UV_NOTDIR in v2. */
11361136 SET_REQ_UV_ERROR (req , UV_ENOENT , ERROR_DIRECTORY );
11371137 CloseHandle (handle );
11381138 return ;
11391139 }
11401140
1141- if (!isrmdir && (info .dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )) {
1141+ if (!isrmdir && (info .FileAttributes & FILE_ATTRIBUTE_DIRECTORY )) {
11421142 /* If not explicitly allowed, do not allow deletion of directories, unless
11431143 * it is a symlink. When the path refers to a non-symlink directory, report
11441144 * EPERM as mandated by POSIX.1. */
11451145
11461146 /* Check if it is a reparse point. If it's not, it's a normal directory. */
1147- if (!(info .dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT )) {
1147+ if (!(info .FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT )) {
11481148 SET_REQ_WIN32_ERROR (req , ERROR_ACCESS_DENIED );
11491149 CloseHandle (handle );
11501150 return ;
@@ -1183,7 +1183,7 @@ static void fs__unlink_rmdir(uv_fs_t* req, BOOL isrmdir) {
11831183 error == ERROR_INVALID_PARAMETER /* pre Windows 10 error */ ||
11841184 error == ERROR_INVALID_FUNCTION /* pre Windows 10 1607 error */ ) {
11851185 /* posix delete not supported so try fallback */
1186- if (info .dwFileAttributes & FILE_ATTRIBUTE_READONLY ) {
1186+ if (info .FileAttributes & FILE_ATTRIBUTE_READONLY ) {
11871187 /* Remove read-only attribute */
11881188 FILE_BASIC_INFORMATION basic = { 0 };
11891189
@@ -1194,7 +1194,7 @@ static void fs__unlink_rmdir(uv_fs_t* req, BOOL isrmdir) {
11941194 * this bug, we re-open the handle here */
11951195 HANDLE write_attributes_handle ;
11961196
1197- basic .FileAttributes = (info .dwFileAttributes & ~FILE_ATTRIBUTE_READONLY ) |
1197+ basic .FileAttributes = (info .FileAttributes & ~FILE_ATTRIBUTE_READONLY ) |
11981198 FILE_ATTRIBUTE_ARCHIVE ;
11991199
12001200 write_attributes_handle = ReOpenFile (handle , FILE_WRITE_ATTRIBUTES ,
0 commit comments