From 3d2d46f62fc01e2653d0251ad9703090574e7c41 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 6 Mar 2024 14:48:10 -0800 Subject: Better .nupkg names --- .../NativeMethods.cs | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs (limited to 'src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs') 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 @@ +// 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.BootstrapperApplicationApi +{ + using System; + using System.Runtime.InteropServices; + + /// + /// Contains native constants, functions, and structures for this assembly. + /// + internal static class NativeMethods + { + #region Error Constants + internal const int S_OK = 0; + internal const int E_MOREDATA = unchecked((int)0x800700ea); + internal const int E_INSUFFICIENT_BUFFER = unchecked((int)0x8007007a); + internal const int E_CANCELLED = unchecked((int)0x800704c7); + internal const int E_ALREADYINITIALIZED = unchecked((int)0x800704df); + internal const int E_NOTFOUND = unchecked((int)0x80070490); + internal const int E_NOTIMPL = unchecked((int)0x80004001); + internal const int E_UNEXPECTED = unchecked((int)0x8000ffff); + #endregion + + #region Functions + [DllImport("shell32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern IntPtr CommandLineToArgvW( + [MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine, + out int pNumArgs + ); + + [DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern IntPtr LocalFree( + IntPtr hMem + ); + #endregion + } + + #region SafeHandles + internal abstract class SafeHandleZeroIsDefaultAndInvalid : SafeHandle + { + public SafeHandleZeroIsDefaultAndInvalid() : base(IntPtr.Zero, true) { } + + public override bool IsInvalid + { + get { return this.handle == IntPtr.Zero; } + } + } + #endregion +} -- cgit v1.2.3-55-g6feb