Share via


IOCTL_HAL_GET_RANDOM_SEED (Compact 2013)

10/16/2014

This I/O control message obtains random bytes from a hardware source. Send this message with OEMIoControl.

Syntax

BOOL OEMIoControl(
    DWORD dwIoControlCode,    // use IOCTL_HAL_GET_RANDOM_SEED
    LPVOID lpInBuffer,        // pointer to input buffer
    DWORD nInBufferSize,      // input buffer size
    LPVOID lpOutBuffer,       // pointer to output buffer
    DWORD nOutBufferSize,     // output buffer size
    LPDWORD lpBytesReturned   // number of bytes returned
);

Parameters

  • dwIoControlCode
    [in] Control code for the operation. Use IOCTL_HAL_GET_RANDOM_SEED for this operation.
  • lpInBuffer
    [in] Set to NULL.
  • nInBufferSize
    [in] Set to zero.
  • lpOutBuffer
    [in] Set to the address of an allocated output buffer for storing the random bytes.
  • nOutBufferSize
    [in] Set to the size of the output buffer. This value must be less than or equal to 1024.
  • lpBytesReturned
    [in] DWORD pointer to receive the size of data returned (up to 24 bytes) in lpOutBuffer.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

To get extended error information, call GetLastError. GetLastError may return other standard error messages as appropriate.

This request is used by the random number generator to query the platform hardware for additional sources of random data, such as a high-frequency counter or real-time clock. If the system has provided support for this I/O control, TRUE is returned for a successful operation. The number of bytes of random data returned can be less than nOutBufferSize, in which case the remaining bytes will be zeroed. If no suitable random source is present on the platform or the request fails, FALSE is returned.

Requirements

Header

pkfuncs.h

See Also

Reference

Other OAL IOCTLs
Security IOCTLs