main
h 46 lines 1.68 KB
Raw
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
5 #include <windows.h>
6
7 #include <IBootstrapperExtensionEngine.h>
8 #include <IBootstrapperExtension.h>
9
10 static HRESULT BextBaseBEProcSearch(
11 __in IBootstrapperExtension* pBE,
12 __in BOOTSTRAPPER_EXTENSION_SEARCH_ARGS* pArgs,
13 __inout BOOTSTRAPPER_EXTENSION_SEARCH_RESULTS* /*pResults*/
14 )
15 {
16 return pBE->Search(pArgs->wzId, pArgs->wzVariable);
17 }
18
19 /*******************************************************************
20 BextBaseBootstrapperExtensionProc - requires pvContext to be of type IBootstrapperExtension.
21 Provides a default mapping between the message based
22 BootstrapperExtension interface and the COM-based BootstrapperExtension interface.
23
24 *******************************************************************/
25 static HRESULT WINAPI BextBaseBootstrapperExtensionProc(
26 __in BOOTSTRAPPER_EXTENSION_MESSAGE message,
27 __in const LPVOID pvArgs,
28 __inout LPVOID pvResults,
29 __in_opt LPVOID pvContext
30 )
31 {
32 IBootstrapperExtension* pBE = reinterpret_cast<IBootstrapperExtension*>(pvContext);
33 HRESULT hr = pBE->BootstrapperExtensionProc(message, pvArgs, pvResults, pvContext);
34
35 if (E_NOTIMPL == hr)
36 {
37 switch (message)
38 {
39 case BOOTSTRAPPER_EXTENSION_MESSAGE_SEARCH:
40 hr = BextBaseBEProcSearch(pBE, reinterpret_cast<BOOTSTRAPPER_EXTENSION_SEARCH_ARGS*>(pvArgs), reinterpret_cast<BOOTSTRAPPER_EXTENSION_SEARCH_RESULTS*>(pvResults));
41 break;
42 }
43 }
44
45 return hr;
46 }