summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/ntdll.h
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/ntdll.h')
-rw-r--r--winsup/cygwin/ntdll.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 4d5eed235..1ce348f47 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -1072,4 +1072,15 @@ extern "C"
NTSTATUS NTAPI RtlInt64ToHexUnicodeString (ULONGLONG value,
PUNICODE_STRING dest,
BOOLEAN append);
+ /* Set file attributes. Don't change file times. */
+ inline
+ NTSTATUS NTAPI NtSetAttributesFile (HANDLE h, ULONG attr)
+ {
+ IO_STATUS_BLOCK io;
+ FILE_BASIC_INFORMATION fbi;
+ fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart =
+ fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
+ fbi.FileAttributes = attr ?: FILE_ATTRIBUTE_NORMAL;
+ return NtSetInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
+ }
}