|
在MS提供的acpimof.mof文件里定义了两个class,分别如下:
' f9 S8 l$ h! v0 e3 O2 `7 z% v7 n( a4 L9 c" s
class Package3 ?5 G; S* t) P( }- c1 Q
{
; C3 o) ]2 N7 Q4 c( V2 S2 Z( Q [WmiDataId(1),8 B3 f9 Z1 R) x5 H# F P
read, write,# L' f) ]" d9 b% Z& u
Description("16 bytes of data")1 |' M( D$ O, n3 Z
] uint8 Bytes[16];( @ `. H2 S* k' X. A/ K
};
' @/ t9 p5 y+ I! ^% a; f `) ^+ F$ c) i( c0 g3 p
[WMI,
- g( Q7 ~: X* n Dynamic,8 ]7 W/ |. U# f4 \5 {2 x8 }
Provider("WmiProv"),) Z3 X- f. r9 {/ {) O. |
Locale("MS\\0x409"),7 l1 V9 r5 c _3 w, F8 I6 k1 M* H
Description("Class to test Query/Set a package"),6 e& ~9 L8 X* F, D1 h( F
guid("{ABBC0F6a-8EA1-11d1-00A0-C90629100000}"): G3 d" h7 K& \4 l( z0 y9 z
]
% Q' t! @# d4 y x0 m; I/ |5 r+ {class AcpiTest_QSPackage
: N( }. n5 c ^{
# o- A1 t m2 j [key, read]
! M3 ]* U& N7 c6 e& z1 p, G string InstanceName;& i7 A2 _# I7 B# G4 a! L
[read] boolean Active;
" s) q' B. [0 `, n$ g* ~+ L3 O1 Q
5 K( @" F8 j( c k0 D [WmiDataId(1),: O+ R0 `& `: `- G% d1 F. N
read, write,
& K# q9 ?; z9 N6 P Description("description")7 {# p; |6 Z* w D, ?
] Package Data;2 f4 @- f6 L2 s" L% W. s
% Q- n8 p9 y5 [* L8 h( ]};
1 [$ j9 B9 h6 ~6 A, Y4 d- d9 B' F! c; e
请教各位大侠,如果我想得到 packge 类型的Data 是不是用:6 b* }& U" E3 I& J- r3 u; q. y
7 z1 F1 W4 e# U$ Y! S2 L
hres = pSvc->ExecQuery(
# s5 B8 C7 N% V9 {8 I0 l1 G bstr_t("WQL"), 1 i6 t$ Q- Z: ~ Z5 c8 f; R
bstr_t("SELECT * FROM AcpiTest_QSPackage"),1 R7 b4 ]0 w, m$ T1 M+ e i. x
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
% n/ H% v8 h8 r, \& [ NULL,4 n3 @; L- ^$ l$ z1 @
&pEnumerator);
/ O2 Y# b9 D% r" k) y# Y; b
& Y l% C! U8 Q$ i' C- e- oHRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, ! p8 e+ ?9 r4 Q: @7 w
&pclsObj, &uReturn);' {3 ~+ b& I8 ^! h
0 q j) E* V% Z* ^
hr = pclsObj->Get(L"Data", 0, &vtProp, 0, 0);
' c. I4 R& ]# P. [! S如果是的话,我下一步要怎么操作vtProp?3 [ `3 m/ }# L* T! s
单个的数或者字符串能得到,就是不知道怎么得到这种package类型的数,这个问题困扰了好几天了,望知道的大侠能指点小弟。谢谢了! |
|