阅读:1131回复:0
windriver生成的XXX_lib.c程序中的XXX_RegisterEvent()函数有什么作用?
windriver生成的XXX_lib.c程序中的XXX_RegisterEvent()函数有什么作用?
源码如下: BOOL PCI_RegisterEvent(PCI_HANDLE hPCI, DWORD dwAction, DWORD dwVendorID, DWORD dwDeviceID, WD_PCI_SLOT pciSlot, EVENT_HANDLER funcHandler) { HANDLE hEvent; WD_EVENT Events; DWORD dwStatus; BZERO(Events); Events.dwCardType = WD_BUS_PCI; Events.u.Pci.pciSlot = pciSlot; Events.u.Pci.cardId.dwVendorId = dwVendorID; Events.u.Pci.cardId.dwDeviceId = dwDeviceID; Events.dwAction = dwAction; dwStatus = EventRegister(&hEvent, hPCI->hWD, &Events, funcHandler, NULL); if (dwStatus) { sprintf(PCI_ErrorString, \"EventRegister() failed with status 0x%x - %s\\n\", dwStatus, Stat2Str(dwStatus)); return FALSE; } hPCI->hEvent = hEvent; return TRUE; } windriver提供的EventRegister()的说明如下: Register your application to receive Plug-and-Play and power management event notifications, according to a predefined set of criteria, and call a callback function upon event receipt. 我在应用程序的什么地方需要用这个函数呢?我不理会它可以吗? |
|
|