Jungo WinDriver  
Official Documentation

◆ WDC_EventUnregister()

DWORD DLLCALLCONV WDC_EventUnregister ( _In_ WDC_DEVICE_HANDLE  hDev)

Unregisters an application from a receiving Plug-and-Play and power management notifications for a device, pursuant to a previous call to WDC_EventRegister()

Parameters
[in]hDevHandle to a Plug-and-Play WDC device, returned by WDC_PciDeviceOpen()
Returns
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise
//WinDriver Callback functions must use DLLCALLCONV macro
static void DLLCALLCONV EventHandlerExample(WDC_DEVICE_HANDLE hDev,
DWORD dwAction)
{
printf("\nReceived event notification (device handle 0x%p): ", hDev);
switch (dwAction)
{
case WD_INSERT:
printf("WD_INSERT\n");
break;
case WD_REMOVE:
printf("WD_REMOVE\n");
break;
printf("WD_POWER_CHANGED_D0\n");
break;
printf("WD_POWER_CHANGED_D1\n");
break;
printf("WD_POWER_CHANGED_D2\n");
break;
printf("WD_POWER_CHANGED_D3\n");
break;
printf("WD_POWER_SYSTEM_WORKING\n");
break;
printf("WD_POWER_SYSTEM_SLEEPING1\n");
break;
printf("WD_POWER_SYSTEM_SLEEPING2\n");
break;
printf("WD_POWER_SYSTEM_SLEEPING3\n");
break;
printf("WD_POWER_SYSTEM_HIBERNATE\n");
break;
printf("WD_POWER_SYSTEM_SHUTDOWN\n");
break;
default:
printf("0x%lx\n", dwAction);
break;
}
}
DWORD EventRegisterExample(WDC_DEVICE_HANDLE hDev)
{
DWORD dwStatus;
DWORD dwActions = WD_ACTIONS_ALL;
/* Check whether the event is already registered */
{
}
/* Register the event */
dwStatus = WDC_EventRegister(hDev, dwActions, EventHandlerExample, hDev,
WDC_IS_KP(hDev));
if (WD_STATUS_SUCCESS != dwStatus)
{
printf("Failed to register events. Error 0x%lx - %s\n",
dwStatus, Stat2Str(dwStatus));
return dwStatus;
}
printf("Events registered\n");
// ...
// Some more code
// ...
/* Cleanup */
dwStatus = WDC_EventUnregister(hDev);
return dwStatus;
}
const char *DLLCALLCONV Stat2Str(_In_ DWORD dwStatus)
Retrieves the status string that corresponds to a status code.
#define WDC_IS_KP(pDev)
Does the device use a Kernel PlugIn driver.
Definition: wdc_defs.h:105
DWORD DLLCALLCONV WDC_EventRegister(_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwActions, _In_ EVENT_HANDLER funcEventHandler, _In_ PVOID pData, _In_ BOOL fUseKP)
Registers the application to receive Plug-and-Play and power management events notifications for the ...
BOOL DLLCALLCONV WDC_EventIsRegistered(_In_ WDC_DEVICE_HANDLE hDev)
Checks if the application is currently registered to receive Plug-and-Play and power management notif...
DWORD DLLCALLCONV WDC_EventUnregister(_In_ WDC_DEVICE_HANDLE hDev)
Unregisters an application from a receiving Plug-and-Play and power management notifications for a de...
void * WDC_DEVICE_HANDLE
Handle to device information struct.
Definition: wdc_lib.h:33
#define WD_ACTIONS_ALL
Definition: windrvr.h:1491
@ WD_STATUS_SUCCESS
[0] Operation completed successfully
Definition: windrvr.h:1066
@ WD_OPERATION_ALREADY_DONE
[0x20000011] Operation Already Done.
Definition: windrvr.h:1146
#define DLLCALLCONV
Definition: windrvr.h:32
@ WD_POWER_SYSTEM_WORKING
Definition: windrvr.h:1469
@ WD_POWER_SYSTEM_SLEEPING3
Definition: windrvr.h:1472
@ WD_POWER_SYSTEM_HIBERNATE
Definition: windrvr.h:1473
@ WD_POWER_CHANGED_D0
Power states for the power management.
Definition: windrvr.h:1464
@ WD_POWER_SYSTEM_SLEEPING2
Definition: windrvr.h:1471
@ WD_POWER_CHANGED_D3
Definition: windrvr.h:1468
@ WD_POWER_SYSTEM_SHUTDOWN
Definition: windrvr.h:1474
@ WD_POWER_CHANGED_D2
Definition: windrvr.h:1467
@ WD_INSERT
Definition: windrvr.h:1461
@ WD_POWER_CHANGED_D1
Definition: windrvr.h:1466
@ WD_POWER_SYSTEM_SLEEPING1
Definition: windrvr.h:1470
@ WD_REMOVE
Definition: windrvr.h:1462