beautypg.com

Rockwell Automation 2711P Software Development Kit User Manual User Manual

Page 87

background image

Publication 2711P-UM005A-EN-P - March 2007

Device Drivers 87

\

KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, \

(PVOID)&i,sizeof(i),(PVOID)&s, \

sizeof(s),NULL)

//

// DEBUG zone text labels use by the platform debugger

//

#ifdef DEBUG

DBGPARAM dpCurSettings = {

TEXT("TestDrv"), {

TEXT("Init"),TEXT(""),TEXT("Stats"),TEXT(""),

TEXT(""),TEXT(""),TEXT(""),TEXT(""),

TEXT(""),TEXT(""),TEXT(""),TEXT(""),

TEXT(""),TEXT("Function"),TEXT("Warning"),TEXT("Error") },

0x00000000

};

#endif

/////////////////////////////////////////////////////////////////////

//

// Example driver global data structure

//

// This structure is used to store information for this DLLs instance

// only. All driver CreateFile() calls create separate "Open"

// instances. The driver should be written so that each of these

// open instances should be able to access the global instance data.

//

/////////////////////////////////////////////////////////////////////

typedef struct

{

BOOL bExitThread;

GIISR_INFO Gii;

DDKISRINFO Dii;

HANDLE hEvent;

HANDLE hThread;

DWORD dwThreadId;

#if defined(DRV_USE_ISR)

HANDLE hIsrHandler;

#endif // defined(DRV_USE_ISR)

#if defined(DRV_USE_PCI)

DDKWINDOWINFO Dwi;

DDKPCIINFO Dpi;

#endif // defined(DRV_USE_PCI)

} DRV_DATA, *PDRV_DATA;

/////////////////////////////////////////////////////////////////////

//

// Function Prototypes

//

/////////////////////////////////////////////////////////////////////

#if defined(DRV_USE_PCI)

static BOOL

PciFindDevice(

LPCTSTR szBaseInstance,

USHORT VendorId,

USHORT DeviceId,

PDDKWINDOWINFO pdwi,