| 1 | //----------------------------------------------------------------------//
|
|---|
| 2 | // //
|
|---|
| 3 | // //
|
|---|
| 4 | // //
|
|---|
| 5 | // //
|
|---|
| 6 | // //
|
|---|
| 7 | // //
|
|---|
| 8 | //----------------------------------------------------------------------//
|
|---|
| 9 |
|
|---|
| 10 | #define INCL_NOPMAPI
|
|---|
| 11 | #define INCL_DOSDEVICES
|
|---|
| 12 | #include <os2.h>
|
|---|
| 13 |
|
|---|
| 14 | #include <stdio.h>
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | int main(int argc, char *argv[])
|
|---|
| 18 | {
|
|---|
| 19 | APIRET rc;
|
|---|
| 20 | HFILE hDev;
|
|---|
| 21 | ULONG ulAction, arInfo[5];
|
|---|
| 22 |
|
|---|
| 23 | rc = DosOpen("CMPCI1$", &hDev, &ulAction, 0, FILE_NORMAL,
|
|---|
| 24 | FILE_OPEN, OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, NULL);
|
|---|
| 25 | if( rc == 0 )
|
|---|
| 26 | {
|
|---|
| 27 | rc = DosDevIOCtl(hDev, 0x81, 0x80,
|
|---|
| 28 | NULL, 0, NULL, arInfo, sizeof(arInfo), NULL);
|
|---|
| 29 | if( rc == 0 )
|
|---|
| 30 | {
|
|---|
| 31 | printf(" PCI ID: 0x%04x:0x%04x\n", arInfo[0] >> 16, arInfo[0] & 0xffff);
|
|---|
| 32 | printf(" IO Base: 0x%04x\n", arInfo[1]);
|
|---|
| 33 | printf(" IRQ No: %d\n", arInfo[2]);
|
|---|
| 34 | printf(" chip rev: %d\n", arInfo[3]);
|
|---|
| 35 | printf("chip caps: 0x%08lx\n", arInfo[4]);
|
|---|
| 36 | }
|
|---|
| 37 | else printf("DosDevIOCtl failed with error %d\n", rc);
|
|---|
| 38 |
|
|---|
| 39 | DosClose(hDev);
|
|---|
| 40 | }
|
|---|
| 41 | else printf("DosOpen failed with error %d\n", rc);
|
|---|
| 42 |
|
|---|
| 43 | return 0;
|
|---|
| 44 | }
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|