metabrainz/libdiscid — pull request #20 by phw (2013-04-23 17:18:32+00:00)
Title: Use first available CD drive on Windows if default device is set.

Currently if the default device is used on Windows it tries to access the hardcoded drive "D:". The patch uses the first CD drive instead.

The code is completely stolen from Picard (https://github.com/musicbrainz/picard/blob/master/picard/util/cdrom.py#L33), I just translated it back to C.