// d3dkmthk.h
PFND3DKMT_ENUMADAPTERS2 Pfnd3dkmtEnumadapters2;
NTSTATUS Pfnd3dkmtEnumadapters2(
const D3DKMT_ENUMADAPTERS2 *unnamedParam1
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The PFND3DKMT_ENUMADAPTERS2 callback function enumerates all graphics and display adapters on the system.
unnamedParam1_Inout_ D3DKMT_ENUMADAPTERS2 * Arg1
Caller passes in array size and empty array space. Callee verifies enough room in the array, fills out array, and passes back how much of the array was used.
This function returns NTSTATUS.
| Return Code | Description |
|---|---|
| STATUS_BUFFER_TOO_SMALL | When the provided array is too small to receive all the adapters. |
| STATUS_INVALID_PARAMETER | When pEnumAdapters is null or is otherwise an invalid memory region. |
| STATUS_NO_MEMORY | When memory cannot be allocated to satisfy the operation. |
//Declaration
PFND3DKMT_ENUMADAPTERS2 Pfnd3dkmtEnumadapters2;
// Definition
NTSTATUS Pfnd3dkmtEnumadapters2
(
const D3DKMT_ENUMADAPTERS2 *
)
{...}
When D3DKMT_ENUMADAPTERS2\::pAdapters is null, D3DKMT_ENUMADAPTERS2\::NumAdapters is set to the maximum supported adapter count. Callees will commonly invoke the method, first, to retrieve the maximum supported adapter count.
When the callee successfully enumerates adapters, it becomes responsible for explicitly managing the lifespan of adapter D3DKMT_HANDLEs. These handles are returned to the callee through pEnumAdapters, and must be closed with D3DKMTCloseAdapter.