Specifications

Example Code
157
// Register for the Your event. This defines the hardware path
// and bits associated with the hardware SMM. These are defined
// by the Framework.
//
YourContext.Type = Framework assigned type;
YourContext.Device = (EFI_DEVICE_PATH_PROTOCOL*)&Framework assigned
path;
Status = mYourFile->Register( mYourFile, YourCallback, &YourContext,
&YourHandle );
if (EFI_ERROR(Status)) {
DEBUG(( EFI_D_ERROR, "Couldn't register for callback: %r\n",
Status));
return Status;
}
DEBUG(( EFI_D_ERROR, "Your file device path address: 0x%x\n",
&YourPATH
));
}
return EFI_SUCCESS;
}
////////////////////////////////////////////
// Callback functions
VOID
YourCallback (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext
)
{
DEBUG(( EFI_D_ERROR, " Your SMI captured T%d D%x\n",
DispatchContext->Type,
DispatchContext->Device
));
Your code here}
////////////////////////////////////////////