aboutsummaryrefslogtreecommitdiff
path: root/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp')
-rw-r--r--src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
index a2b8e041..29a5d7d5 100644
--- a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
+++ b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
@@ -44,6 +44,16 @@ static void CALLBACK BafThmUtilTestingTraceError(
44class CBafThmUtilTesting : public CBalBaseBAFunctions 44class CBafThmUtilTesting : public CBalBaseBAFunctions
45{ 45{
46public: // IBAFunctions 46public: // IBAFunctions
47 virtual STDMETHODIMP OnCreate(
48 __in IBootstrapperEngine* pEngine,
49 __in BOOTSTRAPPER_COMMAND* pCommand
50 )
51 {
52 m_commandDisplay = pCommand->display;
53
54 return __super::OnCreate(pEngine, pCommand);
55 }
56
47 virtual STDMETHODIMP OnThemeControlLoading( 57 virtual STDMETHODIMP OnThemeControlLoading(
48 __in LPCWSTR wzName, 58 __in LPCWSTR wzName,
49 __inout BOOL* pfProcessed, 59 __inout BOOL* pfProcessed,
@@ -95,7 +105,7 @@ public: //IBootstrapperApplication
95 __inout BOOL* pfCancel 105 __inout BOOL* pfCancel
96 ) 106 )
97 { 107 {
98 if (BOOTSTRAPPER_DISPLAY_FULL <= m_command.display) 108 if (BOOTSTRAPPER_DISPLAY_FULL <= m_commandDisplay)
99 { 109 {
100 if (IDCANCEL == ::MessageBoxW(m_hwndParent, L"Shutdown requests should be denied right now.", L"OnExecuteBegin", MB_OKCANCEL)) 110 if (IDCANCEL == ::MessageBoxW(m_hwndParent, L"Shutdown requests should be denied right now.", L"OnExecuteBegin", MB_OKCANCEL))
101 { 111 {
@@ -184,7 +194,7 @@ private:
184 } 194 }
185 195
186 hr = ThemeCreateParentWindow(m_pBafTheme, 0, wc.lpszClassName, m_pBafTheme->sczCaption, m_pBafTheme->dwStyle, x, y, m_hwndParent, m_hModule, this, THEME_WINDOW_INITIAL_POSITION_CENTER_MONITOR_FROM_COORDINATES, &m_hWndBaf); 196 hr = ThemeCreateParentWindow(m_pBafTheme, 0, wc.lpszClassName, m_pBafTheme->sczCaption, m_pBafTheme->dwStyle, x, y, m_hwndParent, m_hModule, this, THEME_WINDOW_INITIAL_POSITION_CENTER_MONITOR_FROM_COORDINATES, &m_hWndBaf);
187 ExitOnFailure(hr, "Failed to create window."); 197 ExitOnFailure(hr, "Failed to create baf testing window.");
188 198
189 hr = S_OK; 199 hr = S_OK;
190 200
@@ -330,7 +340,7 @@ private:
330 { 340 {
331 HRESULT hr = S_OK; 341 HRESULT hr = S_OK;
332 BOOL fProcessed = FALSE; 342 BOOL fProcessed = FALSE;
333 343
334 for (DWORD iAssignControl = 0; iAssignControl < countof(vrgInitControls); ++iAssignControl) 344 for (DWORD iAssignControl = 0; iAssignControl < countof(vrgInitControls); ++iAssignControl)
335 { 345 {
336 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pArgs->pThemeControl->sczName, -1, vrgInitControls[iAssignControl].wzName, -1)) 346 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pArgs->pThemeControl->sczName, -1, vrgInitControls[iAssignControl].wzName, -1))
@@ -371,7 +381,7 @@ private:
371 } 381 }
372 382
373 break; 383 break;
374 384
375 case BAFTHMUTILTESTING_CONTROL_PROGRESSBAR_STANDARD: 385 case BAFTHMUTILTESTING_CONTROL_PROGRESSBAR_STANDARD:
376 fProcessed = TRUE; 386 fProcessed = TRUE;
377 387
@@ -410,11 +420,10 @@ public:
410 // Constructor - initialize member variables. 420 // Constructor - initialize member variables.
411 // 421 //
412 CBafThmUtilTesting( 422 CBafThmUtilTesting(
413 __in HMODULE hModule, 423 __in HMODULE hModule
414 __in IBootstrapperEngine* pEngine, 424 ) : CBalBaseBAFunctions(hModule)
415 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs
416 ) : CBalBaseBAFunctions(hModule, pEngine, pArgs)
417 { 425 {
426 m_commandDisplay = BOOTSTRAPPER_DISPLAY_UNKNOWN;
418 m_pBafTheme = NULL; 427 m_pBafTheme = NULL;
419 m_fRegistered = FALSE; 428 m_fRegistered = FALSE;
420 m_hWndBaf = NULL; 429 m_hWndBaf = NULL;
@@ -434,12 +443,12 @@ public:
434 } 443 }
435 444
436private: 445private:
446 BOOTSTRAPPER_DISPLAY m_commandDisplay;
437 THEME* m_pBafTheme; 447 THEME* m_pBafTheme;
438 BOOL m_fRegistered; 448 BOOL m_fRegistered;
439 HWND m_hWndBaf; 449 HWND m_hWndBaf;
440}; 450};
441 451
442
443HRESULT WINAPI CreateBAFunctions( 452HRESULT WINAPI CreateBAFunctions(
444 __in HMODULE hModule, 453 __in HMODULE hModule,
445 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs, 454 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs,
@@ -448,16 +457,20 @@ HRESULT WINAPI CreateBAFunctions(
448{ 457{
449 HRESULT hr = S_OK; 458 HRESULT hr = S_OK;
450 CBafThmUtilTesting* pBAFunctions = NULL; 459 CBafThmUtilTesting* pBAFunctions = NULL;
451 IBootstrapperEngine* pEngine = NULL;
452 460
453 DutilInitialize(&BafThmUtilTestingTraceError); 461 DutilInitialize(&BafThmUtilTestingTraceError);
454 462
463#if TODO_REWRITE
455 hr = BalInitializeFromCreateArgs(pArgs->pBootstrapperCreateArgs, &pEngine); 464 hr = BalInitializeFromCreateArgs(pArgs->pBootstrapperCreateArgs, &pEngine);
456 ExitOnFailure(hr, "Failed to initialize Bal."); 465 ExitOnFailure(hr, "Failed to initialize Bal.");
466#endif
457 467
458 pBAFunctions = new CBafThmUtilTesting(hModule, pEngine, pArgs); 468 pBAFunctions = new CBafThmUtilTesting(hModule);
459 ExitOnNull(pBAFunctions, hr, E_OUTOFMEMORY, "Failed to create new CBafThmUtilTesting object."); 469 ExitOnNull(pBAFunctions, hr, E_OUTOFMEMORY, "Failed to create new CBafThmUtilTesting object.");
460 470
471 hr = pBAFunctions->OnCreate(pArgs->pEngine, pArgs->pCommand);
472 ExitOnFailure(hr, "Failed to call OnCreate CPrereqBaf.");
473
461 pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc; 474 pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc;
462 pResults->pvBAFunctionsProcContext = pBAFunctions; 475 pResults->pvBAFunctionsProcContext = pBAFunctions;
463 pBAFunctions = NULL; 476 pBAFunctions = NULL;
@@ -466,7 +479,6 @@ HRESULT WINAPI CreateBAFunctions(
466 479
467LExit: 480LExit:
468 ReleaseObject(pBAFunctions); 481 ReleaseObject(pBAFunctions);
469 ReleaseObject(pEngine);
470 482
471 return hr; 483 return hr;
472} 484}