|
|
在MS提供的acpimof.mof文件里定义了两个class,分别如下: n/ |& z/ U% X" y7 T
. V3 N7 F- H- j K2 y
class Package) s5 }5 |5 f7 f- l/ a" M( g
{2 J, ?% w# M1 W. A
[WmiDataId(1),4 V! I; J3 \; b. ]
read, write,+ g% a6 h" N- e/ p2 }1 j
Description("16 bytes of data")
0 Q5 [) W/ |$ n& |4 c ] uint8 Bytes[16];
: p7 X" F: \! r: J- v4 f( F0 @};& r2 R3 t4 l. q6 f0 |% h$ `6 j$ G
# `( u0 v4 N/ y* P e+ Z
[WMI,. {( E& W( g7 \* F3 p
Dynamic,) q1 v! R3 H5 \5 I! f8 h
Provider("WmiProv"),, W* y4 P* v, Y8 w: {' _
Locale("MS\\0x409"),: j6 F- p- s8 z! t/ N
Description("Class to test Query/Set a package"),
3 w' M0 d3 y3 f$ N4 W+ ]% P guid("{ABBC0F6a-8EA1-11d1-00A0-C90629100000}")
1 r0 x+ X- k' J( [- v: |]
0 `1 ], ~2 I$ ], f' _/ kclass AcpiTest_QSPackage; [. u4 A' g2 @
{* Q. a# K4 I5 M0 P* g! v' |4 g# x
[key, read]
* G) x% b6 j: O4 R string InstanceName;
K$ P2 Y7 J8 k y [read] boolean Active;- {7 r0 V0 L" E: Y& O
+ @5 K+ `* }4 k7 K9 F [WmiDataId(1),
8 V' L% X; `+ _. h read, write,
; Z7 Y+ [5 J% v1 P: N1 K8 Z Description("description")2 I6 M! N& _. R7 D- [
] Package Data;
: G" T, s1 v$ V5 z# s6 Q! M1 ]* C/ Q8 p! R0 w
};5 \8 V( {( o" f9 i
8 k7 E) ?4 [. ^1 \请教各位大侠,如果我想得到 packge 类型的Data 是不是用:
1 u# w8 S( |2 m: V9 q1 {: f6 w( {* s" E9 R' J2 S$ U# o
hres = pSvc->ExecQuery(/ B( H" ^1 x! `5 u- O8 k+ g
bstr_t("WQL"), 6 _% u; p. W$ n% j% O- \3 ~
bstr_t("SELECT * FROM AcpiTest_QSPackage"),
! k, A3 x* F# Q1 l8 [ WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
( H3 w4 D2 I7 S3 M9 b$ q/ Q NULL,
- K3 R7 R1 `; g$ V/ C( h &pEnumerator);
7 M& N: G. p+ J4 u2 a* E7 a7 b$ k; n! ]3 c, X+ J) ?# a& e
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, 4 I' V- n9 K7 z% Y8 M6 ~
&pclsObj, &uReturn);
! a) [9 l* x. f7 B# [/ M1 C, C- D. w* Z# j
hr = pclsObj->Get(L"Data", 0, &vtProp, 0, 0);) \1 C) w& N& F
如果是的话,我下一步要怎么操作vtProp?% ?" U8 g H2 H+ W
单个的数或者字符串能得到,就是不知道怎么得到这种package类型的数,这个问题困扰了好几天了,望知道的大侠能指点小弟。谢谢了! |
|