236 |
|
return; |
237 |
|
} |
238 |
|
|
239 |
– |
|
239 |
|
// Iterate through each floppy |
240 |
|
while ( nextFloppy = IOIteratorNext(allFloppies)) |
241 |
|
{ |
242 |
|
char bsdPath[MAXPATHLEN]; |
244 |
– |
CFTypeRef bsdPathAsCFString = |
245 |
– |
IORegistryEntryCreateCFProperty(nextFloppy, |
246 |
– |
CFSTR(kIOBSDNameKey), |
247 |
– |
kCFAllocatorDefault, 0); |
243 |
|
long size; |
244 |
|
CFTypeRef sizeAsCFNumber = |
245 |
|
IORegistryEntryCreateCFProperty(nextFloppy, |
261 |
|
continue; // if kIOMediaSizeKey is unavailable, we shouldn't use it anyway |
262 |
|
} |
263 |
|
|
264 |
< |
*bsdPath = '\0'; |
265 |
< |
if ( bsdPathAsCFString ) |
266 |
< |
{ |
267 |
< |
size_t devPathLength; |
273 |
< |
|
274 |
< |
strcpy(bsdPath, "/dev/"); |
275 |
< |
devPathLength = strlen(bsdPath); |
276 |
< |
|
277 |
< |
if ( CFStringGetCString((const __CFString *)bsdPathAsCFString, |
278 |
< |
bsdPath + devPathLength, |
279 |
< |
MAXPATHLEN - devPathLength, |
280 |
< |
kCFStringEncodingASCII) ) |
281 |
< |
{ |
282 |
< |
D(bug("Floppy BSD path: %s\n", bsdPath)); |
283 |
< |
PrefsAddString("floppy", bsdPath); |
284 |
< |
} |
285 |
< |
else |
286 |
< |
D(bug("Could not get BSD device path for floppy\n")); |
287 |
< |
|
288 |
< |
CFRelease(bsdPathAsCFString); |
264 |
> |
if (get_device_path(nextFloppy, bsdPath, sizeof(bsdPath)) == KERN_SUCCESS) { |
265 |
> |
PrefsAddString("floppy", bsdPath); |
266 |
> |
} else { |
267 |
> |
D(bug("Could not get BSD device path for floppy\n")); |
268 |
|
} |
290 |
– |
else |
291 |
– |
D(bug("Cannot determine bsdPath for floppy\n")); |
269 |
|
} |
270 |
|
|
271 |
|
IOObjectRelease(nextFloppy); |