Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1804 lines
114 KiB

  1. <html>
  2. <head>
  3. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  4. <meta name="ProgId" content="FrontPage.Editor.Document">
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  6. <title>New Page 1</title>
  7. <style>
  8. <!--
  9. p.MsoNormal
  10. {mso-style-parent:"";
  11. margin-bottom:.0001pt;
  12. font-size:10.0pt;
  13. font-family:"Times New Roman";
  14. margin-left:0in; margin-right:0in; margin-top:0in}
  15. table.MsoNormalTable
  16. {mso-style-parent:"";
  17. font-size:10.0pt;
  18. font-family:"Times New Roman"}
  19. p.Tt
  20. {mso-style-parent:"";
  21. margin-top:1.0pt;
  22. margin-right:0in;
  23. margin-bottom:3.0pt;
  24. margin-left:0in;
  25. line-height:11.0pt;
  26. page-break-after:avoid;
  27. font-size:9.5pt;
  28. font-family:Arial;
  29. font-weight:bold;
  30. font-style:italic;
  31. }
  32. p.Ch
  33. {mso-style-parent:"";
  34. margin-top:2.0pt;
  35. margin-right:0in;
  36. margin-bottom:27.0pt;
  37. margin-left:0in;
  38. line-height:27.0pt;
  39. page-break-after:avoid;
  40. font-size:22.0pt;
  41. font-family:Arial;
  42. }
  43. p.Tr
  44. {mso-style-parent:"";
  45. margin-bottom:.0001pt;
  46. text-align:right;
  47. line-height:1.0pt;
  48. page-break-after:avoid;
  49. border:medium none;
  50. padding:0in;
  51. font-size:4.0pt;
  52. font-family:"Times New Roman";
  53. margin-left:0in; margin-right:0in; margin-top:0in}
  54. p.Le
  55. {margin-bottom:.0001pt;
  56. text-align:right;
  57. line-height:8.0pt;
  58. font-size:6.0pt;
  59. font-family:"Times New Roman";
  60. margin-left:0in; margin-right:0in; margin-top:0in}
  61. p.Tpf
  62. {margin-top:1.0pt;
  63. margin-right:0in;
  64. margin-bottom:3.0pt;
  65. margin-left:0in;
  66. line-height:11.0pt;
  67. tab-stops:14.0pt 28.0pt;
  68. font-size:9.5pt;
  69. font-family:"Times New Roman";
  70. }
  71. p.MsoToc1
  72. {margin-bottom:.0001pt;
  73. line-height:11.0pt;
  74. page-break-after:avoid;
  75. tab-stops:right dotted 6.0in;
  76. font-size:9.5pt;
  77. font-family:"Times New Roman";
  78. margin-left:0in; margin-right:0in; margin-top:0in}
  79. p.MsoToc2
  80. {margin-top:0in;
  81. margin-right:0in;
  82. margin-bottom:0in;
  83. margin-left:14.0pt;
  84. margin-bottom:.0001pt;
  85. line-height:11.0pt;
  86. tab-stops:right dotted 6.0in;
  87. font-size:9.5pt;
  88. font-family:"Times New Roman";
  89. }
  90. h1
  91. {mso-style-parent:"";
  92. margin-top:10.0pt;
  93. margin-right:0in;
  94. margin-bottom:4.0pt;
  95. margin-left:0in;
  96. line-height:22.0pt;
  97. page-break-after:avoid;
  98. border:medium none;
  99. padding:0in;
  100. font-size:20.0pt;
  101. font-family:Arial;
  102. font-weight:normal}
  103. p.MsoListBullet
  104. {margin-top:0in;
  105. margin-right:0in;
  106. margin-bottom:4.0pt;
  107. margin-left:.25in;
  108. text-indent:-.25in;
  109. tab-stops:list blank .25in;
  110. font-size:10.0pt;
  111. font-family:"Times New Roman";
  112. }
  113. p.Ex
  114. {mso-style-parent:"";
  115. margin-bottom:.0001pt;
  116. line-height:11.0pt;
  117. tab-stops:19.5pt 39.0pt 58.5pt 78.0pt 97.5pt 117.0pt 136.5pt 156.0pt 175.5pt 195.0pt 214.5pt 3.25in 253.5pt 273.0pt 292.5pt 312.0pt 331.5pt;
  118. font-size:8.0pt;
  119. font-family:"Courier New";
  120. margin-left:0in; margin-right:0in; margin-top:0in}
  121. p.Thf
  122. {margin-top:1.0pt;
  123. margin-right:0in;
  124. margin-bottom:3.0pt;
  125. margin-left:0in;
  126. line-height:11.0pt;
  127. page-break-after:avoid;
  128. font-size:9.5pt;
  129. font-family:"Times New Roman";
  130. font-weight:bold;
  131. }
  132. p.Th
  133. {margin-top:1.0pt;
  134. margin-right:0in;
  135. margin-bottom:3.0pt;
  136. margin-left:12.0pt;
  137. line-height:11.0pt;
  138. page-break-after:avoid;
  139. font-size:9.5pt;
  140. font-family:"Times New Roman";
  141. font-weight:bold;
  142. }
  143. p.Tp
  144. {margin-top:1.0pt;
  145. margin-right:0in;
  146. margin-bottom:3.0pt;
  147. margin-left:12.0pt;
  148. line-height:11.0pt;
  149. tab-stops:14.0pt 28.0pt;
  150. font-size:9.5pt;
  151. font-family:"Times New Roman";
  152. }
  153. p.Lp1
  154. {margin-top:0in;
  155. margin-right:0in;
  156. margin-bottom:4.0pt;
  157. margin-left:.25in;
  158. font-size:10.0pt;
  159. font-family:"Times New Roman";
  160. }
  161. p.Term1
  162. {mso-style-parent:"";
  163. margin-bottom:.0001pt;
  164. line-height:12.0pt;
  165. page-break-after:avoid;
  166. font-size:10.0pt;
  167. font-family:"Times New Roman";
  168. font-weight:bold;
  169. margin-left:0in; margin-right:0in; margin-top:0in}
  170. p.Def1
  171. {margin-top:0in;
  172. margin-right:0in;
  173. margin-bottom:8.0pt;
  174. margin-left:10.0pt;
  175. font-size:10.0pt;
  176. font-family:"Times New Roman";
  177. }
  178. h2
  179. {margin-top:7.0pt;
  180. margin-right:0in;
  181. margin-bottom:3.0pt;
  182. margin-left:0in;
  183. line-height:19.0pt;
  184. page-break-after:avoid;
  185. font-size:17.0pt;
  186. font-family:Arial;
  187. font-weight:normal}
  188. -->
  189. </style>
  190. </head>
  191. <body>
  192. <div style="border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.5pt solid windowtext; padding-left: 0in; padding-right: 0in; padding-top: 0in; padding-bottom: 1.0pt">
  193. <p class="MsoNormal" style="border: medium none; padding: 0in"><b>
  194. <span style="font-size: 30.0pt; font-family: Arial Black">WinHEC 99 White
  195. Paper </span></b>
  196. </div>
  197. <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse">
  198. <tr>
  199. <td width="295" valign="top" style="width: 221.4pt; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
  200. <p class="Tt">Windows<span style="font-size: 8.0pt"></span> Hardware
  201. Engineering Conference:<br>
  202. Advancing the Platform</td>
  203. <td width="304" valign="top" style="width: 228.0pt; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
  204. <p class="MsoNormal" align="right" style="text-align: right">&nbsp;</td>
  205. </tr>
  206. </table>
  207. <p class="Ch"><a name="_Toc441982198">Windows&nbsp;2000 Instrumentation: WMI and ACPI</a></p>
  208. <p class="Tt">Abstract</p>
  209. <div style="mso-border-top-alt: solid windowtext .75pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding: 0in">
  210. <p class="Tr">&nbsp;</div>
  211. <p class="MsoNormal">This paper describes the process that system manufacturers
  212. (OEMs) can use to provide instrumentation information by including ACPI objects
  213. in the systems they build that will be recognized by Microsoft� Windows�
  214. Management Instrumentation (WMI). This information applies for Windows&nbsp;2000 and
  215. Windows&nbsp;98 OSR 1. By including ACPI objects in the systems they build, OEMs can
  216. take advantage of a generic mapping driver that allows WMI to make the
  217. information available to the instrumentation consumers.</p>
  218. <p class="MsoNormal">&nbsp;</p>
  219. <p class="MsoNormal">The ACPI subsystem contains a wealth of instrumentation
  220. information; OEMs are encouraged to use ACPI to add additional platform specific
  221. instrumentation information. However, ACPI objects are not readily accessible by
  222. instrumentation data consumers such as Web-Based Enterprise Management (WBEM).
  223. </p>
  224. <p class="MsoNormal">&nbsp;</p>
  225. <p class="MsoNormal">This paper assumes the reader is familiar with driver
  226. mapping under Windows operating systems and the Data Block GUID Mapping control
  227. method for WMI. References for background and details are cited at
  228. http://www.microsoft.com/hwdev/manageability/; ACPI implementation information
  229. is available at http://www.teleport.com/~acpi/.</p>
  230. <p class="MsoNormal">&nbsp;</p>
  231. <p class="MsoNormal"><!--[if supportFields]>&nbsp;DATE \@ &quot;MMMM d, yyyy&quot; \*
  232. MERGEFORMAT <![endif]-->March 12, 1999<!--[if supportFields]><![endif]--></p>
  233. <p class="Le">&nbsp;</p>
  234. <p class="Le">&nbsp;</p>
  235. <p class="Tt">Disclaimer and Copyright</p>
  236. <div style="mso-border-top-alt: solid windowtext .75pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding: 0in">
  237. <p class="Tr">&nbsp;</div>
  238. <p class="Tpf" style="line-height: 9.0pt"><b><span style="font-size: 8.0pt">
  239. Microsoft Disclaimer: </span></b><span style="font-size: 7.0pt">This document is
  240. for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR
  241. IMPLIED, IN THIS DOCUMENT.</span></p>
  242. <p class="Tpf" style="line-height: 9.0pt"><span style="font-size: 7.0pt">
  243. Microsoft Corporation may have patents or pending patent applications,
  244. trademarks, copyrights, or other intellectual property rights covering subject
  245. matter in this document. The furnishing of this document does not give you any
  246. license to the patents, trademarks, copyrights, or other intellectual property
  247. rights except as expressly provided in any written license agreement from
  248. Microsoft Corporation. </span></p>
  249. <p class="Tpf" style="line-height: 9.0pt"><span style="font-size: 7.0pt">
  250. Microsoft does not make any representation or warranty regarding specifications
  251. in this document or any product or item developed based on these specifications.
  252. Microsoft disclaims all express and implied warranties, including but not
  253. limited to the implied warranties or merchantability, fitness for a particular
  254. purpose and freedom from infringement. Without limiting the generality of the
  255. foregoing, Microsoft does not make any warranty of any kind that any item
  256. developed based on these specifications, or any portion of a specification, will
  257. not infringe any copyright, patent, trade secret or other intellectual property
  258. right of any person or entity in any country. It is your responsibility to seek
  259. licenses for such intellectual property rights where appropriate. Microsoft
  260. shall not be liable for any damages arising out of or in connection with the use
  261. of these specifications, including liability for lost profit, business
  262. interruption, or any other damages whatsoever. Some states do not allow the
  263. exclusion or limitation of liability or consequential or incidental damages; the
  264. above limitation may not apply to you. </span></p>
  265. <p class="Tpf" style="line-height: normal"><span style="font-size: 7.0pt">
  266. Microsoft, DirectX, MS&#8209;DOS, Win32, Windows, and Windows&nbsp;NT are registered
  267. trademarks of Microsoft Corporation. Other product and company names mentioned
  268. herein may be the trademarks of their respective owners.</span></p>
  269. <p class="Tpf" style="line-height: normal"><span style="font-size: 7.0pt">� 1999
  270. Microsoft Corporation. All rights reserved.</span></p>
  271. <p class="Tt">&nbsp;</p>
  272. <p class="Tt">Contents</p>
  273. <div style="mso-border-top-alt: solid windowtext .75pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding: 0in">
  274. <p class="Tr">&nbsp;</div>
  275. <p class="MsoToc1"><!--[if supportFields]>&nbsp;TOC \o &quot;1-2&quot; <![endif]-->Technology
  276. Overview for Windows&nbsp;2000
  277. Instrumentation.......................................................................................
  278. <!--[if supportFields]>PAGEREF _Toc445868966 \h <![endif]-->3<!--[if gte mso 9]><xml>
  279. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900360036000000</w:data>
  280. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  281. <p class="MsoToc1">WMI Overview for Windows&nbsp;2000
  282. Instrumentation...................................................................................................
  283. <!--[if supportFields]>PAGEREF _Toc445868967 \h <![endif]-->3<!--[if gte mso 9]><xml>
  284. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900360037000000</w:data>
  285. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  286. <p class="MsoToc1">ACPI-to-WMI Mapper Goals for Windows&nbsp;2000
  287. Instrumentation...........................................................................
  288. <!--[if supportFields]>PAGEREF _Toc445868968 \h <![endif]-->4<!--[if gte mso 9]><xml>
  289. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900360038000000</w:data>
  290. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  291. <p class="MsoToc1">ACPI Control Method Naming Conventions and Functionality for
  292. Windows&nbsp;2000 Instrumentation................ <!--[if supportFields]>PAGEREF
  293. _Toc445868969 \h <![endif]-->5<!--[if gte mso 9]><xml>
  294. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900360039000000</w:data>
  295. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  296. <p class="MsoToc1">Data Block Design for Windows&nbsp;2000
  297. Instrumentation.............................................................................................
  298. <!--[if supportFields]>PAGEREF _Toc445868970 \h <![endif]-->8<!--[if gte mso 9]><xml>
  299. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900370030000000</w:data>
  300. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  301. <p class="MsoToc1">FAQ about WMI and ACPI for Windows&nbsp;2000
  302. Instrumentation...........................................................................
  303. <!--[if supportFields]>PAGEREF _Toc445868971 \h <![endif]-->11<!--[if gte mso 9]><xml>
  304. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900370031000000</w:data>
  305. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  306. <p class="MsoToc1"><span style="layout-grid-mode: line">ASL Methods and Sample
  307. Code</span>..................................................................................................................................
  308. <!--[if supportFields]>PAGEREF _Toc445868972 \h <![endif]-->11<!--[if gte mso 9]><xml>
  309. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900370032000000</w:data>
  310. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  311. <p class="MsoToc2"><span style="layout-grid-mode: line">ASL Sample Code for an
  312. Event and Initiating Method</span>......................................................................................
  313. <!--[if supportFields]>PAGEREF _Toc445868973 \h <![endif]-->12<!--[if gte mso 9]><xml>
  314. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900370033000000</w:data>
  315. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  316. <p class="MsoToc2">Sample ASL Code Embedding MOD Data in ASL..............................................................................................
  317. <!--[if supportFields]>PAGEREF _Toc445868974 \h <![endif]-->14<!--[if gte mso 9]><xml>
  318. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900370034000000</w:data>
  319. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  320. <p class="MsoToc2">Sample .Mof
  321. File.......................................................................................................................................................
  322. <!--[if supportFields]>PAGEREF _Toc445868975 \h <![endif]-->17<!--[if gte mso 9]><xml>
  323. <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003400340035003800360038003900370035000000</w:data>
  324. </xml><![endif]--><!--[if supportFields]><![endif]--></p>
  325. <p class="Le"><!--[if supportFields]><![endif]-->&nbsp;</p>
  326. <p><span style="font-size: 20.0pt; font-family: Arial">
  327. <br clear="all" style="page-break-before: always">
  328. &nbsp;</span></p>
  329. <div style="mso-border-top-alt: solid windowtext .5pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding-left: 0in; padding-right: 0in; padding-top: 1.0pt; padding-bottom: 0in">
  330. <h1><a name="_Toc440694666">Technology Overview</a> for Windows&nbsp;2000
  331. Instrumentation</h1>
  332. </div>
  333. <p class="MsoNormal">The ACPI-to-WMI mapping functionality is achieved by means
  334. of two device drivers provided with the Windows&nbsp;2000 and Windows&nbsp;98 OSR1
  335. operating systems: </p>
  336. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  337. </span></span>Acpi.sys is the regular ACPI device driver with some
  338. modifications. </p>
  339. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  340. </span></span>Wmiacpi.sys registers with Plug and Play ID PNP0c14. </p>
  341. <p class="Le">&nbsp;</p>
  342. <p class="MsoNormal">OEMs can differentiate their PC system capabilities by
  343. writing ACPI Source Language (ASL) code and a Managed Object Format (.mof or MOF)
  344. file. The .mof file can be in the BIOS or on disk. For more information about
  345. MOF, see the �MOF Data Types� section later in this paper.</p>
  346. <p class="MsoNormal">&nbsp;</p>
  347. <p class="MsoNormal">ASL code is never executed directly by the Wmiacpi.sys
  348. driver. ASL code is always executed by the Acpi.sys driver (see the ASL
  349. information at http://www.teleport.com/~acpi/). Wmiacpi.sys will invoke Acpi.sys
  350. to call control methods that access the management data exposed by the mapping
  351. driver.</p>
  352. <p class="MsoNormal">&nbsp;</p>
  353. <p class="MsoNormal">Microsoft does not ship a .mof file that is associated with
  354. the Wmiacpi.sys driver. The only information surfaced through ACPI is the
  355. temperature zone information, which is surfaced through and associated with the
  356. Acpi.sys device driver. </p>
  357. <p class="MsoNormal">&nbsp;</p>
  358. <div style="mso-border-top-alt: solid windowtext .5pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding-left: 0in; padding-right: 0in; padding-top: 1.0pt; padding-bottom: 0in">
  359. <h1><a name="_Toc440694667">WMI Overview</a> for Windows&nbsp;2000 Instrumentation</h1>
  360. </div>
  361. <p class="MsoNormal">WMI organizes individual data items (properties) into data
  362. blocks (structures) that contain related information. Data blocks may have one
  363. or more data items. Each data item has a unique index within the data block, and
  364. each data block is named by a globally unique 128-bit number called a globally
  365. unique identifier (GUID). WMI can provide notifications to the data producer as
  366. to when to start and stop collecting the data items that compose a data block.
  367. WMI has no knowledge of the data format for individual data blocks.</p>
  368. <p class="MsoNormal">&nbsp;</p>
  369. <p class="MsoNormal">WMI functionality allows for querying all instances of a
  370. data block or a single instance of a data block. It also allows for setting all
  371. data items in an instance of a data block or a single data item within a single
  372. instance of a data block.</p>
  373. <p class="MsoNormal">&nbsp;</p>
  374. <p class="MsoNormal">In addition to queries and sets, WMI allows WMI method
  375. calls, which are functionally equivalent to an I/O control (IOCTL) call to a
  376. device. Each WMI method call is identified by a GUID and a method index for that
  377. GUID. All WMI method calls use one buffer for input and output parameters. WMI
  378. allows notifications of significant events to be delivered to interested
  379. user-mode applications. Each type of event is uniquely named by a GUID. Events
  380. may also carry a data block with additional information about the event. WMI can
  381. provide notifications to the event generator about when to enable and disable an
  382. event type.</p>
  383. <p class="MsoNormal">&nbsp;</p>
  384. <p class="MsoNormal">WMI is an open architecture that allows OEMs to define
  385. their own data blocks, methods, and events. Along with the data that composes
  386. the custom data block, the OEM must also provide a description that generally
  387. represents how a data block or WMI method is mapped to a 2-character ID. This
  388. 2&#8209;character ID is part of the names of the control methods that act upon the
  389. data block. </p>
  390. <p class="MsoNormal">&nbsp;</p>
  391. <p class="MsoNormal">For example, when a call is made to query about the data
  392. block represented by a WMI GUID, the mapper will evaluate the WQ<i>xx</i>
  393. control method (where <i>xx</i> is the 2-character ID mapped to that GUID).
  394. These mappings are defined by the ACPI code and obtained by the mapper
  395. evaluating the _WDG control method. For more information, see �ACPI Control
  396. Method Naming Conventions and Functionality� later in this paper.</p>
  397. <p class="MsoNormal">&nbsp;</p>
  398. <p class="MsoNormal">The mapping process is similar for events. The _WDG control
  399. method provides a mapping between the WMI event GUID that represents the event
  400. and the notification code specified in the ASL notify instruction. For example,
  401. when ACPI provides a callback to the mapper that a control method executed a <b>
  402. notify(mapper-device, 0x81)</b><i> </i>function<i>,</i> the mapper will look up
  403. the WMI GUID mapped to 0x81 and use this WMI GUID in building the WMI event.
  404. Before launching the WMI event, the mapper will evaluate _WED to retrieve any
  405. additional data that belongs with the event.</p>
  406. <p class="MsoNormal">&nbsp;</p>
  407. <p class="MsoNormal"><a name="_Toc409597061"><b>Loading the Mapping Driver</b></a><b>.
  408. </b>The Plug and Play ID PNP0c14 is assigned as the WMI-mapping pseudo device;
  409. the operating system device INFs (Plug and Play ID-to-device driver lookup
  410. table) point this Plug and Play ID to the ACPI-to-WMI mapping driver. To cause
  411. the ACPI-to-WMI mapping driver to load, an ACPI system needs to define one or
  412. more devices with that Plug and Play ID in the ACPI device tree. Each device
  413. declared in the ACPI device tree would have its own operating system device
  414. object with its own set of mappings. </p>
  415. <p class="MsoNormal">&nbsp;</p>
  416. <p class="MsoNormal">In this way, different sets of data blocks can be organized
  417. in the appropriate place within the device tree. This organization allows the
  418. different devices and their corresponding data blocks to come and go from the
  419. ACPI device tree. Note that if there are multiple WMI-mapping pseudo devices in
  420. the ACPI device tree, each device must have a unique value for its _UID.</p>
  421. <p class="MsoNormal">&nbsp;</p>
  422. <p class="MsoNormal"><a name="_Toc409597062"><b>Mapping Driver Functionality</b></a><b>.
  423. </b>Essentially the mapping driver will do the following:</p>
  424. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  425. </span></span>Manage all registration and unregistration with WMI and other
  426. interactions with the operating system. This registration of data and data
  427. blocks is done when the mapper gets the IRP_MN_REGINFO IRP.</p>
  428. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  429. </span></span>At WMI initialization time, the mapping driver will query an ACPI
  430. method for the list of data block, event, and method GUIDs it supports, as well
  431. as the mapping from the GUID to control method IDs. With this information, the
  432. mapping driver will register those GUIDs with WMI.</p>
  433. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  434. </span></span>Translate data block queries, sets, and method call I/O IRPs into
  435. the appropriate ACPI control method call.</p>
  436. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  437. </span></span>Receive notifications from the ACPI event handler control methods
  438. and relaunch them as WMI events.</p>
  439. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  440. </span></span>Translate strings between ASCIZ and UNICODE for data blocks marked
  441. as wholly composed of a string.</p>
  442. <p class="Le">&nbsp;</p>
  443. <div style="mso-border-top-alt: solid windowtext .5pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding-left: 0in; padding-right: 0in; padding-top: 1.0pt; padding-bottom: 0in">
  444. <h1><a name="_Toc440694668">ACPI-to-WMI Mapper Goals</a> for Windows&nbsp;2000
  445. Instrumentation</h1>
  446. </div>
  447. <p class="MsoNormal">The following list describes the goals for the ACPI-to-WMI
  448. mapper:</p>
  449. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  450. </span></span>Expose data maintained by the hardware or firmware and accessible
  451. through ACPI to user-mode instrumentation data consumers, such as WBEM or DMI.</p>
  452. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  453. </span></span>Allow specific ACPI control methods to be called from a user-mode
  454. instrumentation data consumer or hardware configuration application�for example,
  455. from a control panel applet.</p>
  456. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  457. </span></span>Deliver specific ACPI events to all user-mode callers that request
  458. notification of that particular event.</p>
  459. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  460. </span></span>Allow OEMs to include OEM-specific data blocks, user-mode�callable
  461. ACPI control methods, and events without requiring any changes to the
  462. ACPI-to-WMI mapper.</p>
  463. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  464. </span></span>Allow general-purpose data consumer applications�those written
  465. without any special knowledge of the data blocks exposed by a particular
  466. machine�to be able to access and understand the data blocks, user-mode�callable
  467. ACPI control methods, and events being mapped�including those that are OEM
  468. specific.</p>
  469. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  470. </span></span>Define standard data block formats, user-mode�callable ACPI
  471. control methods, events and their WMI GUID mappings for common data blocks, and
  472. callable control methods and events expected to be provided by all OEMs. This
  473. can include dynamic data and functions identified by the industry in the SMBIOS
  474. specification and other specifications.</p>
  475. <p class="Le">&nbsp;</p>
  476. <p class="MsoNormal">These goals are achieved by having supporting code in the
  477. ACPI-to-WMI mapper (Wmiacpi.sys) as well as in the core ACPI code itself (Acpi.sys).</p>
  478. <p class="MsoNormal">&nbsp;</p>
  479. <p class="MsoNormal">The following are <i>not</i> goals for the ACPI-to-WMI
  480. mapper:</p>
  481. <p class="MsoListBullet" style="page-break-after: avoid">
  482. <span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  483. </span></span>To have specific knowledge about any data block that passes
  484. through the mapper.</p>
  485. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  486. </span></span>To provide interfaces specifically for SMBIOS data and functions.
  487. The mapper is an open architecture that is not restricted to SMBIOS data and
  488. functionality.</p>
  489. <p class="Le">&nbsp;</p>
  490. <p class="MsoNormal"><a name="_Toc440962623"><b>How SMBIOS-provided information
  491. is handled</b></a><b>. </b>Vendors who want to provide OEM and system-specific
  492. instrumentation data may choose to use SMBIOS as the mechanism. To use the
  493. capabilities of the WMI infrastructure to surface this SMBIOS data, they must
  494. conform to any SMBIOS version between 2.0 and 2.2. (Microsoft intends to support
  495. future revisions of SMBIOS as and when they appear. To date, we have only one
  496. SMBIOS 2.2 machine for testing). This allows the Microsoft Win32<span style="font-size: 8.0pt"></span>
  497. provider�which is shipped with Windows&nbsp;2000 and future versions of Windows and
  498. is available as an update to Windows&nbsp;98�to populate almost all of the SMBIOS-provided
  499. information into the CIMv2 namespace. In particular, almost all of the
  500. information is put into Win32 classes. Some of these Win32 classes are derived
  501. from the CIMv2.1 physical MOF. </p>
  502. <p class="MsoNormal">&nbsp;</p>
  503. <p class="MsoNormal">The one exception where SMBIOS information will not be
  504. automatically populated by the Win32 provider into the CIMv2 namespace is SMBIOS
  505. vendor-specific data. Such SMBIOS vendor-defined data will be placed in a
  506. �VendorBucket� class in a �Root\VendorDefined� namespace, and will not be
  507. available in the CIMv2 namespace by default. Any system vendor who wants to
  508. provide such data must write a provider that will interpret this data.</p>
  509. <p class="MsoNormal">&nbsp;</p>
  510. <p class="MsoNormal">The SMBIOS data is read only once, either at boot time in
  511. Windows&nbsp;2000 or post boot on Windows&nbsp;98. Dynamic updates that are made to the
  512. SMBIOS data after it has been read will not be reflected in the namespaces in
  513. this implementation. Microsoft is working with the industry to define standard
  514. ACPI methods for dynamic updates.</p>
  515. <p class="MsoNormal">&nbsp;</p>
  516. <p class="MsoNormal">The SMBIOS raw data will be available as a WMI data block
  517. in Windows&nbsp;2000 and as a flat file in Windows&nbsp;98. This data will be interpreted
  518. and populated into the namespaces by the Win32 provider.</p>
  519. <p class="MsoNormal">&nbsp;</p>
  520. <p class="MsoNormal"><b>Note:</b> The Win32 provider capabilities used to read
  521. and populate SMBIOS data as described above will be available in Windows&nbsp;2000
  522. Beta 3.</p>
  523. <p class="MsoNormal">&nbsp;</p>
  524. <div style="mso-border-top-alt: solid windowtext .5pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding-left: 0in; padding-right: 0in; padding-top: 1.0pt; padding-bottom: 0in">
  525. <h1><a name="_Toc409597063">ACPI Control Method Naming Conventions and
  526. Functionality</a> for Windows&nbsp;2000 Instrumentation</h1>
  527. </div>
  528. <p class="MsoNormal">The <a name="_Toc409597064">Data Block GUID Mapping control
  529. method</a> named _WDG evaluates to a buffer that has the GUID mapping
  530. information for data blocks, events, and WMI methods. The result of the
  531. evaluation is a buffer containing an array of the following structure. </p>
  532. <p class="MsoNormal">&nbsp;</p>
  533. <p class="Ex" style="page-break-after: avoid">typedef struct</p>
  534. <p class="Ex" style="page-break-after: avoid">{</p>
  535. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp; GUID guid;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
  536. GUID that names data block</p>
  537. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp; union</p>
  538. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp; {</p>
  539. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CHAR ObjectId[2];&nbsp; //
  540. 2-character ACPI ID&nbsp; (Data Blocks and Methods)</p>
  541. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct </p>
  542. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
  543. <p class="Ex" style="page-break-after: avoid; margin-right: -42.0pt">
  544. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UCHAR NotificationValue;&nbsp; // Byte value passed by event handler
  545. control method</p>
  546. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UCHAR Reserved[1];</p>
  547. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } NotifyId;</p>
  548. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; }</p>
  549. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp; USHORT InstanceCount;&nbsp; //
  550. Number of separate instances of data block</p>
  551. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp; USHORT Flags;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
  552. Flags</p>
  553. <p class="Ex">};</p>
  554. <p class="Ex">&nbsp;</p>
  555. <p class="Ex">// Set this flag if the WCxx control method should be run to
  556. whenever the first </p>
  557. <p class="Ex">// data consumer is interested in collecting the data block and
  558. whenever the last data </p>
  559. <p class="Ex">// consumer is no longer interested.</p>
  560. <p class="Ex">&nbsp;</p>
  561. <p class="Ex">#define WMIACPI_REGFLAG_EXPENSIVE&nbsp;&nbsp; 0x1</p>
  562. <p class="Ex">&nbsp;</p>
  563. <p class="Ex">// Set this flag if the GUID represents a set of WMI method calls
  564. and not a data block</p>
  565. <p class="Ex">&nbsp;</p>
  566. <p class="Ex">#define WMIACPI_REGFLAG_METHOD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x2</p>
  567. <p class="Ex">&nbsp;</p>
  568. <p class="Ex">// Set this flag if the data block is wholly composed of a string
  569. and should be </p>
  570. <p class="Ex">// translated from ASCIZ to UNICODE in returning queries and from
  571. UNICODE to ASCIZ </p>
  572. <p class="Ex">// when passing sets</p>
  573. <p class="Ex">&nbsp;</p>
  574. <p class="Ex">#define WMIACPI_REGFLAG_STRING&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x04</p>
  575. <p class="Ex">&nbsp;</p>
  576. <p class="Ex">// Set this flag if the guid maps to an event rather than a data
  577. block or method</p>
  578. <p class="Ex">&nbsp;</p>
  579. <p class="Ex">#define WMIACPI_REGFLAG_EVENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x08</p>
  580. <p class="Ex">&nbsp;</p>
  581. <p class="Le">&nbsp;</p>
  582. <p class="MsoNormal">Each element in the array describes the mapping of a WMI
  583. data block GUID to a 2-letter ACPI method identifier used to compose the method
  584. names that operate on the data block or on the notification value used in the
  585. ASL <b>Notify</b> operation. Each element of the array also contains the number
  586. of instances of the data block that exist and any flags that are set.</p>
  587. <p class="MsoNormal">&nbsp;</p>
  588. <p class="MsoNormal">This control method is required.</p>
  589. <p class="MsoNormal">&nbsp;</p>
  590. <p class="MsoNormal"><a name="_Toc409597067">The following table summarizes the
  591. information for each control method described later in this section.</a></p>
  592. <p class="MsoNormal">&nbsp;</p>
  593. <p class="Tt">Control Method Summary</p>
  594. <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse">
  595. <tr>
  596. <td width="120" valign="top" style="width: 1.25in; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  597. <p class="Thf">Control method</td>
  598. <td width="96" valign="top" style="width: 1.0in; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  599. <p class="Th">Object name</td>
  600. <td width="103" valign="top" style="width: 77.4pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  601. <p class="Th">Parameters</td>
  602. <td width="281" valign="top" style="width: 210.6pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  603. <p class="Th">Control method required</td>
  604. </tr>
  605. <tr>
  606. <td width="120" valign="top" style="width: 1.25in; padding: 0in">
  607. <p class="Tpf">Data Block Query</td>
  608. <td width="96" valign="top" style="width: 1.0in; padding: 0in">
  609. <p class="Th"><span style="font-weight: normal">WQ<i>xx</i></span></td>
  610. <td width="103" valign="top" style="width: 77.4pt; padding: 0in">
  611. <p class="Th"><span style="font-weight: normal">ULONG</span></td>
  612. <td width="281" valign="top" style="width: 210.6pt; padding: 0in">
  613. <p class="Th"><span style="font-weight: normal">Yes.</span></td>
  614. </tr>
  615. <tr>
  616. <td width="120" valign="top" style="width: 1.25in; padding: 0in">
  617. <p class="Tpf">Data Block Set</td>
  618. <td width="96" valign="top" style="width: 1.0in; padding: 0in">
  619. <p class="Tp">WS<i>xx</i></td>
  620. <td width="103" valign="top" style="width: 77.4pt; padding: 0in">
  621. <p class="Tp">ULONG, buffer</td>
  622. <td width="281" valign="top" style="width: 210.6pt; padding: 0in">
  623. <p class="Tp">No. Not required for data blocks that are read&nbsp;only.</td>
  624. </tr>
  625. <tr>
  626. <td width="120" valign="top" style="width: 1.25in; padding: 0in">
  627. <p class="Tpf">Data Item Set</td>
  628. <td width="96" valign="top" style="width: 1.0in; padding: 0in">
  629. <p class="Tp">Not supported</td>
  630. <td width="103" valign="top" style="width: 77.4pt; padding: 0in">
  631. <p class="Tp">&nbsp;</td>
  632. <td width="281" valign="top" style="width: 210.6pt; padding: 0in">
  633. <p class="Tp">&nbsp;</td>
  634. </tr>
  635. <tr>
  636. <td width="120" valign="top" style="width: 1.25in; padding: 0in">
  637. <p class="Tpf">Method Execution</td>
  638. <td width="96" valign="top" style="width: 1.0in; padding: 0in">
  639. <p class="Tp">WM<i>xx</i></td>
  640. <td width="103" valign="top" style="width: 77.4pt; padding: 0in">
  641. <p class="Tp">ULONG, method&nbsp;ID, <br>
  642. buffer</td>
  643. <td width="281" valign="top" style="width: 210.6pt; padding: 0in">
  644. <p class="Tp">Yes. Required for data blocks specified in the data block GUID
  645. mapping array and that have the WMIACPI_REG_METHOD flag set.</td>
  646. </tr>
  647. </table>
  648. <p class="MsoNormal">&nbsp;</p>
  649. <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse">
  650. <tr>
  651. <td width="120" valign="top" style="width: 1.25in; padding: 0in">
  652. <p class="Tpf">Event Enable and Disable</td>
  653. <td width="96" valign="top" style="width: 1.0in; padding: 0in">
  654. <p class="Tp">WE<i>xx</i></td>
  655. <td width="103" valign="top" style="width: 77.4pt; padding: 0in">
  656. <p class="Tp">UCHAR</td>
  657. <td width="281" valign="top" style="width: 210.6pt; padding: 0in">
  658. <p class="Tp">No. Support only when keeping the event enabled incurs
  659. significant overhead.</td>
  660. </tr>
  661. <tr>
  662. <td width="120" valign="top" style="width: 1.25in; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  663. <p class="Tpf">Data Collection <br>
  664. Enable and Disable</td>
  665. <td width="96" valign="top" style="width: 1.0in; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  666. <p class="Tp">WC<i>xx</i></td>
  667. <td width="103" valign="top" style="width: 77.4pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  668. <p class="Tp">UCHAR</td>
  669. <td width="281" valign="top" style="width: 210.6pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  670. <p class="Tp">No. Support only when data collecting for the data block
  671. incurs significant overhead.</td>
  672. </tr>
  673. </table>
  674. <p class="Le">&nbsp;</p>
  675. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  676. </span></span><b>Data Block Query Control Method. </b>If the Data Block GUID
  677. Mapping control method describes a data block that does not have the
  678. WMIACPI_REG_METHOD flag set, there needs to be a control method that evaluates
  679. to the contents of an instance of the data block. </p>
  680. <p class="Lp1">By convention, the name of the object is WQ<i>xx</i>, where <i>xx</i>
  681. is the 2-character ID that maps to the GUID being queried. One parameter is
  682. passed to the method�the index of the instance, which is of type ULONG. Data
  683. blocks registered with only a single instance can ignore the parameter. If the
  684. result of the evaluation of the WQ<i>xx</i> method is a string, then the mapper
  685. will convert that string to UNICODE so that it can be understood by WMI. </p>
  686. <p class="Lp1">This control method is required.</p>
  687. <p class="MsoListBullet"><a name="_Toc409597068">
  688. <span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  689. </span></span><b>Data Block Set Control Method</b></a><b>. </b>If the Data Block
  690. GUID Mapping control method describes a data block that does not have the
  691. WMIACPI_REG_METHOD flag set, there needs to be a control method that evaluates
  692. to the contents of an instance of the data block. </p>
  693. <p class="Lp1">By convention, the name of the object is WS<i>xx</i>, where <i>xx</i>
  694. is the 2-character ID that maps to the GUID being set. Two parameters are passed
  695. to the method; one is a ULONG that is the index of the instance, and the other
  696. is a buffer that contains the new values for the data block. </p>
  697. <p class="Lp1">If the GUID for the data block is registered with the
  698. WMIACPI_REGFLAG_STRING flag, then the mapper assumes that the data block passed
  699. is wholly composed of a single string and will convert that string from UNICODE
  700. to ASCIZ so that it can be understood by the WS<i>xx</i> control method. </p>
  701. <p class="Lp1">This control method is not required for those data blocks that
  702. are read only. </p>
  703. <p class="Lp1">Because the mapper is unaware of the format of the data block
  704. passed by the caller of the WMI method, it will pass the buffer as a single
  705. buffer parameter to the WM<i>xx</i> control method. The control method can use
  706. the ASL instructions <b>CreateBitField</b>, <b>CreateDWordField</b>, <b>
  707. CreateField</b>, and <b>CreateWordField</b> to break up the buffer into its
  708. parts</p>
  709. <p class="MsoListBullet"><a name="_Toc409597069">
  710. <span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  711. </span></span><b>Data Item Set Control Method</b></a><b>. </b>Setting of
  712. individual data items within a data block is not supported. Typically, data
  713. items that can be modified should be placed in their own data block or the
  714. entire data block should be modified.</p>
  715. <p class="MsoListBullet"><a name="_Toc409597070">
  716. <span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  717. </span></span><b>Method Execution Control Method</b></a><b>. </b>If the Data
  718. Block GUID Mapping control method describes a data block that does have the
  719. WMIACPI_REG_METHOD flag set, there needs to be a control method that performs
  720. the action required of the method. </p>
  721. <p class="Lp1">By convention, the name of the control method is WM<i>xx</i>,
  722. where <i>xx</i> is the 2-character ID that maps to the GUID. This method call
  723. has three parameters; the first is a ULONG that has the instance index being
  724. executed; the second contains the method ID for the method being executed; and
  725. the third is a buffer that contains the input for the method call. </p>
  726. <p class="Lp1">If the GUID for the WMI method is registered with the
  727. WMIACPI_REGFLAG_STRING flag, then the mapper assumes that buffer passed in is a
  728. string. The mapper will convert the incoming string from UNICODE to ASCIZ. </p>
  729. <p class="Lp1">If the result of the WM<i>xx</i> control method is a string, the
  730. mapper will convert the result string from ASCIZ to UNICODE. The return value of
  731. the WM<i>xx</i> method should be a buffer with the result of the method call.
  732. </p>
  733. <p class="Lp1">This control method is<b> </b>required for those data blocks
  734. specified in the Data Block GUID Mapping array that have the WMIACPI_REG_METHOD
  735. flag set. </p>
  736. <p class="Lp1">Because the mapper is unaware of the format of the data block
  737. passed by the caller of the WMI method, it will pass the buffer as a single
  738. buffer parameter to the WM<i>xx</i> control method. The control method can use
  739. the ASL instructions <b>CreateBitField</b>, <b>CreateDWordField</b>, <b>
  740. CreateField</b>, and <b>CreateWordField</b> to break the buffer into its parts.</p>
  741. <p class="MsoListBullet"><a name="_Toc409597071">
  742. <span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  743. </span></span><b>Event Enable and Disable Control Method</b></a><b>. </b>For
  744. each event specified in the Event GUID Mapping control method that has the
  745. WMIACPI_REG_EXPENSIVE flag set, there needs to be a control method that is
  746. invoked whenever launching of the event should be enabled and disabled. </p>
  747. <p class="Lp1">By convention, the control method is named WE<i>xx</i>, where <i>
  748. xx</i> is the hex value of the notification code passed by the event handler
  749. control method. This method has one parameter, a UCHAR that has a value of 0 if
  750. the event is to be disabled or a nonzero value if it is to be enabled. </p>
  751. <p class="Lp1">This method is optional and should only be supported if keeping
  752. the event enabled incurs significant overhead.</p>
  753. <p class="MsoListBullet"><a name="_Toc409597072">
  754. <span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  755. </span></span><b>Data Collection Enable and Disabl</b></a><b>e Control Method.
  756. </b>For each data block described in the Data Block GUID Mapping control method
  757. that has the WMIACPI_REG_EXPENSIVE flag set, there needs to be a control method
  758. that is invoked whenever collection of the data that composes the data block
  759. should be enabled and disabled </p>
  760. <p class="Lp1">By convention, the control method is named WC<i>xx</i>, where <i>
  761. xx</i> is the 2-character ID that maps to the GUID. This method has one
  762. parameter, a UCHAR that has a value of 0 if data block collection is to be
  763. disabled or a nonzero value if it is to be enabled. </p>
  764. <p class="Lp1">This method is optional and should only be supported if
  765. collecting the data for the data block incurs significant overhead.</p>
  766. <p class="MsoListBullet"><a name="_Toc409597073">
  767. <span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  768. </span></span><b>Additional Event Data</b></a><b>. </b>The _WED control method
  769. is evaluated by the mapper in response to receiving a notification from a
  770. control method. The results of the evaluation are passed as part of the WMI
  771. event information. This mechanism allows additional data to be included with an
  772. event. </p>
  773. <p class="Lp1">The control method takes one parameter, which is the notification
  774. code that caused the notification to occur. If the result of the _WED control
  775. method is a string, then the string is converted from ASCIZ to UNICODE before
  776. launching the WMI event.</p>
  777. <p class="Le">&nbsp;</p>
  778. <div style="mso-border-top-alt: solid windowtext .5pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding-left: 0in; padding-right: 0in; padding-top: 1.0pt; padding-bottom: 0in">
  779. <h1><a name="_Toc409597075">Data Block Design </a>for Windows&nbsp;2000
  780. Instrumentation </h1>
  781. </div>
  782. <p class="MsoNormal"><b>Design Considerations. </b>Consider the following in
  783. designing data blocks for instrumentation under Windows&nbsp;2000:</p>
  784. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  785. </span></span>Data items that are read-only and are commonly used together
  786. should be combined into a single data block.</p>
  787. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  788. </span></span>Data items that are strings must be segregated into their own data
  789. block and registered with the WMIACPI_REGFLAG_STRING flag set so that the mapper
  790. can convert between ASCIZ and UNICODE.</p>
  791. <p class="MsoListBullet"><span style="font-family: Symbol"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  792. </span></span>Data items that can be set individually should be segregated into
  793. their own data blocks. For example, a set of data items that must be set all at
  794. the same time can be combined into a single data block.</p>
  795. <p class="Le">&nbsp;</p>
  796. <p class="MsoNormal"><a name="_Toc409597076"><b>MOF</b></a><b> Data Types. </b>
  797. The Managed Object Format (MOF) for the data blocks implemented can be supplied
  798. as either a resource attached to a file or as the buffer that results from the
  799. evaluation of a control method. To establish the former, either bind the
  800. resource to the Wmiacpi.sys image or establish a REG_EXPAND_SZ registry value
  801. named <b>MofImagePath</b> under the WMIACPI service key. The contents of the
  802. value is a path to the image file that contains the resource. In either case,
  803. the resource must be named <b>MofResourceName</b>.</p>
  804. <p class="MsoNormal">&nbsp;</p>
  805. <p class="MsoNormal">The buffer resulting from the evaluation of the WQ<i>xx</i>
  806. control method assigned to the binary MOF GUID describes all data blocks, WMI
  807. methods, and events for the device in a compressed binary format. This binary
  808. data is created by building a text file using the MOF language and compiling it
  809. with the MOF compiler.</p>
  810. <p class="MsoNormal">&nbsp;</p>
  811. <p class="MsoNormal">MOF data types are very rich. MOF supports the basic data
  812. types of 8-, 16-, 32-, and 64-bit signed and unsigned integers, Boolean terms,
  813. floating points, strings, and UTC datetimes. Embedded classes�that is,
  814. structures that can contain basic data types and other embedded classes�are also
  815. supported. In addition, fixed and variable length arrays of basic data types and
  816. embedded classes are supported. </p>
  817. <p class="MsoNormal">&nbsp;</p>
  818. <p class="MsoNormal">The MOF language defines the data types shown in the
  819. following table.</p>
  820. <p class="MsoNormal">&nbsp;</p>
  821. <p class="Tt">MOF Data Types</p>
  822. <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse">
  823. <tr>
  824. <td width="200" valign="top" style="width: 150.0pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  825. <p class="Thf">Data types</td>
  826. <td width="407" valign="top" style="width: 305.4pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  827. <p class="Thf">Data format</td>
  828. </tr>
  829. <tr>
  830. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  831. <p class="Tpf">String</td>
  832. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  833. <p class="Tpf">Null terminated ANSI string</td>
  834. </tr>
  835. <tr>
  836. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  837. <p class="Tpf">sint32</td>
  838. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  839. <p class="Tpf">Signed 32-bit integer </td>
  840. </tr>
  841. <tr>
  842. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  843. <p class="Tpf">uint32</td>
  844. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  845. <p class="Tpf">Unsigned 32-bit integer</td>
  846. </tr>
  847. <tr>
  848. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  849. <p class="Tpf">sint16 </td>
  850. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  851. <p class="Tpf">Signed 16-bit integer </td>
  852. </tr>
  853. <tr>
  854. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  855. <p class="Tpf">uint16 </td>
  856. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  857. <p class="Tpf">Unsigned 16-bit integer </td>
  858. </tr>
  859. <tr>
  860. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  861. <p class="Tpf">sint64</td>
  862. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  863. <p class="Tpf">Signed 64-bit integer</td>
  864. </tr>
  865. <tr>
  866. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  867. <p class="Tpf">uint64</td>
  868. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  869. <p class="Tpf">Unsigned 64-bit integer</td>
  870. </tr>
  871. <tr>
  872. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  873. <p class="Tpf">sint8</td>
  874. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  875. <p class="Tpf">Signed 8-bit character </td>
  876. </tr>
  877. <tr>
  878. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  879. <p class="Tpf">uint8</td>
  880. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  881. <p class="Tpf">Unsigned 8-bit integer</td>
  882. </tr>
  883. <tr>
  884. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  885. <p class="Tpf">Datetime</td>
  886. <td width="407" valign="top" style="width: 305.4pt; padding: 0in">
  887. <p class="Tpf">25-character string used to specify absolute dates or time
  888. intervals. </td>
  889. </tr>
  890. <tr>
  891. <td width="200" valign="top" style="width: 150.0pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  892. <p class="Tpf">Boolean</td>
  893. <td width="407" valign="top" style="width: 305.4pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  894. <p class="Tpf">Byte where 0 is FALSE, != 0 is TRUE </td>
  895. </tr>
  896. </table>
  897. <p class="Le">&nbsp;</p>
  898. <p class="MsoNormal"><b>Important: </b>Because the MOF data types are much
  899. richer than those for ACPI control methods, the control method must be careful
  900. to pack the data blocks correctly within an ACPI buffer. The control method can
  901. also restrict itself to using only common data types.</p>
  902. <p class="MsoNormal">&nbsp;</p>
  903. <p class="MsoNormal">Each MOF class represents a data block and may contain one
  904. or more properties that represent data items within the data block. A MOF class
  905. would hold all information needed to parse a data block returned from the mapper.
  906. In addition, the MOF language allows rich meta-data to be included as qualifiers
  907. on properties and classes. Some qualifiers are required, but most are optional.</p>
  908. <p class="MsoNormal">&nbsp;</p>
  909. <p class="MsoNormal">Class and data item qualifiers are defined in the following
  910. table.</p>
  911. <p class="MsoNormal">&nbsp;</p>
  912. <p class="Tt">Class and Data Item Qualifiers</p>
  913. <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse">
  914. <tr>
  915. <td width="200" valign="top" style="width: 150.0pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  916. <p class="Thf">Qualifier</td>
  917. <td width="400" valign="top" style="width: 300.0pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  918. <p class="Thf">Description</td>
  919. <td style="border: medium none; padding: 0in" width="7">
  920. <p class="MsoNormal">&nbsp;</td>
  921. </tr>
  922. <tr>
  923. <td width="200" valign="top" style="width: 150.0pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  924. <p class="Thf">Class qualifiers:</td>
  925. <td width="400" valign="top" style="width: 300.0pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  926. <p class="Thf"><span style="font-size: 10.5pt">&nbsp;</span></td>
  927. <td style="border: medium none; padding: 0in" width="7">
  928. <p class="MsoNormal">&nbsp;</td>
  929. </tr>
  930. <tr>
  931. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  932. <p class="Tpf">[guid(�<i>guid-string</i>�)] </td>
  933. <td width="400" valign="top" style="width: 300.0pt; padding: 0in">
  934. <p class="Tpf">Declares the GUID that represents the class within WMI. This
  935. qualifier is required.</td>
  936. <td style="border: medium none; padding: 0in" width="7">
  937. <p class="MsoNormal">&nbsp;</td>
  938. </tr>
  939. <tr>
  940. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  941. <p class="Tpf">[Dynamic] </td>
  942. <td width="400" valign="top" style="width: 300.0pt; padding: 0in">
  943. <p class="Tpf">Required for WBEM.</td>
  944. <td style="border: medium none; padding: 0in" width="7">
  945. <p class="MsoNormal">&nbsp;</td>
  946. </tr>
  947. <tr>
  948. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  949. <p class="Tpf">[WMI] </td>
  950. <td width="400" valign="top" style="width: 300.0pt; padding: 0in">
  951. <p class="Tpf">Required for WBEM.</td>
  952. <td style="border: medium none; padding: 0in" width="7">
  953. <p class="MsoNormal">&nbsp;</td>
  954. </tr>
  955. <tr>
  956. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  957. <p class="Tpf">[Provider(�WmiProv�)] </td>
  958. <td width="400" valign="top" style="width: 300.0pt; padding: 0in">
  959. <p class="Tpf">Required for WBEM.</td>
  960. <td style="border: medium none; padding: 0in" width="7">
  961. <p class="MsoNormal">&nbsp;</td>
  962. </tr>
  963. <tr>
  964. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  965. <p class="Tpf">[Description(<i>�description-text�)</i>]<i> </i></td>
  966. <td width="400" valign="top" style="width: 300.0pt; padding: 0in">
  967. <p class="Tpf">Specifies description text for the class or property in the
  968. locale specified for the locale qualifier.</td>
  969. <td style="border: medium none; padding: 0in" width="7">
  970. <p class="MsoNormal">&nbsp;</td>
  971. </tr>
  972. <tr>
  973. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  974. <p class="Tpf">[WmiExpense(<i>expense-value</i>)] </td>
  975. <td width="400" valign="top" style="width: 300.0pt; padding: 0in">
  976. <p class="Tpf">Specifies the quantity of system resources required in order
  977. to collect data in the data block; <i>expense-value</i> is defined to be the
  978. average number of CPU cycles needed to collect the data block. If this
  979. qualifier is not specified, then the <i>expense-value</i> is assumed to be
  980. 0.</td>
  981. <td style="border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext" width="7">
  982. <p class="MsoNormal">&nbsp;</td>
  983. </tr>
  984. <tr>
  985. <td width="200" valign="top" style="width: 150.0pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  986. <p class="Thf">Data item qualifiers:</td>
  987. <td width="407" colspan="2" valign="top" style="width: 305.4pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: 1.0pt solid windowtext; padding: 0in; background: #CCCCCC">
  988. <p class="Thf"><span style="font-size: 10.5pt">&nbsp;</span></td>
  989. </tr>
  990. <tr>
  991. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  992. <p class="Tpf">[read] </td>
  993. <td width="407" colspan="2" valign="top" style="width: 305.4pt; padding: 0in">
  994. <p class="Tpf">Specifies that the data item may be read.</td>
  995. </tr>
  996. <tr>
  997. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  998. <p class="Tpf">[write] </td>
  999. <td width="407" colspan="2" valign="top" style="width: 305.4pt; padding: 0in">
  1000. <p class="Tpf">Specifies that the data item may be written.</td>
  1001. </tr>
  1002. <tr>
  1003. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  1004. <p class="Tpf">[WmiDataID(<i>data-item-ID</i>)] </td>
  1005. <td width="407" colspan="2" valign="top" style="width: 305.4pt; padding: 0in">
  1006. <p class="Tpf">Specifies the data item ID for the data item. This qualifier
  1007. is required.</td>
  1008. </tr>
  1009. <tr>
  1010. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  1011. <p class="Tpf"><span style="layout-grid-mode: line">[WmiScale(<i>scale-factor</i>)]
  1012. </span></td>
  1013. <td width="407" colspan="2" valign="top" style="width: 305.4pt; padding: 0in">
  1014. <p class="Tpf"><span style="layout-grid-mode: line">Specifies the scaling
  1015. factor to use when displaying the data. Before displaying the data returned
  1016. from a query of the data item, it is multiplied by 10 to the power of <i>
  1017. scale-factor</i>. If this qualifier is not specified, then the <i>
  1018. scale-factor</i> is assumed to be 0.</span></td>
  1019. </tr>
  1020. <tr>
  1021. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  1022. <p class="Tpf">[WmiComplexity(�<i>complexity-category�</i>)] </td>
  1023. <td width="407" colspan="2" valign="top" style="width: 305.4pt; padding: 0in">
  1024. <p class="Tpf">Specifies the level of detail associated with the counter. <i>
  1025. Complexity-category</i> can have the value of �Novice� for the information
  1026. that anyone can understand, �Advanced� for information that is useful for
  1027. advanced users, �Expert� for information that is useful to only expert
  1028. users, and �Wizard� for information that is useful for the data provider
  1029. designer. If this qualifier is not specified, then a <i>complexity-category</i>
  1030. of �Novice� is assumed.</td>
  1031. </tr>
  1032. <tr>
  1033. <td width="200" valign="top" style="width: 150.0pt; padding: 0in">
  1034. <p class="Tpf">[WmiVolatility(<i>validity-interval</i>)] </td>
  1035. <td width="407" colspan="2" valign="top" style="width: 305.4pt; padding: 0in">
  1036. <p class="Tpf">Specifies how often this data item value is updated
  1037. internally. <i>Validity-interval</i> is defined in units of milliseconds, so
  1038. a <i>validity-interval</i> of 1000 would mean that the data item is updated
  1039. internally every second. Data consumers can use this measure to determine
  1040. how frequently it should poll for changes in a data item. If this qualifier
  1041. is not specified, then no assumption on the length of validity for a data
  1042. item can be made.</td>
  1043. </tr>
  1044. <tr>
  1045. <td width="200" valign="top" style="width: 150.0pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  1046. <p class="Tpf">[WmiSizeIs(�<i>property-name</i>�)] </td>
  1047. <td width="407" colspan="2" valign="top" style="width: 305.4pt; border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1.0pt solid windowtext; padding: 0in">
  1048. <p class="Tpf">Specifies the property within the current class that has the
  1049. count of the number of array elements (not bytes) contained in a variable
  1050. length array.</td>
  1051. </tr>
  1052. </table>
  1053. <p class="Le">&nbsp;</p>
  1054. <p class="MsoNormal" style="margin-right: -24.0pt">The order that the data items
  1055. are laid out in the data block is controlled by the data item ID. Data item IDs
  1056. must be allocated contiguously starting with data item ID 1. The data item order
  1057. specified in the MOF is not relevant. </p>
  1058. <p class="MsoNormal" style="margin-right: -24.0pt">&nbsp;</p>
  1059. <p class="MsoNormal" style="margin-right: -24.0pt">MOF supports arrays of the
  1060. basic types shown in the �MOF Data Types� table shown earlier. A variable sized
  1061. array must have a <b>WmiSizeIs()</b> qualifier that specifies the property that
  1062. has the number of elements in the array. </p>
  1063. <p class="MsoNormal">&nbsp;</p>
  1064. <p class="MsoNormal"><a name="_Toc409597077"><b>Data Block Format</b></a><b>.
  1065. </b>The format of the data block buffer returned from the query control method
  1066. and passed into the set control method must be consistent with the description
  1067. of it specified by the MOF for that data block with respect to the order and
  1068. size of the data items within the data block<span style="layout-grid-mode: line">.</span>
  1069. The Boolean data type is 1&nbsp;byte in length and has a value of 0 for FALSE and
  1070. non-zero value for TRUE. The string data type is a C-style ANSI null-terminated
  1071. string.</p>
  1072. <p class="MsoNormal">&nbsp;</p>
  1073. <p class="MsoNormal"><a name="_Toc409597078"><b>Standard Data Blocks, Methods,
  1074. and Events</b></a><b>. </b>Additional data blocks, events, and methods will be
  1075. defined in the future; they should be implemented by all OEMs in order to ensure
  1076. a minimum of functionality on all PCs. In the future, an industry standard will
  1077. be defined for the globally unique GUIDs to be assigned to the data blocks. The
  1078. WMI component within Windows will contain the MOF definition for these standard
  1079. data blocks so it does not need to be part of the result from the binary .mof
  1080. query.</p>
  1081. <p class="MsoNormal">&nbsp;</p>
  1082. <p class="MsoNormal"><a name="_Toc440694672"><b>Custom Data Blocks, Methods and
  1083. Events</b></a><b>. </b>Custom or OEM-specific data blocks, events, and methods
  1084. can be added by including them in the result of the _WDG method. The GUIDs that
  1085. are assigned must be globally unique so they can be generated by a tool such as
  1086. Guidgen or Uuidgen, which are provided with the WMI information in the Microsoft
  1087. Platform SDK.</p>
  1088. <p class="MsoNormal">&nbsp;</p>
  1089. <p class="MsoNormal">The MOF definition for these custom data blocks must be
  1090. included in the results of the WQ<i>xx</i> method, where <i>xx</i> has been
  1091. mapped to the MOF Data GUID, which is the GUID that is queried and returns MOF
  1092. data�in order for applications to be able to access the data blocks. Or the MOF
  1093. could be added as a resource to Wmiacpi.sys with a name of <b>MofResourceName</b>
  1094. and a type MOFDATA. It can also be a resource in another image file with same
  1095. name and type that is pointed to by the <b>MofImagePath </b>value in the
  1096. registry key HKLM\CurrentControlSet\Services\WmiAcpi</p>
  1097. <p class="MsoNormal">&nbsp;</p>
  1098. <div style="mso-border-top-alt: solid windowtext .5pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding-left: 0in; padding-right: 0in; padding-top: 1.0pt; padding-bottom: 0in">
  1099. <h1><a name="_Toc440694673">FAQ about WMI and ACPI</a> for Windows&nbsp;2000
  1100. Instrumentation</h1>
  1101. </div>
  1102. <p class="Term1">How does WMI find ACPI/ASL code?</p>
  1103. <p class="Def1"><span style="layout-grid-mode: line">In ASL, the developer
  1104. creates a device with an _HID of </span>PNP0c14<span style="layout-grid-mode: line">.
  1105. The operating system enumerates the device and loads the Wmiacpi.sys driver on
  1106. top of it.</span></p>
  1107. <p class="Term1"><span style="layout-grid-mode: line">How does the MOF
  1108. associated with ACPI BIOS get registered?</span></p>
  1109. <p class="Def1"><span style="layout-grid-mode: line">It is either a resource
  1110. attached to Wmiacpi.sys or another image file such as a resource-only DLL.
  1111. </span></p>
  1112. <p class="Term1"><span style="layout-grid-mode: line">How does a management
  1113. application discover the classes and properties provided by ASL instrumentation?</span></p>
  1114. <p class="Def1"><span style="layout-grid-mode: line">By looking in the WMI
  1115. namespace of the schema.</span></p>
  1116. <p class="Term1"><span style="layout-grid-mode: line">Is the following true?
  1117. Because very few ACPI standards exist for instrumentation, most of the ACPI
  1118. instrumented features will appear differently on each vendor�s product, and
  1119. management applications will have to be �taught� to interpret the varying
  1120. classes and methods.</span></p>
  1121. <p class="Def1"><span style="layout-grid-mode: line">Microsoft is looking at
  1122. standardizing this. Any suggestions are appreciated.</span></p>
  1123. <p class="Term1"><span style="layout-grid-mode: line">Who provides the .mof
  1124. files for standard ACPI features such as thermal monitoring?</span></p>
  1125. <p class="Def1"><span style="layout-grid-mode: line">Windows&nbsp;2000 has a .mof
  1126. file for thermal zone temperature as part of the operating system and
  1127. instruments it within Acpi.sys, outside of the mapper.</span></p>
  1128. <p class="Def1"><span style="layout-grid-mode: line">Typically, .mof files are
  1129. compiled into .bmf files and attached to a driver as a resource. The .bmf files
  1130. can be in the ROM or on disk. WMI determines the location of the .mof
  1131. information by looking at the registry for the <b>MofImagePath</b> value under
  1132. the WMIACPI service. If this does not exist, then WMI looks at the <b>ImagePath</b>
  1133. value. If Wmiacpi.sys does not have a .mof resource, then WMI will query the
  1134. binary .mof GUID for the .mof information.</span></p>
  1135. <p class="Def1"><span style="layout-grid-mode: line">A driver may have a static
  1136. list of pre-built .mof files; if so, it can �dynamically� report one of them.
  1137. The mechanism is to report the file using a predefined GUID that returns a
  1138. binary .mof.</span></p>
  1139. <p class="Def1"><span style="layout-grid-mode: line">To dynamically build a .mof
  1140. file, a driver would have to build a .mof file and then launch the .mof
  1141. compiler, which is difficult. Currently, to do this on the machine running
  1142. Wmiacpi.sys, the <b>mofcomp</b> command can be used to load the .mof file
  1143. directly into the CIMOM database. </span></p>
  1144. <div style="mso-border-top-alt: solid windowtext .5pt; border-left: medium none; border-right: medium none; border-top: 1.0pt solid windowtext; border-bottom: medium none; padding-left: 0in; padding-right: 0in; padding-top: 1.0pt; padding-bottom: 0in">
  1145. <h1><a name="_Toc440694675"><span style="layout-grid-mode: line">ASL Methods
  1146. and Sample Code</span></a></h1>
  1147. </div>
  1148. <p class="MsoNormal"><span style="layout-grid-mode: line">The following list
  1149. represents some of the ASL methods defined by the ACPI specification. These
  1150. methods are of particular interest for systems management. None of these methods
  1151. have been implemented yet within the WMI/ACPI mapper to date. </span>A BIOS
  1152. developer, for example, could use these methods to expose data using the mapper.
  1153. <span style="layout-grid-mode: line">These methods represent good opportunities
  1154. for OEMs to differentiate their products with minimal effort:</span></p>
  1155. <p class="MsoListBullet">
  1156. <span style="font-family: Symbol; layout-grid-mode: line"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1157. </span></span><span style="layout-grid-mode: line">_ACX � Temperature threshold
  1158. at which various degrees of active cooling are engaged</span></p>
  1159. <p class="MsoListBullet">
  1160. <span style="font-family: Symbol; layout-grid-mode: line"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1161. </span></span><span style="layout-grid-mode: line">_CRT � Critical temperature
  1162. at which system will shut down</span></p>
  1163. <p class="MsoListBullet">
  1164. <span style="font-family: Symbol; layout-grid-mode: line"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1165. </span></span><span style="layout-grid-mode: line">_PSV � Temperature at which
  1166. system will throttle CPU in order to cool system</span></p>
  1167. <p class="MsoListBullet">
  1168. <span style="font-family: Symbol; layout-grid-mode: line"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1169. </span></span><span style="layout-grid-mode: line">_LID � Status of the lid
  1170. (open or closed)</span></p>
  1171. <p class="MsoListBullet">
  1172. <span style="font-family: Symbol; layout-grid-mode: line"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1173. </span></span><span style="layout-grid-mode: line">_PSR� Whether the machine
  1174. running on AC </span></p>
  1175. <p class="Le"><span style="layout-grid-mode: line">&nbsp;</span></p>
  1176. <p class="MsoNormal"><span style="layout-grid-mode: line">The same applies for
  1177. these method for Control Method Battery devices:</span></p>
  1178. <p class="MsoListBullet">
  1179. <span style="font-family: Symbol; layout-grid-mode: line"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1180. </span></span><span style="layout-grid-mode: line">_BIF � Battery information
  1181. such as model, serial number, design capacity, last full charge capacity,
  1182. technology, and battery capacity</span></p>
  1183. <p class="MsoListBullet">
  1184. <span style="font-family: Symbol; layout-grid-mode: line"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1185. </span></span><span style="layout-grid-mode: line">_BST � Battery state, battery
  1186. present rate, battery remaining capacity, and battery voltage present</span></p>
  1187. <p class="Le">&nbsp;</p>
  1188. <h2><a name="_Toc445868973"><span style="layout-grid-mode: line">ASL Sample Code
  1189. for an Event and Initiating Method</span></a></h2>
  1190. <p class="MsoNormal"><span style="layout-grid-mode: line">The following ASL code
  1191. implements an event and a method that can be called to initiate that event.</span></p>
  1192. <p class="Ex">Device(AMW0)</p>
  1193. <p class="Ex">{</p>
  1194. <p class="Ex">&nbsp;&nbsp; // pnp0c14 is Plug and Play ID assigned to WMI mapper</p>
  1195. <p class="Ex">&nbsp;&nbsp; Name(_HID, &quot;*pnp0c14&quot;)</p>
  1196. <p class="Ex">&nbsp;&nbsp; Name(_UID, 0x0)</p>
  1197. <p class="Ex">&nbsp;</p>
  1198. <p class="Ex">&nbsp;&nbsp; //</p>
  1199. <p class="Ex">&nbsp;&nbsp; // Description of data and events supported</p>
  1200. <p class="Ex">&nbsp;&nbsp; Name(_WDG, Buffer() {</p>
  1201. <p class="Ex" style="margin-right: -.75in">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x6a, 0x0f, 0xBC, 0xAB, 0xa1,
  1202. 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,</p>
  1203. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 66, 65,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object ID (BA)</p>
  1204. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1205. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x01,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags (WMIACPI_REGFLAG_EXPENSIVE)</p>
  1206. <p class="Ex">&nbsp;</p>
  1207. <p class="Ex" style="margin-right: -.75in">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x6b, 0x0f, 0xBC, 0xAB, 0xa1,
  1208. 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,</p>
  1209. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 66, 66,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object ID (BB)</p>
  1210. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1211. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x02,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags (WMIACPI_REGFLAG_METHOD)</p>
  1212. <p class="Ex">&nbsp;</p>
  1213. <p class="Ex" style="margin-right: -1.0in">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x6c, 0x0f, 0xBC, 0xAB, 0xa1,
  1214. 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,</p>
  1215. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0xb0, 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Notification ID</p>
  1216. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1217. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x08&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags (WMIACPI_REGFLAG_EVENT)</p>
  1218. <p class="Ex">&nbsp;&nbsp;&nbsp; })</p>
  1219. <p class="Ex">&nbsp;</p>
  1220. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1221. <p class="Ex">&nbsp;&nbsp;&nbsp; // Storage for the 3 instances of BA</p>
  1222. <p class="Ex">&nbsp;&nbsp;&nbsp; Name(STB0, Buffer(0x10) { </p>
  1223. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0</p>
  1224. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</p>
  1225. <p class="Ex">&nbsp;&nbsp;&nbsp; Name(STB1, Buffer(0x10) {</p>
  1226. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,1,0,0, 0,2,0,0, 0,3,0,0, 0,4,0,0</p>
  1227. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</p>
  1228. <p class="Ex">&nbsp;&nbsp;&nbsp; Name(STB2, Buffer(0x10) {</p>
  1229. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,0,1,0, 0,0,2,0, 0,0,3,0, 0,0,4,0</p>
  1230. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</p>
  1231. <p class="Ex">&nbsp;</p>
  1232. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1233. <p class="Ex">&nbsp;&nbsp;&nbsp; // Query data block</p>
  1234. <p class="Ex">&nbsp;&nbsp;&nbsp; // Arg0 has the instance being queried</p>
  1235. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(WQBA, 1) {</p>
  1236. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 0)) {</p>
  1237. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(STB0)</p>
  1238. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1239. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 1)) {</p>
  1240. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return(STB1)</p>
  1241. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1242. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 2)) {</p>
  1243. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(STB2)</p>
  1244. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1245. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1246. <p class="Ex">&nbsp;</p>
  1247. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; //</p>
  1248. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; // Set Data Block</p>
  1249. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; // Arg0 has the instance being
  1250. queried</p>
  1251. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; // Arg1 has the new value for
  1252. the data block instance</p>
  1253. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; Method(WSBA, 2) {</p>
  1254. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (LEqual(Arg0, 0)) {</p>
  1255. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(Arg1, STB0)</p>
  1256. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1257. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 1)) {</p>
  1258. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(Arg1, STB1)</p>
  1259. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1260. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 2)) {</p>
  1261. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(Arg1, STB2)</p>
  1262. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1263. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1264. <p class="Ex">&nbsp;</p>
  1265. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1266. <p class="Ex">&nbsp;&nbsp;&nbsp; // Storage for data block BB</p>
  1267. <p class="Ex">&nbsp;&nbsp;&nbsp; Name(B0ED, Buffer(0x10) { </p>
  1268. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,0,0,1, 0,0,0,2, 0,0,0,3, 0,0,0,4</p>
  1269. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</p>
  1270. <p class="Ex">&nbsp;</p>
  1271. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1272. <p class="Ex">&nbsp;&nbsp;&nbsp; // Method Execution</p>
  1273. <p class="Ex">&nbsp;&nbsp;&nbsp; // Arg0 is instance being queried</p>
  1274. <p class="Ex">&nbsp;&nbsp;&nbsp; // Arg1 is the method ID</p>
  1275. <p class="Ex">&nbsp;&nbsp;&nbsp; // Arg2 is the method data passed</p>
  1276. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(WMBB, 3) {</p>
  1277. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg1, 1))</p>
  1278. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
  1279. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(Arg3, B0ED)</p>
  1280. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notify(AMW0, 0xB0)</p>
  1281. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(Arg3)</p>
  1282. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1283. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(Arg1)</p>
  1284. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1285. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1286. <p class="Ex">&nbsp;</p>
  1287. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1288. <p class="Ex">&nbsp;&nbsp;&nbsp; // More info about an event</p>
  1289. <p class="Ex">&nbsp;&nbsp;&nbsp; // Arg0 is the event ID that was launched (�fired�)</p>
  1290. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(_WED, 1) {</p>
  1291. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 0xB0)) {</p>
  1292. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(B0ED)</p>
  1293. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1294. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1295. <p class="Ex">&nbsp;</p>
  1296. <p class="Ex">}</p>
  1297. <p class="Ex">&nbsp;</p>
  1298. <h2><a name="_Toc445868974">Sample ASL Code Embedding MOD Data in ASL</a></h2>
  1299. <p class="MsoNormal" style="page-break-after: avoid">The following&nbsp; sample ASL
  1300. code shows another example of implementing an event mechanism using ASL code.&nbsp;
  1301. It also provides an example of embedding MOF data into ASL.</p>
  1302. <p class="Ex" style="page-break-after: avoid">Device(AMW0)</p>
  1303. <p class="Ex" style="page-break-after: avoid">{</p>
  1304. <p class="Ex" style="page-break-after: avoid">//</p>
  1305. <p class="Ex" style="page-break-after: avoid">// pnp0c14 is the ID assigned by
  1306. Microsoft to the WMI to ACPI mapper</p>
  1307. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp; Name(_HID, &quot;*pnp0c14&quot;)</p>
  1308. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp; Name(_UID, 0x0)</p>
  1309. <p class="Ex" style="page-break-after: avoid">//</p>
  1310. <p class="Ex" style="page-break-after: avoid">// _WDG evaluates to a data
  1311. structure that specifies the data blocks supported</p>
  1312. <p class="Ex" style="page-break-after: avoid">// by the ACPI device.</p>
  1313. <p class="Ex" style="page-break-after: avoid; margin-right: -84.0pt">&nbsp;&nbsp;
  1314. Name(_WDG, Buffer() {</p>
  1315. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x5a, 0x0f, 0xBC, 0xAB, 0xa1,
  1316. 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,</p>
  1317. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 65, 65,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object ID (AA)</p>
  1318. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1319. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x01,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags WMIACPI_REGFLAG_EXPENSIVE</p>
  1320. <p class="Ex">&nbsp;</p>
  1321. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x5b, 0x0f, 0xBC, 0xAB, 0xa1,
  1322. 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,</p>
  1323. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 65, 66,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object ID (AB)</p>
  1324. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1325. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x02,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags WMIACPI_REGFLAG_METHOD</p>
  1326. <p class="Ex">&nbsp;</p>
  1327. <p class="Ex" style="margin-right: -78.0pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x5c, 0x0f, 0xBC, 0xAB, 0xa1,
  1328. 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,</p>
  1329. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0xa0, 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Notification ID</p>
  1330. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1331. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x08,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags (WMIACPI_REGFLAG_EVENT)</p>
  1332. <p class="Ex">&nbsp;</p>
  1333. <p class="Ex">//</p>
  1334. <p class="Ex">// This <span style="layout-grid-mode: line">GUID</span> for
  1335. returning the MOF data</p>
  1336. <p class="Ex">&nbsp;</p>
  1337. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x21, 0x12, 0x90, 0x05, 0x66,
  1338. 0xd5, 0xd1, 0x11, 0xb2, 0xf0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10,</p>
  1339. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 66, 65,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object ID (BA)</p>
  1340. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1341. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags</p>
  1342. <p class="Ex">&nbsp;</p>
  1343. <p class="Ex">&nbsp;&nbsp; })</p>
  1344. <p class="Ex">&nbsp;</p>
  1345. <p class="Ex">//</p>
  1346. <p class="Ex">// Collection control method. If Arg0 is not zero then collection
  1347. for the</p>
  1348. <p class="Ex">// data block is enabled. If Arg0 is zero then collection is
  1349. disabled. If </p>
  1350. <p class="Ex">// this method does not exist then it is assumed that collection
  1351. control is</p>
  1352. <p class="Ex">// not required. Collection control is only useful when collection
  1353. of the </p>
  1354. <p class="Ex">// data block causes overhead.</p>
  1355. <p class="Ex">&nbsp;&nbsp; Method(WCAA, 1) {</p>
  1356. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, Zero)) {</p>
  1357. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Disable collection of data</p>
  1358. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1359. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Enable collection of data</p>
  1360. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1361. <p class="Ex">&nbsp;&nbsp; }</p>
  1362. <p class="Ex">&nbsp;</p>
  1363. <p class="Ex" style="page-break-after: avoid">//</p>
  1364. <p class="Ex" style="page-break-after: avoid">// Query method for data block AA.
  1365. Arg0 has the data block instance index</p>
  1366. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp; Method(WQAA, 1) {</p>
  1367. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, Zero)) {</p>
  1368. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Query is for first
  1369. instance of data block</p>
  1370. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return(0x10)</p>
  1371. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1372. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Query is for second
  1373. instance of data block</p>
  1374. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return(0x20)</p>
  1375. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1376. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp; }</p>
  1377. <p class="Ex">&nbsp;</p>
  1378. <p class="Ex">//</p>
  1379. <p class="Ex">// Set method for data block AA. If data block is read-only then
  1380. this method</p>
  1381. <p class="Ex">// does not need to exist. Arg0 has the instance index of the data
  1382. block,</p>
  1383. <p class="Ex">// Arg1 has the new value for the data block.</p>
  1384. <p class="Ex">&nbsp;&nbsp; Method(WSAA, 2) {</p>
  1385. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, Zero)) {</p>
  1386. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Set is for first instance of data block</p>
  1387. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1388. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Set is for second instance of data block</p>
  1389. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1390. <p class="Ex">&nbsp;&nbsp; }</p>
  1391. <p class="Ex">&nbsp;</p>
  1392. <p class="Ex">//</p>
  1393. <p class="Ex">// Event enable/disable method. If event does not need to be
  1394. armed/disarmed</p>
  1395. <p class="Ex">// then this method is not needed. Arg0 is Zero if event is being
  1396. disarmed or</p>
  1397. <p class="Ex">// non zero if event is being armed.</p>
  1398. <p class="Ex">&nbsp;&nbsp; Name(ACEN, 0)</p>
  1399. <p class="Ex">&nbsp;&nbsp; Method(WEA0, 1) {</p>
  1400. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(Arg0, ACEN)</p>
  1401. <p class="Ex">&nbsp;&nbsp; }</p>
  1402. <p class="Ex">&nbsp;</p>
  1403. <p class="Ex">//</p>
  1404. <p class="Ex">// _WED is called in response to an event launching (�firing�) to
  1405. gain additional </p>
  1406. <p class="Ex">// information about the event. Arg0 has the NotifyId for the
  1407. event launched.</p>
  1408. <p class="Ex">&nbsp;&nbsp; Method(_WED, 1) {</p>
  1409. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 0xA0)) {</p>
  1410. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(0x100)</p>
  1411. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1412. <p class="Ex">&nbsp;&nbsp; }</p>
  1413. <p class="Ex">//</p>
  1414. <p class="Ex">// Evaluation of this method causes the event 0xA0 to be fired.
  1415. Since it is</p>
  1416. <p class="Ex">// defined by the _WDG method it is callable via WMI. Arg0 has the
  1417. instance</p>
  1418. <p class="Ex">// index and Arg1 has any input parameters.</p>
  1419. <p class="Ex">&nbsp;&nbsp; Method(WMAB, 3) {</p>
  1420. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</p>
  1421. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If event was armed then launch it</p>
  1422. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(ACEN, 1)) {</p>
  1423. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notify(AMW0, 0xa0)</p>
  1424. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1425. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(Arg1)</p>
  1426. <p class="Ex">&nbsp;&nbsp; }</p>
  1427. <p class="Ex">&nbsp;</p>
  1428. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp; Name(WQBA, Buffer(926) {</p>
  1429. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x46,
  1430. 0x4f, 0x4d, 0x42, 0x01, 0x00, 0x00, 0x00, 0x8e, 0x03, 0x00, 0x00, 0xf6, 0x0f,
  1431. 0x00, 0x00,</p>
  1432. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x44,
  1433. 0x53, 0x00, 0x01, 0x1a, 0x7d, 0xda, 0x54, 0x98, 0xdd, 0x87, 0x00, 0x01, 0x06,
  1434. 0x18, 0x42,</p>
  1435. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x10,
  1436. 0x0b, 0x10, 0x0a, 0x0b, 0x21, 0x02, 0xcb, 0x82, 0x50, 0x3c, 0x18, 0x14, 0xa0,
  1437. 0x25, 0x41,</p>
  1438. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xc8,
  1439. 0x05, 0x14, 0x55, 0x02, 0x21, 0xc3, 0x02, 0x14, 0x0b, 0x70, 0x2e, 0x40, 0xba,
  1440. 0x00, 0xe5,</p>
  1441. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x28,
  1442. 0x72, 0x0c, 0x22, 0x82, 0xfd, 0xfb, 0x07, 0xc1, 0x90, 0x02, 0x08, 0x29, 0x84,
  1443. 0x90, 0x08,</p>
  1444. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x58,
  1445. 0x2a, 0x04, 0x8d, 0x10, 0xf4, 0x2b, 0x00, 0xa1, 0x43, 0x01, 0x32, 0x05, 0x18,
  1446. 0x14, 0xe0,</p>
  1447. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x14,
  1448. 0x41, 0x04, 0x41, 0x62, 0x17, 0x2e, 0xc0, 0x34, 0x8c, 0x06, 0xd0, 0x36, 0x8a,
  1449. 0x64, 0x0b,</p>
  1450. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xb0,
  1451. 0x0c, 0x2e, 0x98, 0xa3, 0x08, 0x92, 0xa0, 0xc6, 0x09, 0xa0, 0xc4, 0x4c, 0x00,
  1452. 0xa5, 0x13,</p>
  1453. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x5c,
  1454. 0x36, 0x05, 0x58, 0xc4, 0x96, 0x50, 0x14, 0x0d, 0x22, 0x4a, 0x82, 0x13, 0xea,
  1455. 0x1b, 0x41,</p>
  1456. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x13,
  1457. 0x2a, 0x57, 0x80, 0x64, 0x78, 0x69, 0x1e, 0x81, 0xac, 0xcf, 0x41, 0x93, 0xf2,
  1458. 0x04, 0xb8,</p>
  1459. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x9a,
  1460. 0x05, 0x7a, 0x8c, 0x34, 0xff, 0x30, 0x41, 0x99, 0x14, 0x43, 0x0e, 0x20, 0x24,
  1461. 0x71, 0x98,</p>
  1462. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xa0,
  1463. 0x9d, 0x59, 0xed, 0x18, 0xd2, 0x3d, 0x07, 0x32, 0x4d, 0x60, 0x21, 0x70, 0x9e,
  1464. 0xb8, 0x19,</p>
  1465. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xa0,
  1466. 0xf0, 0x5b, 0x1d, 0x80, 0xe0, 0x2b, 0x1d, 0x15, 0xd2, 0xeb, 0x34, 0x64, 0x72,
  1467. 0x46, 0x48,</p>
  1468. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xf8,
  1469. 0xff, 0x7f, 0x02, 0x26, 0xe3, 0xb7, 0x60, 0x02, 0xa5, 0xd9, 0xb2, 0x82, 0x4b,
  1470. 0x80, 0xc1,</p>
  1471. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x68,
  1472. 0x00, 0x91, 0xa2, 0x69, 0xa3, 0xe6, 0xea, 0xf9, 0x36, 0x8f, 0xaf, 0x59, 0x7a,
  1473. 0x9e, 0x47,</p>
  1474. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x7a,
  1475. 0x34, 0x56, 0x36, 0x05, 0xd4, 0xf8, 0x3d, 0x9d, 0x93, 0xf3, 0x4c, 0x02, 0x1e,
  1476. 0x9c, 0x61,</p>
  1477. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x4e,
  1478. 0x87, 0x83, 0xf1, 0xb1, 0xb1, 0x51, 0x70, 0x74, 0x03, 0xb2, 0x31, 0x38, 0xc6,
  1479. 0xb0, 0xd1,</p>
  1480. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x73,
  1481. 0x39, 0x81, 0x47, 0x82, 0x43, 0x89, 0x7e, 0x0e, 0x6f, 0x00, 0x47, 0x17, 0xe3,
  1482. 0x04, 0xce,</p>
  1483. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x27,
  1484. 0xc1, 0x61, 0x06, 0x39, 0xe3, 0x33, 0xf4, 0x44, 0x2c, 0x68, 0xd6, 0x02, 0x0a,
  1485. 0x62, 0xa4,</p>
  1486. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x58,
  1487. 0xa7, 0xf5, 0x7c, 0x10, 0x8b, 0x41, 0x05, 0x8b, 0x11, 0xdb, 0x50, 0x87, 0x60,
  1488. 0x18, 0x8b,</p>
  1489. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x46,
  1490. 0x11, 0xc8, 0x49, 0x3c, 0x49, 0x30, 0x94, 0x40, 0x51, 0x0c, 0x12, 0xda, 0xc3,
  1491. 0x36, 0x92,</p>
  1492. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x81,
  1493. 0xcf, 0xdb, 0x20, 0xc7, 0x84, 0x51, 0x01, 0x21, 0xcf, 0xe3, 0xd0, 0x28, 0x4d,
  1494. 0xd0, 0xfd,</p>
  1495. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x29,
  1496. 0x40, 0x37, 0x8b, 0x08, 0x67, 0x54, 0xd8, 0x44, 0x64, 0x6d, 0x02, 0xb2, 0x25,
  1497. 0x40, 0x1c,</p>
  1498. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xbe,
  1499. 0x40, 0x1a, 0x43, 0x11, 0x44, 0x84, 0x98, 0x51, 0x8c, 0x19, 0x30, 0x82, 0x51,
  1500. 0x0e, 0xa6,</p>
  1501. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x39,
  1502. 0x10, 0x69, 0x13, 0x30, 0xf6, 0x20, 0xd1, 0x62, 0x31, 0x04, 0xdb, 0x9f, 0x83,
  1503. 0x30, 0x0e,</p>
  1504. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x05,
  1505. 0xa3, 0x03, 0x42, 0xe7, 0x84, 0xc3, 0x3b, 0x30, 0x9f, 0x1e, 0x4c, 0x70, 0xda,
  1506. 0xcf, 0x07,</p>
  1507. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xaf,
  1508. 0x0b, 0x21, 0x8b, 0x17, 0x20, 0x0d, 0x43, 0xf8, 0x09, 0x6a, 0x7d, 0x51, 0xe8,
  1509. 0x5a, 0xe0,</p>
  1510. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x34,
  1511. 0xe0, 0xa8, 0xeb, 0x82, 0x6f, 0x01, 0xbe, 0x01, 0x9c, 0xe0, 0xe3, 0x85, 0xf1,
  1512. 0x83, 0x1c,</p>
  1513. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xc1,
  1514. 0x01, 0x3c, 0x44, 0xbc, 0x1a, 0x78, 0x08, 0x9e, 0xc3, 0xfb, 0x05, 0x3b, 0x0f,
  1515. 0x60, 0xff,</p>
  1516. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xff,
  1517. 0x04, 0x5d, 0xe3, 0xe9, 0x92, 0x70, 0x02, 0x96, 0x83, 0x86, 0x1a, 0xac, 0x2f,
  1518. 0x00, 0x27,</p>
  1519. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xe9,
  1520. 0xc1, 0x1a, 0xae, 0xae, 0xd3, 0x06, 0x7a, 0xba, 0xa7, 0x72, 0x5a, 0xa5, 0x0a,
  1521. 0x30, 0x7b,</p>
  1522. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x94,
  1523. 0x20, 0x04, 0xcf, 0x1e, 0x6c, 0xde, 0x67, 0x73, 0xe6, 0x09, 0x9e, 0x14, 0x3c,
  1524. 0x05, 0x3e,</p>
  1525. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x2d,
  1526. 0xcf, 0xd2, 0x97, 0x0e, 0x5f, 0x09, 0x7c, 0x9f, 0x30, 0x41, 0xf4, 0x27, 0x17,
  1527. 0x36, 0x1a,</p>
  1528. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xb8,
  1529. 0xc3, 0xc6, 0x8d, 0x06, 0xce, 0xe5, 0xe0, 0xb1, 0xc3, 0x33, 0xf7, 0x5c, 0x4d,
  1530. 0x50, 0xf3,</p>
  1531. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xe5,
  1532. 0x42, 0x4e, 0x66, 0x83, 0xd2, 0x03, 0xa2, 0x01, 0x3f, 0x34, 0x60, 0xd0, 0x1f,
  1533. 0x19, 0xb8,</p>
  1534. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xc8,
  1535. 0x8b, 0x02, 0x95, 0x86, 0xac, 0xbf, 0x86, 0x45, 0x8d, 0x9b, 0x12, 0x58, 0xca,
  1536. 0xa1, 0x82,</p>
  1537. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xdc, 0x33, 0x7c, 0x9e, 0x38,
  1538. 0x8c, 0x57, 0x00, 0xcf, 0xe6, 0xa0, 0x7c, 0x73, 0x71, 0xba, 0x7b,</p>
  1539. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x05, 0x68, 0x66, 0x83, 0xbb,
  1540. 0x51, 0x80, 0x05, 0xc3, 0xd7, 0x03, 0xdf, 0x30, 0xd8, 0xf1, 0xc3,</p>
  1541. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xd7, 0x0c, 0x36, 0x24, 0x83,
  1542. 0x45, 0x89, 0x14, 0x9b, 0x4d, 0xca, 0x03, 0xc0, 0xe0, 0xbd, 0xd7,</p>
  1543. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xf8, 0x70, 0x61, 0x48, 0x9f,
  1544. 0x31, 0xe0, 0x1e, 0x05, 0xe0, 0xfd, 0xff, 0xcf, 0x09, 0xe0, 0xb8,</p>
  1545. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x6d, 0xf8, 0x2a, 0x62, 0x67,
  1546. 0xf7, 0x0b, 0x5d, 0x6f, 0xb0, 0xf7, 0x1d, 0x78, 0xf8, 0x87, 0x85,</p>
  1547. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xbb, 0x0b, 0x30, 0xb0, 0x13,
  1548. 0xc5, 0x1c, 0x78, 0x80, 0xc7, 0x64, 0x1e, 0x78, 0xc0, 0x75, 0x96,</p>
  1549. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x82, 0x3d, 0x04, 0xae, 0xfa,
  1550. 0xc0, 0x83, 0xca, 0xf1, 0x6a, 0xa0, 0x67, 0x1e, 0xc0, 0xec, 0xff,</p>
  1551. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xff, 0xcc, 0x03, 0x8c, 0xe0,
  1552. 0x9f, 0x79, 0x80, 0x6b, 0xf4, 0x6b, 0x81, 0xde, 0x57, 0x3e, 0xf3,</p>
  1553. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x00, 0x7c, 0x50, 0x79, 0x33,
  1554. 0x01, 0xcd, 0xff, 0xff, 0x66, 0x02, 0xe3, 0xe0, 0xe0, 0x83, 0x88,</p>
  1555. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xaf, 0x32, 0x3e, 0x11, 0x02,
  1556. 0x93, 0xab, 0x09, 0x70, 0x09, 0x79, 0x27, 0xa2, 0x01, 0x07, 0x41,</p>
  1557. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xaf, 0x01, 0x5c, 0x0b, 0x88,
  1558. 0x66, 0xc8, 0xa6, 0x89, 0x25, 0x98, 0xe5, 0x22, 0x40, 0xef, 0x8a,</p>
  1559. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x3e, 0x2a, 0xf1, 0x31, 0xfa,
  1560. 0xa8, 0xc4, 0x70, 0xdf, 0x85, 0x8c, 0x7b, 0x7a, 0x67, 0xf7, 0xac,</p>
  1561. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x84, 0xb9, 0x04, 0xbc, 0x8f,
  1562. 0x80, 0x65, 0xf2, 0xf8, 0xd3, 0x07, 0x47, 0xf4, 0x85, 0xc1, 0x77,</p>
  1563. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x23, 0x78, 0x04, 0xd5, 0x5f,
  1564. 0x65, 0xa8, 0xfe, 0xbd, 0x48, 0x2f, 0x0c, 0xea, 0x2a, 0x03, 0x5c,</p>
  1565. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xff, 0xff, 0x57, 0x19, 0x36,
  1566. 0xc8, 0x63, 0x05, 0xcb, 0xf9, 0x11, 0x33, 0xc7, 0xd3, 0x8c, 0xe2,</p>
  1567. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xa9, 0x78, 0xb8, 0xec, 0x62,
  1568. 0x65, 0xef, 0x53, 0x25, 0xc7, 0x17, 0x5f, 0xab, 0xf0, 0x20, 0x8f,</p>
  1569. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x31, 0xbe, 0xc3, 0x80, 0x71,
  1570. 0x04, 0xef, 0x30, 0xc0, 0x35, 0xf0, 0xcb, 0x41, 0xd7, 0x40, 0xc0,</p>
  1571. <p class="Ex" style="margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xf6, 0xff, 0xff, 0x0e, 0x03,
  1572. 0x96, 0xe0, 0x10, 0xba, 0x06, 0xe2, 0x64, 0x1c, 0x5b, 0xc8, 0x4d,</p>
  1573. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xca,
  1574. 0x53, 0x36, 0xc1, 0xa0, 0x13, 0xa6, 0x47, 0x40, 0xf0, 0xdc, 0x2b, 0x7c, 0x98,
  1575. 0x00, 0xc7,</p>
  1576. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x48,
  1577. 0x30, 0xe7, 0x08, 0x9f, 0x1f, 0x7c, 0x7d, 0x78, 0x93, 0x60, 0x37, 0x0e, 0xc3,
  1578. 0xf8, 0xca,</p>
  1579. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0x07,
  1580. 0x0f, 0xf2, 0x15, 0x8b, 0x5d, 0x26, 0xf8, 0x49, 0x0f, 0x6c, 0x17, 0x65, 0x70,
  1581. 0xdc, 0x7f,</p>
  1582. <p class="Ex" style="page-break-after: avoid; margin-right: -1.25in">&nbsp;&nbsp;&nbsp; 0xe0,
  1583. 0x5c, 0x94, 0x81, 0x11, 0xee, 0xe3, 0x0f, 0xf8, 0x0f, 0xcb, 0x70, 0xfe, 0xff</p>
  1584. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</p>
  1585. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1586. <p class="Ex" style="page-break-after: avoid">&nbsp;</p>
  1587. <h2><a name="_Toc445868975">Sample .Mof File</a></h2>
  1588. <p class="MsoNormal" style="page-break-after: avoid">This sample .mof file
  1589. complements the previous ASL code.</p>
  1590. <p class="Ex" style="page-break-after: avoid">[abstract]</p>
  1591. <p class="Ex" style="page-break-after: avoid">class AcpiSampleBase</p>
  1592. <p class="Ex" style="page-break-after: avoid">{</p>
  1593. <p class="Ex" style="page-break-after: avoid">};</p>
  1594. <p class="Ex" style="page-break-after: avoid">&nbsp;</p>
  1595. <p class="Ex" style="page-break-after: avoid">[abstract]</p>
  1596. <p class="Ex" style="page-break-after: avoid">class AcpiSampleEvent : WMIEvent</p>
  1597. <p class="Ex" style="page-break-after: avoid">{</p>
  1598. <p class="Ex" style="page-break-after: avoid">};</p>
  1599. <p class="Ex" style="page-break-after: avoid">&nbsp;</p>
  1600. <p class="Ex" style="page-break-after: avoid">[Dynamic, Provider(&quot;WMIProv&quot;),</p>
  1601. <p class="Ex" style="page-break-after: avoid">&nbsp;WMI,</p>
  1602. <p class="Ex" style="page-break-after: avoid">&nbsp;Description(&quot;Counter for number
  1603. of times the case has been hit&quot;),</p>
  1604. <p class="Ex" style="page-break-after: avoid">&nbsp;<span style="layout-grid-mode: line">GUID</span>(&quot;{ABBC0f5a-8ea1-11d1-A000-c90629100000}&quot;),</p>
  1605. <p class="Ex">&nbsp;locale(&quot;MS\\0x409&quot;)]</p>
  1606. <p class="Ex">class MachineHitSensor : AcpiSampleBase</p>
  1607. <p class="Ex">{</p>
  1608. <p class="Ex">&nbsp;&nbsp;&nbsp; [key, read]</p>
  1609. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp; string InstanceName;</p>
  1610. <p class="Ex">&nbsp;&nbsp;&nbsp; [read] Boolean Active;</p>
  1611. <p class="Ex">&nbsp;</p>
  1612. <p class="Ex">&nbsp;&nbsp;&nbsp; [WmiDataId(1),</p>
  1613. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp; Description(&quot;Number of times the case sensor determined that
  1614. the machine has been hit&quot;),</p>
  1615. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp; read</p>
  1616. <p class="Ex">&nbsp;&nbsp;&nbsp; ] uint32 NumberTimesHit;</p>
  1617. <p class="Ex">};</p>
  1618. <p class="Ex">&nbsp;</p>
  1619. <p class="Ex">[Dynamic, Provider(&quot;WMIProv&quot;),</p>
  1620. <p class="Ex">&nbsp;WMI,</p>
  1621. <p class="Ex">&nbsp;Description(&quot;Counter for number of times the case has been hit&quot;),</p>
  1622. <p class="Ex">&nbsp;<span style="layout-grid-mode: line">GUID</span>(&quot;{ABBC0f5b-8ea1-11d1-A000-c90629100000}&quot;),</p>
  1623. <p class="Ex">&nbsp;locale(&quot;MS\\0x409&quot;)]</p>
  1624. <p class="Ex">class MachineHitSimulate : AcpiSampleBase</p>
  1625. <p class="Ex">{</p>
  1626. <p class="Ex">&nbsp;&nbsp;&nbsp; [key, read]</p>
  1627. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp; string InstanceName;</p>
  1628. <p class="Ex">&nbsp;&nbsp;&nbsp; [read] Boolean Active;</p>
  1629. <p class="Ex">&nbsp;</p>
  1630. <p class="Ex">&nbsp;&nbsp;&nbsp; [WmiMethodId(1),</p>
  1631. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp; Description(&quot;Simulate hitting the machine&quot;)</p>
  1632. <p class="Ex">&nbsp;&nbsp;&nbsp; ] void HitMachine();</p>
  1633. <p class="Ex">};</p>
  1634. <p class="Ex">&nbsp;</p>
  1635. <p class="Ex">[Dynamic, Provider(&quot;WMIProv&quot;),</p>
  1636. <p class="Ex">&nbsp;WMI,</p>
  1637. <p class="Ex">&nbsp;Description(&quot;Event generated when machine is hit&quot;),</p>
  1638. <p class="Ex">&nbsp;<span style="layout-grid-mode: line">GUID</span>(&quot;{ABBC0f5c-8ea1-11d1-A000-c90629100000}&quot;),</p>
  1639. <p class="Ex">&nbsp;locale(&quot;MS\\0x409&quot;)]</p>
  1640. <p class="Ex">class MachineHitEvent : AcpiSampleEvent</p>
  1641. <p class="Ex">{</p>
  1642. <p class="Ex">&nbsp;&nbsp;&nbsp; [key, read]</p>
  1643. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp; string InstanceName;</p>
  1644. <p class="Ex">&nbsp;&nbsp;&nbsp; [read] Boolean Active;</p>
  1645. <p class="Ex">&nbsp;</p>
  1646. <p class="Ex">&nbsp;&nbsp;&nbsp; [WmiDataId(1),</p>
  1647. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp; Description(&quot;Force with which the machine was hit&quot;)</p>
  1648. <p class="Ex">&nbsp;&nbsp;&nbsp; ] uint32 Force;</p>
  1649. <p class="Ex">};</p>
  1650. <p class="Ex">&nbsp;</p>
  1651. <p class="MsoNormal">Appendix C�ASL sample code</p>
  1652. <p class="Ex">Device(WMI1) {</p>
  1653. <p class="Ex">&nbsp;&nbsp;&nbsp; Name (_HID, EISAID(&quot;PNP0Cxx&quot;))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Plug and Play ID for
  1654. mapping driver (TBD)</p>
  1655. <p class="Ex">&nbsp;&nbsp;&nbsp; _UID(1)</p>
  1656. <p class="Ex">&nbsp;</p>
  1657. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1658. <p class="Ex">&nbsp;&nbsp;&nbsp; // Data block and Wmi method to Object ID mappings</p>
  1659. <p class="Ex">&nbsp;&nbsp;&nbsp; Name(_WDG, Buffer() {</p>
  1660. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object AA - {ABBC0F5A-8EA1-11d1-A53F-00A0C9062910}</p>
  1661. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0xABBC0F5A, 0x8ea1, 0x11d1, 0x00, 0xa0, 0xc9, 0x06,
  1662. 0x29, 0x10,</p>
  1663. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `A','A',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object ID</p>
  1664. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1665. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x04,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags (WMIACPI_REGFLAG_STRING)</p>
  1666. <p class="Ex">&nbsp;&nbsp;&nbsp; </p>
  1667. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object AB - {ABBC0F5B-8EA1-11d1-A53F-00A0C9062910}</p>
  1668. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0xABBC0F5B, 0x8ea1, 0x11d1, 0x00, 0xa0, 0xc9, 0x06,
  1669. 0x29, 0x10,</p>
  1670. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `A','B',&nbsp;&nbsp;&nbsp; // Object ID</p>
  1671. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1672. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x01,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flag (WMIACPI_REGFLAG_EXPENSIVE)</p>
  1673. <p class="Ex">&nbsp;</p>
  1674. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Object AC - {ABBC0F5C-8EA1-11d1-A53F-00A0C9062910}</p>
  1675. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0xABBC0F5C, 0x8ea1, 0x11d1, 0x00, 0xa0, 0xc9, 0x06,
  1676. 0x29, 0x10,</p>
  1677. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `A','C',&nbsp;&nbsp;&nbsp; // Object ID</p>
  1678. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count</p>
  1679. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x06,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flag (WMIACPI_REGFLAG_METHOD |
  1680. _STRING)</p>
  1681. <p class="Ex">&nbsp;</p>
  1682. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Event 0x80 - {ABBC0F5D-8EA1-11d1-A53F-00A0C9062910}</p>
  1683. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0xABBC0F5D, 0x8ea1, 0x11d1, 0x00, 0xa0, 0xc9, 0x06,
  1684. 0x29, 0x10,</p>
  1685. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x80,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Notification value</p>
  1686. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Reserved</p>
  1687. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instance Count (Not meaningful for
  1688. events)</p>
  1689. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;0x0D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Flags (WMIACPI_REGFLAG_EXPENSIVE |
  1690. _STRING |_EVENT)</p>
  1691. <p class="Ex">&nbsp;&nbsp;&nbsp; })</p>
  1692. <p class="Ex">&nbsp;</p>
  1693. <p class="Ex">&nbsp;</p>
  1694. <p class="Ex">&nbsp;</p>
  1695. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1696. <p class="Ex">&nbsp;&nbsp;&nbsp; // IO ports for configuration of Object AB</p>
  1697. <p class="Ex">&nbsp;&nbsp;&nbsp; OperationRegion(CAB0, SystemIo, 0xf8, 1)&nbsp;&nbsp; // Instance 0</p>
  1698. <p class="Ex">&nbsp;&nbsp;&nbsp; OperationRegion(CAB1, SystemIo, 0xfc, 1)&nbsp;&nbsp; // Instance 1</p>
  1699. <p class="Ex">&nbsp;&nbsp;&nbsp; OperationRegion(CABC, SystemIo, 0xf4, 1)&nbsp;&nbsp; // Enable/Disable
  1700. Collection</p>
  1701. <p class="Ex">&nbsp;</p>
  1702. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(WQAB, 1) {</p>
  1703. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</p>
  1704. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Read value from IO space for instance</p>
  1705. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, Zero) {</p>
  1706. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(CAB0, Local0)</p>
  1707. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1708. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(CAB1, Local0)</p>
  1709. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1710. <p class="Ex">&nbsp;</p>
  1711. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</p>
  1712. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If any of the lower 3 bits are set then return TRUE,
  1713. else FALSE</p>
  1714. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (And(Local0, 7))</p>
  1715. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return( 0x00000001 )</p>
  1716. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1717. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return( 0x00000000 )</p>
  1718. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1719. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1720. <p class="Ex">&nbsp;</p>
  1721. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1722. <p class="Ex">&nbsp;&nbsp;&nbsp; // Set the values for object AB</p>
  1723. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(WSAB, 2) {</p>
  1724. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, Zero) {</p>
  1725. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Change contents of first instance of data block
  1726. to </p>
  1727. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // values in buffer in Arg1</p>
  1728. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1729. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Change contents of second instance of data block
  1730. to </p>
  1731. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // values in buffer in Arg1</p>
  1732. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1733. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1734. <p class="Ex">&nbsp;</p>
  1735. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1736. <p class="Ex">&nbsp;&nbsp;&nbsp; // Collection notification for object AB</p>
  1737. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(WCAB, 1) {</p>
  1738. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(Arg0, 1)</p>
  1739. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
  1740. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(One, CABC)&nbsp;&nbsp;&nbsp;&nbsp; // If enable, write all 1's to
  1741. port</p>
  1742. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</p>
  1743. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(Zero, CABC)&nbsp;&nbsp;&nbsp; // If disable, write all 0's to
  1744. port</p>
  1745. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1746. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1747. <p class="Ex">&nbsp;</p>
  1748. <p class="Ex">&nbsp;</p>
  1749. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1750. <p class="Ex">&nbsp;&nbsp;&nbsp; // Storage for maintaining values for the AA method. </p>
  1751. <p class="Ex">&nbsp;&nbsp;&nbsp; Name(STAA, &quot;XYZZY&quot;)</p>
  1752. <p class="Ex">&nbsp;</p>
  1753. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(WQAA, 1) {</p>
  1754. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</p>
  1755. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Only one instance for AA so no need to check arg</p>
  1756. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return(STAA);</p>
  1757. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1758. <p class="Ex">&nbsp;</p>
  1759. <p class="Ex">&nbsp;&nbsp;&nbsp; // Data block mapped to Object AA does not support set so it
  1760. does not need</p>
  1761. <p class="Ex">&nbsp;&nbsp;&nbsp; // a WSAA method</p>
  1762. <p class="Ex">&nbsp;</p>
  1763. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1764. <p class="Ex">&nbsp;&nbsp;&nbsp; // Storage for maintaining state of flag that determines
  1765. whether to fire (launch)</p>
  1766. <p class="Ex">&nbsp;&nbsp;&nbsp; // the event or not. By default firing is disabled</p>
  1767. <p class="Ex">&nbsp;&nbsp;&nbsp; Name(FIRE, 0)</p>
  1768. <p class="Ex">&nbsp;</p>
  1769. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; //</p>
  1770. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; // This method will reset the
  1771. values for AA and send a notification of</p>
  1772. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; // its occurrence</p>
  1773. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp; Method(WMAC, 3) {</p>
  1774. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(STAA, Local0)</p>
  1775. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(&quot;XYZZY&quot;, STAA)</p>
  1776. <p class="Ex" style="page-break-after: avoid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (LEqual(FIRE, 1))</p>
  1777. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
  1778. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notify(WMI1, 0x80)</p>
  1779. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
  1780. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return(Local0)</p>
  1781. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1782. <p class="Ex">&nbsp;</p>
  1783. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1784. <p class="Ex">&nbsp;&nbsp;&nbsp; // Additional information about event</p>
  1785. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(_WED) {</p>
  1786. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return(&quot;Fired&quot;)</p>
  1787. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1788. <p class="Ex">&nbsp;</p>
  1789. <p class="Ex">&nbsp;&nbsp;&nbsp; //</p>
  1790. <p class="Ex">&nbsp;&nbsp;&nbsp; // Event 0x80 Enable/Disable control method</p>
  1791. <p class="Ex">&nbsp;&nbsp;&nbsp; Method(WE80, 1) {</p>
  1792. <p class="Ex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Store(FIRE, Arg0)</p>
  1793. <p class="Ex">&nbsp;&nbsp;&nbsp; }</p>
  1794. <p class="Ex">)</p>
  1795. <p class="Ex">&nbsp;</p>
  1796. <p class="MsoNormal"><i>&nbsp;</i></p>
  1797. <p class="MsoNormal">&nbsp;</p>
  1798. </body>
  1799. </html>