Convenience function for allocating and initializing a PCI Plug-and-Play and power management event structure.
WD_EVENT * DLLCALLCONV PciEventCreate(
WD_PCI_ID cardId,
WD_PCI_SLOT pciSlot,
DWORD dwOptions,
DWORD dwAction);
| Name | Type | Input/Output |
|---|---|---|
| cardId | WD_PCI_ID | |
| • dwVendorId | DWORD | Input |
| • dwDeviceId | DWORD | Input |
| pciSlot | WD_PCI_SLOT | |
| • dwBus | DWORD | Input |
| • dwSlot | DWORD | Input |
| • dwFunction | DWORD | Input |
| dwOptions | DWORD | Input |
| dwAction | DWORD | Input |
| Name | Description |
|---|---|
| cardId | PCI card information structure: |
| • dwVendorId | PCI vendor ID to register to. If zero, register to all PCI vendor IDs. |
| • dwDeviceId | PCI card ID to register to. If zero, register to all PCI device IDs. |
| pciSlot | PCI slot information: |
| • dwBus | PCI bus number to register to. If zero, register to all PCI buses. |
| • dwSlot | PCI slot to register to. If zero, register to all slots. |
| • dwFunction | PCI 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()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 unconfigured and
detached by the operating system's Plug-and-Play ManagerDevice 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 onSystems power state: • WD_POWER_SYSTEM_SLEEPING1 — Fully on but
sleeping • WD_POWER_SYSTEM_SLEEPING2 — CPU off, memory on,
PCI on• WD_POWER_SYSTEM_SLEEPING3 — CPU off, memory is
in refresh, PCI on aux power• WD_POWER_SYSTEM_HIBERNATE — OS saves context
before shutdown• WD_POWER_SYSTEM_SHUTDOWN — No context saved
|
Returns a new structure for handling PCI Plug-and-Play and power management events,
or NULL if the allocation failed.
It is the responsibility of the caller to free the event structure returned by
the function (using free()) when it is no longer needed.
PciEventCreate(cardId, pciSlot, WD_ACKNOWLEDGE, WD_INSERT | WD_REMOVE);