Bewerken

Delen via


RtlIoEncodeMemIoResource function (wdm.h)

The RtlIoEncodeMemIoResource routine updates an IO_RESOURCE_DESCRIPTOR structure to describe a range of memory or I/O port addresses.

Syntax

NTSYSAPI NTSTATUS RtlIoEncodeMemIoResource(
  [in] PIO_RESOURCE_DESCRIPTOR Descriptor,
  [in] UCHAR                   Type,
  [in] ULONGLONG               Length,
  [in] ULONGLONG               Alignment,
  [in] ULONGLONG               MinimumAddress,
  [in] ULONGLONG               MaximumAddress
);

Parameters

[in] Descriptor

A pointer to the IO_RESOURCE_DESCRIPTOR structure to update.

[in] Type

The resource type of the address range. This parameter can be CmResourceTypeMemory, CmResourceTypeMemoryLarge, or CmResourceTypePort.

[in] Length

The length, in bytes, of the range of assignable addresses.

[in] Alignment

The alignment, in bytes, of the starting address of address range.

[in] MinimumAddress

The minimum address that can be assigned to the device.

[in] MaximumAddress

The maximum address that can be assigned to the device.

Return value

RtlIoEncodeMemIoResource returns an NTSTATUS value. This routine might return one of the following values:

Return code Description
STATUS_SUCCESS
The IO_RESOURCE_DESCRIPTOR structure was updated.
STATUS_UNSUCCESSFUL
The specified value for Length or Alignment could not be encoded in an IO_RESOURCE_DESCRIPTOR structure.
STATUS_INVALID_PARAMETER
One or more of the specified parameters were invalid.

Remarks

Addresses that are larger than 32 bits in length must satisfy certain alignment restrictions, or else the routine returns STATUS_UNSUCCESSFUL.

Address length Alignment restriction
40 bits Lowest 8 bits must be zero.
48 bits Lowest 16 bits must be zero.
64 bits Lowest 32 bits must be zero.

Requirements

Requirement Value
Minimum supported client Available in Windows Vista and later versions of Windows.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level

See also

IO_RESOURCE_DESCRIPTOR

RtlIoDecodeMemIoResource