Rockwell-automation 2711P Software Development Kit User Manual Manual de usuario Pagina 92

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 104
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 91
Publication 2711P-UM005A-EN-P - March 2007
92 Device Drivers
if (INVALID_HANDLE_VALUE == (pDrvData->hEvent = CreateEvent(NULL,FALSE,FALSE,NULL)))
{
ERRORMSG(1,(TEXT("DRV_Init: CreateEvent call failed.\r\n")));
DEBUGMSG(ZONE_FUNC, (TEXT("DRV_Init-\r\n")));
DRV_Deinit((DWORD)pDrvData);
return (0);
}
//
// Now initialize the interrupt so that the kernel starts sending
// events for this IRQ
//
if (!InterruptInitialize(pDrvData->Gii.SysIntr,pDrvData->hEvent,NULL,0))
{
ERRORMSG(1,(TEXT("DRV_Init: InterruptInitialize call failed.\r\n")));
DEBUGMSG(ZONE_FUNC, (TEXT("DRV_Init-\r\n")));
DRV_Deinit((DWORD)pDrvData);
return (0);
}
//
// Create the IST thread.
//
if (INVALID_HANDLE_VALUE ==
(pDrvData->hThread = CreateThread(NULL,0,IstThreadProc,pDrvData,
0,&pDrvData->dwThreadId)))
{
ERRORMSG(1,(TEXT("DRV_Init: CreateThread() call failed.\r\n")));
DEBUGMSG(ZONE_FUNC, (TEXT("DRV_Init-\r\n")));
DRV_Deinit((DWORD)pDrvData);
return (0);
}
DEBUGMSG(ZONE_FUNC, (TEXT("DRV_Init-\r\n")));
return ((DWORD)pDrvData);
}
/////////////////////////////////////////////////////////////////////
//
// DRV_Deinit()
//
// Refer to Microsoft documentation on Device Driver Development for a
// detailed description of this function and its parameters
//
/////////////////////////////////////////////////////////////////////
BOOL
DRV_Deinit(
DWORD hDeviceContext
)
{
PDRV_DATA pDrvData = (PDRV_DATA)hDeviceContext;
DEBUGMSG(ZONE_FUNC, (TEXT("DRV_Deinit+\r\n")));
Vista de pagina 91
1 2 ... 87 88 89 90 91 92 93 94 95 96 97 ... 103 104

Comentarios a estos manuales

Sin comentarios