Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 244 of file comppnp.c.
Referenced by CompBattPnpDispatch().
{ PWCHAR p; NTSTATUS Status; PWCHAR LinkList; UNICODE_STRING LinkString; if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING GetBatteries\n"); /* Get all battery links */ Status = IoGetDeviceInterfaces(&GUID_DEVICE_BATTERY, NULL, 0, &LinkList); p = LinkList; if (NT_SUCCESS(Status)) { /* Loop all strings inside */ while (TRUE) { /* Create the string */ RtlInitUnicodeString(&LinkString, p); if (!LinkString.Length) break; /* Add this battery and move on */ Status = CompBattAddNewBattery(&LinkString, DeviceExtension); p += (LinkString.Length / sizeof(WCHAR)) + sizeof(UNICODE_NULL); } /* Parsing complete, clean up buffer */ ExFreePool(LinkList); } else if (CompBattDebug & 8) { /* Fail */ DbgPrint("CompBatt: Couldn't get list of batteries\n"); } /* Done */ if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING GetBatteries\n"); return Status; }