Unregisters an application from a receiving Plug-and-Play and power management notifications for a device, pursuant to a previous call to WDC_EventRegister()
DWORD dwAction)
{
printf("\nReceived event notification (device handle 0x%p): ", hDev);
switch (dwAction)
{
printf("WD_INSERT\n");
break;
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 dwStatus;
{
}
{
printf("Failed to register events. Error 0x%lx - %s\n",
return dwStatus;
}
printf("Events registered\n");
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.
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.
@ WD_STATUS_SUCCESS
[0] Operation completed successfully
@ WD_OPERATION_ALREADY_DONE
[0x20000011] Operation Already Done.
@ WD_POWER_SYSTEM_WORKING
@ WD_POWER_SYSTEM_SLEEPING3
@ WD_POWER_SYSTEM_HIBERNATE
@ WD_POWER_CHANGED_D0
Power states for the power management.
@ WD_POWER_SYSTEM_SLEEPING2
@ WD_POWER_SYSTEM_SHUTDOWN
@ WD_POWER_SYSTEM_SLEEPING1