From a95bd91ba048be1399e841c7a4a56bdddb0a26b4 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 1 Aug 2026 21:19:03 -0700 Subject: [PATCH] Fix incorrect documentation for `EFI_RNG_GET_RNG` `EFI_RNG_GET_RNG` is incorrectly described as returning an allocated buffer that the caller must free. It fills in a user-provided buffer. Update the documentation and error codes, based on . --- .../bringup/efi-rng-protocol-getrng.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/windows-driver-docs-pr/bringup/efi-rng-protocol-getrng.md b/windows-driver-docs-pr/bringup/efi-rng-protocol-getrng.md index ecc3a57b6a..99b08c45f6 100644 --- a/windows-driver-docs-pr/bringup/efi-rng-protocol-getrng.md +++ b/windows-driver-docs-pr/bringup/efi-rng-protocol-getrng.md @@ -29,14 +29,10 @@ typedef EFI_STATUS (EFIAPI *EFI_RNG_GET_RNG) ( [in] A pointer to the EFI_RNG_ALGORITHM which identifies the RNG algorithm to use. If this parameter is NULL, the default algorithm supported by the driver will be used. *RNGValueLength* -[in] The length, in bytes, of the buffer returned by *RNGValue*. +[in] The length, in bytes, of the buffer pointed to by *RNGValue*. The driver shall return exactly this many bytes. *RNGValue* -[in] Pointer to a buffer that will contain the RNG value. The value is allocated by this function using EFI_BOOT_SERVICES->AllocatePool(), and it is the caller's responsibility to free this memory by using EFI_BOOT_SERVICES->FreePool(). - -## Remarks - -The minimum size of *RNGValue* is 32 bytes. +[out] Pointer to a buffer to fill with random bytes. ## Return value @@ -45,11 +41,10 @@ Returns one of the following status codes. | Status code | Description | |--|--| | EFI_SUCCESS | The function successfully returned an RNG value. | -| EFI_INVALID_PARAMETER | *RNGAlgorithm* is NULL when several algorithms are possible. | | EFI_UNSUPPORTED | The algorithm specified by *RNGAlgorithm* is not supported by this driver. | | EFI_DEVICE_ERROR | An RNG value could not be retrieved because of a hardware or firmware error. | | EFI_NOT_READY | There is not enough entropy data available. | -| EFI_OUT_OF_RESOURCES | The driver is unable to allocate memory for the RNG value. | +| EFI_INVALID_PARAMETER | *RNGValue* is null or *RNGValueLength* is zero. | ## Requirements