diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-11 07:36:37 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-11 07:36:37 -0700 |
| commit | 3f583916719eeef598d10a5d4e14ef14f008243b (patch) | |
| tree | 3d528e0ddb5c0550954217c97059d2f19cd6152a /src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs | |
| parent | 2e5ab696b8b4666d551b2a0532b95fb7fe6dbe03 (diff) | |
| download | wix-3f583916719eeef598d10a5d4e14ef14f008243b.tar.gz wix-3f583916719eeef598d10a5d4e14ef14f008243b.tar.bz2 wix-3f583916719eeef598d10a5d4e14ef14f008243b.zip | |
Merge Dtf
Diffstat (limited to 'src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs')
| -rw-r--r-- | src/dtf/WixToolset.Dtf.Compression/SafeNativeMethods.cs | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Dtf.Compression | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Security; | ||
| 7 | using System.Runtime.InteropServices; | ||
| 8 | |||
| 9 | [SuppressUnmanagedCodeSecurity] | ||
| 10 | internal static class SafeNativeMethods | ||
| 11 | { | ||
| 12 | [DllImport("kernel32.dll", SetLastError = true)] | ||
| 13 | [return: MarshalAs(UnmanagedType.Bool)] | ||
| 14 | internal static extern bool DosDateTimeToFileTime( | ||
| 15 | short wFatDate, short wFatTime, out long fileTime); | ||
| 16 | |||
| 17 | [DllImport("kernel32.dll", SetLastError = true)] | ||
| 18 | [return: MarshalAs(UnmanagedType.Bool)] | ||
| 19 | internal static extern bool FileTimeToDosDateTime( | ||
| 20 | ref long fileTime, out short wFatDate, out short wFatTime); | ||
| 21 | } | ||
| 22 | } | ||
