1.fixed one bug to 'reconnect -r' when running 4 times.

2.Code scrub.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7269 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2009-01-14 07:47:48 +00:00
parent ad951a3714
commit f890b1e053
3 changed files with 61 additions and 51 deletions

View File

@ -2686,9 +2686,13 @@ ConSplitterAddGraphicsOutputMode (
// //
// This is the first Graphics Output device added // This is the first Graphics Output device added
// //
CopyMem (CurrentGraphicsOutputMode, GraphicsOutput->Mode, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE)); CurrentGraphicsOutputMode->MaxMode = GraphicsOutput->Mode->MaxMode;
CurrentGraphicsOutputMode->Mode = GraphicsOutput->Mode->Mode;
CopyMem (CurrentGraphicsOutputMode->Info, GraphicsOutput->Mode->Info, GraphicsOutput->Mode->SizeOfInfo); CopyMem (CurrentGraphicsOutputMode->Info, GraphicsOutput->Mode->Info, GraphicsOutput->Mode->SizeOfInfo);
CurrentGraphicsOutputMode->SizeOfInfo = GraphicsOutput->Mode->SizeOfInfo;
CurrentGraphicsOutputMode->FrameBufferBase = GraphicsOutput->Mode->FrameBufferBase;
CurrentGraphicsOutputMode->FrameBufferSize = GraphicsOutput->Mode->FrameBufferSize;
// //
// Allocate resource for the private mode buffer // Allocate resource for the private mode buffer
// //
@ -3389,10 +3393,12 @@ ConSpliterConssoleControlStdInLocked (
/** /**
This timer event will fire when StdIn is locked. It will check the key Record and check key sequence on StdIn.
sequence on StdIn to see if it matches the password. Any error in the
password will cause the check to reset. As long a mConIn.PasswordEnabled is This timer event will fire when StdIn is locked. It will record the key sequence
TRUE the StdIn splitter will not report any input. on StdIn and also check to see if it matches the password. Any error in the
password will cause the check to reset. As long as a mConIn.PasswordEnabled is
TRUE, the StdIn splitter will not report any input.
@param Event The Event this notify function registered to. @param Event The Event this notify function registered to.
@param Context Pointer to the context data registerd to the @param Context Pointer to the context data registerd to the
@ -3414,9 +3420,12 @@ ConSpliterConsoleControlLockStdInEvent (
Status = ConSplitterTextInPrivateReadKeyStroke (&mConIn, &Key); Status = ConSplitterTextInPrivateReadKeyStroke (&mConIn, &Key);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
// //
// if it's an ENTER, match password // If key read successfully
// //
if ((Key.UnicodeChar == CHAR_CARRIAGE_RETURN) && (Key.ScanCode == SCAN_NULL)) { if ((Key.UnicodeChar == CHAR_CARRIAGE_RETURN) && (Key.ScanCode == SCAN_NULL)) {
//
// If it's an ENTER, match password
//
mConIn.PwdAttempt[mConIn.PwdIndex] = CHAR_NULL; mConIn.PwdAttempt[mConIn.PwdIndex] = CHAR_NULL;
if (StrCmp (mConIn.Password, mConIn.PwdAttempt) != 0) { if (StrCmp (mConIn.Password, mConIn.PwdAttempt) != 0) {
// //
@ -3451,7 +3460,8 @@ ConSpliterConsoleControlLockStdInEvent (
} }
} else if ((Key.ScanCode == SCAN_NULL) && (Key.UnicodeChar >= 32)) { } else if ((Key.ScanCode == SCAN_NULL) && (Key.UnicodeChar >= 32)) {
// //
// If it's not an ENTER, neigher a function key, nor a CTRL-X or ALT-X, record the input // If it's not an ENTER, neigher a function key, nor a CTRL-X or ALT-X, record the input,
// value 32 stands for a Blank Space key.
// //
if (mConIn.PwdIndex < (MAX_STD_IN_PASSWORD - 1)) { if (mConIn.PwdIndex < (MAX_STD_IN_PASSWORD - 1)) {
if (mConIn.PwdIndex == 0) { if (mConIn.PwdIndex == 0) {
@ -3504,7 +3514,7 @@ ConSpliterConsoleControlLockStdIn (
mConIn.PasswordEnabled = TRUE; mConIn.PasswordEnabled = TRUE;
mConIn.PwdIndex = 0; mConIn.PwdIndex = 0;
// //
// Timer Periodic is 25ms. // Lock Timer Periodic is 25ms.
// //
gBS->SetTimer (mConIn.LockEvent, TimerPeriodic, 10000 * 25); gBS->SetTimer (mConIn.LockEvent, TimerPeriodic, 10000 * 25);
@ -3550,7 +3560,8 @@ ConSplitterTextInReadKeyStroke (
/** /**
This event agregates all the events of the ConIn devices in the spliter. This event aggregates all the events of the ConIn devices in the spliter.
If the ConIn is password locked then return. If the ConIn is password locked then return.
If any events of physical ConIn devices are signaled, signal the ConIn If any events of physical ConIn devices are signaled, signal the ConIn
spliter event. This will cause the calling code to call spliter event. This will cause the calling code to call
@ -3572,6 +3583,7 @@ ConSplitterTextInWaitForKey (
UINTN Index; UINTN Index;
Private = (TEXT_IN_SPLITTER_PRIVATE_DATA *) Context; Private = (TEXT_IN_SPLITTER_PRIVATE_DATA *) Context;
if (Private->PasswordEnabled) { if (Private->PasswordEnabled) {
// //
// If StdIn Locked return not ready // If StdIn Locked return not ready
@ -3579,15 +3591,16 @@ ConSplitterTextInWaitForKey (
return ; return ;
} }
//
// if KeyEventSignalState is flagged before, and not cleared by Reset() or ReadKeyStroke()
//
if (Private->KeyEventSignalState) { if (Private->KeyEventSignalState) {
//
// If KeyEventSignalState is flagged before, and not cleared by Reset() or ReadKeyStroke()
//
gBS->SignalEvent (Event); gBS->SignalEvent (Event);
return ; return ;
} }
// //
// if any physical console input device has key input, signal the event. // If any physical console input device has key input, signal the event.
// //
for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) { for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
Status = gBS->CheckEvent (Private->TextInList[Index]->WaitForKey); Status = gBS->CheckEvent (Private->TextInList[Index]->WaitForKey);
@ -3822,7 +3835,7 @@ ConSplitterTextInSetState (
successfully. successfully.
@retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data @retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data
structures. structures.
@retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL. @retval EFI_INVALID_PARAMETER KeyData or KeyNotificationFunction or NotifyHandle is NULL.
**/ **/
EFI_STATUS EFI_STATUS
@ -3849,7 +3862,7 @@ ConSplitterTextInRegisterKeyNotify (
Private = TEXT_IN_EX_SPLITTER_PRIVATE_DATA_FROM_THIS (This); Private = TEXT_IN_EX_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
// //
// if no physical console input device exists, // If no physical console input device exists,
// return EFI_SUCCESS directly. // return EFI_SUCCESS directly.
// //
if (Private->CurrentNumberOfExConsoles <= 0) { if (Private->CurrentNumberOfExConsoles <= 0) {

View File

@ -1425,7 +1425,7 @@ ConSplitterTextInSetState (
successfully. successfully.
@retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data @retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data
structures. structures.
@retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL. @retval EFI_INVALID_PARAMETER KeyData or KeyNotificationFunction or NotifyHandle is NULL.
**/ **/
EFI_STATUS EFI_STATUS
@ -1459,7 +1459,8 @@ ConSplitterTextInUnregisterKeyNotify (
); );
/** /**
This event agregates all the events of the ConIn devices in the spliter. This event aggregates all the events of the ConIn devices in the spliter.
If the ConIn is password locked then return. If the ConIn is password locked then return.
If any events of physical ConIn devices are signaled, signal the ConIn If any events of physical ConIn devices are signaled, signal the ConIn
spliter event. This will cause the calling code to call spliter event. This will cause the calling code to call
@ -1490,10 +1491,12 @@ ConSpliterConssoleControlStdInLocked (
); );
/** /**
This timer event will fire when StdIn is locked. It will check the key Record and check key sequence on StdIn.
sequence on StdIn to see if it matches the password. Any error in the
password will cause the check to reset. As long a mConIn.PasswordEnabled is This timer event will fire when StdIn is locked. It will record the key sequence
TRUE the StdIn splitter will not report any input. on StdIn and also check to see if it matches the password. Any error in the
password will cause the check to reset. As long as a mConIn.PasswordEnabled is
TRUE, the StdIn splitter will not report any input.
@param Event The Event this notify function registered to. @param Event The Event this notify function registered to.
@param Context Pointer to the context data registerd to the @param Context Pointer to the context data registerd to the
@ -2197,20 +2200,17 @@ DevNullTextOutClearScreen (
); );
/** /**
Sets the current coordinates of the cursor position. Sets the current coordinates of the cursor position on NULL device.
@param Private Text Out Splitter pointer. @param Private Text Out Splitter pointer.
@param Column @param Column The column position to set the cursor to. Must be
@param Row the position to set the cursor to. Must be greater than or equal to zero and less than the
greater than or equal to zero and less than the number of columns by QueryMode ().
number of columns and rows by QueryMode (). @param Row The row position to set the cursor to. Must be
greater than or equal to zero and less than the
number of rows by QueryMode ().
@retval EFI_SUCCESS The operation completed successfully. @retval EFI_SUCCESS Always returned.
@retval EFI_DEVICE_ERROR The device had an error and could not complete
the request.
@retval EFI_UNSUPPORTED The output device is not in a valid text mode, or
the cursor position is invalid for the current
mode.
**/ **/
EFI_STATUS EFI_STATUS
@ -2221,13 +2221,13 @@ DevNullTextOutSetCursorPosition (
); );
/** /**
Set cursor visibility property. Set cursor visibility property on NULL device.
@param Private Text Out Splitter pointer. @param Private Text Out Splitter pointer.
@param Visible If TRUE, the cursor is set to be visible, If @param Visible If TRUE, the cursor is set to be visible, If
FALSE, the cursor is set to be invisible. FALSE, the cursor is set to be invisible.
@retval EFI_SUCCESS Returns always. @retval EFI_SUCCESS Always returned.
**/ **/
EFI_STATUS EFI_STATUS

View File

@ -1471,7 +1471,7 @@ DevNullTextOutSetMode (
Row = Mode->Rows; Row = Mode->Rows;
Column = Mode->Columns; Column = Mode->Columns;
if (Row <= 0 && Column <= 0) { if (Row == 0 || Column == 0) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -1558,20 +1558,17 @@ DevNullTextOutClearScreen (
/** /**
Sets the current coordinates of the cursor position. Sets the current coordinates of the cursor position on NULL device.
@param Private Text Out Splitter pointer. @param Private Text Out Splitter pointer.
@param Column @param Column The column position to set the cursor to. Must be
@param Row the position to set the cursor to. Must be greater than or equal to zero and less than the
greater than or equal to zero and less than the number of columns by QueryMode ().
number of columns and rows by QueryMode (). @param Row The row position to set the cursor to. Must be
greater than or equal to zero and less than the
number of rows by QueryMode ().
@retval EFI_SUCCESS The operation completed successfully. @retval EFI_SUCCESS Always returned.
@retval EFI_DEVICE_ERROR The device had an error and could not complete
the request.
@retval EFI_UNSUPPORTED The output device is not in a valid text mode, or
the cursor position is invalid for the current
mode.
**/ **/
EFI_STATUS EFI_STATUS
@ -1594,13 +1591,13 @@ DevNullTextOutSetCursorPosition (
/** /**
Set cursor visibility property. Set cursor visibility property on NULL device.
@param Private Text Out Splitter pointer. @param Private Text Out Splitter pointer.
@param Visible If TRUE, the cursor is set to be visible, If @param Visible If TRUE, the cursor is set to be visible, If
FALSE, the cursor is set to be invisible. FALSE, the cursor is set to be invisible.
@retval EFI_SUCCESS Returns always. @retval EFI_SUCCESS Always returned.
**/ **/
EFI_STATUS EFI_STATUS