of the raw block devices media. Currently "El Torito CD-ROM", UDF, Legacy\r
MBR, and GPT partition schemes are supported.\r
\r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
EFI_STATUS Status;\r
+ UINT8 Buffer[1];\r
\r
//\r
- // Read 1 byte from offset 0 but passing NULL as buffer pointer\r
+ // Read 1 byte from offset 0 to check if the MediaId is still valid.\r
+ // The reading operation is synchronious thus it is not worth it to\r
+ // allocate a buffer from the pool. The destination buffer for the\r
+ // data is in the stack.\r
//\r
- Status = DiskIo2->ReadDiskEx (DiskIo2, MediaId, 0, NULL, 1, NULL);\r
+ Status = DiskIo2->ReadDiskEx (DiskIo2, MediaId, 0, NULL, 1, (VOID*)Buffer);\r
if ((Status == EFI_NO_MEDIA) || (Status == EFI_MEDIA_CHANGED)) {\r
return Status;\r
}\r