RxUsbDeregisterNotification

From EDM2
Jump to: navigation, search

Description

Removes the registration of attach/detach notification semaphores.

Syntax

rc = RxUsbDeregisterNotification(NotifyID)

Parameters

NotifyID 
the NotifyID received from RxUsbChangeNotification or RxUsbDeviceNotification.

Return Code

0x0000 - NO_ERROR

Errors

0x0006 - ERROR_INVALID_HANDLE
0x001F - ERROR_GEN_FAILURE
0x0057 - ERROR_INVALID_PARAMETER
0x005F - ERROR_INTERRUPT
0x0064 - ERROR_TOO_MANY_SEMAPHORES
0x0067 - ERROR_TOO_MANY_SEM_REQUESTS
0x0069 - ERROR_SEM_OWNER_DIED
0x1B58 - USB_NOT_INIT
0xFF1F - ERROR_GEN_FAILURE
0xFF57 - ERROR_INVALID_PARAMETER
0xFFBB - ERROR_SEM_NOT_FOUND

Remarks

Device attach/detach notifications may be obtained by registering event semaphores to be posted upon attach/detach of USB devices. The RexxUtil library provides functions to work with event semaphores. Some of these are used in the example code.

Example Code

/* add RxUsbDeregisterNotification */
rc = RxFuncAdd('RxUsbDeregisterNotification','usbcalls','RxUsbDeregisterNotification')
say '+RxUsbDeregisterNotification(),RC=0x'd2x(rc)

/* invoke RxUsbDeregisterNotification */
rc = RxUsbDeregisterNotification(NotifyID)
say '*RxUsbDeregisterNotification(),RC=0x'd2x(rc)

/* drop RxUsbDeregisterNotification */
rc = RxFuncDrop('RxUsbDeregisterNotification')
say '-RxUsbDeregisterNotification(),RC=0x'd2x(rc)

/* add SysCloseEventSem */
rc = RxFuncAdd('SysCloseEventSem','RexxUtil','SysCloseEventSem')
say '+SysCloseEventSem(),RC=0x'd2x(rc)

/* invoke SysCloseEventSem() */
rc = SysCloseEventSem(hSemAttach)
say '*SysCloseEventSem(),RC=0x'd2x(rc)
rc = SysCloseEventSem(hSemDetach)
say '*SysCloseEventSem(),RC=0x'd2x(rc)

/* drop SysCloseEventSem */
rc = RxFuncDrop('SysCloseEventSem')
say '-SysCloseEventSem(),RC=0x'd2x(rc)

Related Functions