Vitaliy Margolen wine-patch@kievinfo.com writes:
@@ -235,14 +249,18 @@ static void create_hardware_branch(void) int i; HANDLE handle; char drive[] = "\\.\A:";
char drive1[] = "A:\";
UINT uNumber = 0;
/* create entries for cdroms (skipping A: and B:) */ for (i = 2; i < 26; i++) { drive[4] = 'A' + i;
drive1[0] = 'A' + i;
if (GetDriveTypeA(drive1) != DRIVE_CDROM) continue; handle = CreateFileA( drive, 0, 0, NULL, OPEN_EXISTING, 0, 0 ); if (handle == INVALID_HANDLE_VALUE) continue;
You shouldn't use GetDriveType here, you should determine the device type from the ioctls you do on the handle. The GetDriveType result doesn't necessarily correspond to the device since it can be changed in the registry.