I ran into the problem that two drives connected at nearly the same time can't be processed. I've actually fixed the old scsi way of getting the drive model but I have a feeling I'm about to run into this same problem.
It appears that if a task is executing, such as the one I have checking if the drive is a particular device and unfortunately takes a bit of time if the device has just been connected. That further WM_DEVICECHANGE messages issued while that is executing aren't taken in at all.
Even if I have to store the message and queue it to be handled I'm not sure how I would go about enabling the application to do that while another task is executing. My first guess is I'd have to work with threads?
I have a WM_DEVICECHANGE handler that listens for device arrival and device removal. It gets and returns a drive letter and passes that along to code that adds the drive to a combo box, then checks if it's a psp or just a removable drive, and then has a message dialog asking the user if they want to select this drive or not.
I also have a feeling that the message dialog would prevent WM_DEVICECHANGE messages from processing but until I write the new methods I can't test for it.
Anyway, I thought maybe someone could understand what I mean and point me in the correct direction. I am worried worried that trying to use threads would cause their own little batch of problems?