|
在MS提供的acpimof.mof文件里定义了两个class,分别如下:
4 \7 P( \$ N0 W; ^
4 Q! d9 \( P/ Y- sclass Package$ S$ ]( Q% ]3 ~0 X0 |$ q: G
{( `5 O, G2 b0 t" B N
[WmiDataId(1),
0 ]5 V. Y) u; U1 n# v/ N2 J read, write,
0 F" ?3 s' A: z Description("16 bytes of data")
$ r5 r( b+ Z& k! p ] uint8 Bytes[16];
0 r4 G k( y. E8 Q% e' t+ m};, P1 \* i4 n* z
- s0 y% m+ f1 ~& r+ W& m[WMI,
# k% V7 C p }" m! R* O3 K Dynamic,7 j$ e' o) D9 \
Provider("WmiProv"),
( R) d# w9 e( h1 b Locale("MS\\0x409"),. z* n$ \' M- i9 c# O
Description("Class to test Query/Set a package"),
7 A' z5 h- A0 p) j; ~ guid("{ABBC0F6a-8EA1-11d1-00A0-C90629100000}")% ^. m% \& X* r9 \1 }+ Z9 H5 Q
]
* w( R; k. E" d* E( nclass AcpiTest_QSPackage* P6 c" ^5 P) ]) j7 i
{
! I; f" f; c. n9 D- e [key, read]2 ^- s9 e" F0 `. M. x0 o" B
string InstanceName;
( J' b) x( m1 f [read] boolean Active;+ {9 t9 K5 ]1 M2 k# E1 H4 x
6 W o/ a; p7 Z [( @
[WmiDataId(1),
" a& \( a$ I2 t0 V read, write,; I' i0 D6 g, l% Z* r+ Z' B' X
Description("description")
* q! m% H4 ^6 n0 r& n1 k( p2 R$ x ] Package Data;
( a7 G ~8 F* v+ v
9 ]- q7 c7 E7 P- _, _% x$ Z& X/ e3 {};
0 k1 I& f9 k$ M* R4 h2 o4 D
) X O3 ~# D, A x% s2 n z1 m请教各位大侠,如果我想得到 packge 类型的Data 是不是用:+ G- J9 [# f ^$ i0 k' b
+ @4 k; E. r- V. ]! Q& a! _* c
hres = pSvc->ExecQuery($ A" v4 j6 k7 }: \. y4 l
bstr_t("WQL"), & o+ L( b- R. A+ D2 l
bstr_t("SELECT * FROM AcpiTest_QSPackage"),& q6 V+ O; i1 \" @! u
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, c2 O# w, b0 t! I
NULL,
5 N' X3 O3 o' r: P, J; f, \7 ` &pEnumerator);: F: ^' [1 @4 s2 ]! M$ g) ~
U; Z1 W$ f } P4 P6 |7 nHRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, * k2 \6 s8 u* |8 w( P
&pclsObj, &uReturn);
2 b, Z6 U% `2 L X. c) c9 p& L6 _" }' Z S/ H5 e3 [# U0 ^
hr = pclsObj->Get(L"Data", 0, &vtProp, 0, 0);9 M: Z, E/ r# z+ @8 c
如果是的话,我下一步要怎么操作vtProp?5 p+ M: c' _6 E, C
单个的数或者字符串能得到,就是不知道怎么得到这种package类型的数,这个问题困扰了好几天了,望知道的大侠能指点小弟。谢谢了! |
|