After inserting the media, I first receive the dbch_devicetype event from the deviceinterface, and then with volume and if the drive was inserted 1, then both events will be triggered by the same device. First, its physical insertion into the port, and then the selection of the mount point. But since these two events are independent of each other, I would like to be able to accurately establish that the output in the volume "mount point" corresponds to the DVINST device I can get in the deviceinterface branch. I need this for the following reasons, for example, I want to insert a drive and validate it against some database of serial numbers, but for now this validation will be done by me, I need to unmount it and, if successful, mount it again. But for this I need to know for sure that it is for this particular device that the specific mount point is attached. If there is any other way to solve this problem, I would also like to know about it.

switch (wParam) { case DBT_DEVICEARRIVAL: { if (((PDEV_BROADCAST_HDR)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { PDEV_BROADCAST_DEVICEINTERFACE deviceinterface = (PDEV_BROADCAST_DEVICEINTERFACE)lParam; } else if (((PDEV_BROADCAST_HDR)lParam)->dbch_devicetype == DBT_DEVTYP_VOLUME) { PDEV_BROADCAST_VOLUME volume = (PDEV_BROADCAST_VOLUME)lParam; wchar_t vol[MAX_PATH]; QString mount_path; getDriveLetter(volume->dbcv_unitmask, &mount_path); GetVolumeNameForVolumeMountPoint(mount_path.toStdWString().data(), vol, MAX_PATH); } break; } 

    0