diff options
| author | Rob Mensching <rob@firegiant.com> | 2024-03-06 14:48:10 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2024-03-07 10:55:57 -0800 |
| commit | 3d2d46f62fc01e2653d0251ad9703090574e7c41 (patch) | |
| tree | ffdf7dce6c646f38b5e3ad8325c2ce78ca891a1a /src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs | |
| parent | a8504dc4eb1c2d09965b0858699ac737336ef3c1 (diff) | |
| download | wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.tar.gz wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.tar.bz2 wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.zip | |
Better .nupkg names
Diffstat (limited to 'src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs')
| -rw-r--r-- | src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs new file mode 100644 index 00000000..4ef9f35e --- /dev/null +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs | |||
| @@ -0,0 +1,49 @@ | |||
| 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.BootstrapperApplicationApi | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Runtime.InteropServices; | ||
| 7 | |||
| 8 | /// <summary> | ||
| 9 | /// Contains native constants, functions, and structures for this assembly. | ||
| 10 | /// </summary> | ||
| 11 | internal static class NativeMethods | ||
| 12 | { | ||
| 13 | #region Error Constants | ||
| 14 | internal const int S_OK = 0; | ||
| 15 | internal const int E_MOREDATA = unchecked((int)0x800700ea); | ||
| 16 | internal const int E_INSUFFICIENT_BUFFER = unchecked((int)0x8007007a); | ||
| 17 | internal const int E_CANCELLED = unchecked((int)0x800704c7); | ||
| 18 | internal const int E_ALREADYINITIALIZED = unchecked((int)0x800704df); | ||
| 19 | internal const int E_NOTFOUND = unchecked((int)0x80070490); | ||
| 20 | internal const int E_NOTIMPL = unchecked((int)0x80004001); | ||
| 21 | internal const int E_UNEXPECTED = unchecked((int)0x8000ffff); | ||
| 22 | #endregion | ||
| 23 | |||
| 24 | #region Functions | ||
| 25 | [DllImport("shell32.dll", ExactSpelling = true, SetLastError = true)] | ||
| 26 | internal static extern IntPtr CommandLineToArgvW( | ||
| 27 | [MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine, | ||
| 28 | out int pNumArgs | ||
| 29 | ); | ||
| 30 | |||
| 31 | [DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)] | ||
| 32 | internal static extern IntPtr LocalFree( | ||
| 33 | IntPtr hMem | ||
| 34 | ); | ||
| 35 | #endregion | ||
| 36 | } | ||
| 37 | |||
| 38 | #region SafeHandles | ||
| 39 | internal abstract class SafeHandleZeroIsDefaultAndInvalid : SafeHandle | ||
| 40 | { | ||
| 41 | public SafeHandleZeroIsDefaultAndInvalid() : base(IntPtr.Zero, true) { } | ||
| 42 | |||
| 43 | public override bool IsInvalid | ||
| 44 | { | ||
| 45 | get { return this.handle == IntPtr.Zero; } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | #endregion | ||
| 49 | } | ||
