2 Load the deferred images after user is identified.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "UserIdentifyManager.h"
17 EFI_HANDLE mDeferredImageHandle
;
20 The function will load all the deferred images again. If the deferred image is loaded
21 successfully, try to start it.
23 @param Event Event whose notification function is being invoked.
24 @param Context Pointer to the notification function's context
35 EFI_DEFERRED_IMAGE_LOAD_PROTOCOL
*DeferredImage
;
37 EFI_HANDLE
*HandleBuf
;
40 EFI_DEVICE_PATH_PROTOCOL
*ImageDevicePath
;
44 EFI_HANDLE ImageHandle
;
49 // Find all the deferred image load protocols.
53 Status
= gBS
->LocateHandleBuffer (
55 &gEfiDeferredImageLoadProtocolGuid
,
60 if (EFI_ERROR (Status
)) {
64 for (Index
= 0; Index
< HandleCount
; Index
++) {
65 Status
= gBS
->HandleProtocol (
67 &gEfiDeferredImageLoadProtocolGuid
,
68 (VOID
**) &DeferredImage
70 if (EFI_ERROR (Status
)) {
77 // Load all the deferred images in this protocol instance.
79 Status
= DeferredImage
->GetImageInfo(
83 (VOID
**) &DriverImage
,
87 if (EFI_ERROR (Status
)) {
92 // Load and start the image.
94 Status
= gBS
->LoadImage (
102 if (!EFI_ERROR (Status
)) {
104 // Before calling the image, enable the Watchdog Timer for
107 gBS
->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL
);
108 Status
= gBS
->StartImage (ImageHandle
, &ExitDataSize
, &ExitData
);
111 // Clear the Watchdog Timer after the image returns.
113 gBS
->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL
);
118 FreePool (HandleBuf
);
123 Register an event notification function for user profile changed.
125 @param[in] ImageHandle Image handle this driver.
129 LoadDeferredImageInit (
130 IN EFI_HANDLE ImageHandle
136 mDeferredImageHandle
= ImageHandle
;
138 Status
= gBS
->CreateEventEx (
143 &gEfiEventUserProfileChangedGuid
,
147 ASSERT (Status
== EFI_SUCCESS
);