A client application using MCI closes a driver by sending an MCI_CLOSE message. This message is intercepted by winmm.dll, which sends the following messages to the appropriate MCI driver, in the order listed:
4.DRV_FREE
Note that the driver does not receive the MCI_CLOSE message. Also be aware that DRV_DISABLE and DRV_FREE are sent only if the calling application is the only one using the driver. After DRV_FREE is sent, winmm.dll unloads the driver from the application's address space.
For more information, see the following topics: