SetupDiEnumDeviceInterfaces fails on WinPE2.0

Dear Sir,
I can use following function to get correct battery information on WindowsXP or Vista, but I can’t run it on WinPE2.0.
SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns ERROR_NO_MORE_ITEMS.

HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *) &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);

If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will be OK.
Besides, I found that the registry on \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related guid definition of Battery.
Is that have any relationship?

Thanks in advance,
Alex

xxxxx@gmail.com wrote:

Dear Sir,
I can use following function to get correct battery information on WindowsXP or Vista, but I can’t run it on WinPE2.0.
SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns ERROR_NO_MORE_ITEMS.

HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *) &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);

If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will be OK.
Besides, I found that the registry on \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related guid definition of Battery.
Is that have any relationship?

Absolutely. The BIOS in your WinPE machine is not advertising the
presence of a battery device. Just that simple. Perhaps the BIOS is
too primitive to expose the battery in its ACPI tree.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Perhaps b/c during winpe there are no battery devices installed?

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, April 17, 2009 2:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Dear Sir,
I can use following function to get correct battery information on WindowsXP or Vista, but I can’t run it on WinPE2.0.
SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns ERROR_NO_MORE_ITEMS.

HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *) &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);

If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will be OK.
Besides, I found that the registry on \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related guid definition of Battery.
Is that have any relationship?

Thanks in advance,
Alex


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

IIRC winpe uses the critical device database to install drivers for devices (networking has its own path to provision the network adapter). The CDD will assign device classes to some devices to trigger necessary upper class filters. However it doesn’t install or assign a device class to every device that full Windows would.

You can try launching regedit and see if the device node for your device has any driver assigned and/or has a device class assigned.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, April 17, 2009 10:03 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Perhaps b/c during winpe there are no battery devices installed?

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, April 17, 2009 2:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Dear Sir,
I can use following function to get correct battery information on WindowsXP or Vista, but I can’t run it on WinPE2.0.
SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns ERROR_NO_MORE_ITEMS.

HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *) &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);

If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will be OK.
Besides, I found that the registry on \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related guid definition of Battery.
Is that have any relationship?

Thanks in advance,
Alex


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Make sure you have the Class entry for the battery class of devices, in the
registry. The class entry for battery is

HKLM\SYSTEM\CurrentControlSet\Control\Class{72631E54-78A4-11D0-BCF7-00AA00B7B32A}

Cheers
Check Abdoul

wrote in message news:xxxxx@ntdev...
> Dear Sir,
> I can use following function to get correct battery information on
> WindowsXP or Vista, but I can't run it on WinPE2.0.
> SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns
> ERROR_NO_MORE_ITEMS.
>
> HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0,
> DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
> DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
> SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *)
> &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);
>
> If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will
> be OK.
> Besides, I found that the registry on
> \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can't find related
> guid definition of Battery.
> Is that have any relationship?
>
> Thanks in advance,
> Alex
>
>

Yes, I can find this class entry for battry on the registry, but I can’t
find this key (“0000” or “0001”) under this location.
It just only have empty key as “Properties”.

The key as {72631E54-78A4-11D0-BCF7-00AA00B7B32A}context is as below:
(Default): @%SystemRoot%\system32\batt.dll,-100
Class: Battert
Class: @%SystemRoot%\system32\batt.dll,-100
IconPath: %systemroot%\sytem32\batt.dll,-2
Installer32: batt.dll,BatteryClassInstall
NoInstallClass: 1

2009/4/19 Check Abdoul

>
> Make sure you have the Class entry for the battery class of devices, in
> the
> registry. The class entry for battery is
>
>
> HKLM\SYSTEM\CurrentControlSet\Control\Class{72631E54-78A4-11D0-BCF7-00AA00B7B32A}
>
> Cheers
> Check Abdoul
> ---------------------
>
>
>
> wrote in message news:xxxxx@ntdev…
> > Dear Sir,
> > I can use following function to get correct battery information on
> > WindowsXP or Vista, but I can’t run it on WinPE2.0.
> > SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError()
> returns
> > ERROR_NO_MORE_ITEMS.
> >
> > HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0,
> > DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
> > DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
> > SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *)
> > &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);
> >
> > If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces()
> will
> > be OK.
> > Besides, I found that the registry on
> > \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related
> > guid definition of Battery.
> > Is that have any relationship?
> >
> > Thanks in advance,
> > Alex
> >
> >
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I just find battc.sys on \system32\drivers, but i can’t find CmBatt.sys on
that location or registry on \HKLM\SYSTEM\CurrentControlSet\Service.
Is that mean my winpe environment doesn’t install driver of battery device?
If that, can I manually install it?

Thanks in advance,
Alex

2009/4/18 Peter Wieland

> IIRC winpe uses the critical device database to install drivers for devices
> (networking has its own path to provision the network adapter). The CDD
> will assign device classes to some devices to trigger necessary upper class
> filters. However it doesn’t install or assign a device class to every
> device that full Windows would.
>
> You can try launching regedit and see if the device node for your device
> has any driver assigned and/or has a device class assigned.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Friday, April 17, 2009 10:03 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>
> Perhaps b/c during winpe there are no battery devices installed?
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
> Sent: Friday, April 17, 2009 2:55 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>
> Dear Sir,
> I can use following function to get correct battery information on
> WindowsXP or Vista, but I can’t run it on WinPE2.0.
> SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns
> ERROR_NO_MORE_ITEMS.
>
> HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0,
> DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
> DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
> SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *)
> &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);
>
> If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will
> be OK.
> Besides, I found that the registry on
> \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related
> guid definition of Battery.
> Is that have any relationship?
>
> Thanks in advance,
> Alex
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Why do you need the battery driver instaled in winpe?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.


From: Alex Jian
Sent: Sunday, April 19, 2009 10:37 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

I just find battc.sys on \system32\drivers, but i can’t find CmBatt.sys on that location or registry on \HKLM\SYSTEM\CurrentControlSet\Service.
Is that mean my winpe environment doesn’t install driver of battery device?
If that, can I manually install it?

Thanks in advance,
Alex

2009/4/18 Peter Wieland >
IIRC winpe uses the critical device database to install drivers for devices (networking has its own path to provision the network adapter). The CDD will assign device classes to some devices to trigger necessary upper class filters. However it doesn’t install or assign a device class to every device that full Windows would.

You can try launching regedit and see if the device node for your device has any driver assigned and/or has a device class assigned.

-p

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of Doron Holan
Sent: Friday, April 17, 2009 10:03 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Perhaps b/c during winpe there are no battery devices installed?

d

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of xxxxx@gmail.commailto:xxxxx
Sent: Friday, April 17, 2009 2:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Dear Sir,
I can use following function to get correct battery information on WindowsXP or Vista, but I can’t run it on WinPE2.0.
SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns ERROR_NO_MORE_ITEMS.

HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *) &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);

If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will be OK.
Besides, I found that the registry on \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related guid definition of Battery.
Is that have any relationship?

Thanks in advance,
Alex


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

Alex Jian wrote:

I just find battc.sys on \system32\drivers, but i can’t find
CmBatt.sys on that location or registry on
\HKLM\SYSTEM\CurrentControlSet\Service.
Is that mean my winpe environment doesn’t install driver of battery
device?
If that, can I manually install it?

Installing a driver by itself does absolutely nothing. In order for a
driver to be USED, it has to be loaded for some DEVICE. In a standard
laptop, the BIOS reports (usually using ACPI) that a battery is present,
and the PnP subsystem searches for a driver to handle it.

In your case, my guess is that your BIOS is not reporting a battery
device. No matter how much cajoling you do, Windows is not going to
load a driver for a device that does not exist.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

But I can successfully get related battery infroamtion via same functions on
WindowsXP or Vista environment.
If the BIOS doesn’t create battery device, I don’t understand how do it
workable on general operator system.

2009/4/21 Tim Roberts

> Alex Jian wrote:
> > I just find battc.sys on \system32\drivers, but i can’t find
> > CmBatt.sys on that location or registry on
> > \HKLM\SYSTEM\CurrentControlSet\Service.
> > Is that mean my winpe environment doesn’t install driver of battery
> > device?
> > If that, can I manually install it?
>
> Installing a driver by itself does absolutely nothing. In order for a
> driver to be USED, it has to be loaded for some DEVICE. In a standard
> laptop, the BIOS reports (usually using ACPI) that a battery is present,
> and the PnP subsystem searches for a driver to handle it.
>
> In your case, my guess is that your BIOS is not reporting a battery
> device. No matter how much cajoling you do, Windows is not going to
> load a driver for a device that does not exist.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I can’t get battery information via SetupDixxx APIs on winpe environment
ONLY, so I need to install that on my winpe, if there are absolute
relatedship.

2009/4/20 Doron Holan

> Why do you need the battery driver instaled in winpe?
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> ------------------------------
> From: Alex Jian
> Sent: Sunday, April 19, 2009 10:37 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>
> I just find battc.sys on \system32\drivers, but i can’t find CmBatt.sys
> on that location or registry on \HKLM\SYSTEM\CurrentControlSet\Service.
> Is that mean my winpe environment doesn’t install driver of battery device?
> If that, can I manually install it?
>
> Thanks in advance,
> Alex
>
> 2009/4/18 Peter Wieland
>
>> IIRC winpe uses the critical device database to install drivers for
>> devices (networking has its own path to provision the network adapter). The
>> CDD will assign device classes to some devices to trigger necessary upper
>> class filters. However it doesn’t install or assign a device class to every
>> device that full Windows would.
>>
>> You can try launching regedit and see if the device node for your device
>> has any driver assigned and/or has a device class assigned.
>>
>> -p
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com [mailto:
>> xxxxx@lists.osr.com] On Behalf Of Doron Holan
>> Sent: Friday, April 17, 2009 10:03 AM
>> To: Windows System Software Devs Interest List
>> Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>
>> Perhaps b/c during winpe there are no battery devices installed?
>>
>> d
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com [mailto:
>> xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
>> Sent: Friday, April 17, 2009 2:55 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>
>> Dear Sir,
>> I can use following function to get correct battery information on
>> WindowsXP or Vista, but I can’t run it on WinPE2.0.
>> SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns
>> ERROR_NO_MORE_ITEMS.
>>
>> HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0,
>> DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
>> DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
>> SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *)
>> &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);
>>
>> If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will
>> be OK.
>> Besides, I found that the registry on
>> \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related
>> guid definition of Battery.
>> Is that have any relationship?
>>
>> Thanks in advance,
>> Alex
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Why do you need it? What are you going to use the battery info for under winpe?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.


From: Alex Jian
Sent: Monday, April 20, 2009 9:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

I can’t get battery information via SetupDixxx APIs on winpe environment ONLY, so I need to install that on my winpe, if there are absolute relatedship.

2009/4/20 Doron Holan >
Why do you need the battery driver instaled in winpe?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

________________________________
From: Alex Jian >
Sent: Sunday, April 19, 2009 10:37 PM
To: Windows System Software Devs Interest List >
Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

I just find battc.sys on \system32\drivers, but i can’t find CmBatt.sys on that location or registry on \HKLM\SYSTEM\CurrentControlSet\Service.
Is that mean my winpe environment doesn’t install driver of battery device?
If that, can I manually install it?

Thanks in advance,
Alex

2009/4/18 Peter Wieland >
IIRC winpe uses the critical device database to install drivers for devices (networking has its own path to provision the network adapter). The CDD will assign device classes to some devices to trigger necessary upper class filters. However it doesn’t install or assign a device class to every device that full Windows would.

You can try launching regedit and see if the device node for your device has any driver assigned and/or has a device class assigned.

-p

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of Doron Holan
Sent: Friday, April 17, 2009 10:03 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Perhaps b/c during winpe there are no battery devices installed?

d

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of xxxxx@gmail.commailto:xxxxx
Sent: Friday, April 17, 2009 2:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Dear Sir,
I can use following function to get correct battery information on WindowsXP or Vista, but I can’t run it on WinPE2.0.
SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns ERROR_NO_MORE_ITEMS.

HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *) &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);

If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will be OK.
Besides, I found that the registry on \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related guid definition of Battery.
Is that have any relationship?

Thanks in advance,
Alex


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

Due to our environment of test station on product line is winpe, they need
to identify battery via related battery info.
Why do I can’t get battery info via SetupDixxx APIs? Is that winpe’s
limitation? or due to the battery driver was not installed on winpe?

Thanks in advance,
Alex

2009/4/21 Doron Holan

>
> Why do you need it? What are you going to use the battery info for under
> winpe?
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> ------------------------------
> From: Alex Jian
> Sent: Monday, April 20, 2009 9:02 PM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>
> I can’t get battery information via SetupDixxx APIs on winpe environment
> ONLY, so I need to install that on my winpe, if there are absolute
> relatedship.
>
>
> 2009/4/20 Doron Holan
>
>> Why do you need the battery driver instaled in winpe?
>>
>> d
>>
>> Sent from my phone with no t9, all spilling mistakes are not intentional.
>>
>> ------------------------------
>> From: Alex Jian
>> Sent: Sunday, April 19, 2009 10:37 PM
>> To: Windows System Software Devs Interest List
>> Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>
>> I just find battc.sys on \system32\drivers, but i can’t find
>> CmBatt.sys on that location or registry on
>> \HKLM\SYSTEM\CurrentControlSet\Service.
>> Is that mean my winpe environment doesn’t install driver of battery
>> device?
>> If that, can I manually install it?
>>
>> Thanks in advance,
>> Alex
>>
>> 2009/4/18 Peter Wieland
>>
>>> IIRC winpe uses the critical device database to install drivers for
>>> devices (networking has its own path to provision the network adapter). The
>>> CDD will assign device classes to some devices to trigger necessary upper
>>> class filters. However it doesn’t install or assign a device class to every
>>> device that full Windows would.
>>>
>>> You can try launching regedit and see if the device node for your device
>>> has any driver assigned and/or has a device class assigned.
>>>
>>> -p
>>>
>>> -----Original Message-----
>>> From: xxxxx@lists.osr.com [mailto:
>>> xxxxx@lists.osr.com] On Behalf Of Doron Holan
>>> Sent: Friday, April 17, 2009 10:03 AM
>>> To: Windows System Software Devs Interest List
>>> Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>>
>>> Perhaps b/c during winpe there are no battery devices installed?
>>>
>>> d
>>>
>>> -----Original Message-----
>>> From: xxxxx@lists.osr.com [mailto:
>>> xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
>>> Sent: Friday, April 17, 2009 2:55 AM
>>> To: Windows System Software Devs Interest List
>>> Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>>
>>> Dear Sir,
>>> I can use following function to get correct battery information on
>>> WindowsXP or Vista, but I can’t run it on WinPE2.0.
>>> SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError()
>>> returns ERROR_NO_MORE_ITEMS.
>>>
>>> HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0,
>>> DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
>>> DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
>>> SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *)
>>> &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);
>>>
>>> If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces()
>>> will be OK.
>>> Besides, I found that the registry on
>>> \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related
>>> guid definition of Battery.
>>> Is that have any relationship?
>>>
>>> Thanks in advance,
>>> Alex
>>>
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>> http://www.osr.com/seminars
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>> http://www.osr.com/seminars
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>> http://www.osr.com/seminars
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>
>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging
>> and other seminars visit: http://www.osr.com/seminars To unsubscribe,
>> visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Winpe only installs enough drivers to boot and get to the network, that is it. I do not know how much of winpe setup we document, but there may be a way for you to write your own inf to install the battery (i would copy the full windows install’s battery inf as a starting point) and point winpe at your inf during start

d

Sent from my phone with no t9, all spilling mistakes are not intentional.


From: Alex Jian
Sent: Wednesday, April 22, 2009 12:34 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Due to our environment of test station on product line is winpe, they need to identify battery via related battery info.
Why do I can’t get battery info via SetupDixxx APIs? Is that winpe’s limitation? or due to the battery driver was not installed on winpe?

Thanks in advance,
Alex

2009/4/21 Doron Holan >

Why do you need it? What are you going to use the battery info for under winpe?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.


From: Alex Jian >
Sent: Monday, April 20, 2009 9:02 PM

To: Windows System Software Devs Interest List >
Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

I can’t get battery information via SetupDixxx APIs on winpe environment ONLY, so I need to install that on my winpe, if there are absolute relatedship.

2009/4/20 Doron Holan >
Why do you need the battery driver instaled in winpe?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.


From: Alex Jian >
Sent: Sunday, April 19, 2009 10:37 PM
To: Windows System Software Devs Interest List >
Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

I just find battc.sys on \system32\drivers, but i can’t find CmBatt.sys on that location or registry on \HKLM\SYSTEM\CurrentControlSet\Service.
Is that mean my winpe environment doesn’t install driver of battery device?
If that, can I manually install it?

Thanks in advance,
Alex

2009/4/18 Peter Wieland >
IIRC winpe uses the critical device database to install drivers for devices (networking has its own path to provision the network adapter). The CDD will assign device classes to some devices to trigger necessary upper class filters. However it doesn’t install or assign a device class to every device that full Windows would.

You can try launching regedit and see if the device node for your device has any driver assigned and/or has a device class assigned.

-p

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of Doron Holan
Sent: Friday, April 17, 2009 10:03 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Perhaps b/c during winpe there are no battery devices installed?

d

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of xxxxx@gmail.commailto:xxxxx
Sent: Friday, April 17, 2009 2:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0

Dear Sir,
I can use following function to get correct battery information on WindowsXP or Vista, but I can’t run it on WinPE2.0.
SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError() returns ERROR_NO_MORE_ITEMS.

HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *) &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);

If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces() will be OK.
Besides, I found that the registry on \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related guid definition of Battery.
Is that have any relationship?

Thanks in advance,
Alex


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

Understood, I will try it.
Thank you for great help.

2009/4/22 Doron Holan

> Winpe only installs enough drivers to boot and get to the network, that
> is it. I do not know how much of winpe setup we document, but there may be a
> way for you to write your own inf to install the battery (i would copy the
> full windows install’s battery inf as a starting point) and point winpe at
> your inf during start
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> ------------------------------
> From: Alex Jian
> Sent: Wednesday, April 22, 2009 12:34 AM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>
> Due to our environment of test station on product line is winpe, they
> need to identify battery via related battery info.
> Why do I can’t get battery info via SetupDixxx APIs? Is that winpe’s
> limitation? or due to the battery driver was not installed on winpe?
>
> Thanks in advance,
> Alex
>
> 2009/4/21 Doron Holan
>
>>
>> Why do you need it? What are you going to use the battery info for under
>> winpe?
>> d
>>
>> Sent from my phone with no t9, all spilling mistakes are not intentional.
>>
>> ------------------------------
>> From: Alex Jian
>> Sent: Monday, April 20, 2009 9:02 PM
>>
>> To: Windows System Software Devs Interest List
>> Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>
>> I can’t get battery information via SetupDixxx APIs on winpe
>> environment ONLY, so I need to install that on my winpe, if there are absolute
>> relatedship.
>>
>>
>> 2009/4/20 Doron Holan
>>
>>> Why do you need the battery driver instaled in winpe?
>>>
>>> d
>>>
>>> Sent from my phone with no t9, all spilling mistakes are not intentional.
>>>
>>> ------------------------------
>>> From: Alex Jian
>>> Sent: Sunday, April 19, 2009 10:37 PM
>>> To: Windows System Software Devs Interest List
>>> Subject: Re: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>>
>>> I just find battc.sys on \system32\drivers, but i can’t find
>>> CmBatt.sys on that location or registry on
>>> \HKLM\SYSTEM\CurrentControlSet\Service.
>>> Is that mean my winpe environment doesn’t install driver of battery
>>> device?
>>> If that, can I manually install it?
>>>
>>> Thanks in advance,
>>> Alex
>>>
>>> 2009/4/18 Peter Wieland
>>>
>>>> IIRC winpe uses the critical device database to install drivers for
>>>> devices (networking has its own path to provision the network adapter). The
>>>> CDD will assign device classes to some devices to trigger necessary upper
>>>> class filters. However it doesn’t install or assign a device class to every
>>>> device that full Windows would.
>>>>
>>>> You can try launching regedit and see if the device node for your device
>>>> has any driver assigned and/or has a device class assigned.
>>>>
>>>> -p
>>>>
>>>> -----Original Message-----
>>>> From: xxxxx@lists.osr.com [mailto:
>>>> xxxxx@lists.osr.com] On Behalf Of Doron Holan
>>>> Sent: Friday, April 17, 2009 10:03 AM
>>>> To: Windows System Software Devs Interest List
>>>> Subject: RE: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>>>
>>>> Perhaps b/c during winpe there are no battery devices installed?
>>>>
>>>> d
>>>>
>>>> -----Original Message-----
>>>> From: xxxxx@lists.osr.com [mailto:
>>>> xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
>>>> Sent: Friday, April 17, 2009 2:55 AM
>>>> To: Windows System Software Devs Interest List
>>>> Subject: [ntdev] SetupDiEnumDeviceInterfaces fails on WinPE2.0
>>>>
>>>> Dear Sir,
>>>> I can use following function to get correct battery information on
>>>> WindowsXP or Vista, but I can’t run it on WinPE2.0.
>>>> SetupDiEnumDeviceInterfaces() always returns FALSE. GetLastError()
>>>> returns ERROR_NO_MORE_ITEMS.
>>>>
>>>> HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVICE_BATTERY, 0, 0,
>>>> DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
>>>> DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
>>>> SetupDiEnumDeviceInterfaces(hDevInfo, NULL, (struct _GUID *)
>>>> &GUID_DEVICE_BATTERY, 0, &DeviceInterfaceData);
>>>>
>>>> If I change GUID from Battery to CDRom, SetupDiEnumDeviceInterfaces()
>>>> will be OK.
>>>> Besides, I found that the registry on
>>>> \HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\ can’t find related
>>>> guid definition of Battery.
>>>> Is that have any relationship?
>>>>
>>>> Thanks in advance,
>>>> Alex
>>>>
>>>>
>>>> —
>>>> NTDEV is sponsored by OSR
>>>>
>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>> http://www.osr.com/seminars
>>>>
>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>
>>>>
>>>> —
>>>> NTDEV is sponsored by OSR
>>>>
>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>> http://www.osr.com/seminars
>>>>
>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>
>>>>
>>>> —
>>>> NTDEV is sponsored by OSR
>>>>
>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>> http://www.osr.com/seminars
>>>>
>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>
>>>
>>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging
>>> and other seminars visit: http://www.osr.com/seminars To unsubscribe,
>>> visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>> http://www.osr.com/seminars
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>
>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging
>> and other seminars visit: http://www.osr.com/seminars To unsubscribe,
>> visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>