2 * Copyright 2012 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wbemprox_private.h"
36 static const WCHAR class_baseboardW
[] =
37 {'W','i','n','3','2','_','B','a','s','e','B','o','a','r','d',0};
38 static const WCHAR class_biosW
[] =
39 {'W','i','n','3','2','_','B','I','O','S',0};
40 static const WCHAR class_cdromdriveW
[] =
41 {'W','i','n','3','2','_','C','D','R','O','M','D','r','i','v','e',0};
42 static const WCHAR class_compsysW
[] =
43 {'W','i','n','3','2','_','C','o','m','p','u','t','e','r','S','y','s','t','e','m',0};
44 static const WCHAR class_compsysproductW
[] =
45 {'W','i','n','3','2','_','C','o','m','p','u','t','e','r','S','y','s','t','e','m','P','r','o','d','u','c','t',0};
46 static const WCHAR class_datafileW
[] =
47 {'C','I','M','_','D','a','t','a','F','i','l','e',0};
48 static const WCHAR class_directoryW
[] =
49 {'W','i','n','3','2','_','D','i','r','e','c','t','o','r','y',0};
50 static const WCHAR class_diskdriveW
[] =
51 {'W','i','n','3','2','_','D','i','s','k','D','r','i','v','e',0};
52 static const WCHAR class_diskpartitionW
[] =
53 {'W','i','n','3','2','_','D','i','s','k','P','a','r','t','i','t','i','o','n',0};
54 static const WCHAR class_logicaldiskW
[] =
55 {'W','i','n','3','2','_','L','o','g','i','c','a','l','D','i','s','k',0};
56 static const WCHAR class_logicaldisk2W
[] =
57 {'C','I','M','_','L','o','g','i','c','a','l','D','i','s','k',0};
58 static const WCHAR class_networkadapterW
[] =
59 {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r',0};
60 static const WCHAR class_networkadapterconfigW
[] =
61 {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r',
62 'C','o','n','f','i','g','u','r','a','t','i','o','n',0};
63 static const WCHAR class_osW
[] =
64 {'W','i','n','3','2','_','O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0};
65 static const WCHAR class_paramsW
[] =
66 {'_','_','P','A','R','A','M','E','T','E','R','S',0};
67 static const WCHAR class_physicalmediaW
[] =
68 {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','d','i','a',0};
69 static const WCHAR class_physicalmemoryW
[] =
70 {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
71 static const WCHAR class_qualifiersW
[] =
72 {'_','_','Q','U','A','L','I','F','I','E','R','S',0};
73 static const WCHAR class_printerW
[] =
74 {'W','i','n','3','2','_','P','r','i','n','t','e','r',0};
75 static const WCHAR class_process_getowner_outW
[] =
76 {'_','_','W','I','N','3','2','_','P','R','O','C','E','S','S','_','G','E','T','O','W',
77 'N','E','R','_','O','U','T',0};
78 static const WCHAR class_processorW
[] =
79 {'W','i','n','3','2','_','P','r','o','c','e','s','s','o','r',0};
80 static const WCHAR class_processor2W
[] =
81 {'C','I','M','_','P','r','o','c','e','s','s','o','r',0};
82 static const WCHAR class_sidW
[] =
83 {'W','i','n','3','2','_','S','I','D',0};
84 static const WCHAR class_sounddeviceW
[] =
85 {'W','i','n','3','2','_','S','o','u','n','d','D','e','v','i','c','e',0};
86 static const WCHAR class_systemenclosureW
[] =
87 {'W','i','n','3','2','_','S','y','s','t','e','m','E','n','c','l','o','s','u','r','e',0};
88 static const WCHAR class_videocontrollerW
[] =
89 {'W','i','n','3','2','_','V','i','d','e','o','C','o','n','t','r','o','l','l','e','r',0};
91 static const WCHAR prop_accountnameW
[] =
92 {'A','c','c','o','u','n','t','N','a','m','e',0};
93 static const WCHAR prop_acceptpauseW
[] =
94 {'A','c','c','e','p','t','P','a','u','s','e',0};
95 static const WCHAR prop_acceptstopW
[] =
96 {'A','c','c','e','p','t','S','t','o','p',0};
97 static const WCHAR prop_accessmaskW
[] =
98 {'A','c','c','e','s','s','M','a','s','k',0};
99 static const WCHAR prop_adapterdactypeW
[] =
100 {'A','d','a','p','t','e','r','D','A','C','T','y','p','e',0};
101 static const WCHAR prop_adapterramW
[] =
102 {'A','d','a','p','t','e','r','R','A','M',0};
103 static const WCHAR prop_adaptertypeW
[] =
104 {'A','d','a','p','t','e','r','T','y','p','e',0};
105 static const WCHAR prop_addresswidthW
[] =
106 {'A','d','d','r','e','s','s','W','i','d','t','h',0};
107 static const WCHAR prop_attributesW
[] =
108 {'A','t','t','r','i','b','u','t','e','s',0};
109 static const WCHAR prop_availabilityW
[] =
110 {'A','v','a','i','l','a','b','i','l','i','t','y',0};
111 static const WCHAR prop_binaryrepresentationW
[] =
112 {'B','i','n','a','r','y','R','e','p','r','e','s','e','n','t','a','t','i','o','n',0};
113 static const WCHAR prop_bootableW
[] =
114 {'B','o','o','t','a','b','l','e',0};
115 static const WCHAR prop_bootpartitionW
[] =
116 {'B','o','o','t','P','a','r','t','i','t','i','o','n',0};
117 static const WCHAR prop_buildnumberW
[] =
118 {'B','u','i','l','d','N','u','m','b','e','r',0};
119 static const WCHAR prop_capacityW
[] =
120 {'C','a','p','a','c','i','t','y',0};
121 static const WCHAR prop_captionW
[] =
122 {'C','a','p','t','i','o','n',0};
123 static const WCHAR prop_chassistypesW
[] =
124 {'C','h','a','s','s','i','s','T','y','p','e','s',0};
125 static const WCHAR prop_classW
[] =
126 {'C','l','a','s','s',0};
127 static const WCHAR prop_codesetW
[] =
128 {'C','o','d','e','S','e','t',0};
129 static const WCHAR prop_commandlineW
[] =
130 {'C','o','m','m','a','n','d','L','i','n','e',0};
131 static const WCHAR prop_countrycodeW
[] =
132 {'C','o','u','n','t','r','y','C','o','d','e',0};
133 static const WCHAR prop_cpustatusW
[] =
134 {'C','p','u','S','t','a','t','u','s',0};
135 static const WCHAR prop_csdversionW
[] =
136 {'C','S','D','V','e','r','s','i','o','n',0};
137 static const WCHAR prop_currentbitsperpixelW
[] =
138 {'C','u','r','r','e','n','t','B','i','t','s','P','e','r','P','i','x','e','l',0};
139 static const WCHAR prop_currentclockspeedW
[] =
140 {'C','u','r','r','e','n','t','C','l','o','c','k','S','p','e','e','d',0};
141 static const WCHAR prop_currenthorizontalresW
[] =
142 {'C','u','r','r','e','n','t','H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0};
143 static const WCHAR prop_currentrefreshrateW
[] =
144 {'C','u','r','r','e','n','t','R','e','f','r','e','s','h','R','a','t','e',0};
145 static const WCHAR prop_currentscanmodeW
[] =
146 {'C','u','r','r','e','n','t','S','c','a','n','M','o','d','e',0};
147 static const WCHAR prop_currentverticalresW
[] =
148 {'C','u','r','r','e','n','t','V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0};
149 static const WCHAR prop_datawidthW
[] =
150 {'D','a','t','a','W','i','d','t','h',0};
151 static const WCHAR prop_defaultvalueW
[] =
152 {'D','e','f','a','u','l','t','V','a','l','u','e',0};
153 static const WCHAR prop_descriptionW
[] =
154 {'D','e','s','c','r','i','p','t','i','o','n',0};
155 static const WCHAR prop_deviceidW
[] =
156 {'D','e','v','i','c','e','I','d',0};
157 static const WCHAR prop_directionW
[] =
158 {'D','i','r','e','c','t','i','o','n',0};
159 static const WCHAR prop_displaynameW
[] =
160 {'D','i','s','p','l','a','y','N','a','m','e',0};
161 static const WCHAR prop_diskindexW
[] =
162 {'D','i','s','k','I','n','d','e','x',0};
163 static const WCHAR prop_dnshostnameW
[] =
164 {'D','N','S','H','o','s','t','N','a','m','e',0};
165 static const WCHAR prop_domainW
[] =
166 {'D','o','m','a','i','n',0};
167 static const WCHAR prop_domainroleW
[] =
168 {'D','o','m','a','i','n','R','o','l','e',0};
169 static const WCHAR prop_driveW
[] =
170 {'D','r','i','v','e',0};
171 static const WCHAR prop_drivernameW
[] =
172 {'D','r','i','v','e','r','N','a','m','e',0};
173 static const WCHAR prop_driverversionW
[] =
174 {'D','r','i','v','e','r','V','e','r','s','i','o','n',0};
175 static const WCHAR prop_drivetypeW
[] =
176 {'D','r','i','v','e','T','y','p','e',0};
177 static const WCHAR prop_familyW
[] =
178 {'F','a','m','i','l','y',0};
179 static const WCHAR prop_filesystemW
[] =
180 {'F','i','l','e','S','y','s','t','e','m',0};
181 static const WCHAR prop_flavorW
[] =
182 {'F','l','a','v','o','r',0};
183 static const WCHAR prop_freespaceW
[] =
184 {'F','r','e','e','S','p','a','c','e',0};
185 static const WCHAR prop_handleW
[] =
186 {'H','a','n','d','l','e',0};
187 static const WCHAR prop_horizontalresolutionW
[] =
188 {'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0};
189 static const WCHAR prop_idW
[] =
191 static const WCHAR prop_identificationcodeW
[] =
192 {'I','d','e','n','t','i','f','i','c','a','t','i','o','n','C','o','d','e',0};
193 static const WCHAR prop_identifyingnumberW
[] =
194 {'I','d','e','n','t','i','f','y','i','n','g','N','u','m','b','e','r',0};
195 static const WCHAR prop_indexW
[] =
196 {'I','n','d','e','x',0};
197 static const WCHAR prop_installdateW
[] =
198 {'I','n','s','t','a','l','l','D','a','t','e',0};
199 static const WCHAR prop_interfaceindexW
[] =
200 {'I','n','t','e','r','f','a','c','e','I','n','d','e','x',0};
201 static const WCHAR prop_interfacetypeW
[] =
202 {'I','n','t','e','r','f','a','c','e','T','y','p','e',0};
203 static const WCHAR prop_intvalueW
[] =
204 {'I','n','t','e','g','e','r','V','a','l','u','e',0};
205 static const WCHAR prop_ipconnectionmetricW
[] =
206 {'I','P','C','o','n','n','e','c','t','i','o','n','M','e','t','r','i','c',0};
207 static const WCHAR prop_ipenabledW
[] =
208 {'I','P','E','n','a','b','l','e','d',0};
209 static const WCHAR prop_lastbootuptimeW
[] =
210 {'L','a','s','t','B','o','o','t','U','p','T','i','m','e',0};
211 static const WCHAR prop_localW
[] =
212 {'L','o','c','a','l',0};
213 static const WCHAR prop_localdatetimeW
[] =
214 {'L','o','c','a','l','D','a','t','e','T','i','m','e',0};
215 static const WCHAR prop_localeW
[] =
216 {'L','o','c','a','l','e',0};
217 static const WCHAR prop_lockpresentW
[] =
218 {'L','o','c','k','P','r','e','s','e','n','t',0};
219 static const WCHAR prop_macaddressW
[] =
220 {'M','A','C','A','d','d','r','e','s','s',0};
221 static const WCHAR prop_manufacturerW
[] =
222 {'M','a','n','u','f','a','c','t','u','r','e','r',0};
223 static const WCHAR prop_maxclockspeedW
[] =
224 {'M','a','x','C','l','o','c','k','S','p','e','e','d',0};
225 static const WCHAR prop_mediatypeW
[] =
226 {'M','e','d','i','a','T','y','p','e',0};
227 static const WCHAR prop_memberW
[] =
228 {'M','e','m','b','e','r',0};
229 static const WCHAR prop_methodW
[] =
230 {'M','e','t','h','o','d',0};
231 static const WCHAR prop_modelW
[] =
232 {'M','o','d','e','l',0};
233 static const WCHAR prop_netconnectionstatusW
[] =
234 {'N','e','t','C','o','n','n','e','c','t','i','o','n','S','t','a','t','u','s',0};
235 static const WCHAR prop_networkW
[] =
236 {'N','e','t','w','o','r','k',0};
237 static const WCHAR prop_numcoresW
[] =
238 {'N','u','m','b','e','r','O','f','C','o','r','e','s',0};
239 static const WCHAR prop_numlogicalprocessorsW
[] =
240 {'N','u','m','b','e','r','O','f','L','o','g','i','c','a','l','P','r','o','c','e','s','s','o','r','s',0};
241 static const WCHAR prop_numprocessorsW
[] =
242 {'N','u','m','b','e','r','O','f','P','r','o','c','e','s','s','o','r','s',0};
243 static const WCHAR prop_osarchitectureW
[] =
244 {'O','S','A','r','c','h','i','t','e','c','t','u','r','e',0};
245 static const WCHAR prop_oslanguageW
[] =
246 {'O','S','L','a','n','g','u','a','g','e',0};
247 static const WCHAR prop_osproductsuiteW
[] =
248 {'O','S','P','r','o','d','u','c','t','S','u','i','t','e',0};
249 static const WCHAR prop_ostypeW
[] =
250 {'O','S','T','y','p','e',0};
251 static const WCHAR prop_parameterW
[] =
252 {'P','a','r','a','m','e','t','e','r',0};
253 static const WCHAR prop_physicaladapterW
[] =
254 {'P','h','y','s','i','c','a','l','A','d','a','p','t','e','r',0};
255 static const WCHAR prop_pnpdeviceidW
[] =
256 {'P','N','P','D','e','v','i','c','e','I','D',0};
257 static const WCHAR prop_pprocessidW
[] =
258 {'P','a','r','e','n','t','P','r','o','c','e','s','s','I','D',0};
259 static const WCHAR prop_primaryW
[] =
260 {'P','r','i','m','a','r','y',0};
261 static const WCHAR prop_processidW
[] =
262 {'P','r','o','c','e','s','s','I','D',0};
263 static const WCHAR prop_processoridW
[] =
264 {'P','r','o','c','e','s','s','o','r','I','d',0};
265 static const WCHAR prop_processortypeW
[] =
266 {'P','r','o','c','e','s','s','o','r','T','y','p','e',0};
267 static const WCHAR prop_productW
[] =
268 {'P','r','o','d','u','c','t',0};
269 static const WCHAR prop_productnameW
[] =
270 {'P','r','o','d','u','c','t','N','a','m','e',0};
271 static const WCHAR prop_referenceddomainnameW
[] =
272 {'R','e','f','e','r','e','n','c','e','d','D','o','m','a','i','n','N','a','m','e',0};
273 static const WCHAR prop_releasedateW
[] =
274 {'R','e','l','e','a','s','e','D','a','t','e',0};
275 static const WCHAR prop_serialnumberW
[] =
276 {'S','e','r','i','a','l','N','u','m','b','e','r',0};
277 static const WCHAR prop_servicepackmajorW
[] =
278 {'S','e','r','v','i','c','e','P','a','c','k','M','a','j','o','r','V','e','r','s','i','o','n',0};
279 static const WCHAR prop_servicepackminorW
[] =
280 {'S','e','r','v','i','c','e','P','a','c','k','M','i','n','o','r','V','e','r','s','i','o','n',0};
281 static const WCHAR prop_servicetypeW
[] =
282 {'S','e','r','v','i','c','e','T','y','p','e',0};
283 static const WCHAR prop_smbiosbiosversionW
[] =
284 {'S','M','B','I','O','S','B','I','O','S','V','e','r','s','i','o','n',0};
285 static const WCHAR prop_startmodeW
[] =
286 {'S','t','a','r','t','M','o','d','e',0};
287 static const WCHAR prop_sidW
[] =
289 static const WCHAR prop_sidlengthW
[] =
290 {'S','i','d','L','e','n','g','t','h',0};
291 static const WCHAR prop_sizeW
[] =
293 static const WCHAR prop_speedW
[] =
294 {'S','p','e','e','d',0};
295 static const WCHAR prop_startingoffsetW
[] =
296 {'S','t','a','r','t','i','n','g','O','f','f','s','e','t',0};
297 static const WCHAR prop_stateW
[] =
298 {'S','t','a','t','e',0};
299 static const WCHAR prop_statusinfoW
[] =
300 {'S','t','a','t','u','s','I','n','f','o',0};
301 static const WCHAR prop_strvalueW
[] =
302 {'S','t','r','i','n','g','V','a','l','u','e',0};
303 static const WCHAR prop_suitemaskW
[] =
304 {'S','u','i','t','e','M','a','s','k',0};
305 static const WCHAR prop_systemdirectoryW
[] =
306 {'S','y','s','t','e','m','D','i','r','e','c','t','o','r','y',0};
307 static const WCHAR prop_systemnameW
[] =
308 {'S','y','s','t','e','m','N','a','m','e',0};
309 static const WCHAR prop_tagW
[] =
311 static const WCHAR prop_threadcountW
[] =
312 {'T','h','r','e','a','d','C','o','u','n','t',0};
313 static const WCHAR prop_totalphysicalmemoryW
[] =
314 {'T','o','t','a','l','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
315 static const WCHAR prop_totalvisiblememorysizeW
[] =
316 {'T','o','t','a','l','V','i','s','i','b','l','e','M','e','m','o','r','y','S','i','z','e',0};
317 static const WCHAR prop_typeW
[] =
319 static const WCHAR prop_uniqueidW
[] =
320 {'U','n','i','q','u','e','I','d',0};
321 static const WCHAR prop_usernameW
[] =
322 {'U','s','e','r','N','a','m','e',0};
323 static const WCHAR prop_uuidW
[] =
325 static const WCHAR prop_varianttypeW
[] =
326 {'V','a','r','i','a','n','t','T','y','p','e',0};
327 static const WCHAR prop_versionW
[] =
328 {'V','e','r','s','i','o','n',0};
329 static const WCHAR prop_videoarchitectureW
[] =
330 {'V','i','d','e','o','A','r','c','h','i','t','e','c','t','u','r','e',0};
331 static const WCHAR prop_videomemorytypeW
[] =
332 {'V','i','d','e','o','M','e','m','o','r','y','T','y','p','e',0};
333 static const WCHAR prop_videoprocessorW
[] =
334 {'V','i','d','e','o','P','r','o','c','e','s','s','o','r',0};
335 static const WCHAR prop_volumenameW
[] =
336 {'V','o','l','u','m','e','N','a','m','e',0};
337 static const WCHAR prop_volumeserialnumberW
[] =
338 {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0};
339 static const WCHAR prop_workingsetsizeW
[] =
340 {'W','o','r','k','i','n','g','S','e','t','S','i','z','e',0};
342 /* column definitions must be kept in sync with record structures below */
343 static const struct column col_baseboard
[] =
345 { prop_manufacturerW
, CIM_STRING
},
346 { prop_modelW
, CIM_STRING
},
347 { prop_nameW
, CIM_STRING
},
348 { prop_productW
, CIM_STRING
},
349 { prop_serialnumberW
, CIM_STRING
},
350 { prop_tagW
, CIM_STRING
|COL_FLAG_KEY
},
351 { prop_versionW
, CIM_STRING
}
353 static const struct column col_bios
[] =
355 { prop_descriptionW
, CIM_STRING
},
356 { prop_identificationcodeW
, CIM_STRING
},
357 { prop_manufacturerW
, CIM_STRING
},
358 { prop_releasedateW
, CIM_DATETIME
},
359 { prop_serialnumberW
, CIM_STRING
},
360 { prop_smbiosbiosversionW
, CIM_STRING
},
361 { prop_versionW
, CIM_STRING
|COL_FLAG_KEY
}
363 static const struct column col_cdromdrive
[] =
365 { prop_deviceidW
, CIM_STRING
|COL_FLAG_KEY
},
366 { prop_driveW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
367 { prop_mediatypeW
, CIM_STRING
},
368 { prop_nameW
, CIM_STRING
},
369 { prop_pnpdeviceidW
, CIM_STRING
}
371 static const struct column col_compsys
[] =
373 { prop_descriptionW
, CIM_STRING
},
374 { prop_domainW
, CIM_STRING
},
375 { prop_domainroleW
, CIM_UINT16
, VT_I4
},
376 { prop_manufacturerW
, CIM_STRING
},
377 { prop_modelW
, CIM_STRING
},
378 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
379 { prop_numlogicalprocessorsW
, CIM_UINT32
, VT_I4
},
380 { prop_numprocessorsW
, CIM_UINT32
, VT_I4
},
381 { prop_totalphysicalmemoryW
, CIM_UINT64
},
382 { prop_usernameW
, CIM_STRING
|COL_FLAG_DYNAMIC
}
384 static const struct column col_compsysproduct
[] =
386 { prop_identifyingnumberW
, CIM_STRING
|COL_FLAG_KEY
},
387 { prop_uuidW
, CIM_STRING
}
389 static const struct column col_datafile
[] =
391 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
392 { prop_versionW
, CIM_STRING
|COL_FLAG_DYNAMIC
}
394 static const struct column col_directory
[] =
396 { prop_accessmaskW
, CIM_UINT32
},
397 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
}
399 static const struct column col_diskdrive
[] =
401 { prop_deviceidW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
402 { prop_indexW
, CIM_UINT32
, VT_I4
},
403 { prop_interfacetypeW
, CIM_STRING
},
404 { prop_manufacturerW
, CIM_STRING
},
405 { prop_mediatypeW
, CIM_STRING
},
406 { prop_modelW
, CIM_STRING
},
407 { prop_pnpdeviceidW
, CIM_STRING
},
408 { prop_serialnumberW
, CIM_STRING
},
409 { prop_sizeW
, CIM_UINT64
}
411 static const struct column col_diskpartition
[] =
413 { prop_bootableW
, CIM_BOOLEAN
},
414 { prop_bootpartitionW
, CIM_BOOLEAN
},
415 { prop_deviceidW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
416 { prop_diskindexW
, CIM_UINT32
, VT_I4
},
417 { prop_indexW
, CIM_UINT32
, VT_I4
},
418 { prop_pnpdeviceidW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
419 { prop_sizeW
, CIM_UINT64
},
420 { prop_startingoffsetW
, CIM_UINT64
},
421 { prop_typeW
, CIM_STRING
|COL_FLAG_DYNAMIC
}
423 static const struct column col_logicaldisk
[] =
425 { prop_deviceidW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
426 { prop_drivetypeW
, CIM_UINT32
, VT_I4
},
427 { prop_filesystemW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
428 { prop_freespaceW
, CIM_UINT64
},
429 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
430 { prop_sizeW
, CIM_UINT64
},
431 { prop_volumenameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
432 { prop_volumeserialnumberW
, CIM_STRING
|COL_FLAG_DYNAMIC
}
434 static const struct column col_networkadapter
[] =
436 { prop_adaptertypeW
, CIM_STRING
},
437 { prop_deviceidW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
438 { prop_indexW
, CIM_UINT32
, VT_I4
},
439 { prop_interfaceindexW
, CIM_UINT32
, VT_I4
},
440 { prop_macaddressW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
441 { prop_manufacturerW
, CIM_STRING
},
442 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
443 { prop_netconnectionstatusW
, CIM_UINT16
, VT_I4
},
444 { prop_physicaladapterW
, CIM_BOOLEAN
},
445 { prop_pnpdeviceidW
, CIM_STRING
},
446 { prop_speedW
, CIM_UINT64
}
448 static const struct column col_networkadapterconfig
[] =
450 { prop_dnshostnameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
451 { prop_indexW
, CIM_UINT32
|COL_FLAG_KEY
, VT_I4
},
452 { prop_ipconnectionmetricW
, CIM_UINT32
, VT_I4
},
453 { prop_ipenabledW
, CIM_BOOLEAN
},
454 { prop_macaddressW
, CIM_STRING
|COL_FLAG_DYNAMIC
}
456 static const struct column col_os
[] =
458 { prop_buildnumberW
, CIM_STRING
},
459 { prop_captionW
, CIM_STRING
},
460 { prop_codesetW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
461 { prop_countrycodeW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
462 { prop_csdversionW
, CIM_STRING
},
463 { prop_installdateW
, CIM_DATETIME
},
464 { prop_lastbootuptimeW
, CIM_DATETIME
|COL_FLAG_DYNAMIC
},
465 { prop_localdatetimeW
, CIM_DATETIME
|COL_FLAG_DYNAMIC
},
466 { prop_localeW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
467 { prop_nameW
, CIM_STRING
},
468 { prop_osarchitectureW
, CIM_STRING
},
469 { prop_oslanguageW
, CIM_UINT32
, VT_I4
},
470 { prop_osproductsuiteW
, CIM_UINT32
, VT_I4
},
471 { prop_ostypeW
, CIM_UINT16
, VT_I4
},
472 { prop_primaryW
, CIM_BOOLEAN
},
473 { prop_serialnumberW
, CIM_STRING
},
474 { prop_servicepackmajorW
, CIM_UINT16
, VT_I4
},
475 { prop_servicepackminorW
, CIM_UINT16
, VT_I4
},
476 { prop_suitemaskW
, CIM_UINT32
, VT_I4
},
477 { prop_systemdirectoryW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
478 { prop_totalvisiblememorysizeW
, CIM_UINT64
},
479 { prop_versionW
, CIM_STRING
}
481 static const struct column col_param
[] =
483 { prop_classW
, CIM_STRING
},
484 { prop_methodW
, CIM_STRING
},
485 { prop_directionW
, CIM_SINT32
},
486 { prop_parameterW
, CIM_STRING
},
487 { prop_typeW
, CIM_UINT32
},
488 { prop_varianttypeW
, CIM_UINT32
},
489 { prop_defaultvalueW
, CIM_UINT32
}
491 static const struct column col_physicalmedia
[] =
493 { prop_serialnumberW
, CIM_STRING
},
494 { prop_tagW
, CIM_STRING
}
496 static const struct column col_physicalmemory
[] =
498 { prop_capacityW
, CIM_UINT64
}
500 static const struct column col_printer
[] =
502 { prop_attributesW
, CIM_UINT32
},
503 { prop_drivernameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
504 { prop_horizontalresolutionW
, CIM_UINT32
},
505 { prop_localW
, CIM_BOOLEAN
},
506 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
507 { prop_networkW
, CIM_BOOLEAN
}
509 static const struct column col_process
[] =
511 { prop_captionW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
512 { prop_commandlineW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
513 { prop_descriptionW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
514 { prop_handleW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
515 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
516 { prop_pprocessidW
, CIM_UINT32
, VT_I4
},
517 { prop_processidW
, CIM_UINT32
, VT_I4
},
518 { prop_threadcountW
, CIM_UINT32
, VT_I4
},
519 { prop_workingsetsizeW
, CIM_UINT64
},
521 { method_getownerW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
}
523 static const struct column col_processor
[] =
525 { prop_addresswidthW
, CIM_UINT16
, VT_I4
},
526 { prop_captionW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
527 { prop_cpustatusW
, CIM_UINT16
},
528 { prop_currentclockspeedW
, CIM_UINT32
, VT_I4
},
529 { prop_datawidthW
, CIM_UINT16
, VT_I4
},
530 { prop_descriptionW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
531 { prop_deviceidW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
532 { prop_familyW
, CIM_UINT16
, VT_I4
},
533 { prop_manufacturerW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
534 { prop_maxclockspeedW
, CIM_UINT32
, VT_I4
},
535 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
536 { prop_numcoresW
, CIM_UINT32
, VT_I4
},
537 { prop_numlogicalprocessorsW
, CIM_UINT32
, VT_I4
},
538 { prop_processoridW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
539 { prop_processortypeW
, CIM_UINT16
, VT_I4
},
540 { prop_uniqueidW
, CIM_STRING
},
541 { prop_versionW
, CIM_STRING
|COL_FLAG_DYNAMIC
}
543 static const struct column col_qualifier
[] =
545 { prop_classW
, CIM_STRING
},
546 { prop_memberW
, CIM_STRING
},
547 { prop_typeW
, CIM_UINT32
},
548 { prop_flavorW
, CIM_SINT32
},
549 { prop_nameW
, CIM_STRING
},
550 { prop_intvalueW
, CIM_SINT32
},
551 { prop_strvalueW
, CIM_STRING
}
553 static const struct column col_service
[] =
555 { prop_acceptpauseW
, CIM_BOOLEAN
},
556 { prop_acceptstopW
, CIM_BOOLEAN
},
557 { prop_displaynameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
558 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
559 { prop_processidW
, CIM_UINT32
},
560 { prop_servicetypeW
, CIM_STRING
},
561 { prop_startmodeW
, CIM_STRING
},
562 { prop_stateW
, CIM_STRING
},
563 { prop_systemnameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
565 { method_pauseserviceW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
},
566 { method_resumeserviceW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
},
567 { method_startserviceW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
},
568 { method_stopserviceW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
}
570 static const struct column col_sid
[] =
572 { prop_accountnameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
573 { prop_binaryrepresentationW
, CIM_UINT8
|CIM_FLAG_ARRAY
|COL_FLAG_DYNAMIC
},
574 { prop_referenceddomainnameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
575 { prop_sidW
, CIM_STRING
|COL_FLAG_DYNAMIC
|COL_FLAG_KEY
},
576 { prop_sidlengthW
, CIM_UINT32
}
578 static const struct column col_sounddevice
[] =
580 { prop_nameW
, CIM_STRING
},
581 { prop_productnameW
, CIM_STRING
},
582 { prop_statusinfoW
, CIM_UINT16
, VT_I4
}
584 static const struct column col_stdregprov
[] =
586 { method_enumkeyW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
},
587 { method_enumvaluesW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
},
588 { method_getstringvalueW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
}
590 static const struct column col_systemenclosure
[] =
592 { prop_captionW
, CIM_STRING
},
593 { prop_chassistypesW
, CIM_UINT16
|CIM_FLAG_ARRAY
},
594 { prop_descriptionW
, CIM_STRING
},
595 { prop_lockpresentW
, CIM_BOOLEAN
},
596 { prop_manufacturerW
, CIM_STRING
},
597 { prop_nameW
, CIM_STRING
},
598 { prop_tagW
, CIM_STRING
},
600 static const struct column col_systemsecurity
[] =
602 { method_getsdW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
},
603 { method_setsdW
, CIM_FLAG_ARRAY
|COL_FLAG_METHOD
},
605 static const struct column col_videocontroller
[] =
607 { prop_adapterdactypeW
, CIM_STRING
},
608 { prop_adapterramW
, CIM_UINT32
, VT_I4
},
609 { prop_availabilityW
, CIM_UINT16
},
610 { prop_captionW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
611 { prop_currentbitsperpixelW
, CIM_UINT32
, VT_I4
},
612 { prop_currenthorizontalresW
, CIM_UINT32
, VT_I4
},
613 { prop_currentrefreshrateW
, CIM_UINT32
, VT_I4
},
614 { prop_currentscanmodeW
, CIM_UINT16
, VT_I4
},
615 { prop_currentverticalresW
, CIM_UINT32
, VT_I4
},
616 { prop_descriptionW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
617 { prop_deviceidW
, CIM_STRING
|COL_FLAG_KEY
},
618 { prop_driverversionW
, CIM_STRING
},
619 { prop_nameW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
620 { prop_pnpdeviceidW
, CIM_STRING
|COL_FLAG_DYNAMIC
},
621 { prop_videoarchitectureW
, CIM_UINT16
, VT_I4
},
622 { prop_videomemorytypeW
, CIM_UINT16
, VT_I4
},
623 { prop_videoprocessorW
, CIM_STRING
|COL_FLAG_DYNAMIC
}
626 static const WCHAR baseboard_manufacturerW
[] =
627 {'I','n','t','e','l',' ','C','o','r','p','o','r','a','t','i','o','n',0};
628 static const WCHAR baseboard_serialnumberW
[] =
630 static const WCHAR baseboard_tagW
[] =
631 {'B','a','s','e',' ','B','o','a','r','d',0};
632 static const WCHAR baseboard_versionW
[] =
634 static const WCHAR bios_descriptionW
[] =
635 {'D','e','f','a','u','l','t',' ','S','y','s','t','e','m',' ','B','I','O','S',0};
636 static const WCHAR bios_manufacturerW
[] =
637 {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0};
638 static const WCHAR bios_releasedateW
[] =
639 {'2','0','1','2','0','6','0','8','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
640 static const WCHAR bios_serialnumberW
[] =
642 static const WCHAR bios_smbiosbiosversionW
[] =
644 static const WCHAR bios_versionW
[] =
645 {'W','I','N','E',' ',' ',' ','-',' ','1',0};
646 static const WCHAR cdromdrive_mediatypeW
[] =
647 {'C','D','-','R','O','M',0};
648 static const WCHAR cdromdrive_nameW
[] =
649 {'W','i','n','e',' ','C','D','-','R','O','M',' ','A','T','A',' ','D','e','v','i','c','e',0};
650 static const WCHAR cdromdrive_pnpdeviceidW
[]=
651 {'I','D','E','\\','C','D','R','O','M','W','I','N','E','_','C','D','-','R','O','M',
652 '_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_',
653 '_','_','_','_','_','_','_','1','.','0','_','_','_','_','_','\\','5','&','3','A','2',
654 'A','5','8','5','4','&','0','&','1','.','0','.','0',0};
655 static const WCHAR compsys_descriptionW
[] =
656 {'A','T','/','A','T',' ','C','O','M','P','A','T','I','B','L','E',0};
657 static const WCHAR compsys_domainW
[] =
658 {'W','O','R','K','G','R','O','U','P',0};
659 static const WCHAR compsys_manufacturerW
[] =
660 {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0};
661 static const WCHAR compsys_modelW
[] =
663 static const WCHAR compsysproduct_identifyingnumberW
[] =
665 static const WCHAR compsysproduct_uuidW
[] =
666 {'0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','-',
667 '0','0','0','0','0','0','0','0','0','0','0','0',0};
668 static const WCHAR diskdrive_interfacetypeW
[] =
670 static const WCHAR diskdrive_manufacturerW
[] =
671 {'(','S','t','a','n','d','a','r','d',' ','d','i','s','k',' ','d','r','i','v','e','s',')',0};
672 static const WCHAR diskdrive_mediatype_fixedW
[] =
673 {'F','i','x','e','d',' ','h','a','r','d',' ','d','i','s','k',0};
674 static const WCHAR diskdrive_mediatype_removableW
[] =
675 {'R','e','m','o','v','a','b','l','e',' ','m','e','d','i','a',0};
676 static const WCHAR diskdrive_modelW
[] =
677 {'W','i','n','e',' ','D','i','s','k',' ','D','r','i','v','e',0};
678 static const WCHAR diskdrive_pnpdeviceidW
[] =
679 {'I','D','E','\\','D','i','s','k','\\','V','E','N','_','W','I','N','E',0};
680 static const WCHAR diskdrive_serialW
[] =
681 {'W','I','N','E','H','D','I','S','K',0};
682 static const WCHAR networkadapter_pnpdeviceidW
[]=
683 {'P','C','I','\\','V','E','N','_','8','0','8','6','&','D','E','V','_','1','0','0','E','&',
684 'S','U','B','S','Y','S','_','0','0','1','E','8','0','8','6','&','R','E','V','_','0','2','\\',
685 '3','&','2','6','7','A','6','1','6','A','&','1','&','1','8',0};
686 static const WCHAR os_32bitW
[] =
687 {'3','2','-','b','i','t',0};
688 static const WCHAR os_64bitW
[] =
689 {'6','4','-','b','i','t',0};
690 static const WCHAR os_buildnumberW
[] =
692 static const WCHAR os_captionW
[] =
693 {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ',
694 'V','e','r','s','i','o','n',' ','=',' ','5','.','1','.','2','6','0','0',0};
695 static const WCHAR os_csdversionW
[] =
696 {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','3',0};
697 static const WCHAR os_installdateW
[] =
698 {'2','0','1','4','0','1','0','1','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
699 static const WCHAR os_nameW
[] =
700 {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ',
701 'P','r','o','f','e','s','s','i','o','n','a','l','|','C',':','\\','W','I','N','D','O','W','S',
702 '|','\\','D','e','v','i','c','e','\\','H','a','r','d','d','i','s','k','0',
703 '\\','P','a','r','t','i','t','i','o','n','1',0};
704 static const WCHAR os_serialnumberW
[] =
705 {'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0};
706 static const WCHAR os_versionW
[] =
707 {'5','.','1','.','2','6','0','0',0};
708 static const WCHAR physicalmedia_tagW
[] =
709 {'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0};
710 static const WCHAR sounddevice_productnameW
[] =
711 {'W','i','n','e',' ','A','u','d','i','o',' ','D','e','v','i','c','e',0};
712 static const WCHAR systemenclosure_systemenclosureW
[] =
713 {'S','y','s','t','e','m',' ','E','n','c','l','o','s','u','r','e',0};
714 static const WCHAR systemenclosure_tagW
[] =
715 {'S','y','s','t','e','m',' ','E','n','c','l','o','s','u','r','e',' ','0',0};
716 static const WCHAR systemenclosure_manufacturerW
[] =
718 static const WCHAR videocontroller_dactypeW
[] =
719 {'I','n','t','e','g','r','a','t','e','d',' ','R','A','M','D','A','C',0};
720 static const WCHAR videocontroller_deviceidW
[] =
721 {'V','i','d','e','o','C','o','n','t','r','o','l','l','e','r','1',0};
722 static const WCHAR videocontroller_driverversionW
[] =
725 #include "pshpack1.h"
726 struct record_baseboard
728 const WCHAR
*manufacturer
;
731 const WCHAR
*product
;
732 const WCHAR
*serialnumber
;
734 const WCHAR
*version
;
738 const WCHAR
*description
;
739 const WCHAR
*identificationcode
;
740 const WCHAR
*manufacturer
;
741 const WCHAR
*releasedate
;
742 const WCHAR
*serialnumber
;
743 const WCHAR
*smbiosbiosversion
;
744 const WCHAR
*version
;
746 struct record_cdromdrive
748 const WCHAR
*device_id
;
750 const WCHAR
*mediatype
;
752 const WCHAR
*pnpdevice_id
;
754 struct record_computersystem
756 const WCHAR
*description
;
759 const WCHAR
*manufacturer
;
762 UINT32 num_logical_processors
;
763 UINT32 num_processors
;
764 UINT64 total_physical_memory
;
765 const WCHAR
*username
;
767 struct record_computersystemproduct
769 const WCHAR
*identifyingnumber
;
772 struct record_datafile
775 const WCHAR
*version
;
777 struct record_directory
782 struct record_diskdrive
784 const WCHAR
*device_id
;
786 const WCHAR
*interfacetype
;
787 const WCHAR
*manufacturer
;
788 const WCHAR
*mediatype
;
790 const WCHAR
*pnpdevice_id
;
791 const WCHAR
*serialnumber
;
794 struct record_diskpartition
798 const WCHAR
*device_id
;
801 const WCHAR
*pnpdevice_id
;
803 UINT64 startingoffset
;
806 struct record_logicaldisk
808 const WCHAR
*device_id
;
810 const WCHAR
*filesystem
;
814 const WCHAR
*volumename
;
815 const WCHAR
*volumeserialnumber
;
817 struct record_networkadapter
819 const WCHAR
*adaptertype
;
820 const WCHAR
*device_id
;
822 UINT32 interface_index
;
823 const WCHAR
*mac_address
;
824 const WCHAR
*manufacturer
;
826 UINT16 netconnection_status
;
828 const WCHAR
*pnpdevice_id
;
831 struct record_networkadapterconfig
833 const WCHAR
*dnshostname
;
835 UINT32 ipconnectionmetric
;
837 const WCHAR
*mac_address
;
839 struct record_operatingsystem
841 const WCHAR
*buildnumber
;
842 const WCHAR
*caption
;
843 const WCHAR
*codeset
;
844 const WCHAR
*countrycode
;
845 const WCHAR
*csdversion
;
846 const WCHAR
*installdate
;
847 const WCHAR
*lastbootuptime
;
848 const WCHAR
*localdatetime
;
851 const WCHAR
*osarchitecture
;
853 UINT32 osproductsuite
;
856 const WCHAR
*serialnumber
;
857 UINT16 servicepackmajor
;
858 UINT16 servicepackminor
;
860 const WCHAR
*systemdirectory
;
861 UINT64 totalvisiblememorysize
;
862 const WCHAR
*version
;
869 const WCHAR
*parameter
;
874 struct record_physicalmedia
876 const WCHAR
*serialnumber
;
879 struct record_physicalmemory
883 struct record_printer
886 const WCHAR
*drivername
;
887 UINT32 horizontalresolution
;
892 struct record_process
894 const WCHAR
*caption
;
895 const WCHAR
*commandline
;
896 const WCHAR
*description
;
902 UINT64 workingsetsize
;
904 class_method
*get_owner
;
906 struct record_processor
909 const WCHAR
*caption
;
911 UINT32 currentclockspeed
;
913 const WCHAR
*description
;
914 const WCHAR
*device_id
;
916 const WCHAR
*manufacturer
;
917 UINT32 maxclockspeed
;
920 UINT32 num_logical_processors
;
921 const WCHAR
*processor_id
;
922 UINT16 processortype
;
923 const WCHAR
*unique_id
;
924 const WCHAR
*version
;
926 struct record_qualifier
934 const WCHAR
*strvalue
;
936 struct record_service
940 const WCHAR
*displayname
;
943 const WCHAR
*servicetype
;
944 const WCHAR
*startmode
;
946 const WCHAR
*systemname
;
948 class_method
*pause_service
;
949 class_method
*resume_service
;
950 class_method
*start_service
;
951 class_method
*stop_service
;
955 const WCHAR
*accountname
;
956 const struct array
*binaryrepresentation
;
957 const WCHAR
*referenceddomainname
;
961 struct record_sounddevice
964 const WCHAR
*productname
;
967 struct record_stdregprov
969 class_method
*enumkey
;
970 class_method
*enumvalues
;
971 class_method
*getstringvalue
;
973 struct record_systemsecurity
978 struct record_systemenclosure
980 const WCHAR
*caption
;
981 const struct array
*chassistypes
;
982 const WCHAR
*description
;
984 const WCHAR
*manufacturer
;
988 struct record_videocontroller
990 const WCHAR
*adapter_dactype
;
993 const WCHAR
*caption
;
994 UINT32 current_bitsperpixel
;
995 UINT32 current_horizontalres
;
996 UINT32 current_refreshrate
;
997 UINT16 current_scanmode
;
998 UINT32 current_verticalres
;
999 const WCHAR
*description
;
1000 const WCHAR
*device_id
;
1001 const WCHAR
*driverversion
;
1003 const WCHAR
*pnpdevice_id
;
1004 UINT16 videoarchitecture
;
1005 UINT16 videomemorytype
;
1006 const WCHAR
*videoprocessor
;
1008 #include "poppack.h"
1010 static const struct record_baseboard data_baseboard
[] =
1012 { baseboard_manufacturerW
, baseboard_tagW
, baseboard_tagW
, baseboard_tagW
, baseboard_serialnumberW
, baseboard_versionW
}
1014 static const struct record_bios data_bios
[] =
1016 { bios_descriptionW
, bios_descriptionW
, bios_manufacturerW
, bios_releasedateW
, bios_serialnumberW
,
1017 bios_smbiosbiosversionW
, bios_versionW
}
1019 static const struct record_computersystemproduct data_compsysproduct
[] =
1021 { compsysproduct_identifyingnumberW
, compsysproduct_uuidW
}
1023 static const struct record_param data_param
[] =
1025 { class_processW
, method_getownerW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1026 { class_processW
, method_getownerW
, -1, param_userW
, CIM_STRING
},
1027 { class_processW
, method_getownerW
, -1, param_domainW
, CIM_STRING
},
1028 { class_serviceW
, method_pauseserviceW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1029 { class_serviceW
, method_resumeserviceW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1030 { class_serviceW
, method_startserviceW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1031 { class_serviceW
, method_stopserviceW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1032 { class_stdregprovW
, method_enumkeyW
, 1, param_defkeyW
, CIM_SINT32
, 0, 0x80000002 },
1033 { class_stdregprovW
, method_enumkeyW
, 1, param_subkeynameW
, CIM_STRING
},
1034 { class_stdregprovW
, method_enumkeyW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1035 { class_stdregprovW
, method_enumkeyW
, -1, param_namesW
, CIM_STRING
|CIM_FLAG_ARRAY
},
1036 { class_stdregprovW
, method_enumvaluesW
, 1, param_defkeyW
, CIM_SINT32
, 0, 0x80000002 },
1037 { class_stdregprovW
, method_enumvaluesW
, 1, param_subkeynameW
, CIM_STRING
},
1038 { class_stdregprovW
, method_enumvaluesW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1039 { class_stdregprovW
, method_enumvaluesW
, -1, param_namesW
, CIM_STRING
|CIM_FLAG_ARRAY
},
1040 { class_stdregprovW
, method_enumvaluesW
, -1, param_typesW
, CIM_SINT32
|CIM_FLAG_ARRAY
},
1041 { class_stdregprovW
, method_getstringvalueW
, 1, param_defkeyW
, CIM_SINT32
, 0, 0x80000002 },
1042 { class_stdregprovW
, method_getstringvalueW
, 1, param_subkeynameW
, CIM_STRING
},
1043 { class_stdregprovW
, method_getstringvalueW
, 1, param_valuenameW
, CIM_STRING
},
1044 { class_stdregprovW
, method_getstringvalueW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1045 { class_stdregprovW
, method_getstringvalueW
, -1, param_valueW
, CIM_STRING
},
1046 { class_systemsecurityW
, method_getsdW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1047 { class_systemsecurityW
, method_getsdW
, -1, param_sdW
, CIM_UINT8
|CIM_FLAG_ARRAY
},
1048 { class_systemsecurityW
, method_setsdW
, 1, param_sdW
, CIM_UINT8
|CIM_FLAG_ARRAY
},
1049 { class_systemsecurityW
, method_setsdW
, -1, param_returnvalueW
, CIM_UINT32
, VT_I4
},
1052 #define FLAVOR_ID (WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE | WBEM_FLAVOR_NOT_OVERRIDABLE |\
1053 WBEM_FLAVOR_ORIGIN_PROPAGATED)
1055 static const struct record_physicalmedia data_physicalmedia
[] =
1057 { diskdrive_serialW
, physicalmedia_tagW
}
1059 static const struct record_qualifier data_qualifier
[] =
1061 { class_process_getowner_outW
, param_userW
, CIM_SINT32
, FLAVOR_ID
, prop_idW
, 0 },
1062 { class_process_getowner_outW
, param_domainW
, CIM_SINT32
, FLAVOR_ID
, prop_idW
, 1 }
1064 static const struct record_sounddevice data_sounddevice
[] =
1066 { sounddevice_productnameW
, sounddevice_productnameW
, 3 /* enabled */ }
1068 static const struct record_stdregprov data_stdregprov
[] =
1070 { reg_enum_key
, reg_enum_values
, reg_get_stringvalue
}
1072 static UINT16 systemenclosure_chassistypes
[] =
1076 static const struct array systemenclosure_chassistypes_array
=
1078 SIZEOF(systemenclosure_chassistypes
),
1079 &systemenclosure_chassistypes
1081 static const struct record_systemenclosure data_systemenclosure
[] =
1084 systemenclosure_systemenclosureW
,
1085 &systemenclosure_chassistypes_array
,
1086 systemenclosure_systemenclosureW
,
1088 systemenclosure_manufacturerW
,
1089 systemenclosure_systemenclosureW
,
1090 systemenclosure_tagW
,
1093 static const struct record_systemsecurity data_systemsecurity
[] =
1095 { security_get_sd
, security_set_sd
}
1098 /* check if row matches condition and update status */
1099 static BOOL
match_row( const struct table
*table
, UINT row
, const struct expr
*cond
, enum fill_status
*status
)
1106 *status
= FILL_STATUS_UNFILTERED
;
1109 if (eval_cond( table
, row
, cond
, &val
, &type
) != S_OK
)
1111 *status
= FILL_STATUS_FAILED
;
1114 *status
= FILL_STATUS_FILTERED
;
1118 static BOOL
resize_table( struct table
*table
, UINT row_count
, UINT row_size
)
1120 if (!table
->num_rows_allocated
)
1122 if (!(table
->data
= heap_alloc( row_count
* row_size
))) return FALSE
;
1123 table
->num_rows_allocated
= row_count
;
1126 if (row_count
> table
->num_rows_allocated
)
1129 UINT count
= max( row_count
, table
->num_rows_allocated
* 2 );
1130 if (!(data
= heap_realloc( table
->data
, count
* row_size
))) return FALSE
;
1132 table
->num_rows_allocated
= count
;
1137 static enum fill_status
fill_cdromdrive( struct table
*table
, const struct expr
*cond
)
1139 static const WCHAR fmtW
[] = {'%','c',':',0};
1140 WCHAR drive
[3], root
[] = {'A',':','\\',0};
1141 struct record_cdromdrive
*rec
;
1142 UINT i
, row
= 0, offset
= 0;
1143 DWORD drives
= GetLogicalDrives();
1144 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1146 if (!resize_table( table
, 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1148 for (i
= 0; i
< sizeof(drives
); i
++)
1150 if (drives
& (1 << i
))
1153 if (GetDriveTypeW( root
) != DRIVE_CDROM
)
1156 if (!resize_table( table
, row
+ 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1158 rec
= (struct record_cdromdrive
*)(table
->data
+ offset
);
1159 rec
->device_id
= cdromdrive_pnpdeviceidW
;
1160 sprintfW( drive
, fmtW
, 'A' + i
);
1161 rec
->drive
= heap_strdupW( drive
);
1162 rec
->mediatype
= cdromdrive_mediatypeW
;
1163 rec
->name
= cdromdrive_nameW
;
1164 rec
->pnpdevice_id
= cdromdrive_pnpdeviceidW
;
1165 if (!match_row( table
, row
, cond
, &status
))
1167 free_row_values( table
, row
);
1170 offset
+= sizeof(*rec
);
1174 TRACE("created %u rows\n", row
);
1175 table
->num_rows
= row
;
1179 static UINT
get_processor_count(void)
1181 SYSTEM_BASIC_INFORMATION info
;
1183 if (NtQuerySystemInformation( SystemBasicInformation
, &info
, sizeof(info
), NULL
)) return 1;
1184 return info
.NumberOfProcessors
;
1187 static UINT
get_logical_processor_count( UINT
*num_cores
)
1189 SYSTEM_LOGICAL_PROCESSOR_INFORMATION
*info
;
1190 UINT i
, j
, count
= 0;
1194 if (num_cores
) *num_cores
= get_processor_count();
1195 status
= NtQuerySystemInformation( SystemLogicalProcessorInformation
, NULL
, 0, &len
);
1196 if (status
!= STATUS_INFO_LENGTH_MISMATCH
) return get_processor_count();
1198 if (!(info
= heap_alloc( len
))) return get_processor_count();
1199 status
= NtQuerySystemInformation( SystemLogicalProcessorInformation
, info
, len
, &len
);
1200 if (status
!= STATUS_SUCCESS
)
1203 return get_processor_count();
1205 if (num_cores
) *num_cores
= 0;
1206 for (i
= 0; i
< len
/ sizeof(*info
); i
++)
1208 if (info
[i
].Relationship
== RelationProcessorCore
)
1210 for (j
= 0; j
< sizeof(ULONG_PTR
); j
++) if (info
[i
].ProcessorMask
& (1 << j
)) count
++;
1212 else if (info
[i
].Relationship
== RelationProcessorPackage
&& num_cores
)
1214 for (j
= 0; j
< sizeof(ULONG_PTR
); j
++) if (info
[i
].ProcessorMask
& (1 << j
)) (*num_cores
)++;
1221 static UINT64
get_total_physical_memory(void)
1223 MEMORYSTATUSEX status
;
1225 status
.dwLength
= sizeof(status
);
1226 if (!GlobalMemoryStatusEx( &status
)) return 1024 * 1024 * 1024;
1227 return status
.ullTotalPhys
;
1230 static WCHAR
*get_computername(void)
1233 DWORD size
= MAX_COMPUTERNAME_LENGTH
+ 1;
1235 if (!(ret
= heap_alloc( size
* sizeof(WCHAR
) ))) return NULL
;
1236 GetComputerNameW( ret
, &size
);
1240 static WCHAR
*get_username(void)
1243 DWORD compsize
, usersize
;
1247 GetComputerNameW( NULL
, &compsize
);
1249 GetUserNameW( NULL
, &usersize
);
1250 size
= compsize
+ usersize
; /* two null terminators account for the \ */
1251 if (!(ret
= heap_alloc( size
* sizeof(WCHAR
) ))) return NULL
;
1252 GetComputerNameW( ret
, &compsize
);
1253 ret
[compsize
] = '\\';
1254 GetUserNameW( ret
+ compsize
+ 1, &usersize
);
1258 static enum fill_status
fill_compsys( struct table
*table
, const struct expr
*cond
)
1260 struct record_computersystem
*rec
;
1261 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1264 if (!resize_table( table
, 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1266 rec
= (struct record_computersystem
*)table
->data
;
1267 rec
->description
= compsys_descriptionW
;
1268 rec
->domain
= compsys_domainW
;
1269 rec
->domainrole
= 0; /* standalone workstation */
1270 rec
->manufacturer
= compsys_manufacturerW
;
1271 rec
->model
= compsys_modelW
;
1272 rec
->name
= get_computername();
1273 rec
->num_logical_processors
= get_logical_processor_count( NULL
);
1274 rec
->num_processors
= get_processor_count();
1275 rec
->total_physical_memory
= get_total_physical_memory();
1276 rec
->username
= get_username();
1277 if (!match_row( table
, row
, cond
, &status
)) free_row_values( table
, row
);
1280 TRACE("created %u rows\n", row
);
1281 table
->num_rows
= row
;
1293 static struct dirstack
*alloc_dirstack( UINT size
)
1295 struct dirstack
*dirstack
;
1297 if (!(dirstack
= heap_alloc( sizeof(*dirstack
) ))) return NULL
;
1298 if (!(dirstack
->dirs
= heap_alloc( sizeof(WCHAR
*) * size
)))
1300 heap_free( dirstack
);
1303 if (!(dirstack
->len_dirs
= heap_alloc( sizeof(UINT
) * size
)))
1305 heap_free( dirstack
->dirs
);
1306 heap_free( dirstack
);
1309 dirstack
->num_dirs
= 0;
1310 dirstack
->num_allocated
= size
;
1314 static void clear_dirstack( struct dirstack
*dirstack
)
1317 for (i
= 0; i
< dirstack
->num_dirs
; i
++) heap_free( dirstack
->dirs
[i
] );
1318 dirstack
->num_dirs
= 0;
1321 static void free_dirstack( struct dirstack
*dirstack
)
1323 clear_dirstack( dirstack
);
1324 heap_free( dirstack
->dirs
);
1325 heap_free( dirstack
->len_dirs
);
1326 heap_free( dirstack
);
1329 static BOOL
push_dir( struct dirstack
*dirstack
, WCHAR
*dir
, UINT len
)
1331 UINT size
, i
= dirstack
->num_dirs
;
1333 if (!dir
) return FALSE
;
1335 if (i
== dirstack
->num_allocated
)
1340 size
= dirstack
->num_allocated
* 2;
1341 if (!(tmp
= heap_realloc( dirstack
->dirs
, size
* sizeof(WCHAR
*) ))) return FALSE
;
1342 dirstack
->dirs
= tmp
;
1343 if (!(len_tmp
= heap_realloc( dirstack
->len_dirs
, size
* sizeof(UINT
) ))) return FALSE
;
1344 dirstack
->len_dirs
= len_tmp
;
1345 dirstack
->num_allocated
= size
;
1347 dirstack
->dirs
[i
] = dir
;
1348 dirstack
->len_dirs
[i
] = len
;
1349 dirstack
->num_dirs
++;
1353 static WCHAR
*pop_dir( struct dirstack
*dirstack
, UINT
*len
)
1355 if (!dirstack
->num_dirs
)
1360 dirstack
->num_dirs
--;
1361 *len
= dirstack
->len_dirs
[dirstack
->num_dirs
];
1362 return dirstack
->dirs
[dirstack
->num_dirs
];
1365 static const WCHAR
*peek_dir( struct dirstack
*dirstack
)
1367 if (!dirstack
->num_dirs
) return NULL
;
1368 return dirstack
->dirs
[dirstack
->num_dirs
- 1];
1371 static WCHAR
*build_glob( WCHAR drive
, const WCHAR
*path
, UINT len
)
1376 if (!(ret
= heap_alloc( (len
+ 6) * sizeof(WCHAR
) ))) return NULL
;
1382 memcpy( ret
+ i
, path
, len
* sizeof(WCHAR
) );
1391 static WCHAR
*build_name( WCHAR drive
, const WCHAR
*path
)
1393 UINT i
= 0, len
= 0;
1397 for (p
= path
; *p
; p
++)
1399 if (*p
== '\\') len
+= 2;
1402 if (!(ret
= heap_alloc( (len
+ 5) * sizeof(WCHAR
) ))) return NULL
;
1407 for (p
= path
; *p
; p
++)
1409 if (*p
!= '\\') ret
[i
++] = *p
;
1420 static WCHAR
*build_dirname( const WCHAR
*path
, UINT
*ret_len
)
1422 const WCHAR
*p
= path
, *start
;
1426 if (!isalphaW( p
[0] ) || p
[1] != ':' || p
[2] != '\\' || p
[3] != '\\' || !p
[4]) return NULL
;
1428 len
= strlenW( start
);
1429 p
= start
+ len
- 1;
1430 if (*p
== '\\') return NULL
;
1432 while (p
>= start
&& *p
!= '\\') { len
--; p
--; };
1433 while (p
>= start
&& *p
== '\\') { len
--; p
--; };
1435 if (!(ret
= heap_alloc( (len
+ 1) * sizeof(WCHAR
) ))) return NULL
;
1436 for (i
= 0, p
= start
; p
< start
+ len
; p
++)
1438 if (p
[0] == '\\' && p
[1] == '\\')
1450 static BOOL
seen_dir( struct dirstack
*dirstack
, const WCHAR
*path
)
1453 for (i
= 0; i
< dirstack
->num_dirs
; i
++) if (!strcmpW( dirstack
->dirs
[i
], path
)) return TRUE
;
1457 /* optimize queries of the form WHERE Name='...' [OR Name='...']* */
1458 static UINT
seed_dirs( struct dirstack
*dirstack
, const struct expr
*cond
, WCHAR root
, UINT
*count
)
1460 const struct expr
*left
, *right
;
1462 if (!cond
|| cond
->type
!= EXPR_COMPLEX
) return *count
= 0;
1464 left
= cond
->u
.expr
.left
;
1465 right
= cond
->u
.expr
.right
;
1466 if (cond
->u
.expr
.op
== OP_EQ
)
1470 const WCHAR
*str
= NULL
;
1472 if (left
->type
== EXPR_PROPVAL
&& right
->type
== EXPR_SVAL
&&
1473 !strcmpW( left
->u
.propval
->name
, prop_nameW
) &&
1474 toupperW( right
->u
.sval
[0] ) == toupperW( root
))
1476 str
= right
->u
.sval
;
1478 else if (left
->type
== EXPR_SVAL
&& right
->type
== EXPR_PROPVAL
&&
1479 !strcmpW( right
->u
.propval
->name
, prop_nameW
) &&
1480 toupperW( left
->u
.sval
[0] ) == toupperW( root
))
1484 if (str
&& (path
= build_dirname( str
, &len
)))
1486 if (seen_dir( dirstack
, path
))
1491 else if (push_dir( dirstack
, path
, len
)) return ++*count
;
1496 else if (cond
->u
.expr
.op
== OP_OR
)
1498 UINT left_count
= 0, right_count
= 0;
1500 if (!(seed_dirs( dirstack
, left
, root
, &left_count
))) return *count
= 0;
1501 if (!(seed_dirs( dirstack
, right
, root
, &right_count
))) return *count
= 0;
1502 return *count
+= left_count
+ right_count
;
1507 static WCHAR
*append_path( const WCHAR
*path
, const WCHAR
*segment
, UINT
*len
)
1509 UINT len_path
= 0, len_segment
= strlenW( segment
);
1513 if (path
) len_path
= strlenW( path
);
1514 if (!(ret
= heap_alloc( (len_path
+ len_segment
+ 2) * sizeof(WCHAR
) ))) return NULL
;
1515 if (path
&& len_path
)
1517 memcpy( ret
, path
, len_path
* sizeof(WCHAR
) );
1518 ret
[len_path
] = '\\';
1519 *len
+= len_path
+ 1;
1521 memcpy( ret
+ *len
, segment
, len_segment
* sizeof(WCHAR
) );
1522 *len
+= len_segment
;
1527 static WCHAR
*get_file_version( const WCHAR
*filename
)
1529 static const WCHAR slashW
[] = {'\\',0}, fmtW
[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
1530 VS_FIXEDFILEINFO
*info
;
1535 if (!(ret
= heap_alloc( (4 * 5 + sizeof(fmtW
) / sizeof(fmtW
[0])) * sizeof(WCHAR
) ))) return NULL
;
1536 if (!(size
= GetFileVersionInfoSizeW( filename
, NULL
)) || !(block
= heap_alloc( size
)))
1541 if (!GetFileVersionInfoW( filename
, 0, size
, block
) ||
1542 !VerQueryValueW( block
, slashW
, (void **)&info
, &size
))
1548 sprintfW( ret
, fmtW
, info
->dwFileVersionMS
>> 16, info
->dwFileVersionMS
& 0xffff,
1549 info
->dwFileVersionLS
>> 16, info
->dwFileVersionLS
& 0xffff );
1554 static enum fill_status
fill_datafile( struct table
*table
, const struct expr
*cond
)
1556 static const WCHAR dotW
[] = {'.',0}, dotdotW
[] = {'.','.',0};
1557 struct record_datafile
*rec
;
1558 UINT i
, len
, row
= 0, offset
= 0, num_expected_rows
;
1559 WCHAR
*glob
= NULL
, *path
= NULL
, *new_path
, root
[] = {'A',':','\\',0};
1560 DWORD drives
= GetLogicalDrives();
1561 WIN32_FIND_DATAW data
;
1563 struct dirstack
*dirstack
;
1564 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1566 if (!resize_table( table
, 8, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1568 dirstack
= alloc_dirstack(2);
1570 for (i
= 0; i
< sizeof(drives
); i
++)
1572 if (!(drives
& (1 << i
))) continue;
1575 if (GetDriveTypeW( root
) != DRIVE_FIXED
) continue;
1577 num_expected_rows
= 0;
1578 if (!seed_dirs( dirstack
, cond
, root
[0], &num_expected_rows
)) clear_dirstack( dirstack
);
1584 path
= pop_dir( dirstack
, &len
);
1585 if (!(glob
= build_glob( root
[0], path
, len
)))
1587 status
= FILL_STATUS_FAILED
;
1590 if ((handle
= FindFirstFileW( glob
, &data
)) != INVALID_HANDLE_VALUE
)
1594 if (!resize_table( table
, row
+ 1, sizeof(*rec
) ))
1596 status
= FILL_STATUS_FAILED
;
1597 FindClose( handle
);
1600 if (!strcmpW( data
.cFileName
, dotW
) || !strcmpW( data
.cFileName
, dotdotW
)) continue;
1601 new_path
= append_path( path
, data
.cFileName
, &len
);
1603 if (data
.dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY
)
1605 if (push_dir( dirstack
, new_path
, len
)) continue;
1606 heap_free( new_path
);
1607 FindClose( handle
);
1608 status
= FILL_STATUS_FAILED
;
1611 rec
= (struct record_datafile
*)(table
->data
+ offset
);
1612 rec
->name
= build_name( root
[0], new_path
);
1613 rec
->version
= get_file_version( rec
->name
);
1614 if (!match_row( table
, row
, cond
, &status
))
1616 free_row_values( table
, row
);
1619 else if (num_expected_rows
&& row
== num_expected_rows
- 1)
1622 FindClose( handle
);
1623 status
= FILL_STATUS_FILTERED
;
1626 offset
+= sizeof(*rec
);
1629 while (FindNextFileW( handle
, &data
));
1630 FindClose( handle
);
1632 if (!peek_dir( dirstack
)) break;
1637 free_dirstack( dirstack
);
1641 TRACE("created %u rows\n", row
);
1642 table
->num_rows
= row
;
1646 static enum fill_status
fill_directory( struct table
*table
, const struct expr
*cond
)
1648 static const WCHAR dotW
[] = {'.',0}, dotdotW
[] = {'.','.',0};
1649 struct record_directory
*rec
;
1650 UINT i
, len
, row
= 0, offset
= 0, num_expected_rows
;
1651 WCHAR
*glob
= NULL
, *path
= NULL
, *new_path
, root
[] = {'A',':','\\',0};
1652 DWORD drives
= GetLogicalDrives();
1653 WIN32_FIND_DATAW data
;
1655 struct dirstack
*dirstack
;
1656 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1658 if (!resize_table( table
, 4, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1660 dirstack
= alloc_dirstack(2);
1662 for (i
= 0; i
< sizeof(drives
); i
++)
1664 if (!(drives
& (1 << i
))) continue;
1667 if (GetDriveTypeW( root
) != DRIVE_FIXED
) continue;
1669 num_expected_rows
= 0;
1670 if (!seed_dirs( dirstack
, cond
, root
[0], &num_expected_rows
)) clear_dirstack( dirstack
);
1676 path
= pop_dir( dirstack
, &len
);
1677 if (!(glob
= build_glob( root
[0], path
, len
)))
1679 status
= FILL_STATUS_FAILED
;
1682 if ((handle
= FindFirstFileW( glob
, &data
)) != INVALID_HANDLE_VALUE
)
1686 if (!resize_table( table
, row
+ 1, sizeof(*rec
) ))
1688 FindClose( handle
);
1689 status
= FILL_STATUS_FAILED
;
1692 if (!(data
.dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY
) ||
1693 !strcmpW( data
.cFileName
, dotW
) || !strcmpW( data
.cFileName
, dotdotW
))
1696 new_path
= append_path( path
, data
.cFileName
, &len
);
1697 if (!(push_dir( dirstack
, new_path
, len
)))
1699 heap_free( new_path
);
1700 FindClose( handle
);
1701 status
= FILL_STATUS_FAILED
;
1704 rec
= (struct record_directory
*)(table
->data
+ offset
);
1705 rec
->accessmask
= FILE_ALL_ACCESS
;
1706 rec
->name
= build_name( root
[0], new_path
);
1707 if (!match_row( table
, row
, cond
, &status
))
1709 free_row_values( table
, row
);
1712 else if (num_expected_rows
&& row
== num_expected_rows
- 1)
1715 FindClose( handle
);
1716 status
= FILL_STATUS_FILTERED
;
1719 offset
+= sizeof(*rec
);
1722 while (FindNextFileW( handle
, &data
));
1723 FindClose( handle
);
1725 if (!peek_dir( dirstack
)) break;
1730 free_dirstack( dirstack
);
1734 TRACE("created %u rows\n", row
);
1735 table
->num_rows
= row
;
1739 static UINT64
get_freespace( const WCHAR
*dir
, UINT64
*disksize
)
1741 WCHAR root
[] = {'\\','\\','.','\\','A',':',0};
1742 ULARGE_INTEGER free
;
1743 DISK_GEOMETRY_EX info
;
1745 DWORD bytes_returned
;
1747 free
.QuadPart
= 512 * 1024 * 1024;
1748 GetDiskFreeSpaceExW( dir
, NULL
, NULL
, &free
);
1751 handle
= CreateFileW( root
, GENERIC_READ
, FILE_SHARE_READ
|FILE_SHARE_WRITE
, NULL
, OPEN_EXISTING
, 0, 0 );
1752 if (handle
!= INVALID_HANDLE_VALUE
)
1754 if (DeviceIoControl( handle
, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
, NULL
, 0, &info
, sizeof(info
), &bytes_returned
, NULL
))
1755 *disksize
= info
.DiskSize
.QuadPart
;
1756 CloseHandle( handle
);
1758 return free
.QuadPart
;
1761 static enum fill_status
fill_diskdrive( struct table
*table
, const struct expr
*cond
)
1763 static const WCHAR fmtW
[] =
1764 {'\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','%','u',0};
1765 WCHAR device_id
[sizeof(fmtW
)/sizeof(fmtW
[0]) + 10], root
[] = {'A',':','\\',0};
1766 struct record_diskdrive
*rec
;
1767 UINT i
, row
= 0, offset
= 0, index
= 0, type
;
1768 UINT64 size
= 1024 * 1024 * 1024;
1769 DWORD drives
= GetLogicalDrives();
1770 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1772 if (!resize_table( table
, 2, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1774 for (i
= 0; i
< sizeof(drives
); i
++)
1776 if (drives
& (1 << i
))
1779 type
= GetDriveTypeW( root
);
1780 if (type
!= DRIVE_FIXED
&& type
!= DRIVE_REMOVABLE
)
1783 if (!resize_table( table
, row
+ 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1785 rec
= (struct record_diskdrive
*)(table
->data
+ offset
);
1786 sprintfW( device_id
, fmtW
, index
);
1787 rec
->device_id
= heap_strdupW( device_id
);
1789 rec
->interfacetype
= diskdrive_interfacetypeW
;
1790 rec
->manufacturer
= diskdrive_manufacturerW
;
1791 if (type
== DRIVE_FIXED
)
1792 rec
->mediatype
= diskdrive_mediatype_fixedW
;
1794 rec
->mediatype
= diskdrive_mediatype_removableW
;
1795 rec
->model
= diskdrive_modelW
;
1796 rec
->pnpdevice_id
= diskdrive_pnpdeviceidW
;
1797 rec
->serialnumber
= diskdrive_serialW
;
1798 get_freespace( root
, &size
);
1800 if (!match_row( table
, row
, cond
, &status
))
1802 free_row_values( table
, row
);
1805 offset
+= sizeof(*rec
);
1810 TRACE("created %u rows\n", row
);
1811 table
->num_rows
= row
;
1815 static WCHAR
*get_filesystem( const WCHAR
*root
)
1817 static const WCHAR ntfsW
[] = {'N','T','F','S',0};
1818 WCHAR buffer
[MAX_PATH
+ 1];
1820 if (GetVolumeInformationW( root
, NULL
, 0, NULL
, NULL
, NULL
, buffer
, MAX_PATH
+ 1 ))
1821 return heap_strdupW( buffer
);
1822 return heap_strdupW( ntfsW
);
1825 static enum fill_status
fill_diskpartition( struct table
*table
, const struct expr
*cond
)
1827 static const WCHAR fmtW
[] =
1828 {'D','i','s','k',' ','#','%','u',',',' ','P','a','r','t','i','t','i','o','n',' ','#','0',0};
1829 WCHAR device_id
[32], root
[] = {'A',':','\\',0};
1830 struct record_diskpartition
*rec
;
1831 UINT i
, row
= 0, offset
= 0, type
, index
= 0;
1832 UINT64 size
= 1024 * 1024 * 1024;
1833 DWORD drives
= GetLogicalDrives();
1834 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1836 if (!resize_table( table
, 4, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1838 for (i
= 0; i
< sizeof(drives
); i
++)
1840 if (drives
& (1 << i
))
1843 type
= GetDriveTypeW( root
);
1844 if (type
!= DRIVE_FIXED
&& type
!= DRIVE_REMOVABLE
)
1847 if (!resize_table( table
, row
+ 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1849 rec
= (struct record_diskpartition
*)(table
->data
+ offset
);
1850 rec
->bootable
= (i
== 2) ? -1 : 0;
1851 rec
->bootpartition
= (i
== 2) ? -1 : 0;
1852 sprintfW( device_id
, fmtW
, index
);
1853 rec
->device_id
= heap_strdupW( device_id
);
1854 rec
->diskindex
= index
;
1856 rec
->pnpdevice_id
= heap_strdupW( device_id
);
1857 get_freespace( root
, &size
);
1859 rec
->startingoffset
= 0;
1860 rec
->type
= get_filesystem( root
);
1861 if (!match_row( table
, row
, cond
, &status
))
1863 free_row_values( table
, row
);
1866 offset
+= sizeof(*rec
);
1871 TRACE("created %u rows\n", row
);
1872 table
->num_rows
= row
;
1876 static WCHAR
*get_volumename( const WCHAR
*root
)
1878 WCHAR buf
[MAX_PATH
+ 1] = {0};
1879 GetVolumeInformationW( root
, buf
, sizeof(buf
)/sizeof(buf
[0]), NULL
, NULL
, NULL
, NULL
, 0 );
1880 return heap_strdupW( buf
);
1882 static WCHAR
*get_volumeserialnumber( const WCHAR
*root
)
1884 static const WCHAR fmtW
[] = {'%','0','8','X',0};
1888 GetVolumeInformationW( root
, NULL
, 0, &serial
, NULL
, NULL
, NULL
, 0 );
1889 sprintfW( buffer
, fmtW
, serial
);
1890 return heap_strdupW( buffer
);
1893 static enum fill_status
fill_logicaldisk( struct table
*table
, const struct expr
*cond
)
1895 static const WCHAR fmtW
[] = {'%','c',':',0};
1896 WCHAR device_id
[3], root
[] = {'A',':','\\',0};
1897 struct record_logicaldisk
*rec
;
1898 UINT i
, row
= 0, offset
= 0, type
;
1899 UINT64 size
= 1024 * 1024 * 1024;
1900 DWORD drives
= GetLogicalDrives();
1901 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1903 if (!resize_table( table
, 4, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1905 for (i
= 0; i
< sizeof(drives
); i
++)
1907 if (drives
& (1 << i
))
1910 type
= GetDriveTypeW( root
);
1911 if (type
!= DRIVE_FIXED
&& type
!= DRIVE_CDROM
&& type
!= DRIVE_REMOVABLE
)
1914 if (!resize_table( table
, row
+ 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
1916 rec
= (struct record_logicaldisk
*)(table
->data
+ offset
);
1917 sprintfW( device_id
, fmtW
, 'A' + i
);
1918 rec
->device_id
= heap_strdupW( device_id
);
1919 rec
->drivetype
= type
;
1920 rec
->filesystem
= get_filesystem( root
);
1921 rec
->freespace
= get_freespace( root
, &size
);
1922 rec
->name
= heap_strdupW( device_id
);
1924 rec
->volumename
= get_volumename( root
);
1925 rec
->volumeserialnumber
= get_volumeserialnumber( root
);
1926 if (!match_row( table
, row
, cond
, &status
))
1928 free_row_values( table
, row
);
1931 offset
+= sizeof(*rec
);
1935 TRACE("created %u rows\n", row
);
1936 table
->num_rows
= row
;
1940 static UINT16
get_connection_status( IF_OPER_STATUS status
)
1944 case IfOperStatusDown
:
1945 return 0; /* Disconnected */
1946 case IfOperStatusUp
:
1947 return 2; /* Connected */
1949 ERR("unhandled status %u\n", status
);
1954 static WCHAR
*get_mac_address( const BYTE
*addr
, DWORD len
)
1956 static const WCHAR fmtW
[] =
1957 {'%','0','2','x',':','%','0','2','x',':','%','0','2','x',':',
1958 '%','0','2','x',':','%','0','2','x',':','%','0','2','x',0};
1961 if (len
!= 6 || !(ret
= heap_alloc( 18 * sizeof(WCHAR
) ))) return NULL
;
1962 sprintfW( ret
, fmtW
, addr
[0], addr
[1], addr
[2], addr
[3], addr
[4], addr
[5] );
1965 static const WCHAR
*get_adaptertype( DWORD type
, int *physical
)
1967 static const WCHAR ethernetW
[] = {'E','t','h','e','r','n','e','t',' ','8','0','2','.','3',0};
1968 static const WCHAR wirelessW
[] = {'W','i','r','e','l','e','s','s',0};
1969 static const WCHAR firewireW
[] = {'1','3','9','4',0};
1970 static const WCHAR tunnelW
[] = {'T','u','n','n','e','l',0};
1974 case IF_TYPE_ETHERNET_CSMACD
: *physical
= -1; return ethernetW
;
1975 case IF_TYPE_IEEE80211
: *physical
= -1; return wirelessW
;
1976 case IF_TYPE_IEEE1394
: *physical
= -1; return firewireW
;
1977 case IF_TYPE_TUNNEL
: *physical
= 0; return tunnelW
;
1978 default: *physical
= 0; return NULL
;
1982 static enum fill_status
fill_networkadapter( struct table
*table
, const struct expr
*cond
)
1984 static const WCHAR fmtW
[] = {'%','u',0};
1985 WCHAR device_id
[11];
1986 struct record_networkadapter
*rec
;
1987 IP_ADAPTER_ADDRESSES
*aa
, *buffer
;
1988 UINT row
= 0, offset
= 0, count
= 0;
1989 DWORD size
= 0, ret
;
1991 enum fill_status status
= FILL_STATUS_UNFILTERED
;
1993 ret
= GetAdaptersAddresses( AF_UNSPEC
, 0, NULL
, NULL
, &size
);
1994 if (ret
!= ERROR_BUFFER_OVERFLOW
) return FILL_STATUS_FAILED
;
1996 if (!(buffer
= heap_alloc( size
))) return FILL_STATUS_FAILED
;
1997 if (GetAdaptersAddresses( AF_UNSPEC
, 0, NULL
, buffer
, &size
))
1999 heap_free( buffer
);
2000 return FILL_STATUS_FAILED
;
2002 for (aa
= buffer
; aa
; aa
= aa
->Next
)
2004 if (aa
->IfType
!= IF_TYPE_SOFTWARE_LOOPBACK
) count
++;
2006 if (!resize_table( table
, count
, sizeof(*rec
) ))
2008 heap_free( buffer
);
2009 return FILL_STATUS_FAILED
;
2011 for (aa
= buffer
; aa
; aa
= aa
->Next
)
2013 if (aa
->IfType
== IF_TYPE_SOFTWARE_LOOPBACK
) continue;
2015 rec
= (struct record_networkadapter
*)(table
->data
+ offset
);
2016 sprintfW( device_id
, fmtW
, aa
->u
.s
.IfIndex
);
2017 rec
->adaptertype
= get_adaptertype( aa
->IfType
, &physical
);
2018 rec
->device_id
= heap_strdupW( device_id
);
2019 rec
->index
= aa
->u
.s
.IfIndex
;
2020 rec
->interface_index
= aa
->u
.s
.IfIndex
;
2021 rec
->mac_address
= get_mac_address( aa
->PhysicalAddress
, aa
->PhysicalAddressLength
);
2022 rec
->manufacturer
= compsys_manufacturerW
;
2023 rec
->name
= heap_strdupW( aa
->FriendlyName
);
2024 rec
->netconnection_status
= get_connection_status( aa
->OperStatus
);
2025 rec
->physicaladapter
= physical
;
2026 rec
->pnpdevice_id
= networkadapter_pnpdeviceidW
;
2027 rec
->speed
= 1000000;
2028 if (!match_row( table
, row
, cond
, &status
))
2030 free_row_values( table
, row
);
2033 offset
+= sizeof(*rec
);
2036 TRACE("created %u rows\n", row
);
2037 table
->num_rows
= row
;
2039 heap_free( buffer
);
2043 static WCHAR
*get_dnshostname( IP_ADAPTER_UNICAST_ADDRESS
*addr
)
2045 const SOCKET_ADDRESS
*sa
= &addr
->Address
;
2046 WCHAR buf
[NI_MAXHOST
];
2048 if (!addr
) return NULL
;
2049 if (GetNameInfoW( sa
->lpSockaddr
, sa
->iSockaddrLength
, buf
, sizeof(buf
)/sizeof(buf
[0]), NULL
,
2050 0, NI_NAMEREQD
)) return NULL
;
2051 return heap_strdupW( buf
);
2054 static enum fill_status
fill_networkadapterconfig( struct table
*table
, const struct expr
*cond
)
2056 struct record_networkadapterconfig
*rec
;
2057 IP_ADAPTER_ADDRESSES
*aa
, *buffer
;
2058 UINT row
= 0, offset
= 0, count
= 0;
2059 DWORD size
= 0, ret
;
2060 enum fill_status status
= FILL_STATUS_UNFILTERED
;
2062 ret
= GetAdaptersAddresses( AF_UNSPEC
, 0, NULL
, NULL
, &size
);
2063 if (ret
!= ERROR_BUFFER_OVERFLOW
) return FILL_STATUS_FAILED
;
2065 if (!(buffer
= heap_alloc( size
))) return FILL_STATUS_FAILED
;
2066 if (GetAdaptersAddresses( AF_UNSPEC
, 0, NULL
, buffer
, &size
))
2068 heap_free( buffer
);
2069 return FILL_STATUS_FAILED
;
2071 for (aa
= buffer
; aa
; aa
= aa
->Next
)
2073 if (aa
->IfType
!= IF_TYPE_SOFTWARE_LOOPBACK
) count
++;
2075 if (!resize_table( table
, count
, sizeof(*rec
) ))
2077 heap_free( buffer
);
2078 return FILL_STATUS_FAILED
;
2080 for (aa
= buffer
; aa
; aa
= aa
->Next
)
2082 if (aa
->IfType
== IF_TYPE_SOFTWARE_LOOPBACK
) continue;
2084 rec
= (struct record_networkadapterconfig
*)(table
->data
+ offset
);
2085 rec
->dnshostname
= get_dnshostname( aa
->FirstUnicastAddress
);
2086 rec
->index
= aa
->u
.s
.IfIndex
;
2087 rec
->ipconnectionmetric
= 20;
2088 rec
->ipenabled
= -1;
2089 rec
->mac_address
= get_mac_address( aa
->PhysicalAddress
, aa
->PhysicalAddressLength
);
2090 if (!match_row( table
, row
, cond
, &status
))
2092 free_row_values( table
, row
);
2095 offset
+= sizeof(*rec
);
2098 TRACE("created %u rows\n", row
);
2099 table
->num_rows
= row
;
2101 heap_free( buffer
);
2105 static enum fill_status
fill_physicalmemory( struct table
*table
, const struct expr
*cond
)
2107 struct record_physicalmemory
*rec
;
2108 enum fill_status status
= FILL_STATUS_UNFILTERED
;
2111 if (!resize_table( table
, 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
2113 rec
= (struct record_physicalmemory
*)table
->data
;
2114 rec
->capacity
= get_total_physical_memory();
2115 if (!match_row( table
, row
, cond
, &status
)) free_row_values( table
, row
);
2118 TRACE("created %u rows\n", row
);
2119 table
->num_rows
= row
;
2123 static enum fill_status
fill_printer( struct table
*table
, const struct expr
*cond
)
2125 struct record_printer
*rec
;
2126 enum fill_status status
= FILL_STATUS_UNFILTERED
;
2127 PRINTER_INFO_2W
*info
;
2128 DWORD i
, offset
= 0, count
= 0, size
= 0;
2130 EnumPrintersW( PRINTER_ENUM_LOCAL
, NULL
, 2, NULL
, 0, &size
, &count
);
2131 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) return FILL_STATUS_FAILED
;
2133 if (!(info
= heap_alloc( size
))) return FILL_STATUS_FAILED
;
2134 if (!EnumPrintersW( PRINTER_ENUM_LOCAL
, NULL
, 2, (BYTE
*)info
, size
, &size
, &count
))
2137 return FILL_STATUS_FAILED
;
2139 if (!resize_table( table
, count
, sizeof(*rec
) ))
2142 return FILL_STATUS_FAILED
;
2145 for (i
= 0; i
< count
; i
++)
2147 rec
= (struct record_printer
*)(table
->data
+ offset
);
2148 rec
->attributes
= info
[i
].Attributes
;
2149 rec
->drivername
= heap_strdupW( info
[i
].pDriverName
);
2150 rec
->horizontalresolution
= info
[i
].pDevMode
->u1
.s1
.dmPrintQuality
;
2152 rec
->name
= heap_strdupW( info
[i
].pPrinterName
);
2154 if (!match_row( table
, i
, cond
, &status
))
2156 free_row_values( table
, i
);
2159 offset
+= sizeof(*rec
);
2161 TRACE("created %u rows\n", count
);
2162 table
->num_rows
= count
;
2168 static WCHAR
*get_cmdline( DWORD process_id
)
2170 if (process_id
== GetCurrentProcessId()) return heap_strdupW( GetCommandLineW() );
2171 return NULL
; /* FIXME handle different process case */
2174 static enum fill_status
fill_process( struct table
*table
, const struct expr
*cond
)
2176 static const WCHAR fmtW
[] = {'%','u',0};
2178 struct record_process
*rec
;
2179 PROCESSENTRY32W entry
;
2181 enum fill_status status
= FILL_STATUS_FAILED
;
2182 UINT row
= 0, offset
= 0;
2184 snap
= CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS
, 0 );
2185 if (snap
== INVALID_HANDLE_VALUE
) return FILL_STATUS_FAILED
;
2187 entry
.dwSize
= sizeof(entry
);
2188 if (!Process32FirstW( snap
, &entry
)) goto done
;
2189 if (!resize_table( table
, 8, sizeof(*rec
) )) goto done
;
2193 if (!resize_table( table
, row
+ 1, sizeof(*rec
) )) goto done
;
2195 rec
= (struct record_process
*)(table
->data
+ offset
);
2196 rec
->caption
= heap_strdupW( entry
.szExeFile
);
2197 rec
->commandline
= get_cmdline( entry
.th32ProcessID
);
2198 rec
->description
= heap_strdupW( entry
.szExeFile
);
2199 sprintfW( handle
, fmtW
, entry
.th32ProcessID
);
2200 rec
->handle
= heap_strdupW( handle
);
2201 rec
->name
= heap_strdupW( entry
.szExeFile
);
2202 rec
->process_id
= entry
.th32ProcessID
;
2203 rec
->pprocess_id
= entry
.th32ParentProcessID
;
2204 rec
->thread_count
= entry
.cntThreads
;
2205 rec
->workingsetsize
= 0;
2206 rec
->get_owner
= process_get_owner
;
2207 if (!match_row( table
, row
, cond
, &status
))
2209 free_row_values( table
, row
);
2212 offset
+= sizeof(*rec
);
2214 } while (Process32NextW( snap
, &entry
));
2216 TRACE("created %u rows\n", row
);
2217 table
->num_rows
= row
;
2218 status
= FILL_STATUS_UNFILTERED
;
2221 CloseHandle( snap
);
2225 static inline void do_cpuid( unsigned int ax
, unsigned int *p
)
2231 __asm__("pushl %%ebx\n\t"
2233 "movl %%ebx, %%esi\n\t"
2235 : "=a" (p
[0]), "=S" (p
[1]), "=c" (p
[2]), "=d" (p
[3])
2240 static const WCHAR
*get_osarchitecture(void)
2243 GetNativeSystemInfo( &info
);
2244 if (info
.u
.s
.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_AMD64
) return os_64bitW
;
2247 static void get_processor_caption( WCHAR
*caption
)
2249 static const WCHAR fmtW
[] =
2250 {'%','s',' ','F','a','m','i','l','y',' ','%','u',' ',
2251 'M','o','d','e','l',' ','%','u',' ','S','t','e','p','p','i','n','g',' ','%','u',0};
2252 static const WCHAR x86W
[] = {'x','8','6',0};
2253 static const WCHAR intel64W
[] = {'I','n','t','e','l','6','4',0};
2254 const WCHAR
*arch
= (get_osarchitecture() == os_32bitW
) ? x86W
: intel64W
;
2255 unsigned int regs
[4] = {0, 0, 0, 0};
2257 do_cpuid( 1, regs
);
2258 sprintfW( caption
, fmtW
, arch
, (regs
[0] & (15 << 8)) >> 8, (regs
[0] & (15 << 4)) >> 4, regs
[0] & 15 );
2260 static void get_processor_version( WCHAR
*version
)
2262 static const WCHAR fmtW
[] =
2263 {'M','o','d','e','l',' ','%','u',',',' ','S','t','e','p','p','i','n','g',' ','%','u',0};
2264 unsigned int regs
[4] = {0, 0, 0, 0};
2266 do_cpuid( 1, regs
);
2267 sprintfW( version
, fmtW
, (regs
[0] & (15 << 4)) >> 4, regs
[0] & 15 );
2269 static void get_processor_id( WCHAR
*processor_id
)
2271 static const WCHAR fmtW
[] = {'%','0','8','X','%','0','8','X',0};
2272 unsigned int regs
[4] = {0, 0, 0, 0};
2274 do_cpuid( 1, regs
);
2275 sprintfW( processor_id
, fmtW
, regs
[3], regs
[0] );
2277 static void regs_to_str( unsigned int *regs
, unsigned int len
, WCHAR
*buffer
)
2280 unsigned char *p
= (unsigned char *)regs
;
2282 for (i
= 0; i
< len
; i
++) { buffer
[i
] = *p
++; }
2285 static void get_processor_manufacturer( WCHAR
*manufacturer
)
2287 unsigned int tmp
, regs
[4] = {0, 0, 0, 0};
2289 do_cpuid( 0, regs
);
2290 tmp
= regs
[2]; /* swap edx and ecx */
2294 regs_to_str( regs
+ 1, 12, manufacturer
);
2296 static void get_processor_name( WCHAR
*name
)
2298 unsigned int regs
[4] = {0, 0, 0, 0};
2300 do_cpuid( 0x80000000, regs
);
2301 if (regs
[0] >= 0x80000004)
2303 do_cpuid( 0x80000002, regs
);
2304 regs_to_str( regs
, 16, name
);
2305 do_cpuid( 0x80000003, regs
);
2306 regs_to_str( regs
, 16, name
+ 16 );
2307 do_cpuid( 0x80000004, regs
);
2308 regs_to_str( regs
, 16, name
+ 32 );
2311 static UINT
get_processor_currentclockspeed( UINT index
)
2313 PROCESSOR_POWER_INFORMATION
*info
;
2314 UINT ret
= 1000, size
= get_processor_count() * sizeof(PROCESSOR_POWER_INFORMATION
);
2317 if ((info
= heap_alloc( size
)))
2319 status
= NtPowerInformation( ProcessorInformation
, NULL
, 0, info
, size
);
2320 if (!status
) ret
= info
[index
].CurrentMhz
;
2325 static UINT
get_processor_maxclockspeed( UINT index
)
2327 PROCESSOR_POWER_INFORMATION
*info
;
2328 UINT ret
= 1000, size
= get_processor_count() * sizeof(PROCESSOR_POWER_INFORMATION
);
2331 if ((info
= heap_alloc( size
)))
2333 status
= NtPowerInformation( ProcessorInformation
, NULL
, 0, info
, size
);
2334 if (!status
) ret
= info
[index
].MaxMhz
;
2340 static enum fill_status
fill_processor( struct table
*table
, const struct expr
*cond
)
2342 static const WCHAR fmtW
[] = {'C','P','U','%','u',0};
2343 WCHAR caption
[100], device_id
[14], processor_id
[17], manufacturer
[13], name
[49] = {0}, version
[50];
2344 struct record_processor
*rec
;
2345 UINT i
, offset
= 0, num_cores
, num_logical_processors
, count
= get_processor_count();
2346 enum fill_status status
= FILL_STATUS_UNFILTERED
;
2348 if (!resize_table( table
, count
, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
2350 get_processor_caption( caption
);
2351 get_processor_id( processor_id
);
2352 get_processor_manufacturer( manufacturer
);
2353 get_processor_name( name
);
2354 get_processor_version( version
);
2356 num_logical_processors
= get_logical_processor_count( &num_cores
) / count
;
2359 for (i
= 0; i
< count
; i
++)
2361 rec
= (struct record_processor
*)(table
->data
+ offset
);
2362 rec
->addresswidth
= get_osarchitecture() == os_32bitW
? 32 : 64;
2363 rec
->caption
= heap_strdupW( caption
);
2364 rec
->cpu_status
= 1; /* CPU Enabled */
2365 rec
->currentclockspeed
= get_processor_currentclockspeed( i
);
2366 rec
->datawidth
= get_osarchitecture() == os_32bitW
? 32 : 64;
2367 rec
->description
= heap_strdupW( caption
);
2368 sprintfW( device_id
, fmtW
, i
);
2369 rec
->device_id
= heap_strdupW( device_id
);
2370 rec
->family
= 2; /* Unknown */
2371 rec
->manufacturer
= heap_strdupW( manufacturer
);
2372 rec
->maxclockspeed
= get_processor_maxclockspeed( i
);
2373 rec
->name
= heap_strdupW( name
);
2374 rec
->num_cores
= num_cores
;
2375 rec
->num_logical_processors
= num_logical_processors
;
2376 rec
->processor_id
= heap_strdupW( processor_id
);
2377 rec
->processortype
= 3; /* central processor */
2378 rec
->unique_id
= NULL
;
2379 rec
->version
= heap_strdupW( version
);
2380 if (!match_row( table
, i
, cond
, &status
))
2382 free_row_values( table
, i
);
2385 offset
+= sizeof(*rec
);
2388 TRACE("created %u rows\n", count
);
2389 table
->num_rows
= count
;
2393 static WCHAR
*get_lastbootuptime(void)
2395 static const WCHAR fmtW
[] =
2396 {'%','0','4','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u',
2397 '.','%','0','6','u','+','0','0','0',0};
2398 SYSTEM_TIMEOFDAY_INFORMATION ti
;
2402 if (!(ret
= heap_alloc( 26 * sizeof(WCHAR
) ))) return NULL
;
2404 NtQuerySystemInformation( SystemTimeOfDayInformation
, &ti
, sizeof(ti
), NULL
);
2405 RtlTimeToTimeFields( &ti
.liKeBootTime
, &tf
);
2406 sprintfW( ret
, fmtW
, tf
.Year
, tf
.Month
, tf
.Day
, tf
.Hour
, tf
.Minute
, tf
.Second
, tf
.Milliseconds
* 1000 );
2409 static WCHAR
*get_localdatetime(void)
2411 static const WCHAR fmtW
[] =
2412 {'%','0','4','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u',
2413 '.','%','0','6','u','%','+','0','3','d',0};
2414 TIME_ZONE_INFORMATION tzi
;
2420 Status
= GetTimeZoneInformation(&tzi
);
2422 if(Status
== TIME_ZONE_ID_INVALID
) return NULL
;
2424 if(Status
== TIME_ZONE_ID_DAYLIGHT
)
2425 Bias
+= tzi
.DaylightBias
;
2427 Bias
+= tzi
.StandardBias
;
2428 if (!(ret
= heap_alloc( 26 * sizeof(WCHAR
) ))) return NULL
;
2431 sprintfW( ret
, fmtW
, st
.wYear
, st
.wMonth
, st
.wDay
, st
.wHour
, st
.wMinute
, st
.wSecond
, st
.wMilliseconds
* 1000, -Bias
);
2434 static WCHAR
*get_systemdirectory(void)
2439 if (!(ret
= heap_alloc( MAX_PATH
* sizeof(WCHAR
) ))) return NULL
;
2440 Wow64DisableWow64FsRedirection( &redir
);
2441 GetSystemDirectoryW( ret
, MAX_PATH
);
2442 Wow64RevertWow64FsRedirection( redir
);
2445 static WCHAR
*get_codeset(void)
2447 static const WCHAR fmtW
[] = {'%','u',0};
2448 WCHAR
*ret
= heap_alloc( 11 * sizeof(WCHAR
) );
2449 if (ret
) sprintfW( ret
, fmtW
, GetACP() );
2452 static WCHAR
*get_countrycode(void)
2454 WCHAR
*ret
= heap_alloc( 6 * sizeof(WCHAR
) );
2455 if (ret
) GetLocaleInfoW( LOCALE_SYSTEM_DEFAULT
, LOCALE_ICOUNTRY
, ret
, 6 );
2458 static WCHAR
*get_locale(void)
2460 WCHAR
*ret
= heap_alloc( 5 * sizeof(WCHAR
) );
2461 if (ret
) GetLocaleInfoW( LOCALE_SYSTEM_DEFAULT
, LOCALE_ILANGUAGE
, ret
, 5 );
2465 static enum fill_status
fill_os( struct table
*table
, const struct expr
*cond
)
2467 struct record_operatingsystem
*rec
;
2468 enum fill_status status
= FILL_STATUS_UNFILTERED
;
2471 if (!resize_table( table
, 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
2473 rec
= (struct record_operatingsystem
*)table
->data
;
2474 rec
->buildnumber
= os_buildnumberW
;
2475 rec
->caption
= os_captionW
;
2476 rec
->codeset
= get_codeset();
2477 rec
->countrycode
= get_countrycode();
2478 rec
->csdversion
= os_csdversionW
;
2479 rec
->installdate
= os_installdateW
;
2480 rec
->lastbootuptime
= get_lastbootuptime();
2481 rec
->localdatetime
= get_localdatetime();
2482 rec
->locale
= get_locale();
2483 rec
->name
= os_nameW
;
2484 rec
->osarchitecture
= get_osarchitecture();
2485 rec
->oslanguage
= GetSystemDefaultLangID();
2486 rec
->osproductsuite
= 2461140; /* Windows XP Professional */
2487 rec
->ostype
= 18; /* WINNT */
2489 rec
->serialnumber
= os_serialnumberW
;
2490 rec
->servicepackmajor
= 3;
2491 rec
->servicepackminor
= 0;
2492 rec
->suitemask
= 272; /* Single User + Terminal */
2493 rec
->systemdirectory
= get_systemdirectory();
2494 rec
->totalvisiblememorysize
= get_total_physical_memory() / 1024;
2495 rec
->version
= os_versionW
;
2496 if (!match_row( table
, row
, cond
, &status
)) free_row_values( table
, row
);
2499 TRACE("created %u rows\n", row
);
2500 table
->num_rows
= row
;
2504 static const WCHAR
*get_service_type( DWORD type
)
2506 static const WCHAR filesystem_driverW
[] =
2507 {'F','i','l','e',' ','S','y','s','t','e','m',' ','D','r','i','v','e','r',0};
2508 static const WCHAR kernel_driverW
[] =
2509 {'K','e','r','n','e','l',' ','D','r','i','v','e','r',0};
2510 static const WCHAR own_processW
[] =
2511 {'O','w','n',' ','P','r','o','c','e','s','s',0};
2512 static const WCHAR share_processW
[] =
2513 {'S','h','a','r','e',' ','P','r','o','c','e','s','s',0};
2515 if (type
& SERVICE_KERNEL_DRIVER
) return kernel_driverW
;
2516 else if (type
& SERVICE_FILE_SYSTEM_DRIVER
) return filesystem_driverW
;
2517 else if (type
& SERVICE_WIN32_OWN_PROCESS
) return own_processW
;
2518 else if (type
& SERVICE_WIN32_SHARE_PROCESS
) return share_processW
;
2519 else ERR("unhandled type 0x%08x\n", type
);
2522 static const WCHAR
*get_service_state( DWORD state
)
2524 static const WCHAR runningW
[] =
2525 {'R','u','n','n','i','n','g',0};
2526 static const WCHAR start_pendingW
[] =
2527 {'S','t','a','r','t',' ','P','e','n','d','i','n','g',0};
2528 static const WCHAR stop_pendingW
[] =
2529 {'S','t','o','p',' ','P','e','n','d','i','n','g',0};
2530 static const WCHAR stoppedW
[] =
2531 {'S','t','o','p','p','e','d',0};
2532 static const WCHAR unknownW
[] =
2533 {'U','n','k','n','o','w','n',0};
2537 case SERVICE_STOPPED
: return stoppedW
;
2538 case SERVICE_START_PENDING
: return start_pendingW
;
2539 case SERVICE_STOP_PENDING
: return stop_pendingW
;
2540 case SERVICE_RUNNING
: return runningW
;
2542 ERR("unknown state %u\n", state
);
2546 static const WCHAR
*get_service_startmode( DWORD mode
)
2548 static const WCHAR bootW
[] = {'B','o','o','t',0};
2549 static const WCHAR systemW
[] = {'S','y','s','t','e','m',0};
2550 static const WCHAR autoW
[] = {'A','u','t','o',0};
2551 static const WCHAR manualW
[] = {'M','a','n','u','a','l',0};
2552 static const WCHAR disabledW
[] = {'D','i','s','a','b','l','e','d',0};
2553 static const WCHAR unknownW
[] = {'U','n','k','n','o','w','n',0};
2557 case SERVICE_BOOT_START
: return bootW
;
2558 case SERVICE_SYSTEM_START
: return systemW
;
2559 case SERVICE_AUTO_START
: return autoW
;
2560 case SERVICE_DEMAND_START
: return manualW
;
2561 case SERVICE_DISABLED
: return disabledW
;
2563 ERR("unknown mode 0x%x\n", mode
);
2567 static QUERY_SERVICE_CONFIGW
*query_service_config( SC_HANDLE manager
, const WCHAR
*name
)
2569 QUERY_SERVICE_CONFIGW
*config
= NULL
;
2573 if (!(service
= OpenServiceW( manager
, name
, SERVICE_QUERY_CONFIG
))) return NULL
;
2574 QueryServiceConfigW( service
, NULL
, 0, &size
);
2575 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) goto done
;
2576 if (!(config
= heap_alloc( size
))) goto done
;
2577 if (QueryServiceConfigW( service
, config
, size
, &size
)) goto done
;
2578 heap_free( config
);
2582 CloseServiceHandle( service
);
2586 static enum fill_status
fill_service( struct table
*table
, const struct expr
*cond
)
2588 struct record_service
*rec
;
2590 ENUM_SERVICE_STATUS_PROCESSW
*tmp
, *services
= NULL
;
2591 SERVICE_STATUS_PROCESS
*status
;
2592 WCHAR sysnameW
[MAX_COMPUTERNAME_LENGTH
+ 1];
2593 DWORD len
= sizeof(sysnameW
) / sizeof(sysnameW
[0]);
2594 UINT i
, row
= 0, offset
= 0, size
= 256, needed
, count
;
2595 enum fill_status fill_status
= FILL_STATUS_FAILED
;
2598 if (!(manager
= OpenSCManagerW( NULL
, NULL
, SC_MANAGER_ENUMERATE_SERVICE
))) return FILL_STATUS_FAILED
;
2599 if (!(services
= heap_alloc( size
))) goto done
;
2601 ret
= EnumServicesStatusExW( manager
, SC_ENUM_PROCESS_INFO
, SERVICE_TYPE_ALL
,
2602 SERVICE_STATE_ALL
, (BYTE
*)services
, size
, &needed
,
2603 &count
, NULL
, NULL
);
2606 if (GetLastError() != ERROR_MORE_DATA
) goto done
;
2608 if (!(tmp
= heap_realloc( services
, size
))) goto done
;
2610 ret
= EnumServicesStatusExW( manager
, SC_ENUM_PROCESS_INFO
, SERVICE_TYPE_ALL
,
2611 SERVICE_STATE_ALL
, (BYTE
*)services
, size
, &needed
,
2612 &count
, NULL
, NULL
);
2613 if (!ret
) goto done
;
2615 if (!resize_table( table
, count
, sizeof(*rec
) )) goto done
;
2617 GetComputerNameW( sysnameW
, &len
);
2618 fill_status
= FILL_STATUS_UNFILTERED
;
2620 for (i
= 0; i
< count
; i
++)
2622 QUERY_SERVICE_CONFIGW
*config
;
2624 if (!(config
= query_service_config( manager
, services
[i
].lpServiceName
))) continue;
2626 status
= &services
[i
].ServiceStatusProcess
;
2627 rec
= (struct record_service
*)(table
->data
+ offset
);
2628 rec
->accept_pause
= (status
->dwControlsAccepted
& SERVICE_ACCEPT_PAUSE_CONTINUE
) ? -1 : 0;
2629 rec
->accept_stop
= (status
->dwControlsAccepted
& SERVICE_ACCEPT_STOP
) ? -1 : 0;
2630 rec
->displayname
= heap_strdupW( services
[i
].lpDisplayName
);
2631 rec
->name
= heap_strdupW( services
[i
].lpServiceName
);
2632 rec
->process_id
= status
->dwProcessId
;
2633 rec
->servicetype
= get_service_type( status
->dwServiceType
);
2634 rec
->startmode
= get_service_startmode( config
->dwStartType
);
2635 rec
->state
= get_service_state( status
->dwCurrentState
);
2636 rec
->systemname
= heap_strdupW( sysnameW
);
2637 rec
->pause_service
= service_pause_service
;
2638 rec
->resume_service
= service_resume_service
;
2639 rec
->start_service
= service_start_service
;
2640 rec
->stop_service
= service_stop_service
;
2641 heap_free( config
);
2642 if (!match_row( table
, row
, cond
, &fill_status
))
2644 free_row_values( table
, row
);
2647 offset
+= sizeof(*rec
);
2651 TRACE("created %u rows\n", row
);
2652 table
->num_rows
= row
;
2655 CloseServiceHandle( manager
);
2656 heap_free( services
);
2660 static WCHAR
*get_accountname( LSA_TRANSLATED_NAME
*name
)
2662 if (!name
|| !name
->Name
.Buffer
) return NULL
;
2663 return heap_strdupW( name
->Name
.Buffer
);
2665 static struct array
*get_binaryrepresentation( PSID sid
, UINT len
)
2667 struct array
*array
= heap_alloc( sizeof(struct array
) );
2670 UINT8
*ret
= heap_alloc( len
);
2673 memcpy( ret
, sid
, len
);
2682 static WCHAR
*get_referenceddomainname( LSA_REFERENCED_DOMAIN_LIST
*domain
)
2684 if (!domain
|| !domain
->Domains
|| !domain
->Domains
->Name
.Buffer
) return NULL
;
2685 return heap_strdupW( domain
->Domains
->Name
.Buffer
);
2687 static const WCHAR
*find_sid_str( const struct expr
*cond
)
2689 const struct expr
*left
, *right
;
2690 const WCHAR
*ret
= NULL
;
2692 if (!cond
|| cond
->type
!= EXPR_COMPLEX
|| cond
->u
.expr
.op
!= OP_EQ
) return NULL
;
2694 left
= cond
->u
.expr
.left
;
2695 right
= cond
->u
.expr
.right
;
2696 if (left
->type
== EXPR_PROPVAL
&& right
->type
== EXPR_SVAL
&& !strcmpiW( left
->u
.propval
->name
, prop_sidW
))
2698 ret
= right
->u
.sval
;
2700 else if (left
->type
== EXPR_SVAL
&& right
->type
== EXPR_PROPVAL
&& !strcmpiW( right
->u
.propval
->name
, prop_sidW
))
2707 static enum fill_status
fill_sid( struct table
*table
, const struct expr
*cond
)
2710 LSA_REFERENCED_DOMAIN_LIST
*domain
;
2711 LSA_TRANSLATED_NAME
*name
;
2713 LSA_OBJECT_ATTRIBUTES attrs
;
2715 struct record_sid
*rec
;
2718 if (!(str
= find_sid_str( cond
))) return FILL_STATUS_FAILED
;
2719 if (!resize_table( table
, 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
2721 if (!ConvertStringSidToSidW( str
, &sid
)) return FILL_STATUS_FAILED
;
2722 len
= GetLengthSid( sid
);
2724 memset( &attrs
, 0, sizeof(attrs
) );
2725 attrs
.Length
= sizeof(attrs
);
2726 if (LsaOpenPolicy( NULL
, &attrs
, POLICY_ALL_ACCESS
, &handle
))
2729 return FILL_STATUS_FAILED
;
2731 if (LsaLookupSids( handle
, 1, &sid
, &domain
, &name
))
2735 return FILL_STATUS_FAILED
;
2738 rec
= (struct record_sid
*)table
->data
;
2739 rec
->accountname
= get_accountname( name
);
2740 rec
->binaryrepresentation
= get_binaryrepresentation( sid
, len
);
2741 rec
->referenceddomainname
= get_referenceddomainname( domain
);
2742 rec
->sid
= heap_strdupW( str
);
2743 rec
->sidlength
= len
;
2745 TRACE("created 1 row\n");
2746 table
->num_rows
= 1;
2748 LsaFreeMemory( domain
);
2749 LsaFreeMemory( name
);
2752 return FILL_STATUS_FILTERED
;
2755 static UINT32
get_bits_per_pixel( UINT
*hres
, UINT
*vres
)
2757 HDC hdc
= GetDC( NULL
);
2760 if (!hdc
) return 32;
2761 ret
= GetDeviceCaps( hdc
, BITSPIXEL
);
2762 *hres
= GetDeviceCaps( hdc
, HORZRES
);
2763 *vres
= GetDeviceCaps( hdc
, VERTRES
);
2764 ReleaseDC( NULL
, hdc
);
2767 static WCHAR
*get_pnpdeviceid( DXGI_ADAPTER_DESC
*desc
)
2769 static const WCHAR fmtW
[] =
2770 {'P','C','I','\\','V','E','N','_','%','0','4','X','&','D','E','V','_','%','0','4','X',
2771 '&','S','U','B','S','Y','S','_','%','0','8','X','&','R','E','V','_','%','0','2','X','\\',
2772 '0','&','D','E','A','D','B','E','E','F','&','0','&','D','E','A','D',0};
2775 if (!(ret
= heap_alloc( sizeof(fmtW
) + 2 * sizeof(WCHAR
) ))) return NULL
;
2776 sprintfW( ret
, fmtW
, desc
->VendorId
, desc
->DeviceId
, desc
->SubSysId
, desc
->Revision
);
2780 static enum fill_status
fill_videocontroller( struct table
*table
, const struct expr
*cond
)
2783 struct record_videocontroller
*rec
;
2785 IDXGIFactory
*factory
= NULL
;
2786 IDXGIAdapter
*adapter
= NULL
;
2787 DXGI_ADAPTER_DESC desc
;
2788 UINT hres
= 1024, vres
= 768, vidmem
= 512 * 1024 * 1024;
2789 const WCHAR
*name
= videocontroller_deviceidW
;
2790 enum fill_status status
= FILL_STATUS_UNFILTERED
;
2793 if (!resize_table( table
, 1, sizeof(*rec
) )) return FILL_STATUS_FAILED
;
2795 memset (&desc
, 0, sizeof(desc
));
2796 hr
= CreateDXGIFactory( &IID_IDXGIFactory
, (void **)&factory
);
2797 if (FAILED(hr
)) goto done
;
2799 hr
= IDXGIFactory_EnumAdapters( factory
, 0, &adapter
);
2800 if (FAILED(hr
)) goto done
;
2802 hr
= IDXGIAdapter_GetDesc( adapter
, &desc
);
2805 vidmem
= desc
.DedicatedVideoMemory
;
2806 name
= desc
.Description
;
2810 rec
= (struct record_videocontroller
*)table
->data
;
2811 rec
->adapter_dactype
= videocontroller_dactypeW
;
2812 rec
->adapter_ram
= vidmem
;
2813 rec
->availability
= 3; /* Running or Full Power */
2814 rec
->caption
= heap_strdupW( name
);
2815 rec
->current_bitsperpixel
= get_bits_per_pixel( &hres
, &vres
);
2816 rec
->current_horizontalres
= hres
;
2817 rec
->current_refreshrate
= 0; /* default refresh rate */
2818 rec
->current_scanmode
= 2; /* Unknown */
2819 rec
->current_verticalres
= vres
;
2820 rec
->description
= heap_strdupW( name
);
2821 rec
->device_id
= videocontroller_deviceidW
;
2822 rec
->driverversion
= videocontroller_driverversionW
;
2823 rec
->name
= heap_strdupW( name
);
2824 rec
->pnpdevice_id
= get_pnpdeviceid( &desc
);
2825 rec
->videoarchitecture
= 2; /* Unknown */
2826 rec
->videomemorytype
= 2; /* Unknown */
2827 rec
->videoprocessor
= heap_strdupW( name
);
2828 if (!match_row( table
, row
, cond
, &status
)) free_row_values( table
, row
);
2831 TRACE("created %u rows\n", row
);
2832 table
->num_rows
= row
;
2834 if (adapter
) IDXGIAdapter_Release( adapter
);
2835 if (factory
) IDXGIFactory_Release( factory
);
2839 static struct table builtin_classes
[] =
2841 { class_baseboardW
, SIZEOF(col_baseboard
), col_baseboard
, SIZEOF(data_baseboard
), 0, (BYTE
*)data_baseboard
},
2842 { class_biosW
, SIZEOF(col_bios
), col_bios
, SIZEOF(data_bios
), 0, (BYTE
*)data_bios
},
2843 { class_cdromdriveW
, SIZEOF(col_cdromdrive
), col_cdromdrive
, 0, 0, NULL
, fill_cdromdrive
},
2844 { class_compsysW
, SIZEOF(col_compsys
), col_compsys
, 0, 0, NULL
, fill_compsys
},
2845 { class_compsysproductW
, SIZEOF(col_compsysproduct
), col_compsysproduct
, SIZEOF(data_compsysproduct
), 0, (BYTE
*)data_compsysproduct
},
2846 { class_datafileW
, SIZEOF(col_datafile
), col_datafile
, 0, 0, NULL
, fill_datafile
},
2847 { class_directoryW
, SIZEOF(col_directory
), col_directory
, 0, 0, NULL
, fill_directory
},
2848 { class_diskdriveW
, SIZEOF(col_diskdrive
), col_diskdrive
, 0, 0, NULL
, fill_diskdrive
},
2849 { class_diskpartitionW
, SIZEOF(col_diskpartition
), col_diskpartition
, 0, 0, NULL
, fill_diskpartition
},
2850 { class_logicaldiskW
, SIZEOF(col_logicaldisk
), col_logicaldisk
, 0, 0, NULL
, fill_logicaldisk
},
2851 { class_logicaldisk2W
, SIZEOF(col_logicaldisk
), col_logicaldisk
, 0, 0, NULL
, fill_logicaldisk
},
2852 { class_networkadapterW
, SIZEOF(col_networkadapter
), col_networkadapter
, 0, 0, NULL
, fill_networkadapter
},
2853 { class_networkadapterconfigW
, SIZEOF(col_networkadapterconfig
), col_networkadapterconfig
, 0, 0, NULL
, fill_networkadapterconfig
},
2854 { class_osW
, SIZEOF(col_os
), col_os
, 0, 0, NULL
, fill_os
},
2855 { class_paramsW
, SIZEOF(col_param
), col_param
, SIZEOF(data_param
), 0, (BYTE
*)data_param
},
2856 { class_physicalmediaW
, SIZEOF(col_physicalmedia
), col_physicalmedia
, SIZEOF(data_physicalmedia
), 0, (BYTE
*)data_physicalmedia
},
2857 { class_physicalmemoryW
, SIZEOF(col_physicalmemory
), col_physicalmemory
, 0, 0, NULL
, fill_physicalmemory
},
2858 { class_printerW
, SIZEOF(col_printer
), col_printer
, 0, 0, NULL
, fill_printer
},
2859 { class_processW
, SIZEOF(col_process
), col_process
, 0, 0, NULL
, fill_process
},
2860 { class_processorW
, SIZEOF(col_processor
), col_processor
, 0, 0, NULL
, fill_processor
},
2861 { class_processor2W
, SIZEOF(col_processor
), col_processor
, 0, 0, NULL
, fill_processor
},
2862 { class_qualifiersW
, SIZEOF(col_qualifier
), col_qualifier
, SIZEOF(data_qualifier
), 0, (BYTE
*)data_qualifier
},
2863 { class_serviceW
, SIZEOF(col_service
), col_service
, 0, 0, NULL
, fill_service
},
2864 { class_sidW
, SIZEOF(col_sid
), col_sid
, 0, 0, NULL
, fill_sid
},
2865 { class_sounddeviceW
, SIZEOF(col_sounddevice
), col_sounddevice
, SIZEOF(data_sounddevice
), 0, (BYTE
*)data_sounddevice
},
2866 { class_stdregprovW
, SIZEOF(col_stdregprov
), col_stdregprov
, SIZEOF(data_stdregprov
), 0, (BYTE
*)data_stdregprov
},
2867 { class_systemsecurityW
, SIZEOF(col_systemsecurity
), col_systemsecurity
, SIZEOF(data_systemsecurity
), 0, (BYTE
*)data_systemsecurity
},
2868 { class_systemenclosureW
, SIZEOF(col_systemenclosure
), col_systemenclosure
, SIZEOF(data_systemenclosure
), 0, (BYTE
*)data_systemenclosure
},
2869 { class_videocontrollerW
, SIZEOF(col_videocontroller
), col_videocontroller
, 0, 0, NULL
, fill_videocontroller
}
2872 void init_table_list( void )
2874 static struct list tables
= LIST_INIT( tables
);
2877 for (i
= 0; i
< SIZEOF(builtin_classes
); i
++) list_add_tail( &tables
, &builtin_classes
[i
].entry
);
2878 table_list
= &tables
;