diff options
Diffstat (limited to 'src/burn/engine/ba.h')
-rw-r--r-- | src/burn/engine/ba.h | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/src/burn/engine/ba.h b/src/burn/engine/ba.h new file mode 100644 index 00000000..c092fedf --- /dev/null +++ b/src/burn/engine/ba.h | |||
@@ -0,0 +1,160 @@ | |||
1 | #pragma once | ||
2 | // 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. | ||
3 | |||
4 | #define BAAPI HRESULT __stdcall | ||
5 | |||
6 | #if defined(__cplusplus) | ||
7 | extern "C" { | ||
8 | #endif | ||
9 | |||
10 | |||
11 | // constants | ||
12 | |||
13 | const DWORD BURN_MB_RETRYTRYAGAIN = 0x10; | ||
14 | const DWORD64 BOOTSTRAPPER_APPLICATION_API_VERSION = MAKEQWORDVERSION(2024, 1, 1, 0); | ||
15 | |||
16 | |||
17 | // structs | ||
18 | |||
19 | typedef struct _BURN_USER_EXPERIENCE | ||
20 | { | ||
21 | BURN_PAYLOADS payloads; | ||
22 | |||
23 | BURN_PAYLOAD* pPrimaryExePayload; | ||
24 | BURN_PAYLOAD* pSecondaryExePayload; | ||
25 | |||
26 | //HMODULE hUXModule; | ||
27 | //PFN_BOOTSTRAPPER_APPLICATION_PROC pfnBAProc; | ||
28 | //LPVOID pvBAProcContext; | ||
29 | HANDLE hBAProcess; | ||
30 | PIPE_RPC_HANDLE hBARpcPipe; | ||
31 | BAENGINE_CONTEXT* pEngineContext; | ||
32 | |||
33 | LPWSTR sczTempDirectory; | ||
34 | |||
35 | CRITICAL_SECTION csEngineActive; // Changing the engine active state in the user experience must be | ||
36 | // syncronized through this critical section. | ||
37 | // Note: The engine must never do a UX callback while in this critical section. | ||
38 | |||
39 | BOOL fEngineActive; // Indicates that the engine is currently active with one of the execution | ||
40 | // steps (detect, plan, apply), and cannot accept requests from the UX. | ||
41 | // This flag should be cleared by the engine prior to UX callbacks that | ||
42 | // allow altering of the engine state. | ||
43 | |||
44 | HRESULT hrApplyError; // Tracks if an error occurs during apply that requires the cache or | ||
45 | // execute threads to bail. | ||
46 | |||
47 | HWND hwndApply; // The window handle provided at the beginning of Apply(). Only valid | ||
48 | // during apply. | ||
49 | |||
50 | HWND hwndDetect; // The window handle provided at the beginning of Detect(). Only valid | ||
51 | // during Detect. | ||
52 | |||
53 | DWORD dwExitCode; // Exit code returned by the user experience for the engine overall. | ||
54 | } BURN_USER_EXPERIENCE; | ||
55 | |||
56 | |||
57 | // functions | ||
58 | |||
59 | /******************************************************************* | ||
60 | BootstrapperApplicationParseFromXml - parses the bootstrapper application | ||
61 | data embedded in the bundle. | ||
62 | |||
63 | *******************************************************************/ | ||
64 | HRESULT BootstrapperApplicationParseFromXml( | ||
65 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
66 | __in IXMLDOMNode* pixnBundle | ||
67 | ); | ||
68 | |||
69 | /******************************************************************* | ||
70 | BootstrapperApplicationUninitialize - uninitializes the bootstrapper | ||
71 | application data. | ||
72 | |||
73 | *******************************************************************/ | ||
74 | void BootstrapperApplicationUninitialize( | ||
75 | __in BURN_USER_EXPERIENCE* pUserExperience | ||
76 | ); | ||
77 | |||
78 | /******************************************************************* | ||
79 | BootstrapperApplicationStart - starts the bootstrapper application | ||
80 | process and creates the bootstrapper application in it. | ||
81 | |||
82 | *******************************************************************/ | ||
83 | HRESULT BootstrapperApplicationStart( | ||
84 | __in BURN_ENGINE_STATE* pEngineState, | ||
85 | __in BOOL fSecondary | ||
86 | ); | ||
87 | |||
88 | /******************************************************************* | ||
89 | BootstrapperApplicationStop - destroys the bootstrapper application | ||
90 | in the bootstrapper application process, disconnects and waits | ||
91 | for the process to exit. | ||
92 | |||
93 | *******************************************************************/ | ||
94 | HRESULT BootstrapperApplicationStop( | ||
95 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
96 | __inout BOOL* pfReload | ||
97 | ); | ||
98 | |||
99 | int BootstrapperApplicationCheckExecuteResult( | ||
100 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
101 | __in BOOL fRollback, | ||
102 | __in DWORD dwAllowedResults, | ||
103 | __in int nResult | ||
104 | ); | ||
105 | |||
106 | HRESULT BootstrapperApplicationInterpretExecuteResult( | ||
107 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
108 | __in BOOL fRollback, | ||
109 | __in DWORD dwAllowedResults, | ||
110 | __in int nResult | ||
111 | ); | ||
112 | |||
113 | HRESULT BootstrapperApplicationEnsureWorkingFolder( | ||
114 | __in BURN_CACHE* pCache, | ||
115 | __deref_out_z LPWSTR* psczUserExperienceWorkingFolder | ||
116 | ); | ||
117 | |||
118 | HRESULT BootstrapperApplicationRemove( | ||
119 | __in BURN_USER_EXPERIENCE* pUserExperience | ||
120 | ); | ||
121 | |||
122 | int BootstrapperApplicationSendError( | ||
123 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
124 | __in BOOTSTRAPPER_ERROR_TYPE errorType, | ||
125 | __in_z_opt LPCWSTR wzPackageId, | ||
126 | __in HRESULT hrCode, | ||
127 | __in_z_opt LPCWSTR wzError, | ||
128 | __in DWORD uiFlags, | ||
129 | __in int nRecommendation | ||
130 | ); | ||
131 | |||
132 | void BootstrapperApplicationActivateEngine( | ||
133 | __in BURN_USER_EXPERIENCE* pUserExperience | ||
134 | ); | ||
135 | |||
136 | void BootstrapperApplicationDeactivateEngine( | ||
137 | __in BURN_USER_EXPERIENCE* pUserExperience | ||
138 | ); | ||
139 | |||
140 | /******************************************************************** | ||
141 | BootstrapperApplicationEnsureEngineInactive - Verifies the engine is inactive. | ||
142 | The caller MUST enter the csActive critical section before calling. | ||
143 | |||
144 | *********************************************************************/ | ||
145 | HRESULT BootstrapperApplicationEnsureEngineInactive( | ||
146 | __in BURN_USER_EXPERIENCE* pUserExperience | ||
147 | ); | ||
148 | |||
149 | void BootstrapperApplicationExecuteReset( | ||
150 | __in BURN_USER_EXPERIENCE* pUserExperience | ||
151 | ); | ||
152 | |||
153 | void BootstrapperApplicationExecutePhaseComplete( | ||
154 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
155 | __in HRESULT hrResult | ||
156 | ); | ||
157 | |||
158 | #if defined(__cplusplus) | ||
159 | } | ||
160 | #endif | ||