Structure PROCESSOR_POWER_POLICY_INFO ... AllowPromotion:1 ?

Everything else that doesn't fall into one of the other PB categories.
User avatar
bingo
Enthusiast
Enthusiast
Posts: 210
Joined: Fri Apr 02, 2004 12:21 pm
Location: germany/thueringen
Contact:

Structure PROCESSOR_POWER_POLICY_INFO ... AllowPromotion:1 ?

Post by bingo »

Structure PROCESSOR_POWER_POLICY_INFO
TimeCheck.l
DemoteLimit.l
PromoteLimit.l
DemotePercent.b
PromotePercent.b
Spare.b[2]
AllowDemotion:1.l
AllowPromotion:1.l ; already declared ???
Reserved:30.l
EndStructure

this structure field has been already declared :?:

[pb3.93]
["1:0>1"]
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

It's because the PureBasic compiler thinks that you have a variable called 1.l in your structure and that you have already declared it.

In C that is a bitfield, so makes those Allow* fields use 1 bit each. You can stick a .l variable in there and access the relevant bits, but I can't remember whether it is a standard or compiler specific whether they are allocated right to left or right to left so you will need to check to see which ones are the correct bits. I'd guess at right to left, so that AllowDemotion is bit 0 and AllowPromotion is bit 1.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply