NdisWritePcmciaAttributeMemory function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NdisWritePcmciaAttributeMemory writes bus-relative configuration parameters for a PC Card NIC to attribute memory.

Syntax

ULONG NdisWritePcmciaAttributeMemory(
  _In_ NDIS_HANDLE NdisAdapterHandle,
  _In_ ULONG       Offset,
  _In_ PVOID       Buffer,
  _In_ ULONG       Length
);

Parameters

  • NdisAdapterHandle [in]
    Specifies the handle that NDIS passed as an input parameter to MiniportInitialize.

  • Offset [in]
    Specifies the byte offset from the beginning of attribute memory, excluding odd-numbered bytes, at which to begin writing.

  • Buffer [in]
    Pointer to a caller-allocated buffer from which this function copies the specified number of bytes to PC Card attribute memory.

  • Length [in]
    Specifies the number of even-numbered bytes to write to attribute memory, beginning at Offset.

Return value

NdisWritePcmciaAttributeMemory returns how many bytes it wrote to attribute memory. A return value of zero indicates that the write operation failed.

Remarks

The driver of a PC Card NIC calls NdisWritePcmciaAttributeMemory to write bus-relative configuration parameters for its NIC to PC Card attribute memory. Such a miniport driver usually calls NdisWritePcmciaAttributeMemory from its MiniportInitialize function. A driver can call NdisWritePcmciaAttributeMemory more than once to write nonoverlapping sections of attribute memory.

Drivers of PC Card NICs should use NdisWritePcmciaAttributeMemory to maintain binary compatibility across Microsoft operating systems that support Win32. Drivers should never attempt to write directly to attribute memory from the bus.

PC Card attribute memory contains significant information only in even-numbered bytes. NdisWritePcmciaAttributeMemory therefore treats attribute memory as if it were compacted, with all odd (meaningless) bytes removed. The Offset and Length parameters refer to compacted memory (memory consisting only of even-numbered bytes). For example, to write a 6-byte Ethernet address to attribute memory at an actual offset of 0xFF0, the caller of NdisWritePcmciaAttributeMemory would specify an Offset of 0x7F8 (0xFF0/2) and a Length of 6.

Requirements

Target platform

Universal

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

<= DISPATCH

See also

MiniportInitialize

NdisReadPcmciaAttributeMemory

 

 

Send comments about this topic to Microsoft