4.3  PcmciaEventCreate

Purpose
• Convenience function for allocating and initializing a PCMCIA Plug-and-Play and power management event structure.

Prototype
WD_EVENT * DLLCALLCONV PcmciaEventCreate(
  WD_PCMCIA_ID deviceId,
  WD_PCMCIA_SLOT pcmciaSlot,
  DWORD dwOptions,
  DWORD dwAction);

Parameters
NameTypeInput/Output
deviceIdWD_PCMCIA_ID 
• wManufacturerIdWORDInput
• wCardIdWORDInput
pcmciaSlotWD_PCMCIA_SLOT 
• uBusBYTEInput
• uSocketBYTEInput
• uFunctionBYTEInput
• uPaddingBYTEN/A
dwOptionsDWORDInput
dwActionDWORDInput

Description
NameDescription
deviceId PCMCIA card ID information structure:
• w ManufacturerId PCMCIA Manufacturer ID to register to. If zero, register to all PCMCIA manufacturer IDs.
• wCardId PCMCIA card ID to register to. If zero, register to all PCMCIA card IDs.
slot PCMCIA slot information structure:
• uBus PCMCIA bus number to register to. If zero, register to all PCMCIA buses.
• uSocket PCMCIA socket to register to. If zero, register to all sockets.
• uFunction PCMCIA function to register to. If zero, register to all functions.
dwOptions Can be either zero or:
WD_ACKNOWLEDGE – If set, the user can perform actions on the requested event before acknowledging it. The OS waits on the event until the user calls WD_EventSend() If EventRegister() [4.4] is called, WD_EventSend() will be called automatically after the callback function exits.
dwAction A bit-mask indicating which events to register to:
Plug-and-Play events:
WD_INSERT – Device was attached and configured by the operating system's Plug-and-Play manager
WD_REMOVE – Device was un-configured and detached by the operating system's Plug-and-Play manager
Device power state:
WD_POWER_CHANGED_D0 – Full power
WD_POWER_CHANGED_D1 – Low sleep
WD_POWER_CHANGED_D2 – Medium sleep
WD_POWER_CHANGED_D3 – Full sleep
WD_POWER_SYSTEM_WORKING – Fully on
Systems power state:
WD_POWER_SYSTEM_SLEEPING1 – Fully on but sleeping
WD_POWER_SYSTEM_SLEEPING2 – CPU off, memory on, PCMCIA on
WD_POWER_SYSTEM_SLEEPING3 – CPU off, memory is in refresh, PCMCIA on aux power
WD_POWER_SYSTEM_HIBERNATE – OS saves context before shutdown
WD_POWER_SYSTEM_SHUTDOWN – No context saved

Return Value
Returns a new events structure for handling PCMCIA Plug-and-Play and power management events, or NULL if the allocation failed.

Remarks

Example
PciEventCreate(deviceId, pcmciaSlot, WD_ACKNOWLEDGE, WD_INSERT | WD_REMOVE);