|
在MS提供的acpimof.mof文件里定义了两个class,分别如下: r; J# B( m; u/ V; y2 j& I
6 Y4 c% n1 B. x- _/ Dclass Package
" G% R- D; z+ s/ N- r{, ?6 v' J) r {! ]. y
[WmiDataId(1),
* i B, X) S' Z! M }2 z/ u read, write,
+ g, d! Q7 T% u; d Description("16 bytes of data")7 A6 `& f9 B4 D
] uint8 Bytes[16];' Z. ], L( Y7 L+ C9 \8 N5 ~
};
# K9 b: P! h; i3 J' O! X# O
- a t, a. ^! a[WMI,6 d1 Y% u$ T* i
Dynamic,
- y6 m( a" E! n5 t9 ^3 Z: F% N Provider("WmiProv"),+ b; R Y% m9 n) x) h
Locale("MS\\0x409"),3 }- B; l# R$ x) r, r
Description("Class to test Query/Set a package"),, m* I/ X1 U& v2 c# w1 K
guid("{ABBC0F6a-8EA1-11d1-00A0-C90629100000}")1 H& r0 K( E2 i$ Q+ u
]% M. M; V# L e
class AcpiTest_QSPackage
$ p% x6 E" H( }9 c2 v{
7 f" j9 j# f0 ~+ } [key, read]2 l& A+ Q/ |5 A. f9 X
string InstanceName;
, t% L* _9 }7 ]0 H" K5 d, N+ ] [read] boolean Active;$ ~4 p! l1 W% L% Y0 p! D
" q. D6 y5 y+ F. K [WmiDataId(1),
, e" b2 ~' \4 G3 {" W8 M0 I% L read, write,
$ S8 u6 Y; a& \ Description("description")
0 [; m/ s' O5 O6 X ] Package Data;* ~% F9 B" u6 Z6 C, P9 f( m5 u
; i. n0 k. A; W n, `1 |4 F0 V" z6 s
};
7 a& F& }' H0 D. N6 d: u: a6 |0 N9 i2 v
4 d# u" X% T* N0 ?) U& N) X& B请教各位大侠,如果我想得到 packge 类型的Data 是不是用:
/ i# O4 }5 S5 _/ ^* ^
' e, q! E% v0 ?- O3 V; f8 @1 Bhres = pSvc->ExecQuery($ \$ x& r4 L( X. S& }
bstr_t("WQL"), 2 _- ]( L6 S5 i0 F% A7 {
bstr_t("SELECT * FROM AcpiTest_QSPackage"),
. O& K) b( e$ m WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
3 z8 ]" c' B B6 A1 V) L" B NULL,0 p. G h: e! n x0 N, a3 S/ H* |
&pEnumerator);
) M) f0 J4 i) S8 C) X; Y3 ~
: ]8 z+ r' E1 }+ G: ?HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, 4 o Y! R! g+ J
&pclsObj, &uReturn);9 K8 H& e+ N: e" s ~0 M, S& v; T
5 g2 Y/ M& u8 [/ [hr = pclsObj->Get(L"Data", 0, &vtProp, 0, 0);
4 t$ x3 L' \( U) p如果是的话,我下一步要怎么操作vtProp?
% c2 C# ^. R$ m2 n, a P单个的数或者字符串能得到,就是不知道怎么得到这种package类型的数,这个问题困扰了好几天了,望知道的大侠能指点小弟。谢谢了! |
|