/** @file\r
This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.\r
\r
- Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
(Filename == NULL) ||\r
(BufferSize == NULL) ||\r
(ServerIp == NULL) ||\r
- ((BufferPtr == NULL) && DontUseBuffer) ||\r
((BlockSize != NULL) && (*BlockSize < PXE_MTFTP_DEFAULT_BLOCK_SIZE))) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ if (Operation == EFI_PXE_BASE_CODE_TFTP_READ_FILE ||\r
+ Operation == EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY ||\r
+ Operation == EFI_PXE_BASE_CODE_MTFTP_READ_FILE ||\r
+ Operation == EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY) {\r
+ if (BufferPtr == NULL && !DontUseBuffer) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ }\r
+\r
Config = NULL;\r
Status = EFI_DEVICE_ERROR;\r
Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);\r
\r
if (NewSendGUID != NULL) {\r
if (*NewSendGUID && EFI_ERROR (NetLibGetSystemGuid (&SystemGuid))) {\r
+ DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios table!\n"));\r
return EFI_INVALID_PARAMETER;\r
}\r
Mode->SendGUID = *NewSendGUID;\r
EFI_STATUS Status;\r
EFI_STATUS MediaStatus;\r
\r
- if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {\r
+ if (This == NULL || BufferSize == NULL || FilePath == NULL || !IsDevicePathEnd (FilePath)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);\r
- Private = VirtualNic->Private;\r
- PxeBc = &Private->PxeBc;\r
- UsingIpv6 = FALSE;\r
- Status = EFI_DEVICE_ERROR;\r
-\r
- if (This == NULL || BufferSize == NULL) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
-\r
//\r
// Only support BootPolicy\r
//\r
if (!BootPolicy) {\r
return EFI_UNSUPPORTED;\r
}\r
+ \r
+ VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);\r
+ Private = VirtualNic->Private;\r
+ PxeBc = &Private->PxeBc;\r
+ UsingIpv6 = FALSE;\r
+ Status = EFI_DEVICE_ERROR;\r
\r
//\r
// Check media status before PXE start\r