⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 device.asl

📁 winddk src目录下的WDM源码压缩!
💻 ASL
📖 第 1 页 / 共 3 页
字号:
//
// Sample ASL code to demonstrate WMI query, set, method and event operations
//
// Insert this code at an appropriate place in the bios ASL source, rebuild
// the DSDT and replace the original DSDT via the registry or reflashing.
// NT should recognize the pnp0c14 device and by the magic of pnp install 
// wmiacpi.sys and bind it to this ASL. Note that you can have as many
// devices as needed, however each device must have a unique _UID.
//


            Device(AMW0)
                    {
                       // pnp0c14 is pnp id assigned to WMI mapper
                       Name(_HID, "*pnp0c14")
                       Name(_UID, 0x0)

//
// Description of data, events and methods supported by this ASL device.
                       Name(_WDG, Buffer() {

//
// Query - Set Guids.
//
                           // {ABBC0F6a-8EA1-11d1-00A0-C90629100000}
                           // Query - Set Package Guid
                           0x6a, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           65, 65,        // Object Id (AA)
                           4,             // Instance Count
                           0x01,          // Flags (WMIACPI_REGFLAG_EXPENSIVE)

                           // {ABBC0F6b-8EA1-11d1-00A0-C90629100000}
                           // Query - Set String Guid
                           0x6b, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           65, 66,        // Object Id (AB)
                           4,             // Instance Count
                           0x05,          // Flags (WMIACPI_REGFLAG_EXPENSIVE |
                                          //        WMIACPI_REGFLAG_STRING)

                           // Query - Set ULONG Guid
                           // {ABBC0F6c-8EA1-11d1-00A0-C90629100000}
                           0x6c, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           65, 67,        // Object Id (AC)
                           4,             // Instance Count
                           0x01,          // Flags (WMIACPI_REGFLAG_EXPENSIVE)


//
// Method Guids
//    Method Id 1 is get with no input
//    Method Id 2 is set with no output
//    Method Id 3 is fire event

                           // Package
                           // {ABBC0F6d-8EA1-11d1-00A0-C90629100000}
                           0x6d, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           66, 65,        // Object Id (BA)
                           4,             // Instance Count
                           0x02,          // Flags (WMIACPI_REGFLAG_METHOD)

                           // String
                           // {ABBC0F6e-8EA1-11d1-00A0-C90629100000}
                           0x6e, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           66, 66,        // Object Id (BB)
                           4,             // Instance Count
                           0x06,          // Flags (WMIACPI_REGFLAG_METHOD)
                                          //        WMIACPI_REGFLAG_STRING)

                           // ULONG
                           // {ABBC0F6f-8EA1-11d1-00A0-C90629100000}
                           0x6f, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           66, 67,        // Object Id (BC)
                           4,             // Instance Count
                           0x02,          // Flags (WMIACPI_REGFLAG_METHOD)



//
// Event Guids

                           // Package
                           // {ABBC0F70-8EA1-11d1-00A0-C90629100000}
                           0x70, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           0xd0, 0,       // Notification Id
                           1,             // Instance Count
                           0x08,          // Flags (WMIACPI_REGFLAG_EVENT)

                           // String
                           // {ABBC0F71-8EA1-11d1-00A0-C90629100000}
                           0x71, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           0xd1, 0,       // Notification Id
                           1,             // Instance Count
                           0x0c,          // Flags (WMIACPI_REGFLAG_EVENT)
                                          //        WMIACPI_REGFLAG_STRING)

                           // ULONG
                           // {ABBC0F72-8EA1-11d1-00A0-C90629100000}
                           0x72, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
                           0xd2, 0,       // Notification Id
                           1,             // Instance Count
                           0x08           // Flags (WMIACPI_REGFLAG_EVENT)

                       })


                       // Storage for 4 instances of Package
                       Name(SAA0, Buffer(0x10)
                       {
                           1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
                       })

                       Name(SAA1, Buffer(0x10)
                       {
                           1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
                       })

                       Name(SAA2, Buffer(0x10)
                       {
                           1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
                       })

                       Name(SAA3, Buffer(0x10)
                       {
                           1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
                       })


                       // Storage for 4 instances of string
                       // Maximum length for string is 80 chars
                       Name(SAB0, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")

                       Name(SAB1, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")

                       Name(SAB2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")

                       Name(SAB3, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")

                       // Storage for 4 instances of ULONG
                       Name(SAC0, 0)
                       Name(SAC1, 1)
                       Name(SAC2, 2)
                       Name(SAC3, 3)


                       // Collection Control flags
                       Name(CCAA, 0)
                       Name(CCAB, 0)
                       Name(CCAC, 0)

                       // Event Control flags
                       Name(ECD0, 0)
                       Name(ECD1, 0)
                       Name(ECD2, 0)


                       // Collection control for AA
                       // Arg0 has 0 for disable, non 0 for enable
                       Method(WCAA, 1) {

                           if (LEqual(Arg0, Zero))
                           {
                               // We are disabling
                               if (LEqual(CCAA, Zero))
                               {
                                   // ERROR - Collection Control was already disabled
                                   Name(Foo, "WMIACPI: ASL: WCAA called, but CCAA is 0\n")
                                   Store(Foo, Debug)
                                   Fatal(0xa0, 14, 0)
                               }
                           } else {
                               // We are enabling
                               if (LNotEqual(CCAA, Zero))
                               {
                                   // ERROR - Collection Control was already enabled
                                   Name(Foo1, "WMIACPI: ASL: WCAA called, but CCAA is 1\n")
                                   Store(Foo1, Debug)
                                   Fatal(0xa0, 13, 0)
                               }
                           }
                           Store(Arg0, CCAA)
                       }

                       // Collection control for AB
                       // Arg0 has 0 for disable, non 0 for enable
                       Method(WCAB, 1) {

                           if (LEqual(Arg0, Zero))
                           {
                               // We are disabling
                               if (LEqual(CCAB, Zero))
                               {
                                   // ERROR - Collection Control was already disabled
                                   Name(Foo, "WMIACPI: ASL: WCAB called, but CCAB is 0\n")
                                   Store(Foo, Debug)
                                   Fatal(0xa0, 16, 0)
                               }
                           } else {
                               // We are enabling
                               if (LNotEqual(CCAB, Zero))
                               {
                                   // ERROR - Collection Control was already enabled
                                   Name(Foo1, "WMIACPI: ASL: WCAB called, but CCAB is 1\n")
                                   Store(Foo1, Debug)
                                   Fatal(0xa0, 15, 0)
                               }
                           }
                           Store(Arg0, CCAB)
                       }

                       // Collection control for AC
                       // Arg0 has 0 for disable, non 0 for enable
                       Method(WCAC, 1) {

                           if (LEqual(Arg0, Zero))
                           {
                               // We are disabling
                               if (LEqual(CCAC, Zero))
                               {
                                   // ERROR - Collection Control was already disabled
                                   Name(Foo, "WMIACPI: ASL: WCAC called, but CCAC is 0\n")
                                   Store(Foo, Debug)
                                   Fatal(0xa0, 18, 0)
                               }
                           } else {
                               // We are enabling
                               if (LNotEqual(CCAC, Zero))
                               {
                                   // ERROR - Collection Control was already enabled
                                   Name(Foo1, "WMIACPI: ASL: WCAC called, but CCAC is 1\n")
                                   Store(Foo1, Debug)
                                   Fatal(0xa0, 17, 0)
                               }
                           }
                           Store(Arg0, CCAC)
                       }


                       // Event control for D0
                       // Arg0 has 0 for disable, non 0 for enable
                       Method(WED0, 1) {

                           if (LEqual(Arg0, Zero))
                           {
                               // We are disabling
                               if (LEqual(ECD0, Zero))
                               {
                                   // ERROR - Event Control was already disabled
                                   Name(Foo, "WMIACPI: ASL: WED0 called, but ECD0 is 0\n")
                                   Store(Foo, Debug)
                                   Fatal(0xa0, 20, 0)
                               }
                           } else {
                               // We are enabling
                               if (LNotEqual(ECD0, Zero))
                               {
                                   // ERROR - Event Control was already enabled
                                   Name(Foo1, "WMIACPI: ASL: WED0 called, but WED0 is 1\n")

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -