Hardware Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize

IoAllocateDriverObjectExtension routine

The IoAllocateDriverObjectExtension routine allocates a per-driver context area, called a driver object extension, and assigns a unique identifier to it.

Syntax


NTSTATUS IoAllocateDriverObjectExtension(
  _In_  PDRIVER_OBJECT DriverObject,
  _In_  PVOID          ClientIdentificationAddress,
  _In_  ULONG          DriverObjectExtensionSize,
  _Out_ PVOID          *DriverObjectExtension
);

Parameters

DriverObject [in]

Pointer to a driver object to which the context area will be associated.

ClientIdentificationAddress [in]

Specifies a unique identifier for the context area to be allocated.

DriverObjectExtensionSize [in]

Specifies the length, in bytes, of the context area to be allocated.

DriverObjectExtension [out]

Pointer to, on completion, the allocated context area.

Return value

IoAllocateDriverObjectExtension returns one of the following NTSTATUS codes:

Return codeDescription
STATUS_SUCCESS

Indicates that the routine allocated an extension of the requested size.

STATUS_INSUFFICIENT_RESOURCES

Indicates that the memory could not be allocated for the driver object extension.

STATUS_OBJECT_NAME_COLLISION

Indicates that a driver object extension with the given ClientIdentificationAddress already exists.

 

Remarks

Memory allocated by the system for the driver object extension is resident storage and is accessible from any IRQL. The allocated storage is automatically freed by the I/O manager when the driver object is deleted.

Callers of this routine must provide a unique identifier for ClientIdentificationAddress. To retrieve a pointer to the context area, a caller passes the ClientIdentificationAddress to IoGetDriverObjectExtension.

Requirements

Target platform

Universal

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

<= DISPATCH_LEVEL

See also

IoGetDriverObjectExtension

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft