diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2019-12-22 10:31:33 +1100 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2019-12-22 13:19:29 +1000 |
| commit | 24379873f589cff33965f1104041f61c0c4503e0 (patch) | |
| tree | b50fb0270d2de706cb6f3a4dea0af77ce2cae9e1 /src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs | |
| parent | f3c383c2412e376353d64a8b744184fa1cee1c6e (diff) | |
| download | wix-24379873f589cff33965f1104041f61c0c4503e0.tar.gz wix-24379873f589cff33965f1104041f61c0c4503e0.tar.bz2 wix-24379873f589cff33965f1104041f61c0c4503e0.zip | |
Move the responsibility of wrapping the binary interfaces from mbahost to the new mbanative dll of WixToolset.Mba.Core.
Diffstat (limited to 'src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs')
| -rw-r--r-- | src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs b/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs index 20151b71..264733ac 100644 --- a/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs +++ b/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs | |||
| @@ -2,15 +2,35 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Mba.Core | 3 | namespace WixToolset.Mba.Core |
| 4 | { | 4 | { |
| 5 | using System; | ||
| 6 | using System.Runtime.InteropServices; | ||
| 7 | |||
| 5 | public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory | 8 | public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory |
| 6 | { | 9 | { |
| 7 | public IBootstrapperApplication Create(IBootstrapperEngine pEngine, ref Command command) | 10 | public void Create(IntPtr pArgs, IntPtr pResults) |
| 8 | { | 11 | { |
| 9 | IEngine engine = new Engine(pEngine); | 12 | InitializeFromCreateArgs(pArgs, out var engine, out var bootstrapperCommand); |
| 10 | IBootstrapperCommand bootstrapperCommand = command.GetBootstrapperCommand(); | 13 | |
| 11 | return this.Create(engine, bootstrapperCommand); | 14 | var ba = this.Create(engine, bootstrapperCommand); |
| 15 | StoreBAInCreateResults(pResults, ba); | ||
| 12 | } | 16 | } |
| 13 | 17 | ||
| 14 | protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand); | 18 | protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand); |
| 19 | |||
| 20 | public static void InitializeFromCreateArgs(IntPtr pArgs, out IEngine engine, out IBootstrapperCommand bootstrapperCommand) | ||
| 21 | { | ||
| 22 | Command pCommand = new Command | ||
| 23 | { | ||
| 24 | cbSize = Marshal.SizeOf(typeof(Command)) | ||
| 25 | }; | ||
| 26 | var pEngine = BalUtil.InitializeFromCreateArgs(pArgs, ref pCommand); | ||
| 27 | engine = new Engine(pEngine); | ||
| 28 | bootstrapperCommand = pCommand.GetBootstrapperCommand(); | ||
| 29 | } | ||
| 30 | |||
| 31 | public static void StoreBAInCreateResults(IntPtr pResults, IBootstrapperApplication ba) | ||
| 32 | { | ||
| 33 | BalUtil.StoreBAInCreateResults(pResults, ba); | ||
| 34 | } | ||
| 15 | } | 35 | } |
| 16 | } | 36 | } |
