[Defines]
INF_VERSION = 0x00010005
BASE_NAME = mst
FILE_GUID = fb925ac7-192b-9569-8580-7c6f5f710601
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = MSMain
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF
#
[Sources]
MSTest.c
[Packages]
AppPkg/AppPkg.dec
MdePkg/MdePkg.dec
[LibraryClasses]
UefiApplicationEntryPoint
UefiLib
BaseLib
错误提示为:
c:\buildbs\201903\AppPkg\Applications\MSTest\MSTest.c(20): error C2143: syntax error: missing '{' before '*'
c:\buildbs\201903\AppPkg\Applications\MSTest\MSTest.c(20): warning C4218: nonstandard extension used: must specify at least a storage class or a type
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Vc\bin\x86_amd64\cl.exe"' : return code '0x2'
Stop.
EFI_STATUS
GopPrivateReadKeyStrokeWorker (
IN GOP_PRIVATE_DATA *Private,
OUT EFI_KEY_DATA *KeyData
)
/*++
Routine Description:
Reads the next keystroke from the input device. The WaitForKey Event can
be used to test for existance of a keystroke via WaitForEvent () call.
Arguments:
Private - The private structure of WinNt Gop device.
KeyData - A pointer to a buffer that is filled in with the keystroke
state data for the key that was pressed.
Returns:
EFI_SUCCESS - The keystroke information was returned.
EFI_NOT_READY - There was no keystroke data availiable.
EFI_DEVICE_ERROR - The keystroke information was not returned due to
hardware errors.
EFI_INVALID_PARAMETER - KeyData is NULL.
--*/
{
EFI_STATUS Status;
EFI_TPL OldTpl;
if (KeyData == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Enter critical section
//
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
//
// Call hot key callback before telling caller there is a key available
//
WinNtGopSimpleTextInTimerHandler (NULL, Private);
ZeroMem (&KeyData->Key, sizeof (KeyData->Key));
InitializeKeyState (Private, &KeyData->KeyState);
Status = GopPrivateCheckQ (&Private->QueueForRead);
if (!EFI_ERROR (Status)) {
//
// If a Key press exists try and read it.
//
Status = GopPrivateDeleteQ (Private, &Private->QueueForRead, KeyData);
if (!EFI_ERROR (Status)) {
//
// If partial keystroke is not enabled, check whether it is value key. If not return
// EFI_NOT_READY.
//
if (!Private->IsPartialKeySupport) {
if (KeyData->Key.ScanCode == SCAN_NULL && KeyData->Key.UnicodeChar == CHAR_NULL) {
Status = EFI_NOT_READY;
}
}
}
}
//
// Leave critical section and return
//
gBS->RestoreTPL (OldTpl);
return Status;
}
case WM_CHAR:
//
// The ESC key also generate WM_CHAR.
//
if (wParam == 0x1B) {
return 0;
}
if (AltIsPress == TRUE) {
//
// If AltIsPress is true that means the Alt key is pressed.
//
Private->LeftAlt = TRUE;
}
for (Index = 0; Index < (lParam & 0xffff); Index++) {
if (wParam != 0) {
Key.UnicodeChar = (CHAR16) wParam;
Key.ScanCode = SCAN_NULL;
GopPrivateAddKey (Private, Key);
}
}
if (AltIsPress == TRUE) {
//
// When Alt is released there is no windoes message, so
// clean it after using it.
//
Private->LeftAlt = FALSE;
Private->RightAlt = FALSE;
}
DEBUG ((EFI_D_INFO, "Key [%X] [%X]\n",Key.ScanCode,Key.UnicodeChar)); //LABZ_DEBUG
return 0;
text
help = STRING_TOKEN(STR_NULL_STRING),
text = STRING_TOKEN(STR_PROCESSOR_MICROCODE_STRING),
text = STRING_TOKEN(STR_PROCESSOR_MICROCODE_VALUE),
flags = 0,
key = 0;
/**
Returns a 64-bit Machine Specific Register(MSR).
Reads and returns the 64-bit MSR specified by Index. No parameter checking is
performed on Index, and some Index values may cause CPU exceptions. The
caller must either guarantee that Index is valid, or the caller must set up
exception handlers to catch the exceptions. This function is only available
on IA-32 and x64.
@param Index The 32-bit MSR index to read.
@return The value of the MSR identified by Index.
**/
UINT64
EFIAPI
AsmReadMsr64 (
IN UINT32 Index
);