ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

NTSTATUS NTAPI CompBattGetBatteries ( IN PCOMPBATT_DEVICE_EXTENSION  DeviceExtension)

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;
}

Generated on Sun May 27 2012 05:23:00 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.