From 3f583916719eeef598d10a5d4e14ef14f008243b Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 11 May 2021 07:36:37 -0700 Subject: Merge Dtf --- .../SafeNativeMethods.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs (limited to 'src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs') diff --git a/src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs b/src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs new file mode 100644 index 00000000..1829ba81 --- /dev/null +++ b/src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Dtf.Compression +{ + using System; + using System.Security; + using System.Runtime.InteropServices; + + [SuppressUnmanagedCodeSecurity] + internal static class SafeNativeMethods + { + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool DosDateTimeToFileTime( + short wFatDate, short wFatTime, out long fileTime); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool FileTimeToDosDateTime( + ref long fileTime, out short wFatDate, out short wFatTime); + } +} -- cgit v1.2.3-55-g6feb