30 #include <sys/utime.h>
40 #define UV_FS_FREE_PATHS 0x0002
41 #define UV_FS_FREE_PTR 0x0008
42 #define UV_FS_CLEANEDUP 0x0010
45 #define INIT(subtype) \
49 uv_fs_req_init(loop, req, subtype, cb); \
56 uv__req_register(loop, req); \
57 uv__work_submit(loop, \
64 uv__fs_work(&req->work_req); \
70 #define SET_REQ_RESULT(req, result_value) \
72 req->result = (result_value); \
73 assert(req->result != -1); \
76 #define SET_REQ_WIN32_ERROR(req, sys_errno) \
78 req->sys_errno_ = (sys_errno); \
79 req->result = uv_translate_sys_error(req->sys_errno_); \
82 #define SET_REQ_UV_ERROR(req, uv_errno, sys_errno) \
84 req->result = (uv_errno); \
85 req->sys_errno_ = (sys_errno); \
88 #define VERIFY_FD(fd, req) \
90 req->result = UV_EBADF; \
91 req->sys_errno_ = ERROR_INVALID_HANDLE; \
95 #define MILLIONu (1000U * 1000U)
96 #define BILLIONu (1000U * 1000U * 1000U)
98 #define FILETIME_TO_UINT(filetime) \
99 (*((uint64_t*) &(filetime)) - (uint64_t) 116444736 * BILLIONu)
101 #define FILETIME_TO_TIME_T(filetime) \
102 (FILETIME_TO_UINT(filetime) / (10u * MILLIONu))
104 #define FILETIME_TO_TIME_NS(filetime, secs) \
105 ((FILETIME_TO_UINT(filetime) - (secs * (uint64_t) 10 * MILLIONu)) * 100U)
107 #define FILETIME_TO_TIMESPEC(ts, filetime) \
109 (ts).tv_sec = (long) FILETIME_TO_TIME_T(filetime); \
110 (ts).tv_nsec = (long) FILETIME_TO_TIME_NS(filetime, (ts).tv_sec); \
113 #define TIME_T_TO_FILETIME(time, filetime_ptr) \
115 uint64_t bigtime = ((uint64_t) ((time) * (uint64_t) 10 * MILLIONu)) + \
116 (uint64_t) 116444736 * BILLIONu; \
117 (filetime_ptr)->dwLowDateTime = bigtime & 0xFFFFFFFF; \
118 (filetime_ptr)->dwHighDateTime = bigtime >> 32; \
121 #define IS_SLASH(c) ((c) == L'\\' || (c) == L'/')
122 #define IS_LETTER(c) (((c) >= L'a' && (c) <= L'z') || \
123 ((c) >= L'A' && (c) <= L'Z'))
125 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
142 SYSTEM_INFO system_info;
144 GetSystemInfo(&system_info);
152 const char* new_path,
const int copy_path) {
155 ssize_t buf_sz = 0, path_len = 0, pathw_len = 0, new_pathw_len = 0;
161 pathw_len = MultiByteToWideChar(CP_UTF8,
167 if (pathw_len == 0) {
168 return GetLastError();
171 buf_sz += pathw_len *
sizeof(WCHAR);
175 path_len = 1 + strlen(
path);
179 if (new_path !=
NULL) {
180 new_pathw_len = MultiByteToWideChar(CP_UTF8,
186 if (new_pathw_len == 0) {
187 return GetLastError();
190 buf_sz += new_pathw_len *
sizeof(WCHAR);
203 return ERROR_OUTOFMEMORY;
209 DWORD r = MultiByteToWideChar(CP_UTF8,
216 req->file.pathw = (WCHAR*)
pos;
217 pos +=
r *
sizeof(WCHAR);
222 if (new_path !=
NULL) {
223 DWORD r = MultiByteToWideChar(CP_UTF8,
230 req->fs.info.new_pathw = (WCHAR*)
pos;
231 pos +=
r *
sizeof(WCHAR);
256 req->fs_type = fs_type;
273 target_len = WideCharToMultiByte(CP_UTF8,
282 if (target_len == 0) {
286 if (target_len_ptr !=
NULL) {
287 *target_len_ptr = target_len;
290 if (target_ptr ==
NULL) {
295 if (target ==
NULL) {
296 SetLastError(ERROR_OUTOFMEMORY);
300 r = WideCharToMultiByte(CP_UTF8,
309 target[target_len] =
'\0';
310 *target_ptr = target;
317 char buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
318 REPARSE_DATA_BUFFER* reparse_data = (REPARSE_DATA_BUFFER*)
buffer;
325 if (!DeviceIoControl(
handle,
338 w_target = reparse_data->SymbolicLinkReparseBuffer.PathBuffer +
339 (reparse_data->SymbolicLinkReparseBuffer.SubstituteNameOffset /
342 reparse_data->SymbolicLinkReparseBuffer.SubstituteNameLength /
350 if (w_target_len >= 4 &&
351 w_target[0] ==
L'\\' &&
352 w_target[1] ==
L'?' &&
353 w_target[2] ==
L'?' &&
354 w_target[3] ==
L'\\') {
356 if (w_target_len >= 6 &&
357 ((w_target[4] >=
L'A' && w_target[4] <=
L'Z') ||
358 (w_target[4] >=
L'a' && w_target[4] <=
L'z')) &&
359 w_target[5] ==
L':' &&
360 (w_target_len == 6 || w_target[6] ==
L'\\')) {
365 }
else if (w_target_len >= 8 &&
366 (w_target[4] ==
L'U' || w_target[4] ==
L'u') &&
367 (w_target[5] ==
L'N' || w_target[5] ==
L'n') &&
368 (w_target[6] ==
L'C' || w_target[6] ==
L'c') &&
369 w_target[7] ==
L'\\') {
378 }
else if (reparse_data->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
380 w_target = reparse_data->MountPointReparseBuffer.PathBuffer +
381 (reparse_data->MountPointReparseBuffer.SubstituteNameOffset /
383 w_target_len = reparse_data->MountPointReparseBuffer.SubstituteNameLength /
391 if (!(w_target_len >= 6 &&
392 w_target[0] ==
L'\\' &&
393 w_target[1] ==
L'?' &&
394 w_target[2] ==
L'?' &&
395 w_target[3] ==
L'\\' &&
396 ((w_target[4] >=
L'A' && w_target[4] <=
L'Z') ||
397 (w_target[4] >=
L'a' && w_target[4] <=
L'z')) &&
398 w_target[5] ==
L':' &&
399 (w_target_len == 6 || w_target[6] ==
L'\\'))) {
410 if (reparse_data->AppExecLinkReparseBuffer.StringCount < 3) {
414 w_target = reparse_data->AppExecLinkReparseBuffer.StringList;
417 for (
i = 0;
i < 2; ++
i) {
418 len = wcslen(w_target);
425 w_target_len = wcslen(w_target);
426 if (w_target_len == 0) {
431 if (!(w_target_len >= 3 &&
432 ((w_target[0] >=
L'a' && w_target[0] <=
L'z') ||
433 (w_target[0] >=
L'A' && w_target[0] <=
L'Z')) &&
434 w_target[1] ==
L':' &&
435 w_target[2] ==
L'\\')) {
446 return fs__wide_to_utf8(w_target, w_target_len, target_ptr, target_len_ptr);
454 DWORD attributes = 0;
456 int fd, current_umask;
457 int flags =
req->fs.info.file_flags;
482 current_umask =
umask(0);
483 umask(current_umask);
488 access = FILE_GENERIC_READ;
491 access = FILE_GENERIC_WRITE;
494 access = FILE_GENERIC_READ | FILE_GENERIC_WRITE;
501 access &= ~FILE_WRITE_DATA;
502 access |= FILE_APPEND_DATA;
518 share = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
524 disposition = OPEN_EXISTING;
527 disposition = OPEN_ALWAYS;
531 disposition = CREATE_NEW;
535 disposition = TRUNCATE_EXISTING;
538 disposition = CREATE_ALWAYS;
544 attributes |= FILE_ATTRIBUTE_NORMAL;
546 if (!((
req->fs.info.mode & ~current_umask) & _S_IWRITE)) {
547 attributes |= FILE_ATTRIBUTE_READONLY;
552 attributes |= FILE_FLAG_DELETE_ON_CLOSE | FILE_ATTRIBUTE_TEMPORARY;
557 attributes |= FILE_ATTRIBUTE_TEMPORARY;
564 attributes |= FILE_FLAG_SEQUENTIAL_SCAN;
567 attributes |= FILE_FLAG_RANDOM_ACCESS;
594 if (
access & FILE_APPEND_DATA) {
595 if (
access & FILE_WRITE_DATA) {
596 access &= ~FILE_APPEND_DATA;
601 attributes |= FILE_FLAG_NO_BUFFERING;
609 attributes |= FILE_FLAG_WRITE_THROUGH;
616 attributes |= FILE_FLAG_BACKUP_SEMANTICS;
618 file = CreateFileW(
req->file.pathw,
646 else if (GetLastError() != ERROR_SUCCESS)
655 FILE_STANDARD_INFO file_info;
656 if (!GetFileInformationByHandleEx(
file,
667 fd_info.
size.QuadPart = 0;
670 if (!GetFileSizeEx(
file, &fd_info.
size)) {
676 if (fd_info.
size.QuadPart == 0) {
684 fd_info.
size.HighPart,
685 fd_info.
size.LowPart,
706 int fd =
req->file.fd;
738 return EXCEPTION_CONTINUE_SEARCH;
742 if (pep !=
NULL && pep->ExceptionRecord !=
NULL &&
743 pep->ExceptionRecord->NumberParameters >= 3) {
746 if (*perror != ERROR_SUCCESS) {
747 return EXCEPTION_EXECUTE_HANDLER;
750 *perror = UV_UNKNOWN;
751 return EXCEPTION_EXECUTE_HANDLER;
756 int fd =
req->file.fd;
757 int rw_flags = fd_info->
flags &
759 size_t read_size, done_read;
761 LARGE_INTEGER
pos, end_pos;
763 LARGE_INTEGER view_base;
775 if (
req->fs.info.offset == -1) {
778 pos.QuadPart =
req->fs.info.offset;
782 if (
pos.QuadPart >= fd_info->
size.QuadPart) {
788 for (index = 0; index <
req->fs.info.nbufs; ++index) {
789 read_size +=
req->fs.info.bufs[index].len;
791 read_size = (
size_t)
MIN((LONGLONG) read_size,
792 fd_info->
size.QuadPart -
pos.QuadPart);
793 if (read_size == 0) {
798 end_pos.QuadPart =
pos.QuadPart + read_size;
801 view_base.QuadPart =
pos.QuadPart - view_offset;
802 view = MapViewOfFile(fd_info->
mapping,
806 view_offset + read_size);
814 index <
req->fs.info.nbufs && done_read < read_size;
816 size_t this_read_size =
MIN(
req->fs.info.bufs[index].len,
817 read_size - done_read);
823 (
char*)view + view_offset + done_read,
828 GetExceptionInformation(), &
err)) {
830 UnmapViewOfFile(view);
834 done_read += this_read_size;
836 assert(done_read == read_size);
838 if (!UnmapViewOfFile(view)) {
843 if (
req->fs.info.offset == -1) {
853 int fd =
req->file.fd;
856 OVERLAPPED overlapped, *overlapped_ptr;
857 LARGE_INTEGER offset_;
862 LARGE_INTEGER original_position;
863 LARGE_INTEGER zero_offset;
864 int restore_position;
874 zero_offset.QuadPart = 0;
875 restore_position = 0;
884 memset(&overlapped, 0,
sizeof overlapped);
885 overlapped_ptr = &overlapped;
886 if (SetFilePointerEx(
handle, zero_offset, &original_position,
888 restore_position = 1;
891 overlapped_ptr =
NULL;
897 DWORD incremental_bytes;
901 overlapped.Offset = offset_.LowPart;
902 overlapped.OffsetHigh = offset_.HighPart;
906 req->fs.info.bufs[index].base,
907 req->fs.info.bufs[index].len,
910 bytes += incremental_bytes;
912 }
while (result && index < req->fs.info.nbufs);
914 if (restore_position)
915 SetFilePointerEx(
handle, original_position,
NULL, FILE_BEGIN);
917 if (result ||
bytes > 0) {
920 error = GetLastError();
921 if (
error == ERROR_HANDLE_EOF) {
932 int fd =
req->file.fd;
934 int rw_flags = fd_info->
flags &
936 size_t write_size, done_write;
938 LARGE_INTEGER
pos, end_pos;
940 LARGE_INTEGER view_base;
954 for (index = 0; index <
req->fs.info.nbufs; ++index) {
955 write_size +=
req->fs.info.bufs[index].len;
958 if (write_size == 0) {
965 }
else if (
req->fs.info.offset == -1) {
968 pos.QuadPart =
req->fs.info.offset;
971 end_pos.QuadPart =
pos.QuadPart + write_size;
974 if (end_pos.QuadPart > fd_info->
size.QuadPart) {
989 fd_info->
size.QuadPart = 0;
995 fd_info->
size = end_pos;
1000 view_base.QuadPart =
pos.QuadPart - view_offset;
1001 view = MapViewOfFile(fd_info->
mapping,
1005 view_offset + write_size);
1012 for (index = 0; index <
req->fs.info.nbufs; ++index) {
1017 memcpy((
char*)view + view_offset + done_write,
1018 req->fs.info.bufs[index].base,
1019 req->fs.info.bufs[index].len);
1023 GetExceptionInformation(), &
err)) {
1025 UnmapViewOfFile(view);
1029 done_write +=
req->fs.info.bufs[index].len;
1031 assert(done_write == write_size);
1033 if (!FlushViewOfFile(view, 0)) {
1035 UnmapViewOfFile(view);
1038 if (!UnmapViewOfFile(view)) {
1043 if (
req->fs.info.offset == -1) {
1048 GetSystemTimeAsFileTime(&ft);
1055 int fd =
req->file.fd;
1058 OVERLAPPED overlapped, *overlapped_ptr;
1059 LARGE_INTEGER offset_;
1063 LARGE_INTEGER original_position;
1064 LARGE_INTEGER zero_offset;
1065 int restore_position;
1070 zero_offset.QuadPart = 0;
1071 restore_position = 0;
1084 memset(&overlapped, 0,
sizeof overlapped);
1085 overlapped_ptr = &overlapped;
1086 if (SetFilePointerEx(
handle, zero_offset, &original_position,
1088 restore_position = 1;
1091 overlapped_ptr =
NULL;
1097 DWORD incremental_bytes;
1101 overlapped.Offset = offset_.LowPart;
1102 overlapped.OffsetHigh = offset_.HighPart;
1105 result = WriteFile(
handle,
1106 req->fs.info.bufs[index].base,
1107 req->fs.info.bufs[index].len,
1110 bytes += incremental_bytes;
1112 }
while (result && index < req->fs.info.nbufs);
1114 if (restore_position)
1115 SetFilePointerEx(
handle, original_position,
NULL, FILE_BEGIN);
1117 if (result ||
bytes > 0) {
1126 int result = _wrmdir(
req->file.pathw);
1135 const WCHAR* pathw =
req->file.pathw;
1137 BY_HANDLE_FILE_INFORMATION
info;
1142 handle = CreateFileW(pathw,
1143 FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | DELETE,
1144 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
1147 FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS,
1155 if (!GetFileInformationByHandle(
handle, &
info)) {
1161 if (
info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
1167 if (!(
info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
1178 error = ERROR_ACCESS_DENIED;
1185 if (
info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
1189 basic.FileAttributes = (
info.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY) |
1190 FILE_ATTRIBUTE_ARCHIVE;
1223 if (CreateDirectoryW(
req->file.pathw,
NULL)) {
1227 if (
req->sys_errno_ == ERROR_INVALID_NAME)
1228 req->result = UV_EINVAL;
1236 static const WCHAR *tempchars =
1237 L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
1238 static const size_t num_chars = 62;
1239 static const size_t num_x = 6;
1241 unsigned int tries,
i;
1247 len = wcslen(
req->file.pathw);
1248 ep =
req->file.pathw +
len;
1249 if (
len < num_x || wcsncmp(ep - num_x,
L"XXXXXX", num_x)) {
1262 for (
i = 0;
i < num_x;
i++) {
1263 *cp++ = tempchars[
v % num_chars];
1268 if (
req->result >= 0) {
1270 wcstombs(
path +
len - num_x, ep - num_x, num_x);
1285 if (CreateDirectoryW(
req->file.pathw,
NULL)) {
1289 error = GetLastError();
1290 if (
error != ERROR_ALREADY_EXISTS) {
1308 file = CreateFileW(
req->file.pathw,
1309 GENERIC_READ | GENERIC_WRITE,
1310 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
1313 FILE_ATTRIBUTE_NORMAL,
1318 error = GetLastError();
1322 if (
error != ERROR_FILE_EXISTS) {
1338 else if (GetLastError() != ERROR_SUCCESS)
1358 static const size_t dirents_initial_size = 32;
1363 size_t dirents_size = 0;
1364 size_t dirents_used = 0;
1386 CreateFileW(
req->file.pathw,
1387 FILE_LIST_DIRECTORY | SYNCHRONIZE,
1388 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
1391 FILE_FLAG_BACKUP_SEMANTICS,
1413 goto not_a_directory_error;
1417 size_t next_entry_offset = 0;
1427 position += next_entry_offset;
1431 next_entry_offset =
info->NextEntryOffset;
1434 wchar_len =
info->FileNameLength /
sizeof info->FileName[0];
1440 while (wchar_len > 0 &&
info->FileName[wchar_len - 1] ==
L'\0')
1445 if (wchar_len == 1 &&
info->FileName[0] ==
L'.')
1447 if (wchar_len == 2 &&
info->FileName[0] ==
L'.' &&
1448 info->FileName[1] ==
L'.')
1452 utf8_len = WideCharToMultiByte(
1458 if (dirents_used >= dirents_size) {
1459 size_t new_dirents_size =
1460 dirents_size == 0 ? dirents_initial_size : dirents_size << 1;
1462 uv__realloc(dirents, new_dirents_size *
sizeof *dirents);
1464 if (new_dirents ==
NULL)
1465 goto out_of_memory_error;
1467 dirents_size = new_dirents_size;
1468 dirents = new_dirents;
1477 goto out_of_memory_error;
1479 dirents[dirents_used++] =
dirent;
1482 if (WideCharToMultiByte(CP_UTF8,
1496 if (
info->FileAttributes & FILE_ATTRIBUTE_DEVICE)
1498 else if (
info->FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
1500 else if (
info->FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
1504 }
while (next_entry_offset != 0);
1530 CloseHandle(dir_handle);
1534 if (dirents !=
NULL)
1540 req->fs.info.nbufs = 0;
1552 not_a_directory_error:
1556 out_of_memory_error:
1562 CloseHandle(dir_handle);
1563 while (dirents_used > 0)
1565 if (dirents !=
NULL)
1576 pathw =
req->file.pathw;
1581 if (!(GetFileAttributesW(pathw) & FILE_ATTRIBUTE_DIRECTORY)) {
1592 len = wcslen(pathw);
1608 dir->dir_handle = FindFirstFileW(
find_path, &dir->find_data);
1612 GetLastError() != ERROR_FILE_NOT_FOUND) {
1617 dir->need_find_call =
FALSE;
1632 unsigned int dirent_idx;
1633 PWIN32_FIND_DATAW find_data;
1641 find_data = &dir->find_data;
1644 while (dirent_idx < dir->nentries) {
1645 if (dir->need_find_call && FindNextFileW(dir->dir_handle, find_data) == 0) {
1646 if (GetLastError() == ERROR_NO_MORE_FILES)
1652 if (find_data->cFileName[0] ==
L'.' &&
1653 (find_data->cFileName[1] ==
L'\0' ||
1654 (find_data->cFileName[1] ==
L'.' &&
1655 find_data->cFileName[2] ==
L'\0'))) {
1656 dir->need_find_call =
TRUE;
1662 (
char**) &dirents[dirent_idx].
name);
1667 if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
1669 else if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0)
1671 else if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0)
1677 dir->need_find_call =
TRUE;
1686 for (
i = 0;
i < dirent_idx; ++
i) {
1696 FindClose(dir->dir_handle);
1789 statbuf->
st_mode |= _S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6);
1791 statbuf->
st_mode |= (_S_IREAD | _S_IWRITE) | ((_S_IREAD | _S_IWRITE) >> 3) |
1792 ((_S_IREAD | _S_IWRITE) >> 6);
1843 size_t len = wcslen(pathw);
1846 if (
len > 1 && pathw[
len - 2] !=
L':' &&
1847 (pathw[
len - 1] ==
L'\\' || pathw[
len - 1] ==
L'/')) {
1848 pathw[
len - 1] =
'\0';
1860 flags = FILE_FLAG_BACKUP_SEMANTICS;
1862 flags |= FILE_FLAG_OPEN_REPARSE_POINT;
1865 FILE_READ_ATTRIBUTES,
1866 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
1873 ret = GetLastError();
1875 ret = GetLastError();
1891 error == ERROR_NOT_A_REPARSE_POINT)) {
1902 req->ptr = &
req->statbuf;
1920 int fd =
req->file.fd;
1937 req->ptr = &
req->statbuf;
1943 if (!MoveFileExW(
req->file.pathw,
req->fs.info.new_pathw, MOVEFILE_REPLACE_EXISTING)) {
1953 int fd =
req->file.fd;
1978 int fd =
req->file.fd;
2013 if (fd_info.
flags) {
2016 fd_info.
size.QuadPart = 0;
2023 if (fd_info.
flags) {
2026 if (fd_info.
size.QuadPart == 0) {
2034 fd_info.
size.HighPart,
2035 fd_info.
size.LowPart,
2041 fd_info.
size.QuadPart = 0;
2068 if (CopyFileW(
req->file.pathw,
req->fs.info.new_pathw, overwrite) != 0) {
2074 if (
req->result != UV_EBUSY)
2091 int fd_in =
req->file.fd, fd_out =
req->fs.info.fd_out;
2092 size_t length =
req->fs.info.bufsml[0].len;
2094 const size_t max_buf_size = 65536;
2107 if (result_offset == -1) {
2114 }
else if (
n == -1) {
2121 n = _write(fd_out,
buf,
n);
2138 DWORD attr = GetFileAttributesW(
req->file.pathw);
2140 if (attr == INVALID_FILE_ATTRIBUTES) {
2152 if (!(
req->fs.info.mode &
W_OK) ||
2153 !(attr & FILE_ATTRIBUTE_READONLY) ||
2154 (attr & FILE_ATTRIBUTE_DIRECTORY)) {
2164 int result = _wchmod(
req->file.pathw,
req->fs.info.mode);
2173 int fd =
req->file.fd;
2174 int clear_archive_flag;
2196 goto fchmod_cleanup;
2211 goto fchmod_cleanup;
2214 clear_archive_flag = 1;
2216 clear_archive_flag = 0;
2219 if (
req->fs.info.mode & _S_IWRITE) {
2233 goto fchmod_cleanup;
2236 if (clear_archive_flag) {
2248 goto fchmod_cleanup;
2259 FILETIME filetime_a, filetime_m;
2264 if (!SetFileTime(
handle,
NULL, &filetime_a, &filetime_m)) {
2279 flags = FILE_FLAG_BACKUP_SEMANTICS;
2281 flags |= FILE_FLAG_OPEN_REPARSE_POINT;
2285 FILE_WRITE_ATTRIBUTES,
2286 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
2293 ret = GetLastError();
2295 ret = GetLastError();
2315 error == ERROR_NOT_A_REPARSE_POINT)) {
2335 int fd =
req->file.fd;
2369 const WCHAR* new_path) {
2374 int is_absolute, is_long_path;
2375 int needed_buf_size, used_buf_size, used_data_size, path_buf_len;
2381 target_len = wcslen(
path);
2399 FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer.PathBuffer) +
2401 2 * (target_len + 2) *
sizeof(WCHAR);
2410 path_buf = (WCHAR*)&(
buffer->MountPointReparseBuffer.PathBuffer);
2414 start = path_buf_len;
2428 path_buf[path_buf_len++] =
L'\\';
2432 path_buf[path_buf_len++] =
path[
i];
2434 path_buf[path_buf_len++] =
L'\\';
2438 buffer->MountPointReparseBuffer.SubstituteNameOffset =
start *
sizeof(WCHAR);
2439 buffer->MountPointReparseBuffer.SubstituteNameLength =
len *
sizeof(WCHAR);
2442 path_buf[path_buf_len++] =
L'\0';
2445 start = path_buf_len;
2454 path_buf[path_buf_len++] =
L'\\';
2458 path_buf[path_buf_len++] =
path[
i];
2462 path_buf[path_buf_len++] =
L'\\';
2467 buffer->MountPointReparseBuffer.PrintNameOffset =
start *
sizeof(WCHAR);
2468 buffer->MountPointReparseBuffer.PrintNameLength =
len *
sizeof(WCHAR);
2471 path_buf[path_buf_len++] =
L'\0';
2474 used_buf_size = FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer.PathBuffer) +
2475 path_buf_len *
sizeof(WCHAR);
2476 used_data_size = used_buf_size -
2477 FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer);
2480 buffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
2481 buffer->ReparseDataLength = used_data_size;
2485 if (!CreateDirectoryW(new_path,
NULL)) {
2492 handle = CreateFileW(new_path,
2497 FILE_FLAG_BACKUP_SEMANTICS |
2498 FILE_FLAG_OPEN_REPARSE_POINT,
2506 if (!DeviceIoControl(
handle,
2533 RemoveDirectoryW(new_path);
2544 pathw =
req->file.pathw;
2545 new_pathw =
req->fs.info.new_pathw;
2557 if (CreateSymbolicLinkW(new_pathw, pathw,
flags)) {
2565 err = GetLastError();
2566 if (
err == ERROR_INVALID_PARAMETER &&
2587 FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS,
2610 DWORD w_realpath_len;
2611 WCHAR* w_realpath_ptr =
NULL;
2612 WCHAR* w_realpath_buf;
2614 w_realpath_len = GetFinalPathNameByHandleW(
handle,
NULL, 0, VOLUME_NAME_DOS);
2615 if (w_realpath_len == 0) {
2619 w_realpath_buf =
uv__malloc((w_realpath_len + 1) *
sizeof(WCHAR));
2620 if (w_realpath_buf ==
NULL) {
2621 SetLastError(ERROR_OUTOFMEMORY);
2624 w_realpath_ptr = w_realpath_buf;
2626 if (GetFinalPathNameByHandleW(
2627 handle, w_realpath_ptr, w_realpath_len, VOLUME_NAME_DOS) == 0) {
2629 SetLastError(ERROR_INVALID_HANDLE);
2634 if (wcsncmp(w_realpath_ptr,
2637 w_realpath_ptr += 6;
2638 *w_realpath_ptr =
L'\\';
2639 w_realpath_len -= 6;
2640 }
else if (wcsncmp(w_realpath_ptr,
2643 w_realpath_ptr += 4;
2644 w_realpath_len -= 4;
2647 SetLastError(ERROR_INVALID_HANDLE);
2664 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS,
2700 DWORD sectors_per_cluster;
2701 DWORD bytes_per_sector;
2702 DWORD free_clusters;
2703 DWORD total_clusters;
2706 pathw =
req->file.pathw;
2707 retry_get_disk_free_space:
2708 if (0 == GetDiskFreeSpaceW(pathw,
2709 §ors_per_cluster,
2719 err = GetLastError();
2720 is_second = pathw !=
req->file.pathw;
2721 if (
err != ERROR_DIRECTORY || is_second) {
2731 if (pathw ==
NULL) {
2735 retry_get_full_path_name:
2736 ret = GetFullPathNameW(
req->file.pathw,
2744 }
else if (ret >
len) {
2747 if (pathw ==
NULL) {
2751 goto retry_get_full_path_name;
2756 goto retry_get_disk_free_space;
2758 if (pathw !=
req->file.pathw) {
2763 if (stat_fs ==
NULL) {
2769 stat_fs->
f_bsize = bytes_per_sector * sectors_per_cluster;
2770 stat_fs->
f_blocks = total_clusters;
2771 stat_fs->
f_bfree = free_clusters;
2787 #define XX(uc, lc) case UV_FS_##uc: fs__##lc(req); break;
2788 switch (
req->fs_type) {
2793 XX(COPYFILE, copyfile)
2794 XX(SENDFILE, sendfile)
2811 XX(MKSTEMP, mkstemp)
2815 XX(OPENDIR, opendir)
2816 XX(CLOSEDIR, closedir)
2820 XX(REALPATH, realpath)
2826 assert(!
"bad uv_fs_type");
2837 if (
status == UV_ECANCELED) {
2865 if (
req->fs.info.bufs !=
req->fs.info.bufsml)
2870 req->fs.info.new_pathw =
NULL;
2918 req->fs.info.nbufs = nbufs;
2919 req->fs.info.bufs =
req->fs.info.bufsml;
2923 if (
req->fs.info.bufs ==
NULL) {
2951 req->fs.info.nbufs = nbufs;
2952 req->fs.info.bufs =
req->fs.info.bufsml;
2956 if (
req->fs.info.bufs ==
NULL) {
3287 const char* new_path,
3315 req->file.fd = fd_in;
3316 req->fs.info.fd_out = fd_out;
3317 req->fs.info.offset = in_offset;
3378 req->fs.time.atime = atime;
3379 req->fs.time.mtime = mtime;
3388 req->fs.time.atime = atime;
3389 req->fs.time.mtime = mtime;
3404 req->fs.time.atime = atime;
3405 req->fs.time.mtime = mtime;
3427 return req->sys_errno_;
static mcore_handle handle
RzBinInfo * info(RzBinFile *bf)
#define EXCEPTION_IN_PAGE_ERROR
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence ftruncate
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count fchmod
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
static static fork const void static count close
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen rmdir
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
static static sync static getppid static getegid const char static filename char static len readlink
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset fstat
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz umask
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg fsync
static static fork const void static count static fd const char const char static newpath const char static path chmod
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem lchown
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
static static fork const void static count static fd link
void uv_fatal_error(const int errorno, const char *syscall)
static INLINE void uv__fd_hash_add(int fd, struct uv__fd_info_s *info)
static INLINE int uv__fd_hash_get(int fd, struct uv__fd_info_s *info)
static INLINE void uv__fd_hash_init(void)
static INLINE int uv__fd_hash_remove(int fd, struct uv__fd_info_s *info)
static INLINE HANDLE uv__get_osfhandle(int fd)
#define INVALID_HANDLE_VALUE
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig mkdir
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds utime
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause access
static const char struct stat static buf struct stat static buf static vhangup int struct rusage static rusage struct sysinfo static info unsigned static __unused struct utsname static buf const char static size const char static name static pid unsigned static persona static fsgid const void static flags const struct iovec static count fdatasync
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname unsigned long static filedes void static end_data_segment static handler static getegid char static len static pgid const char static path static newfd static getpgrp static euid const sigset_t static mask const char static len const gid_t static list symlink
static static fork const void static count static fd const char static mode unlink
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname unsigned long static filedes void static end_data_segment static handler static getegid char static len static pgid const char static path static newfd static getpgrp static euid const sigset_t static mask const char static len const gid_t static list const char const char static newpath const char static library readdir
static const char struct stat static buf struct stat static buf static vhangup int status
static const char struct stat static buf struct stat static buf static vhangup int struct rusage static rusage struct sysinfo static info unsigned static __unused struct utsname static buf const char static size const char static name static pid unsigned static persona static fsgid const void static flags const struct iovec static count static fd const void static len static munlockall struct sched_param static p static sched_yield static policy const struct timespec struct timespec static rem uid_t uid_t uid_t static suid struct pollfd unsigned static timeout chown
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync rename
assert(limit<=UINT32_MAX/2)
int scandir(const char *maindir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const struct dirent **, const struct dirent **))
char * mkdtemp(char *path)
#define SET_REQ_SUCCESS(req)
#define container_of(ptr, type, member)
static struct sockaddr static addrlen static backlog const void static flags void flags
LARGE_INTEGER current_pos
uv_timespec_t st_birthtim
__declspec(noreturn) void uv_fatal_error(const int errorno
int uv__convert_utf16_to_utf8(const WCHAR *utf16, int utf16len, char **utf8)
int uv__random_rtlgenrandom(void *buf, size_t buflen)
static char bufs[4][128]
Buffers for uint64_to_str() and uint64_to_nicestr()
int uv_fs_fstat(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb)
int uv_fs_closedir(uv_loop_t *loop, uv_fs_t *req, uv_dir_t *dir, uv_fs_cb cb)
int uv_fs_scandir(uv_loop_t *loop, uv_fs_t *req, const char *path, int flags, uv_fs_cb cb)
int uv_fs_fchown(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb)
int uv_fs_rename(uv_loop_t *loop, uv_fs_t *req, const char *path, const char *new_path, uv_fs_cb cb)
int uv_fs_access(uv_loop_t *loop, uv_fs_t *req, const char *path, int flags, uv_fs_cb cb)
int uv_fs_close(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb)
int uv_fs_stat(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
int uv_fs_ftruncate(uv_loop_t *loop, uv_fs_t *req, uv_file file, int64_t off, uv_fs_cb cb)
int uv_fs_open(uv_loop_t *loop, uv_fs_t *req, const char *path, int flags, int mode, uv_fs_cb cb)
int uv_fs_utime(uv_loop_t *loop, uv_fs_t *req, const char *path, double atime, double mtime, uv_fs_cb cb)
int uv_fs_opendir(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
int uv_fs_mkstemp(uv_loop_t *loop, uv_fs_t *req, const char *tpl, uv_fs_cb cb)
int uv_fs_futime(uv_loop_t *loop, uv_fs_t *req, uv_file file, double atime, double mtime, uv_fs_cb cb)
int uv_fs_symlink(uv_loop_t *loop, uv_fs_t *req, const char *path, const char *new_path, int flags, uv_fs_cb cb)
int uv_fs_sendfile(uv_loop_t *loop, uv_fs_t *req, uv_file out_fd, uv_file in_fd, int64_t off, size_t len, uv_fs_cb cb)
int uv_fs_get_system_error(const uv_fs_t *req)
int uv_fs_unlink(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
int uv_fs_mkdir(uv_loop_t *loop, uv_fs_t *req, const char *path, int mode, uv_fs_cb cb)
int uv_fs_mkdtemp(uv_loop_t *loop, uv_fs_t *req, const char *tpl, uv_fs_cb cb)
int uv_fs_chown(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb)
int uv_fs_copyfile(uv_loop_t *loop, uv_fs_t *req, const char *path, const char *new_path, int flags, uv_fs_cb cb)
int uv_fs_lutime(uv_loop_t *loop, uv_fs_t *req, const char *path, double atime, double mtime, uv_fs_cb cb)
void uv_fs_req_cleanup(uv_fs_t *req)
int uv_fs_lstat(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
int uv_fs_read(uv_loop_t *loop, uv_fs_t *req, uv_file file, const uv_buf_t bufs[], unsigned int nbufs, int64_t off, uv_fs_cb cb)
int uv_fs_chmod(uv_loop_t *loop, uv_fs_t *req, const char *path, int mode, uv_fs_cb cb)
int uv_fs_lchown(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb)
int uv_fs_link(uv_loop_t *loop, uv_fs_t *req, const char *path, const char *new_path, uv_fs_cb cb)
int uv_fs_realpath(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
int uv_fs_fdatasync(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb)
int uv_fs_statfs(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
int uv_fs_fsync(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb)
int uv_fs_fchmod(uv_loop_t *loop, uv_fs_t *req, uv_file file, int mode, uv_fs_cb cb)
int uv_fs_write(uv_loop_t *loop, uv_fs_t *req, uv_file file, const uv_buf_t bufs[], unsigned int nbufs, int64_t off, uv_fs_cb cb)
int uv_fs_rmdir(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
int uv_fs_readdir(uv_loop_t *loop, uv_fs_t *req, uv_dir_t *dir, uv_fs_cb cb)
int uv_fs_readlink(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb)
#define UV_FS_O_SEQUENTIAL
#define UV_FS_O_TEMPORARY
#define UV_FS_O_SHORT_LIVED
void error(const char *msg)
void * uv__reallocf(void *ptr, size_t size)
void * uv__realloc(void *ptr, size_t size)
void uv__fs_scandir_cleanup(uv_fs_t *req)
void * uv__malloc(size_t size)
void uv__fs_readdir_cleanup(uv_fs_t *req)
uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t *dent)
#define UV_REQ_INIT(req, typ)
#define STATIC_ASSERT(expr)
#define uv__req_unregister(loop, req)
#define UV_FS_SYMLINK_DIR
#define UV_FS_COPYFILE_FICLONE_FORCE
void(* uv_fs_cb)(uv_fs_t *req)
#define UV_FS_COPYFILE_EXCL
#define UV_FS_COPYFILE_FICLONE
#define UV_FS_SYMLINK_JUNCTION
static INLINE void fs__utime_impl(uv_fs_t *req, int do_lutime)
static void fs__chmod(uv_fs_t *req)
static void fs__utime(uv_fs_t *req)
void fs__opendir(uv_fs_t *req)
const WCHAR UNC_PATH_PREFIX_LEN
static void fs__fchown(uv_fs_t *req)
static INLINE void fs__sync_impl(uv_fs_t *req)
#define VERIFY_FD(fd, req)
static INLINE int fs__utime_handle(HANDLE handle, double atime, double mtime)
void fs__read(uv_fs_t *req)
static void fs__readlink(uv_fs_t *req)
static int fs__mkdtemp_func(uv_fs_t *req)
LONG fs__filemap_ex_filter(LONG excode, PEXCEPTION_POINTERS pep, int *perror)
static void fs__copyfile(uv_fs_t *req)
static void fs__link(uv_fs_t *req)
void fs__open(uv_fs_t *req)
void fs__mktemp(uv_fs_t *req, uv__fs_mktemp_func func)
void fs__write(uv_fs_t *req)
void fs__closedir(uv_fs_t *req)
void fs__read_filemap(uv_fs_t *req, struct uv__fd_info_s *fd_info)
static void fs__symlink(uv_fs_t *req)
static INLINE int fs__capture_path(uv_fs_t *req, const char *path, const char *new_path, const int copy_path)
#define SET_REQ_UV_ERROR(req, uv_errno, sys_errno)
static void fs__sendfile(uv_fs_t *req)
static void fs__lstat(uv_fs_t *req)
static void fs__ftruncate(uv_fs_t *req)
static void uv__fs_done(struct uv__work *w, int status)
const WCHAR JUNCTION_PREFIX_LEN
static void fs__futime(uv_fs_t *req)
const WCHAR LONG_PATH_PREFIX[]
static void fs__statfs(uv_fs_t *req)
static void fs__fchmod(uv_fs_t *req)
static void fs__access(uv_fs_t *req)
void fs__readdir(uv_fs_t *req)
static void fs__fdatasync(uv_fs_t *req)
int(* uv__fs_mktemp_func)(uv_fs_t *req)
static INLINE DWORD fs__utime_impl_from_path(WCHAR *path, double atime, double mtime, int do_lutime)
static void fs__stat(uv_fs_t *req)
void fs__write_filemap(uv_fs_t *req, HANDLE file, struct uv__fd_info_s *fd_info)
void fs__close(uv_fs_t *req)
const WCHAR UNC_PATH_PREFIX[]
const WCHAR LONG_PATH_PREFIX_LEN
static ssize_t fs__realpath_handle(HANDLE handle, char **realpath_ptr)
static void fs__realpath(uv_fs_t *req)
static void fs__rename(uv_fs_t *req)
void fs__scandir(uv_fs_t *req)
static int fs__wide_to_utf8(WCHAR *w_source_ptr, DWORD w_source_len, char **target_ptr, uint64_t *target_len_ptr)
static int fs__mkstemp_func(uv_fs_t *req)
static INLINE DWORD fs__stat_impl_from_path(WCHAR *path, int do_lstat, uv_stat_t *statbuf)
static int uv__file_symlink_usermode_flag
void fs__rmdir(uv_fs_t *req)
static void fs__chown(uv_fs_t *req)
void fs__mkdir(uv_fs_t *req)
#define SET_REQ_WIN32_ERROR(req, sys_errno)
static void fs__lchown(uv_fs_t *req)
static INLINE void fs__stat_prepare_path(WCHAR *pathw)
static void uv__fs_work(struct uv__work *w)
static void fs__create_junction(uv_fs_t *req, const WCHAR *path, const WCHAR *new_path)
const WCHAR JUNCTION_PREFIX[]
static void fs__fstat(uv_fs_t *req)
static INLINE int fs__stat_handle(HANDLE handle, uv_stat_t *statbuf, int do_lstat)
void fs__mkstemp(uv_fs_t *req)
#define SET_REQ_RESULT(req, result_value)
static DWORD uv__allocation_granularity
static INLINE int fs__readlink_handle(HANDLE handle, char **target_ptr, uint64_t *target_len_ptr)
static INLINE void uv_fs_req_init(uv_loop_t *loop, uv_fs_t *req, uv_fs_type fs_type, const uv_fs_cb cb)
static INLINE void fs__stat_impl(uv_fs_t *req, int do_lstat)
#define FILETIME_TO_TIMESPEC(ts, filetime)
void fs__unlink(uv_fs_t *req)
static void fs__lutime(uv_fs_t *req)
void fs__mkdtemp(uv_fs_t *req)
static void fs__fsync(uv_fs_t *req)
#define TIME_T_TO_FILETIME(time, filetime_ptr)
static WCHAR * find_path(WCHAR *env)
sNtQueryVolumeInformationFile pNtQueryVolumeInformationFile
sNtQueryDirectoryFile pNtQueryDirectoryFile
sNtSetInformationFile pNtSetInformationFile
sNtQueryInformationFile pNtQueryInformationFile
sRtlNtStatusToDosError pRtlNtStatusToDosError
@ FileEndOfFileInformation
@ FileDirectoryInformation
@ FileDispositionInformation
#define FSCTL_GET_REPARSE_POINT
#define FSCTL_SET_REPARSE_POINT
#define SYMBOLIC_LINK_FLAG_DIRECTORY
#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
#define STATUS_INVALID_PARAMETER
#define ERROR_SYMLINK_NOT_SUPPORTED
#define NT_SUCCESS(status)
#define IO_REPARSE_TAG_APPEXECLINK
#define STATUS_NOT_IMPLEMENTED
#define IO_REPARSE_TAG_SYMLINK
#define STATUS_BUFFER_OVERFLOW
#define STATUS_NO_MORE_FILES
@ FileFsVolumeInformation
static const z80_opcode fd[]
int read(izstream &zs, T *x, Items items)