Reads/writes from/to the PCMCIA attribute space of a selected PCMCIA card. The PCMCIA attribute space contains the Card Information Structure (CIS).
DWORD WD_PcmciaConfigDump(
HANDLE hWD,
WD_PCMCIA_CONFIG_DUMP *pPcmciaConfig);
| Name | Type | Input/Output |
|---|---|---|
| hWD | HANDLE | Input |
| pPcmciaConfig | WD_PCMCIA_CONFIG_DUMP* | |
| • pcmciaSlot | WD_PCMCIA_SLOT | |
| * uBus | BYTE | Input |
| * uSocket | BYTE | Input |
| * uFunction | BYTE | Input |
| * uPadding | BYTE | N/A |
| • pBuffer | PVOID | Input/Output |
| • dwOffset | DWORD | Input |
| • dwBytes | DWORD | Input |
| • fIsRead | DWORD | Input |
| • dwResult | DWORD | Output |
| • dwOptions | DWORD | Input |
| Name | Description |
|---|---|
| hWD | Handle to WinDriver's kernel-mode driver as
received from WD_Open() |
| pPcmciaConfig | Pointer to a PCMCIA attribute space information structure: |
| • pcmciaSlot | PCMCIA slot information structure: |
| * uBus | PCMCIA bus number (0 based) |
| * uSocket | PCMCIA slot number (0 based) |
| * uFunction | PCMCIA function number (0 based) |
| * uPadding | Padding of 1 byte (reserved) |
| • pBuffer |
A pointer to the data that is read from the PCMCIA attribute space (if
fIsRead is TRUE) or a pointer to the data to
write to the PCMCIA attribute space (if fIsRead is
FALSE)
|
| • dwOffset | The offset of the specific register(s) in the PCMCIA attribute space to read/write from/to |
| • dwBytes | Number of bytes to read/write |
| • fIsRead |
If TRUE — read from the PCMCIA attribute space;If FALSE — write to the PCMCIA attribute space.
|
| • dwResult |
Result of the PCMCIA attribute space read/write. Can be any of the
following PCMCIA_ACCESS_RESULT enumeration values:• PCMCIA_ACCESS_OK — read/write succeeded• PCMCIA_BAD_SOCKET — the specified socket or
function does not exist• PCMCIA_BAD_OFFSET — the specified offset is
incorrect• PCMCIA_ACCESS_ERROR — read/write failed
|
| • dwOptions | Should always be set to 0 (reserved for future use) |
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate
error code otherwise
WD_PCMCIA_CONFIG_DUMP pcmciaConfig;
DWORD dwStatus;
WORD aBuffer[2];
BZERO(pcmciaConfig);
pcmciaConfig.pcmciaSlot.uBus = 0;
pcmciaConfig.pcmciaSlot.uSocket = 0;
pcmciaConfig.pcmciaSlot.uFunction = 0;
pcmciaConfig.pcmciaSlot.uPadding = 0;
pcmciaConfig.pBuffer = aBuffer;
pcmciaConfig.dwOffset = 0;
pcmciaConfig.dwBytes = sizeof(aBuffer);
pcmciaConfig.fIsRead = TRUE;
dwStatus = WD_PcmciaConfigDump(hWD, &pcmciaConfig);
if (dwStatus)
{
printf("WD_PcmciaConfigDump failed: %s\n", Stat2Str(dwStatus));
}
else
{
printf("Card in Bus 0, Socket 0: the code of the first tuple in"
" the CIS is %x\n", (UINT32)aBuffer[0]);
}