aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs
blob: b9c62a994a0d4dd116220f33fd5cf63d498c5f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// 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.Mba.Core
{
    using System;
    using System.CodeDom.Compiler;
    using System.Runtime.InteropServices;

    [ComVisible(true)]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [Guid("2965A12F-AC7B-43A0-85DF-E4B2168478A4")]
    [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
    public interface IBootstrapperApplicationFactory
    {
        void Create(
            IntPtr pArgs,
            IntPtr pResults
            );
    }

    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
    public struct Command
    {
        // Strings must be declared as pointers so that Marshaling doesn't free them.
        [MarshalAs(UnmanagedType.I4)] internal int cbSize;
        [MarshalAs(UnmanagedType.U4)] private readonly LaunchAction action;
        [MarshalAs(UnmanagedType.U4)] private readonly Display display;
        [MarshalAs(UnmanagedType.U4)] private readonly Restart restart;
        private readonly IntPtr wzCommandLine;
        [MarshalAs(UnmanagedType.I4)] private readonly int nCmdShow;
        [MarshalAs(UnmanagedType.U4)] private readonly ResumeType resume;
        private readonly IntPtr hwndSplashScreen;
        [MarshalAs(UnmanagedType.I4)] private readonly RelationType relation;
        [MarshalAs(UnmanagedType.Bool)] private readonly bool passthrough;
        private readonly IntPtr wzLayoutDirectory;
        private readonly IntPtr wzBootstrapperWorkingFolder;
        private readonly IntPtr wzBootstrapperApplicationDataPath;

        public IBootstrapperCommand GetBootstrapperCommand()
        {
            return new BootstrapperCommand(
                this.action,
                this.display,
                this.restart,
                Marshal.PtrToStringUni(this.wzCommandLine),
                this.nCmdShow,
                this.resume,
                this.hwndSplashScreen,
                this.relation,
                this.passthrough,
                Marshal.PtrToStringUni(this.wzLayoutDirectory),
                Marshal.PtrToStringUni(this.wzBootstrapperWorkingFolder),
                Marshal.PtrToStringUni(this.wzBootstrapperApplicationDataPath));
        }
    }

    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
    public struct BootstrapperCreateArgs
    {
        [MarshalAs(UnmanagedType.I4)] public readonly int cbSize;
        [MarshalAs(UnmanagedType.I8)] public readonly long qwEngineAPIVersion;
        public readonly IntPtr pfnBootstrapperEngineProc;
        public readonly IntPtr pvBootstrapperEngineProcContext;
        public readonly IntPtr pCommand;

        public BootstrapperCreateArgs(long version, IntPtr pEngineProc, IntPtr pEngineContext, IntPtr pCommand)
        {
            this.cbSize = Marshal.SizeOf(typeof(BootstrapperCreateArgs));
            this.qwEngineAPIVersion = version;
            this.pfnBootstrapperEngineProc = pEngineProc;
            this.pvBootstrapperEngineProcContext = pEngineContext;
            this.pCommand = pCommand;
        }
    }
}