refine the code and add more security check.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9691 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2010-01-08 02:35:56 +00:00
parent 33338afebd
commit e285199897
18 changed files with 499 additions and 493 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Support routines for PxeBc.
Copyright (c) 2007 - 2009, Intel Corporation.<BR>
Copyright (c) 2007 - 2010, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
This function returns SMBIOS string given the string number.
@param Smbios Pointer to SMBIOS structure
@param StringNumber String number to return. 0 is used to skip all
strings and point to the next SMBIOS structure.
@@ -97,6 +97,7 @@ GetSmbiosSystemGuidAndSerialNumber (
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
ASSERT (SmbiosTable != NULL);
Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress;
SmbiosEnd.Raw = (UINT8 *) (UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength);
@@ -137,7 +138,7 @@ GetSmbiosSystemGuidAndSerialNumber (
/**
The common notify function associated with various PxeBc events.
The common notify function associated with various PxeBc events.
@param Event The event signaled.
@param Context The context.
@@ -156,13 +157,13 @@ PxeBcCommonNotify (
/**
This function initialize(or configure) the Udp4Write instance.
@param Udp4 Pointer to the EFI_UDP4_PROTOCOL instance.
@param StationIp Pointer to the station ip address.
@param SubnetMask Pointer to the subnetmask of the station ip address.
@param Gateway Pointer to the gateway ip address.
@param SrcPort Pointer to the srouce port of the station.
@retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@@ -177,7 +178,7 @@ PxeBcCommonNotify (
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance
was not opened.
@retval Others Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.
**/
EFI_STATUS
PxeBcConfigureUdpWriteInstance (