PageRenderTime 60ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ext/BalExtension/mba/core/NativeMethods.cs

http://wix.codeplex.com
C# | 47 lines | 28 code | 4 blank | 15 comment | 0 complexity | 7a31d8172ef3e9e5c18bbdb230ee8291 MD5 | raw file
Possible License(s): CPL-1.0
  1. //-------------------------------------------------------------------------------------------------
  2. // <copyright file="NativeMethods.cs" company="Outercurve Foundation">
  3. // Copyright (c) 2004, Outercurve Foundation.
  4. // This software is released under Microsoft Reciprocal License (MS-RL).
  5. // The license and further copyright text can be found in the file
  6. // LICENSE.TXT at the root directory of the distribution.
  7. // </copyright>
  8. //
  9. // <summary>
  10. // Container class for the IBootstrapperEngine interface passed to the IBootstrapperApplication.
  11. // </summary>
  12. //-------------------------------------------------------------------------------------------------
  13. namespace WixToolset.Bootstrapper
  14. {
  15. using System;
  16. using System.Runtime.InteropServices;
  17. /// <summary>
  18. /// Contains native constants, functions, and structures for this assembly.
  19. /// </summary>
  20. internal static class NativeMethods
  21. {
  22. #region Error Constants
  23. internal const int S_OK = 0;
  24. internal const int E_MOREDATA = unchecked((int)0x800700ea);
  25. internal const int E_INSUFFICIENT_BUFFER = unchecked((int)0x8007007a);
  26. internal const int E_CANCELLED = unchecked((int)0x800704c7);
  27. internal const int E_ALREADYINITIALIZED = unchecked((int)0x800704df);
  28. internal const int E_NOTFOUND = unchecked((int)0x80070490);
  29. internal const int E_UNEXPECTED = unchecked((int)0x8000ffff);
  30. #endregion
  31. #region Functions
  32. [DllImport("shell32.dll", ExactSpelling = true, SetLastError = true)]
  33. internal static extern IntPtr CommandLineToArgvW(
  34. [MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine,
  35. out int pNumArgs
  36. );
  37. [DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)]
  38. internal static extern IntPtr LocalFree(
  39. IntPtr hMem
  40. );
  41. #endregion
  42. }
  43. }