Chip Davis (@cdavis5e) commented about dlls/ntdll/unix/system.c:
bs->AcOnLine = TRUE; return STATUS_SUCCESS; } /* Just use the first battery. */
- battery = CFArrayGetValueAtIndex( batteries, 0 );
- prop = CFDictionaryGetValue( battery, CFSTR(kIOBatteryFlagsKey) );
- CFNumberGetValue( prop, kCFNumberSInt32Type, &value );
- source = IOPSGetPowerSourceDescription( blob, CFArrayGetValueAtIndex( sources, 0 ) );
- if (!source)
return STATUS_ACCESS_DENIED;
- if (value & kIOBatteryInstalled)
- prop = CFDictionaryGetValue( source, CFSTR(kIOPSTypeKey) );
- source_type = CFStringGetCStringPtr((CFStringRef) prop, kCFStringEncodingASCII);
The casts on `prop` shouldn't be necessary, since `void *` (or `CFTypeRef` for that matter) in C doesn't require casting to and from other pointer types.