ReactOS 0.4.15-dev-7788-g1ad9096
builtin.c
Go to the documentation of this file.
1/*
2 * Copyright 2012 Hans Leidekker for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19#define COBJMACROS
20#define NONAMELESSUNION
21#define NONAMELESSSTRUCT
22
23#include <stdarg.h>
24#ifdef __REACTOS__
25#include <wchar.h>
26#endif
27
28#include "ntstatus.h"
29#define WIN32_NO_STATUS
30#include "windef.h"
31#include "winbase.h"
32#include "winsock2.h"
33#include "ws2tcpip.h"
34#include "initguid.h"
35#include "wbemcli.h"
36#include "wbemprov.h"
37#include "iphlpapi.h"
38#include "netioapi.h"
39#include "tlhelp32.h"
40#ifndef __REACTOS__
41#include "d3d10.h"
42#endif
43#include "winternl.h"
44#include "winioctl.h"
45#include "winsvc.h"
46#include "winver.h"
47#include "sddl.h"
48#include "ntsecapi.h"
49#ifdef __REACTOS__
50#include <wingdi.h>
51#include <winreg.h>
52#endif
53#include "winspool.h"
54#include "setupapi.h"
55
56#include "wine/asm.h"
57#include "wine/debug.h"
58#include "wbemprox_private.h"
59
61
62static const WCHAR class_associatorsW[] =
63 {'_','_','A','S','S','O','C','I','A','T','O','R','S',0};
64static const WCHAR class_baseboardW[] =
65 {'W','i','n','3','2','_','B','a','s','e','B','o','a','r','d',0};
66static const WCHAR class_biosW[] =
67 {'W','i','n','3','2','_','B','I','O','S',0};
68static const WCHAR class_cdromdriveW[] =
69 {'W','i','n','3','2','_','C','D','R','O','M','D','r','i','v','e',0};
70static const WCHAR class_compsysW[] =
71 {'W','i','n','3','2','_','C','o','m','p','u','t','e','r','S','y','s','t','e','m',0};
73 {'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};
74static const WCHAR class_datafileW[] =
75 {'C','I','M','_','D','a','t','a','F','i','l','e',0};
77 {'W','i','n','3','2','_','D','e','s','k','t','o','p','M','o','n','i','t','o','r',0};
78static const WCHAR class_directoryW[] =
79 {'W','i','n','3','2','_','D','i','r','e','c','t','o','r','y',0};
80static const WCHAR class_diskdriveW[] =
81 {'W','i','n','3','2','_','D','i','s','k','D','r','i','v','e',0};
83 {'W','i','n','3','2','_','D','i','s','k','D','r','i','v','e','T','o','D','i','s','k','P','a','r','t','i','t','i','o','n',0};
85 {'W','i','n','3','2','_','D','i','s','k','P','a','r','t','i','t','i','o','n',0};
87 {'W','i','n','3','2','_','D','i','s','p','l','a','y','C','o','n','t','r','o','l','l','e','r',
88 'C','o','n','f','i','g','u','r','a','t','i','o','n',0};
90 {'W','i','n','3','2','_','I','P','4','R','o','u','t','e','T','a','b','l','e',0};
91static const WCHAR class_logicaldiskW[] =
92 {'W','i','n','3','2','_','L','o','g','i','c','a','l','D','i','s','k',0};
93static const WCHAR class_logicaldisk2W[] =
94 {'C','I','M','_','L','o','g','i','c','a','l','D','i','s','k',0};
96 {'W','i','n','3','2','_','L','o','g','i','c','a','l','D','i','s','k','T','o','P','a','r','t','i','t','i','o','n',0};
98 {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r',0};
100 {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r',
101 'C','o','n','f','i','g','u','r','a','t','i','o','n',0};
103 {'W','i','n','3','2','_','O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0};
104static const WCHAR class_paramsW[] =
105 {'_','_','P','A','R','A','M','E','T','E','R','S',0};
107 {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','d','i','a',0};
109 {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
110static const WCHAR class_pnpentityW[] =
111 {'W','i','n','3','2','_','P','n','P','E','n','t','i','t','y',0};
112static const WCHAR class_printerW[] =
113 {'W','i','n','3','2','_','P','r','i','n','t','e','r',0};
115 {'_','_','W','I','N','3','2','_','P','R','O','C','E','S','S','_','G','E','T','O','W',
116 'N','E','R','_','O','U','T',0};
117static const WCHAR class_processorW[] =
118 {'W','i','n','3','2','_','P','r','o','c','e','s','s','o','r',0};
119static const WCHAR class_processor2W[] =
120 {'C','I','M','_','P','r','o','c','e','s','s','o','r',0};
121static const WCHAR class_qualifiersW[] =
122 {'_','_','Q','U','A','L','I','F','I','E','R','S',0};
124 {'W','i','n','3','2','_','Q','u','i','c','k','F','i','x','E','n','g','i','n','e','e','r','i','n','g',0};
125static const WCHAR class_sidW[] =
126 {'W','i','n','3','2','_','S','I','D',0};
127static const WCHAR class_sounddeviceW[] =
128 {'W','i','n','3','2','_','S','o','u','n','d','D','e','v','i','c','e',0};
130 {'W','i','n','3','2','_','S','y','s','t','e','m','E','n','c','l','o','s','u','r','e',0};
131#ifndef __REACTOS__
133 {'W','i','n','3','2','_','V','i','d','e','o','C','o','n','t','r','o','l','l','e','r',0};
134#endif
135static const WCHAR class_winsatW[] =
136 {'W','i','n','3','2','_','W','i','n','S','A','T',0};
137
138static const WCHAR prop_accountnameW[] =
139 {'A','c','c','o','u','n','t','N','a','m','e',0};
140static const WCHAR prop_acceptpauseW[] =
141 {'A','c','c','e','p','t','P','a','u','s','e',0};
142static const WCHAR prop_acceptstopW[] =
143 {'A','c','c','e','p','t','S','t','o','p',0};
144static const WCHAR prop_accessmaskW[] =
145 {'A','c','c','e','s','s','M','a','s','k',0};
146#ifndef __REACTOS__
148 {'A','d','a','p','t','e','r','D','A','C','T','y','p','e',0};
149static const WCHAR prop_adapterramW[] =
150 {'A','d','a','p','t','e','r','R','A','M',0};
151#endif
152static const WCHAR prop_adaptertypeW[] =
153 {'A','d','a','p','t','e','r','T','y','p','e',0};
155 {'A','d','a','p','t','e','r','T','y','p','e','I','D',0};
156static const WCHAR prop_addresswidthW[] =
157 {'A','d','d','r','e','s','s','W','i','d','t','h',0};
158static const WCHAR prop_antecedentW[] =
159 {'A','n','t','e','c','e','d','e','n','t',0};
160static const WCHAR prop_architectureW[] =
161 {'A','r','c','h','i','t','e','c','t','u','r','e',0};
162static const WCHAR prop_assocclassW[] =
163 {'A','s','s','o','c','C','l','a','s','s',0};
164static const WCHAR prop_associatorW[] =
165 {'A','s','s','o','c','i','a','t','o','r',0};
166static const WCHAR prop_attributesW[] =
167 {'A','t','t','r','i','b','u','t','e','s',0};
168#ifndef __REACTOS__
169static const WCHAR prop_availabilityW[] =
170 {'A','v','a','i','l','a','b','i','l','i','t','y',0};
171#endif
173 {'B','i','n','a','r','y','R','e','p','r','e','s','e','n','t','a','t','i','o','n',0};
174static const WCHAR prop_bitsperpixelW[] =
175 {'B','i','t','s','P','e','r','P','i','x','e','l',0};
176static const WCHAR prop_boolvalueW[] =
177 {'B','o','o','l','V','a','l','u','e',0};
178static const WCHAR prop_bootableW[] =
179 {'B','o','o','t','a','b','l','e',0};
181 {'B','o','o','t','P','a','r','t','i','t','i','o','n',0};
182static const WCHAR prop_buildnumberW[] =
183 {'B','u','i','l','d','N','u','m','b','e','r',0};
184static const WCHAR prop_capacityW[] =
185 {'C','a','p','a','c','i','t','y',0};
186static const WCHAR prop_captionW[] =
187 {'C','a','p','t','i','o','n',0};
188static const WCHAR prop_chassistypesW[] =
189 {'C','h','a','s','s','i','s','T','y','p','e','s',0};
190static const WCHAR prop_classW[] =
191 {'C','l','a','s','s',0};
192static const WCHAR prop_codesetW[] =
193 {'C','o','d','e','S','e','t',0};
194static const WCHAR prop_commandlineW[] =
195 {'C','o','m','m','a','n','d','L','i','n','e',0};
197 {'C','o','n','f','i','g','M','a','n','a','g','e','r','E','r','r','o','r','C','o','d','e',0};
199 {'C','o','n','f','i','g','u','r','e','d','C','l','o','c','k','S','p','e','e','d',0};
200static const WCHAR prop_countrycodeW[] =
201 {'C','o','u','n','t','r','y','C','o','d','e',0};
202static const WCHAR prop_cpuscoreW[] =
203 {'C','P','U','S','c','o','r','e',0};
204static const WCHAR prop_cpustatusW[] =
205 {'C','p','u','S','t','a','t','u','s',0};
206static const WCHAR prop_csdversionW[] =
207 {'C','S','D','V','e','r','s','i','o','n',0};
208static const WCHAR prop_csnameW[] =
209 {'C','S','N','a','m','e',0};
210#ifndef __REACTOS__
212 {'C','u','r','r','e','n','t','B','i','t','s','P','e','r','P','i','x','e','l',0};
213#endif
215 {'C','u','r','r','e','n','t','C','l','o','c','k','S','p','e','e','d',0};
217 {'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};
219 {'C','u','r','r','e','n','t','L','a','n','g','u','a','g','e',0};
221 {'C','u','r','r','e','n','t','R','e','f','r','e','s','h','R','a','t','e',0};
223 {'C','u','r','r','e','n','t','S','c','a','n','M','o','d','e',0};
225 {'C','u','r','r','e','n','t','T','i','m','e','Z','o','n','e',0};
227 {'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};
228static const WCHAR prop_d3dscoreW[] =
229 {'D','3','D','S','c','o','r','e',0};
230static const WCHAR prop_datawidthW[] =
231 {'D','a','t','a','W','i','d','t','h',0};
233 {'D','e','f','a','u','l','t','I','P','G','a','t','e','w','a','y',0};
234static const WCHAR prop_defaultvalueW[] =
235 {'D','e','f','a','u','l','t','V','a','l','u','e',0};
236static const WCHAR prop_dependentW[] =
237 {'D','e','p','e','n','d','e','n','t',0};
238static const WCHAR prop_descriptionW[] =
239 {'D','e','s','c','r','i','p','t','i','o','n',0};
240static const WCHAR prop_destinationW[] =
241 {'D','e','s','t','i','n','a','t','i','o','n',0};
242static const WCHAR prop_deviceidW[] =
243 {'D','e','v','i','c','e','I','d',0};
245 {'D','e','v','i','c','e','L','o','c','a','t','o','r',0};
246static const WCHAR prop_dhcpenabledW[] =
247 {'D','H','C','P','E','n','a','b','l','e','d',0};
248static const WCHAR prop_directionW[] =
249 {'D','i','r','e','c','t','i','o','n',0};
250static const WCHAR prop_diskscoreW[] =
251 {'D','i','s','k','S','c','o','r','e',0};
252static const WCHAR prop_displaynameW[] =
253 {'D','i','s','p','l','a','y','N','a','m','e',0};
254static const WCHAR prop_diskindexW[] =
255 {'D','i','s','k','I','n','d','e','x',0};
256static const WCHAR prop_dnshostnameW[] =
257 {'D','N','S','H','o','s','t','N','a','m','e',0};
259 {'D','N','S','S','e','r','v','e','r','S','e','a','r','c','h','O','r','d','e','r',0};
260static const WCHAR prop_domainW[] =
261 {'D','o','m','a','i','n',0};
262static const WCHAR prop_domainroleW[] =
263 {'D','o','m','a','i','n','R','o','l','e',0};
264static const WCHAR prop_driveW[] =
265 {'D','r','i','v','e',0};
266static const WCHAR prop_driverdateW[] =
267 {'D','r','i','v','e','r','D','a','t','e',0};
268static const WCHAR prop_drivernameW[] =
269 {'D','r','i','v','e','r','N','a','m','e',0};
270#ifndef __REACTOS__
272 {'D','r','i','v','e','r','V','e','r','s','i','o','n',0};
273#endif
274static const WCHAR prop_drivetypeW[] =
275 {'D','r','i','v','e','T','y','p','e',0};
276static const WCHAR prop_familyW[] =
277 {'F','a','m','i','l','y',0};
278static const WCHAR prop_filesystemW[] =
279 {'F','i','l','e','S','y','s','t','e','m',0};
280static const WCHAR prop_flavorW[] =
281 {'F','l','a','v','o','r',0};
282static const WCHAR prop_freespaceW[] =
283 {'F','r','e','e','S','p','a','c','e',0};
285 {'F','r','e','e','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
286static const WCHAR prop_handleW[] =
287 {'H','a','n','d','l','e',0};
289 {'G','r','a','p','h','i','c','s','S','c','o','r','e',0};
291 {'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0};
292static const WCHAR prop_hotfixidW[] =
293 {'H','o','t','F','i','x','I','D',0};
294static const WCHAR prop_idW[] =
295 {'I','D',0};
297 {'I','d','e','n','t','i','f','i','c','a','t','i','o','n','C','o','d','e',0};
299 {'I','d','e','n','t','i','f','y','i','n','g','N','u','m','b','e','r',0};
300static const WCHAR prop_indexW[] =
301 {'I','n','d','e','x',0};
302static const WCHAR prop_installdateW[] =
303 {'I','n','s','t','a','l','l','D','a','t','e',0};
305 {'I','n','s','t','a','l','l','e','d','D','i','s','p','l','a','y','D','r','i','v','e','r','s',0};
307 {'I','n','t','e','r','f','a','c','e','I','n','d','e','x',0};
309 {'I','n','t','e','r','f','a','c','e','T','y','p','e',0};
310static const WCHAR prop_intvalueW[] =
311 {'I','n','t','e','g','e','r','V','a','l','u','e',0};
312static const WCHAR prop_ipaddressW[] =
313 {'I','P','A','d','d','r','e','s','s',0};
315 {'I','P','C','o','n','n','e','c','t','i','o','n','M','e','t','r','i','c',0};
316static const WCHAR prop_ipenabledW[] =
317 {'I','P','E','n','a','b','l','e','d',0};
318static const WCHAR prop_ipsubnet[] =
319 {'I','P','S','u','b','n','e','t',0};
321 {'L','a','s','t','B','o','o','t','U','p','T','i','m','e',0};
322static const WCHAR prop_levelW[] =
323 {'L','e','v','e','l',0};
324static const WCHAR prop_localW[] =
325 {'L','o','c','a','l',0};
327 {'L','o','c','a','l','D','a','t','e','T','i','m','e',0};
328static const WCHAR prop_localeW[] =
329 {'L','o','c','a','l','e',0};
330static const WCHAR prop_locationW[] =
331 {'L','o','c','a','t','i','o','n',0};
332static const WCHAR prop_lockpresentW[] =
333 {'L','o','c','k','P','r','e','s','e','n','t',0};
334static const WCHAR prop_macaddressW[] =
335 {'M','A','C','A','d','d','r','e','s','s',0};
336static const WCHAR prop_manufacturerW[] =
337 {'M','a','n','u','f','a','c','t','u','r','e','r',0};
339 {'M','a','x','C','l','o','c','k','S','p','e','e','d',0};
340static const WCHAR prop_mediatypeW[] =
341 {'M','e','d','i','a','T','y','p','e',0};
342static const WCHAR prop_memberW[] =
343 {'M','e','m','b','e','r',0};
344static const WCHAR prop_memoryscoreW[] =
345 {'M','e','m','o','r','y','S','c','o','r','e',0};
346static const WCHAR prop_memorytypeW[] =
347 {'M','e','m','o','r','y','T','y','p','e',0};
348static const WCHAR prop_methodW[] =
349 {'M','e','t','h','o','d',0};
350static const WCHAR prop_modelW[] =
351 {'M','o','d','e','l',0};
353 {'N','e','t','C','o','n','n','e','c','t','i','o','n','S','t','a','t','u','s',0};
354static const WCHAR prop_networkW[] =
355 {'N','e','t','w','o','r','k',0};
356static const WCHAR prop_nexthopW[] =
357 {'N','e','x','t','H','o','p',0};
358static const WCHAR prop_numcoresW[] =
359 {'N','u','m','b','e','r','O','f','C','o','r','e','s',0};
361 {'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};
363 {'N','u','m','b','e','r','O','f','P','r','o','c','e','s','s','o','r','s',0};
365 {'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m','S','K','U',0};
367 {'O','S','A','r','c','h','i','t','e','c','t','u','r','e',0};
368static const WCHAR prop_oslanguageW[] =
369 {'O','S','L','a','n','g','u','a','g','e',0};
371 {'O','S','P','r','o','d','u','c','t','S','u','i','t','e',0};
372static const WCHAR prop_ostypeW[] =
373 {'O','S','T','y','p','e',0};
374static const WCHAR prop_parameterW[] =
375 {'P','a','r','a','m','e','t','e','r',0};
376static const WCHAR prop_partnumberW[] =
377 {'P','a','r','t','N','u','m','b','e','r',0};
379 {'P','h','y','s','i','c','a','l','A','d','a','p','t','e','r',0};
381 {'P','i','x','e','l','s','P','e','r','X','L','o','g','i','c','a','l','I','n','c','h',0};
382static const WCHAR prop_pnpdeviceidW[] =
383 {'P','N','P','D','e','v','i','c','e','I','D',0};
384static const WCHAR prop_portnameW[] =
385 {'P','o','r','t','N','a','m','e',0};
386static const WCHAR prop_pprocessidW[] =
387 {'P','a','r','e','n','t','P','r','o','c','e','s','s','I','D',0};
388static const WCHAR prop_primaryW[] =
389 {'P','r','i','m','a','r','y',0};
390static const WCHAR prop_processidW[] =
391 {'P','r','o','c','e','s','s','I','D',0};
392static const WCHAR prop_processoridW[] =
393 {'P','r','o','c','e','s','s','o','r','I','d',0};
395 {'P','r','o','c','e','s','s','o','r','T','y','p','e',0};
396static const WCHAR prop_productW[] =
397 {'P','r','o','d','u','c','t',0};
398static const WCHAR prop_productnameW[] =
399 {'P','r','o','d','u','c','t','N','a','m','e',0};
401 {'R','e','f','e','r','e','n','c','e','d','D','o','m','a','i','n','N','a','m','e',0};
402static const WCHAR prop_releasedateW[] =
403 {'R','e','l','e','a','s','e','D','a','t','e',0};
404static const WCHAR prop_revisionW[] =
405 {'R','e','v','i','s','i','o','n',0};
406static const WCHAR prop_serialnumberW[] =
407 {'S','e','r','i','a','l','N','u','m','b','e','r',0};
409 {'S','e','r','v','i','c','e','P','a','c','k','M','a','j','o','r','V','e','r','s','i','o','n',0};
411 {'S','e','r','v','i','c','e','P','a','c','k','M','i','n','o','r','V','e','r','s','i','o','n',0};
412static const WCHAR prop_servicetypeW[] =
413 {'S','e','r','v','i','c','e','T','y','p','e',0};
414static const WCHAR prop_settingidW[] =
415 {'S','e','t','t','i','n','g','I','D',0};
416static const WCHAR prop_skunumberW[] =
417 {'S','K','U','N','u','m','b','e','r',0};
419 {'S','M','B','I','O','S','B','I','O','S','V','e','r','s','i','o','n',0};
421 {'S','M','B','I','O','S','M','a','j','o','r','V','e','r','s','i','o','n',0};
423 {'S','M','B','I','O','S','M','i','n','o','r','V','e','r','s','i','o','n',0};
424static const WCHAR prop_startmodeW[] =
425 {'S','t','a','r','t','M','o','d','e',0};
426static const WCHAR prop_sidW[] =
427 {'S','I','D',0};
428static const WCHAR prop_sidlengthW[] =
429 {'S','i','d','L','e','n','g','t','h',0};
430static const WCHAR prop_sizeW[] =
431 {'S','i','z','e',0};
432static const WCHAR prop_speedW[] =
433 {'S','p','e','e','d',0};
435 {'S','t','a','r','t','i','n','g','O','f','f','s','e','t',0};
436static const WCHAR prop_stateW[] =
437 {'S','t','a','t','e',0};
438static const WCHAR prop_statusW[] =
439 {'S','t','a','t','u','s',0};
440static const WCHAR prop_statusinfoW[] =
441 {'S','t','a','t','u','s','I','n','f','o',0};
442static const WCHAR prop_strvalueW[] =
443 {'S','t','r','i','n','g','V','a','l','u','e',0};
444static const WCHAR prop_suitemaskW[] =
445 {'S','u','i','t','e','M','a','s','k',0};
447 {'S','y','s','t','e','m','D','i','r','e','c','t','o','r','y',0};
448static const WCHAR prop_systemdriveW[] =
449 {'S','y','s','t','e','m','D','r','i','v','e',0};
450static const WCHAR prop_systemnameW[] =
451 {'S','y','s','t','e','m','N','a','m','e',0};
452static const WCHAR prop_tagW[] =
453 {'T','a','g',0};
454static const WCHAR prop_threadcountW[] =
455 {'T','h','r','e','a','d','C','o','u','n','t',0};
456static const WCHAR prop_timetakenW[] =
457 {'T','i','m','e','T','a','k','e','n',0};
459 {'T','o','t','a','l','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
461 {'T','o','t','a','l','V','i','r','t','u','a','l','M','e','m','o','r','y','S','i','z','e',0};
463 {'T','o','t','a','l','V','i','s','i','b','l','e','M','e','m','o','r','y','S','i','z','e',0};
464static const WCHAR prop_typeW[] =
465 {'T','y','p','e',0};
466static const WCHAR prop_uniqueidW[] =
467 {'U','n','i','q','u','e','I','d',0};
468static const WCHAR prop_usernameW[] =
469 {'U','s','e','r','N','a','m','e',0};
470static const WCHAR prop_uuidW[] =
471 {'U','U','I','D',0};
472static const WCHAR prop_vendorW[] =
473 {'V','e','n','d','o','r',0};
474static const WCHAR prop_versionW[] =
475 {'V','e','r','s','i','o','n',0};
477 {'V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0};
478#ifndef __REACTOS__
480 {'V','i','d','e','o','A','r','c','h','i','t','e','c','t','u','r','e',0};
482 {'V','i','d','e','o','M','e','m','o','r','y','T','y','p','e',0};
484 {'V','i','d','e','o','M','o','d','e','D','e','s','c','r','i','p','t','i','o','n',0};
486 {'V','i','d','e','o','P','r','o','c','e','s','s','o','r',0};
487#endif /* !__REACTOS__ */
488static const WCHAR prop_volumenameW[] =
489 {'V','o','l','u','m','e','N','a','m','e',0};
491 {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0};
493 {'W','i','n','S','A','T','A','s','s','e','s','s','m','e','n','t','S','t','a','t','e',0};
494static const WCHAR prop_winsprlevelW[] =
495 {'W','i','n','S','P','R','L','e','v','e','l',0};
497 {'W','o','r','k','i','n','g','S','e','t','S','i','z','e',0};
498
499/* column definitions must be kept in sync with record structures below */
500static const struct column col_associator[] =
501{
505};
506static const struct column col_baseboard[] =
507{
515};
516static const struct column col_bios[] =
517{
529};
530static const struct column col_cdromdrive[] =
531{
537};
538static const struct column col_compsys[] =
539{
550};
551static const struct column col_compsysproduct[] =
552{
559};
560static const struct column col_datafile[] =
561{
564};
565static const struct column col_desktopmonitor[] =
566{
568};
569static const struct column col_directory[] =
570{
573};
574static const struct column col_diskdrive[] =
575{
585};
587{
590};
591static const struct column col_diskpartition[] =
592{
602};
603static const struct column col_displaycontrollerconfig[] =
604{
610};
611static const struct column col_ip4routetable[] =
612{
616};
617static const struct column col_logicaldisk[] =
618{
627};
628static const struct column col_logicaldisktopartition[] =
629{
632};
633static const struct column col_networkadapter[] =
634{
648};
649static const struct column col_networkadapterconfig[] =
650{
663};
664static const struct column col_operatingsystem[] =
665{
695};
696static const struct column col_param[] =
697{
704};
705static const struct column col_physicalmedia[] =
706{
709};
710static const struct column col_physicalmemory[] =
711{
717};
718static const struct column col_pnpentity[] =
719{
721};
722static const struct column col_printer[] =
723{
733};
734static const struct column col_process[] =
735{
745 /* methods */
747};
748static const struct column col_processor[] =
749{
770};
771static const struct column col_qualifier[] =
772{
781};
782static const struct column col_quickfixengineering[] =
783{
786};
787static const struct column col_service[] =
788{
798 /* methods */
803};
804static const struct column col_sid[] =
805{
811};
812static const struct column col_sounddevice[] =
813{
817};
818static const struct column col_stdregprov[] =
819{
824};
825static const struct column col_systemenclosure[] =
826{
834};
835static const struct column col_systemsecurity[] =
836{
839};
840
841#ifndef __REACTOS__
842static const struct column col_videocontroller[] =
843{
866};
867#endif
868
869static const struct column col_winsat[] =
870{
879};
880
881
883 {'I','n','t','e','l',' ','C','o','r','p','o','r','a','t','i','o','n',0};
885 {'N','o','n','e',0};
886static const WCHAR baseboard_tagW[] =
887 {'B','a','s','e',' ','B','o','a','r','d',0};
888static const WCHAR baseboard_versionW[] =
889 {'1','.','0',0};
890static const WCHAR bios_descriptionW[] =
891 {'D','e','f','a','u','l','t',' ','S','y','s','t','e','m',' ','B','I','O','S',0};
892static const WCHAR bios_manufacturerW[] =
893 {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0};
894static const WCHAR bios_releasedateW[] =
895 {'2','0','1','2','0','6','0','8','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
896static const WCHAR bios_serialnumberW[] =
897 {'0',0};
899 {'W','i','n','e',0};
900static const WCHAR bios_versionW[] =
901 {'W','I','N','E',' ',' ',' ','-',' ','1',0};
903 {'C','D','-','R','O','M',0};
904static const WCHAR cdromdrive_nameW[] =
905 {'W','i','n','e',' ','C','D','-','R','O','M',' ','A','T','A',' ','D','e','v','i','c','e',0};
907 {'I','D','E','\\','C','D','R','O','M','W','I','N','E','_','C','D','-','R','O','M',
908 '_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_',
909 '_','_','_','_','_','_','_','1','.','0','_','_','_','_','_','\\','5','&','3','A','2',
910 'A','5','8','5','4','&','0','&','1','.','0','.','0',0};
912 {'A','T','/','A','T',' ','C','O','M','P','A','T','I','B','L','E',0};
913static const WCHAR compsys_domainW[] =
914 {'W','O','R','K','G','R','O','U','P',0};
916 {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0};
917static const WCHAR compsys_modelW[] =
918 {'W','i','n','e',0};
920 {'0',0};
922 {'W','i','n','e',0};
924 {'d','e','a','d','d','e','a','d','-','d','e','a','d','-','d','e','a','d','-','d','e','a','d','-',
925 'd','e','a','d','d','e','a','d','d','e','a','d',0};
927 {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0};
929 {'1','.','0',0};
931 {'I','D','E',0};
933 {'(','S','t','a','n','d','a','r','d',' ','d','i','s','k',' ','d','r','i','v','e','s',')',0};
935 {'F','i','x','e','d',' ','h','a','r','d',' ','d','i','s','k',0};
937 {'R','e','m','o','v','a','b','l','e',' ','m','e','d','i','a',0};
938static const WCHAR diskdrive_modelW[] =
939 {'W','i','n','e',' ','D','i','s','k',' ','D','r','i','v','e',0};
941 {'I','D','E','\\','D','i','s','k','\\','V','E','N','_','W','I','N','E',0};
942static const WCHAR diskdrive_serialW[] =
943 {'W','I','N','E','H','D','I','S','K',0};
945 {'P','C','I','\\','V','E','N','_','8','0','8','6','&','D','E','V','_','1','0','0','E','&',
946 'S','U','B','S','Y','S','_','0','0','1','E','8','0','8','6','&','R','E','V','_','0','2','\\',
947 '3','&','2','6','7','A','6','1','6','A','&','1','&','1','8',0};
948static const WCHAR os_32bitW[] =
949 {'3','2','-','b','i','t',0};
950static const WCHAR os_64bitW[] =
951 {'6','4','-','b','i','t',0};
952static const WCHAR os_installdateW[] =
953 {'2','0','1','4','0','1','0','1','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
954static const WCHAR os_serialnumberW[] =
955 {'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0};
956static const WCHAR physicalmedia_tagW[] =
957 {'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0};
959 {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',0};
961 {'K','B','1','2','3','4','5','6','7',0};
963 {'W','i','n','e',' ','A','u','d','i','o',' ','D','e','v','i','c','e',0};
965 {'S','y','s','t','e','m',' ','E','n','c','l','o','s','u','r','e',0};
967 {'S','y','s','t','e','m',' ','E','n','c','l','o','s','u','r','e',' ','0',0};
969 {'W','i','n','e',0};
971 {'I','n','t','e','g','r','a','t','e','d',' ','R','A','M','D','A','C',0};
973 {'V','i','d','e','o','C','o','n','t','r','o','l','l','e','r','1',0};
975 {'2','0','1','7','0','1','0','1','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
977 {'1','.','0',0};
979 {'O','K',0};
980static const WCHAR winsat_timetakenW[] =
981 {'M','o','s','t','R','e','c','e','n','t','A','s','s','e','s','s','m','e','n','t',0};
982
983#include "pshpack1.h"
985{
987 const WCHAR *class;
989};
991{
993 const WCHAR *model;
994 const WCHAR *name;
997 const WCHAR *tag;
999};
1001{
1006 const WCHAR *name;
1013};
1015{
1017 const WCHAR *drive;
1019 const WCHAR *name;
1021};
1023{
1028 const WCHAR *model;
1029 const WCHAR *name;
1034};
1036{
1038 const WCHAR *name;
1040 const WCHAR *uuid;
1043};
1045{
1046 const WCHAR *name;
1048};
1050{
1052};
1054{
1056 const WCHAR *name;
1057};
1059{
1065 const WCHAR *model;
1069};
1071{
1074};
1076{
1085 const WCHAR *type;
1086};
1088{
1092 const WCHAR *name;
1094};
1096{
1100};
1102{
1107 const WCHAR *name;
1111};
1113{
1116};
1118{
1127 const WCHAR *name;
1132};
1134{
1141 const struct array *ipaddress;
1144 const struct array *ipsubnet;
1147};
1149{
1163 const WCHAR *name;
1179};
1181{
1182 const WCHAR *class;
1188};
1190{
1192 const WCHAR *tag;
1193};
1195{
1201};
1203{
1205};
1207{
1214 const WCHAR *name;
1217};
1219{
1224 const WCHAR *name;
1229 /* methods */
1231};
1233{
1246 const WCHAR *name;
1254};
1256{
1257 const WCHAR *class;
1261 const WCHAR *name;
1265};
1267{
1270};
1272{
1276 const WCHAR *name;
1280 const WCHAR *state;
1282 /* methods */
1287};
1289{
1293 const WCHAR *sid;
1295};
1297{
1298 const WCHAR *name;
1301};
1303{
1308};
1310{
1313};
1315{
1317 const struct array *chassistypes;
1321 const WCHAR *name;
1322 const WCHAR *tag;
1323};
1325{
1341 const WCHAR *name;
1348};
1350{
1359};
1360#include "poppack.h"
1361
1362static const struct record_associator data_associator[] =
1363{
1366};
1367static const struct record_param data_param[] =
1368{
1397};
1398
1399#define FLAVOR_ID (WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE | WBEM_FLAVOR_NOT_OVERRIDABLE |\
1400 WBEM_FLAVOR_ORIGIN_PROPAGATED)
1401
1403{
1405};
1406static const struct record_qualifier data_qualifier[] =
1407{
1410};
1412{
1414};
1416{
1418};
1419static const struct record_stdregprov data_stdregprov[] =
1420{
1422};
1424{
1425 1,
1426};
1428{
1429 sizeof(*systemenclosure_chassistypes),
1432};
1434{
1436};
1437static const struct record_winsat data_winsat[] =
1438{
1439 { 8.0f, 8.0f, 8.0f, 8.0f, 8.0f, winsat_timetakenW, 1 /* Valid */, 8.0f },
1440};
1441
1442/* check if row matches condition and update status */
1443static BOOL match_row( const struct table *table, UINT row, const struct expr *cond, enum fill_status *status )
1444{
1445 LONGLONG val;
1446 UINT type;
1447
1448 if (!cond)
1449 {
1451 return TRUE;
1452 }
1453 if (eval_cond( table, row, cond, &val, &type ) != S_OK)
1454 {
1456 return FALSE;
1457 }
1459 return val != 0;
1460}
1461
1462static BOOL resize_table( struct table *table, UINT row_count, UINT row_size )
1463{
1465 {
1466 if (!(table->data = heap_alloc( row_count * row_size ))) return FALSE;
1467 table->num_rows_allocated = row_count;
1468 return TRUE;
1469 }
1470 if (row_count > table->num_rows_allocated)
1471 {
1472 BYTE *data;
1473 UINT count = max( row_count, table->num_rows_allocated * 2 );
1474 if (!(data = heap_realloc( table->data, count * row_size ))) return FALSE;
1475 table->data = data;
1477 }
1478 return TRUE;
1479}
1480
1481#include "pshpack1.h"
1483{
1489};
1490
1492{
1497};
1498
1500{
1504};
1505
1507{
1513};
1514
1516{
1524};
1525
1527{
1534};
1535
1537{
1544};
1545#include "poppack.h"
1546
1547#define RSMB (('R' << 24) | ('S' << 16) | ('M' << 8) | 'B')
1548
1549static const struct smbios_header *find_smbios_entry( enum smbios_type type, const char *buf, UINT len )
1550{
1551 const char *ptr, *start;
1552 const struct smbios_prologue *prologue;
1553 const struct smbios_header *hdr;
1554
1555 if (len < sizeof(struct smbios_prologue)) return NULL;
1556 prologue = (const struct smbios_prologue *)buf;
1557 if (prologue->length > len - sizeof(*prologue) || prologue->length < sizeof(*hdr)) return NULL;
1558
1559 start = (const char *)(prologue + 1);
1560 hdr = (const struct smbios_header *)start;
1561
1562 for (;;)
1563 {
1564 if ((const char *)hdr - start >= prologue->length - sizeof(*hdr)) return NULL;
1565
1566 if (!hdr->length)
1567 {
1568 WARN( "invalid entry\n" );
1569 return NULL;
1570 }
1571
1572 if (hdr->type == type)
1573 {
1574 if ((const char *)hdr - start + hdr->length > prologue->length) return NULL;
1575 break;
1576 }
1577 else /* skip other entries and their strings */
1578 {
1579 for (ptr = (const char *)hdr + hdr->length; ptr - buf < len && *ptr; ptr++)
1580 {
1581 for (; ptr - buf < len; ptr++) if (!*ptr) break;
1582 }
1583 if (ptr == (const char *)hdr + hdr->length) ptr++;
1584 hdr = (const struct smbios_header *)(ptr + 1);
1585 }
1586 }
1587
1588 return hdr;
1589}
1590
1591static WCHAR *get_smbios_string( BYTE id, const char *buf, UINT offset, UINT buflen )
1592{
1593 const char *ptr = buf + offset;
1594 UINT i = 0;
1595
1596 if (!id || offset >= buflen) return NULL;
1597 for (ptr = buf + offset; ptr - buf < buflen && *ptr; ptr++)
1598 {
1599 if (++i == id) return heap_strdupAW( ptr );
1600 for (; ptr - buf < buflen; ptr++) if (!*ptr) break;
1601 }
1602 return NULL;
1603}
1604
1605static WCHAR *get_baseboard_string( BYTE id, const char *buf, UINT len )
1606{
1607 const struct smbios_header *hdr;
1608 const struct smbios_baseboard *baseboard;
1609 UINT offset;
1610
1611 if (!(hdr = find_smbios_entry( SMBIOS_TYPE_BASEBOARD, buf, len ))) return NULL;
1612
1613 baseboard = (const struct smbios_baseboard *)hdr;
1614 offset = (const char *)baseboard - buf + baseboard->hdr.length;
1615 return get_smbios_string( id, buf, offset, len );
1616}
1617
1619{
1622 return ret;
1623}
1624
1625static WCHAR *get_baseboard_product( const char *buf, UINT len )
1626{
1628 if (!ret) return heap_strdupW( baseboard_tagW );
1629 return ret;
1630}
1631
1633{
1636 return ret;
1637}
1638
1639static WCHAR *get_baseboard_version( const char *buf, UINT len )
1640{
1642 if (!ret) return heap_strdupW( baseboard_versionW );
1643 return ret;
1644}
1645
1646static enum fill_status fill_baseboard( struct table *table, const struct expr *cond )
1647{
1648 struct record_baseboard *rec;
1650 UINT row = 0, len;
1651 char *buf;
1652
1653 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1654
1655 len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 );
1656 if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED;
1658
1659 rec = (struct record_baseboard *)table->data;
1661 rec->model = baseboard_tagW;
1662 rec->name = baseboard_tagW;
1665 rec->tag = baseboard_tagW;
1667 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
1668 else row++;
1669
1670 heap_free( buf );
1671
1672 TRACE("created %u rows\n", row);
1673 table->num_rows = row;
1674 return status;
1675}
1676
1678{
1679 const struct smbios_prologue *prologue = (const struct smbios_prologue *)buf;
1680 if (len < sizeof(*prologue)) return 2;
1681 return prologue->major_version;
1682}
1683
1685{
1686 const struct smbios_prologue *prologue = (const struct smbios_prologue *)buf;
1687 if (len < sizeof(*prologue)) return 0;
1688 return prologue->minor_version;
1689}
1690
1691static WCHAR *get_bios_string( BYTE id, const char *buf, UINT len )
1692{
1693 const struct smbios_header *hdr;
1694 const struct smbios_bios *bios;
1695 UINT offset;
1696
1697 if (!(hdr = find_smbios_entry( SMBIOS_TYPE_BIOS, buf, len ))) return NULL;
1698
1699 bios = (const struct smbios_bios *)hdr;
1700 offset = (const char *)bios - buf + bios->hdr.length;
1701 return get_smbios_string( id, buf, offset, len );
1702}
1703
1704static WCHAR *get_bios_manufacturer( const char *buf, UINT len )
1705{
1706 WCHAR *ret = get_bios_string( 1, buf, len );
1707 if (!ret) return heap_strdupW( bios_manufacturerW );
1708 return ret;
1709}
1710
1712{
1713 static const WCHAR fmtW[] =
1714 {'%','0','4','u','%','0','2','u','%','0','2','u','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
1715 UINT year, month, day, len = lstrlenW( str );
1716 const WCHAR *p = str, *q;
1717 WCHAR *ret;
1718
1719 while (len && iswspace( *p )) { p++; len--; }
1720 while (len && iswspace( p[len - 1] )) { len--; }
1721
1722 q = p;
1723 while (len && iswdigit( *q )) { q++; len--; };
1724 if (q - p != 2 || !len || *q != '/') return NULL;
1725 month = (p[0] - '0') * 10 + p[1] - '0';
1726
1727 p = ++q; len--;
1728 while (len && iswdigit( *q )) { q++; len--; };
1729 if (q - p != 2 || !len || *q != '/') return NULL;
1730 day = (p[0] - '0') * 10 + p[1] - '0';
1731
1732 p = ++q; len--;
1733 while (len && iswdigit( *q )) { q++; len--; };
1734 if (q - p == 4) year = (p[0] - '0') * 1000 + (p[1] - '0') * 100 + (p[2] - '0') * 10 + p[3] - '0';
1735 else if (q - p == 2) year = 1900 + (p[0] - '0') * 10 + p[1] - '0';
1736 else return NULL;
1737
1738 if (!(ret = heap_alloc( sizeof(fmtW) ))) return NULL;
1739 swprintf( ret, fmtW, year, month, day );
1740 return ret;
1741}
1742
1743static WCHAR *get_bios_releasedate( const char *buf, UINT len )
1744{
1745 WCHAR *ret, *date = get_bios_string( 3, buf, len );
1747 heap_free( date );
1748 return ret;
1749}
1750
1752{
1753 WCHAR *ret = get_bios_string( 2, buf, len );
1755 return ret;
1756}
1757
1758static enum fill_status fill_bios( struct table *table, const struct expr *cond )
1759{
1760 struct record_bios *rec;
1762 UINT row = 0, len;
1763 char *buf;
1764
1765 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1766
1767 len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 );
1768 if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED;
1770
1771 rec = (struct record_bios *)table->data;
1772 rec->currentlanguage = NULL;
1774 rec->identificationcode = NULL;
1776 rec->name = bios_descriptionW;
1782 rec->version = bios_versionW;
1783 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
1784 else row++;
1785
1786 heap_free( buf );
1787
1788 TRACE("created %u rows\n", row);
1789 table->num_rows = row;
1790 return status;
1791}
1792
1793static enum fill_status fill_cdromdrive( struct table *table, const struct expr *cond )
1794{
1795 static const WCHAR fmtW[] = {'%','c',':',0};
1796 WCHAR drive[3], root[] = {'A',':','\\',0};
1797 struct record_cdromdrive *rec;
1798 UINT i, row = 0, offset = 0;
1799 DWORD drives = GetLogicalDrives();
1801
1802 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1803
1804 for (i = 0; i < 26; i++)
1805 {
1806 if (drives & (1 << i))
1807 {
1808 root[0] = 'A' + i;
1809 if (GetDriveTypeW( root ) != DRIVE_CDROM)
1810 continue;
1811
1812 if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1813
1814 rec = (struct record_cdromdrive *)(table->data + offset);
1816 swprintf( drive, fmtW, 'A' + i );
1817 rec->drive = heap_strdupW( drive );
1819 rec->name = cdromdrive_nameW;
1821 if (!match_row( table, row, cond, &status ))
1822 {
1824 continue;
1825 }
1826 offset += sizeof(*rec);
1827 row++;
1828 }
1829 }
1830 TRACE("created %u rows\n", row);
1831 table->num_rows = row;
1832 return status;
1833}
1834
1836{
1838
1839 if (NtQuerySystemInformation( SystemBasicInformation, &info, sizeof(info), NULL )) return 1;
1840 return info.NumberOfProcessors;
1841}
1842
1843#ifdef __REACTOS__
1844static UINT get_logical_processor_count( UINT *num_cores )
1845{
1847 UINT i, j, count = 0;
1849 ULONG len;
1850
1851 if (num_cores) *num_cores = get_processor_count();
1854
1855 if (!(info = heap_alloc( len ))) return get_processor_count();
1857 if (status != STATUS_SUCCESS)
1858 {
1859 heap_free( info );
1860 return get_processor_count();
1861 }
1862 if (num_cores) *num_cores = 0;
1863 for (i = 0; i < len / sizeof(*info); i++)
1864 {
1865 if (info[i].Relationship == RelationProcessorCore)
1866 {
1867 for (j = 0; j < sizeof(ULONG_PTR); j++) if (info[i].ProcessorMask & (1 << j)) count++;
1868 }
1869 else if (info[i].Relationship == RelationProcessorPackage && num_cores)
1870 {
1871 for (j = 0; j < sizeof(ULONG_PTR); j++) if (info[i].ProcessorMask & (1 << j)) (*num_cores)++;
1872 }
1873 }
1874 heap_free( info );
1875 return count;
1876}
1877#else
1878static UINT get_logical_processor_count( UINT *num_physical, UINT *num_packages )
1879{
1881 UINT core_relation_count = 0, package_relation_count = 0;
1883 ULONG len, offset = 0;
1884 BOOL smt_enabled = FALSE;
1885 DWORD all = RelationAll;
1886
1887 if (num_packages) *num_packages = 1;
1890
1891 if (!(buf = heap_alloc( len ))) return get_processor_count();
1893 if (status != STATUS_SUCCESS)
1894 {
1895 heap_free( buf );
1896 return get_processor_count();
1897 }
1898
1899 while (offset < len)
1900 {
1902
1903 if (entry->Relationship == RelationProcessorCore)
1904 {
1905 core_relation_count++;
1906 if (entry->u.Processor.Flags & LTP_PC_SMT) smt_enabled = TRUE;
1907 }
1908 else if (entry->Relationship == RelationProcessorPackage)
1909 {
1910 package_relation_count++;
1911 }
1912 offset += entry->Size;
1913 }
1914
1915 heap_free( buf );
1916 if (num_physical) *num_physical = core_relation_count;
1917 if (num_packages) *num_packages = package_relation_count;
1918 return smt_enabled ? core_relation_count * 2 : core_relation_count;
1919}
1920#endif
1921
1923{
1924 MEMORYSTATUSEX status;
1925
1926 status.dwLength = sizeof(status);
1927 if (!GlobalMemoryStatusEx( &status )) return 1024 * 1024 * 1024;
1928 return status.ullTotalPhys;
1929}
1930
1932{
1933 MEMORYSTATUSEX status;
1934
1935 status.dwLength = sizeof(status);
1936 if (!GlobalMemoryStatusEx( &status )) return 1024 * 1024 * 1024;
1937 return status.ullAvailPhys;
1938}
1939
1941{
1942 WCHAR *ret;
1944
1945 if (!(ret = heap_alloc( size * sizeof(WCHAR) ))) return NULL;
1947 return ret;
1948}
1949
1950static WCHAR *get_username(void)
1951{
1952 WCHAR *ret;
1953 DWORD compsize, usersize;
1954 DWORD size;
1955
1956 compsize = 0;
1957 GetComputerNameW( NULL, &compsize );
1958 usersize = 0;
1959 GetUserNameW( NULL, &usersize );
1960 size = compsize + usersize; /* two null terminators account for the \ */
1961 if (!(ret = heap_alloc( size * sizeof(WCHAR) ))) return NULL;
1962 GetComputerNameW( ret, &compsize );
1963 ret[compsize] = '\\';
1964 GetUserNameW( ret + compsize + 1, &usersize );
1965 return ret;
1966}
1967
1968static enum fill_status fill_compsys( struct table *table, const struct expr *cond )
1969{
1970 struct record_computersystem *rec;
1972 UINT row = 0;
1973
1974 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1975
1976 rec = (struct record_computersystem *)table->data;
1978 rec->domain = compsys_domainW;
1979 rec->domainrole = 0; /* standalone workstation */
1981 rec->model = compsys_modelW;
1982 rec->name = get_computername();
1983#ifdef __REACTOS__
1986#else
1988#endif
1990 rec->username = get_username();
1991 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
1992 else row++;
1993
1994 TRACE("created %u rows\n", row);
1995 table->num_rows = row;
1996 return status;
1997}
1998
1999static WCHAR *get_compsysproduct_string( BYTE id, const char *buf, UINT len )
2000{
2001 const struct smbios_header *hdr;
2002 const struct smbios_system *system;
2003 UINT offset;
2004
2005 if (!(hdr = find_smbios_entry( SMBIOS_TYPE_SYSTEM, buf, len ))) return NULL;
2006
2007 system = (const struct smbios_system *)hdr;
2008 offset = (const char *)system - buf + system->hdr.length;
2009 return get_smbios_string( id, buf, offset, len );
2010}
2011
2013{
2016 return ret;
2017}
2018
2020{
2022 if (!ret) return heap_strdupW( compsysproduct_nameW );
2023 return ret;
2024}
2025
2027{
2028 static const WCHAR fmtW[] =
2029 {'%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-',
2030 '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X',
2031 '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',0};
2032 static const BYTE none[] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
2033 const struct smbios_header *hdr;
2034 const struct smbios_system *system;
2035 const BYTE *ptr;
2036 WCHAR *ret = NULL;
2037
2038 if (!(hdr = find_smbios_entry( SMBIOS_TYPE_SYSTEM, buf, len )) || hdr->length < sizeof(*system)) goto done;
2039 system = (const struct smbios_system *)hdr;
2040 if (!memcmp( system->uuid, none, sizeof(none) ) || !(ret = heap_alloc( 37 * sizeof(WCHAR) ))) goto done;
2041
2042 ptr = system->uuid;
2043 swprintf( ret, fmtW, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7], ptr[8], ptr[9],
2044 ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15] );
2045
2046done:
2048 return ret;
2049}
2050
2052{
2054 if (!ret) return heap_strdupW( compsysproduct_vendorW );
2055 return ret;
2056}
2057
2059{
2062 return ret;
2063}
2064
2065static enum fill_status fill_compsysproduct( struct table *table, const struct expr *cond )
2066{
2067 struct record_computersystemproduct *rec;
2069 UINT row = 0, len;
2070 char *buf;
2071
2072 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2073
2074 len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 );
2075 if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED;
2077
2078 rec = (struct record_computersystemproduct *)table->data;
2081 rec->skunumber = NULL;
2085 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
2086 else row++;
2087
2088 heap_free( buf );
2089
2090 TRACE("created %u rows\n", row);
2091 table->num_rows = row;
2092 return status;
2093}
2094
2096{
2101};
2102
2104{
2105 struct dirstack *dirstack;
2106
2107 if (!(dirstack = heap_alloc( sizeof(*dirstack) ))) return NULL;
2108 if (!(dirstack->dirs = heap_alloc( sizeof(WCHAR *) * size )))
2109 {
2111 return NULL;
2112 }
2113 if (!(dirstack->len_dirs = heap_alloc( sizeof(UINT) * size )))
2114 {
2117 return NULL;
2118 }
2119 dirstack->num_dirs = 0;
2121 return dirstack;
2122}
2123
2124static void clear_dirstack( struct dirstack *dirstack )
2125{
2126 UINT i;
2127 for (i = 0; i < dirstack->num_dirs; i++) heap_free( dirstack->dirs[i] );
2128 dirstack->num_dirs = 0;
2129}
2130
2131static void free_dirstack( struct dirstack *dirstack )
2132{
2137}
2138
2140{
2142
2143 if (!dir) return FALSE;
2144
2145 if (i == dirstack->num_allocated)
2146 {
2147 WCHAR **tmp;
2148 UINT *len_tmp;
2149
2151 if (!(tmp = heap_realloc( dirstack->dirs, size * sizeof(WCHAR *) ))) return FALSE;
2152 dirstack->dirs = tmp;
2153 if (!(len_tmp = heap_realloc( dirstack->len_dirs, size * sizeof(UINT) ))) return FALSE;
2154 dirstack->len_dirs = len_tmp;
2156 }
2157 dirstack->dirs[i] = dir;
2158 dirstack->len_dirs[i] = len;
2159 dirstack->num_dirs++;
2160 return TRUE;
2161}
2162
2164{
2165 if (!dirstack->num_dirs)
2166 {
2167 *len = 0;
2168 return NULL;
2169 }
2170 dirstack->num_dirs--;
2172 return dirstack->dirs[dirstack->num_dirs];
2173}
2174
2175static const WCHAR *peek_dir( struct dirstack *dirstack )
2176{
2177 if (!dirstack->num_dirs) return NULL;
2178 return dirstack->dirs[dirstack->num_dirs - 1];
2179}
2180
2182{
2183 UINT i = 0;
2184 WCHAR *ret;
2185
2186 if (!(ret = heap_alloc( (len + 6) * sizeof(WCHAR) ))) return NULL;
2187 ret[i++] = drive;
2188 ret[i++] = ':';
2189 ret[i++] = '\\';
2190 if (path && len)
2191 {
2192 memcpy( ret + i, path, len * sizeof(WCHAR) );
2193 i += len;
2194 ret[i++] = '\\';
2195 }
2196 ret[i++] = '*';
2197 ret[i] = 0;
2198 return ret;
2199}
2200
2202{
2203 UINT i = 0, len = 0;
2204 const WCHAR *p;
2205 WCHAR *ret;
2206
2207 for (p = path; *p; p++)
2208 {
2209 if (*p == '\\') len += 2;
2210 else len++;
2211 };
2212 if (!(ret = heap_alloc( (len + 5) * sizeof(WCHAR) ))) return NULL;
2213 ret[i++] = drive;
2214 ret[i++] = ':';
2215 ret[i++] = '\\';
2216 ret[i++] = '\\';
2217 for (p = path; *p; p++)
2218 {
2219 if (*p != '\\') ret[i++] = *p;
2220 else
2221 {
2222 ret[i++] = '\\';
2223 ret[i++] = '\\';
2224 }
2225 }
2226 ret[i] = 0;
2227 return ret;
2228}
2229
2231{
2232 const WCHAR *p = path, *start;
2233 UINT len, i;
2234 WCHAR *ret;
2235
2236 if (!iswalpha( p[0] ) || p[1] != ':' || p[2] != '\\' || p[3] != '\\' || !p[4]) return NULL;
2237 start = path + 4;
2238 len = lstrlenW( start );
2239 p = start + len - 1;
2240 if (*p == '\\') return NULL;
2241
2242 while (p >= start && *p != '\\') { len--; p--; };
2243 while (p >= start && *p == '\\') { len--; p--; };
2244
2245 if (!(ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
2246 for (i = 0, p = start; p < start + len; p++)
2247 {
2248 if (p[0] == '\\' && p[1] == '\\')
2249 {
2250 ret[i++] = '\\';
2251 p++;
2252 }
2253 else ret[i++] = *p;
2254 }
2255 ret[i] = 0;
2256 *ret_len = i;
2257 return ret;
2258}
2259
2260static BOOL seen_dir( struct dirstack *dirstack, const WCHAR *path )
2261{
2262 UINT i;
2263 for (i = 0; i < dirstack->num_dirs; i++) if (!wcscmp( dirstack->dirs[i], path )) return TRUE;
2264 return FALSE;
2265}
2266
2267/* optimize queries of the form WHERE Name='...' [OR Name='...']* */
2268static UINT seed_dirs( struct dirstack *dirstack, const struct expr *cond, WCHAR root, UINT *count )
2269{
2270 const struct expr *left, *right;
2271
2272 if (!cond || cond->type != EXPR_COMPLEX) return *count = 0;
2273
2274 left = cond->u.expr.left;
2275 right = cond->u.expr.right;
2276 if (cond->u.expr.op == OP_EQ)
2277 {
2278 UINT len;
2279 WCHAR *path;
2280 const WCHAR *str = NULL;
2281
2282 if (left->type == EXPR_PROPVAL && right->type == EXPR_SVAL &&
2283 !wcscmp( left->u.propval->name, prop_nameW ) &&
2284 towupper( right->u.sval[0] ) == towupper( root ))
2285 {
2286 str = right->u.sval;
2287 }
2288 else if (left->type == EXPR_SVAL && right->type == EXPR_PROPVAL &&
2289 !wcscmp( right->u.propval->name, prop_nameW ) &&
2290 towupper( left->u.sval[0] ) == towupper( root ))
2291 {
2292 str = left->u.sval;
2293 }
2294 if (str && (path = build_dirname( str, &len )))
2295 {
2296 if (seen_dir( dirstack, path ))
2297 {
2298 heap_free( path );
2299 return ++*count;
2300 }
2301 else if (push_dir( dirstack, path, len )) return ++*count;
2302 heap_free( path );
2303 return *count = 0;
2304 }
2305 }
2306 else if (cond->u.expr.op == OP_OR)
2307 {
2308 UINT left_count = 0, right_count = 0;
2309
2310 if (!(seed_dirs( dirstack, left, root, &left_count ))) return *count = 0;
2311 if (!(seed_dirs( dirstack, right, root, &right_count ))) return *count = 0;
2312 return *count += left_count + right_count;
2313 }
2314 return *count = 0;
2315}
2316
2317static WCHAR *append_path( const WCHAR *path, const WCHAR *segment, UINT *len )
2318{
2319 UINT len_path = 0, len_segment = lstrlenW( segment );
2320 WCHAR *ret;
2321
2322 *len = 0;
2323 if (path) len_path = lstrlenW( path );
2324 if (!(ret = heap_alloc( (len_path + len_segment + 2) * sizeof(WCHAR) ))) return NULL;
2325 if (path && len_path)
2326 {
2327 memcpy( ret, path, len_path * sizeof(WCHAR) );
2328 ret[len_path] = '\\';
2329 *len += len_path + 1;
2330 }
2331 memcpy( ret + *len, segment, len_segment * sizeof(WCHAR) );
2332 *len += len_segment;
2333 ret[*len] = 0;
2334 return ret;
2335}
2336
2338{
2339 static const WCHAR slashW[] = {'\\',0}, fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
2341 DWORD size, len = 4 * 5 + ARRAY_SIZE( fmtW );
2342 void *block;
2343 WCHAR *ret;
2344
2345 if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
2347 {
2348 heap_free( ret );
2349 return NULL;
2350 }
2351 if (!GetFileVersionInfoW( filename, 0, size, block ) ||
2352 !VerQueryValueW( block, slashW, (void **)&info, &size ))
2353 {
2354 heap_free( block );
2355 heap_free( ret );
2356 return NULL;
2357 }
2358 swprintf( ret, fmtW, info->dwFileVersionMS >> 16, info->dwFileVersionMS & 0xffff,
2359 info->dwFileVersionLS >> 16, info->dwFileVersionLS & 0xffff );
2360 heap_free( block );
2361 return ret;
2362}
2363
2364static enum fill_status fill_datafile( struct table *table, const struct expr *cond )
2365{
2366 static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0};
2367 struct record_datafile *rec;
2368 UINT i, len, row = 0, offset = 0, num_expected_rows;
2369 WCHAR *glob = NULL, *path = NULL, *new_path, root[] = {'A',':','\\',0};
2370 DWORD drives = GetLogicalDrives();
2372 HANDLE handle;
2373 struct dirstack *dirstack;
2375
2376 if (!resize_table( table, 8, sizeof(*rec) )) return FILL_STATUS_FAILED;
2377
2379
2380 for (i = 0; i < 26; i++)
2381 {
2382 if (!(drives & (1 << i))) continue;
2383
2384 root[0] = 'A' + i;
2385 if (GetDriveTypeW( root ) != DRIVE_FIXED) continue;
2386
2387 num_expected_rows = 0;
2388 if (!seed_dirs( dirstack, cond, root[0], &num_expected_rows )) clear_dirstack( dirstack );
2389
2390 for (;;)
2391 {
2392 heap_free( glob );
2393 heap_free( path );
2394 path = pop_dir( dirstack, &len );
2395 if (!(glob = build_glob( root[0], path, len )))
2396 {
2398 goto done;
2399 }
2401 {
2402 do
2403 {
2404 if (!resize_table( table, row + 1, sizeof(*rec) ))
2405 {
2407 FindClose( handle );
2408 goto done;
2409 }
2410 if (!wcscmp( data.cFileName, dotW ) || !wcscmp( data.cFileName, dotdotW )) continue;
2411
2412 if (!(new_path = append_path( path, data.cFileName, &len )))
2413 {
2415 FindClose( handle );
2416 goto done;
2417 }
2418
2419 if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
2420 {
2421 if (push_dir( dirstack, new_path, len )) continue;
2422 heap_free( new_path );
2423 FindClose( handle );
2425 goto done;
2426 }
2427 rec = (struct record_datafile *)(table->data + offset);
2428 rec->name = build_name( root[0], new_path );
2429 rec->version = get_file_version( rec->name );
2430 heap_free( new_path );
2431 if (!match_row( table, row, cond, &status ))
2432 {
2434 continue;
2435 }
2436 else if (num_expected_rows && row == num_expected_rows - 1)
2437 {
2438 row++;
2439 FindClose( handle );
2441 goto done;
2442 }
2443 offset += sizeof(*rec);
2444 row++;
2445 }
2446 while (FindNextFileW( handle, &data ));
2447 FindClose( handle );
2448 }
2449 if (!peek_dir( dirstack )) break;
2450 }
2451 }
2452
2453done:
2455 heap_free( glob );
2456 heap_free( path );
2457
2458 TRACE("created %u rows\n", row);
2459 table->num_rows = row;
2460 return status;
2461}
2462
2464{
2465 HDC hdc = GetDC( NULL );
2466 UINT32 ret;
2467
2468 if (!hdc) return 96;
2470 ReleaseDC( NULL, hdc );
2471 return ret;
2472}
2473
2474static enum fill_status fill_desktopmonitor( struct table *table, const struct expr *cond )
2475{
2476 struct record_desktopmonitor *rec;
2478 UINT row = 0;
2479
2480 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2481
2482 rec = (struct record_desktopmonitor *)table->data;
2484
2485 if (match_row( table, row, cond, &status )) row++;
2486
2487 TRACE("created %u rows\n", row);
2488 table->num_rows = row;
2489 return status;
2490}
2491
2492static enum fill_status fill_directory( struct table *table, const struct expr *cond )
2493{
2494 static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0};
2495 struct record_directory *rec;
2496 UINT i, len, row = 0, offset = 0, num_expected_rows;
2497 WCHAR *glob = NULL, *path = NULL, *new_path, root[] = {'A',':','\\',0};
2498 DWORD drives = GetLogicalDrives();
2500 HANDLE handle;
2501 struct dirstack *dirstack;
2503
2504 if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
2505
2507
2508 for (i = 0; i < 26; i++)
2509 {
2510 if (!(drives & (1 << i))) continue;
2511
2512 root[0] = 'A' + i;
2513 if (GetDriveTypeW( root ) != DRIVE_FIXED) continue;
2514
2515 num_expected_rows = 0;
2516 if (!seed_dirs( dirstack, cond, root[0], &num_expected_rows )) clear_dirstack( dirstack );
2517
2518 for (;;)
2519 {
2520 heap_free( glob );
2521 heap_free( path );
2522 path = pop_dir( dirstack, &len );
2523 if (!(glob = build_glob( root[0], path, len )))
2524 {
2526 goto done;
2527 }
2529 {
2530 do
2531 {
2532 if (!resize_table( table, row + 1, sizeof(*rec) ))
2533 {
2534 FindClose( handle );
2536 goto done;
2537 }
2538 if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
2539 !wcscmp( data.cFileName, dotW ) || !wcscmp( data.cFileName, dotdotW ))
2540 continue;
2541
2542 if (!(new_path = append_path( path, data.cFileName, &len )))
2543 {
2544 FindClose( handle );
2546 goto done;
2547 }
2548
2549 if (!(push_dir( dirstack, new_path, len )))
2550 {
2551 heap_free( new_path );
2552 FindClose( handle );
2554 goto done;
2555 }
2556 rec = (struct record_directory *)(table->data + offset);
2558 rec->name = build_name( root[0], new_path );
2559 heap_free( new_path );
2560 if (!match_row( table, row, cond, &status ))
2561 {
2563 continue;
2564 }
2565 else if (num_expected_rows && row == num_expected_rows - 1)
2566 {
2567 row++;
2568 FindClose( handle );
2570 goto done;
2571 }
2572 offset += sizeof(*rec);
2573 row++;
2574 }
2575 while (FindNextFileW( handle, &data ));
2576 FindClose( handle );
2577 }
2578 if (!peek_dir( dirstack )) break;
2579 }
2580 }
2581
2582done:
2584 heap_free( glob );
2585 heap_free( path );
2586
2587 TRACE("created %u rows\n", row);
2588 table->num_rows = row;
2589 return status;
2590}
2591
2592static UINT64 get_freespace( const WCHAR *dir, UINT64 *disksize )
2593{
2594 WCHAR root[] = {'\\','\\','.','\\','A',':',0};
2597 HANDLE handle;
2598 DWORD bytes_returned;
2599
2600 free.QuadPart = 512 * 1024 * 1024;
2602
2603 root[4] = dir[0];
2606 {
2607 if (DeviceIoControl( handle, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, &info, sizeof(info), &bytes_returned, NULL ))
2608 *disksize = info.DiskSize.QuadPart;
2610 }
2611 return free.QuadPart;
2612}
2613
2614static enum fill_status fill_diskdrive( struct table *table, const struct expr *cond )
2615{
2616 static const WCHAR fmtW[] =
2617 {'\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','%','u',0};
2618 WCHAR device_id[ARRAY_SIZE( fmtW ) + 10], root[] = {'A',':','\\',0};
2619 struct record_diskdrive *rec;
2620 UINT i, row = 0, offset = 0, index = 0, type;
2621 UINT64 size = 1024 * 1024 * 1024;
2622 DWORD drives = GetLogicalDrives();
2624
2625 if (!resize_table( table, 2, sizeof(*rec) )) return FILL_STATUS_FAILED;
2626
2627 for (i = 0; i < 26; i++)
2628 {
2629 if (drives & (1 << i))
2630 {
2631 root[0] = 'A' + i;
2632 type = GetDriveTypeW( root );
2633 if (type != DRIVE_FIXED && type != DRIVE_REMOVABLE)
2634 continue;
2635
2636 if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2637
2638 rec = (struct record_diskdrive *)(table->data + offset);
2639 swprintf( device_id, fmtW, index );
2641 rec->index = index++;
2645 rec->model = diskdrive_modelW;
2648 get_freespace( root, &size );
2649 rec->size = size;
2650 if (!match_row( table, row, cond, &status ))
2651 {
2653 continue;
2654 }
2655 offset += sizeof(*rec);
2656 row++;
2657 }
2658 }
2659 TRACE("created %u rows\n", row);
2660 table->num_rows = row;
2661 return status;
2662}
2663
2665{
2668};
2669
2670static void free_assocations( struct association *assoc, UINT count )
2671{
2672 UINT i;
2673 if (!assoc) return;
2674 for (i = 0; i < count; i++)
2675 {
2676 heap_free( assoc[i].ref );
2677 heap_free( assoc[i].ref2 );
2678 }
2679 heap_free( assoc );
2680}
2681
2683{
2684 static const WCHAR pathW[] =
2685 {'_','_','P','A','T','H',0};
2686 static const WCHAR selectW[] =
2687 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
2688 'D','i','s','k','D','r','i','v','e',0};
2689 static const WCHAR select2W[] =
2690 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
2691 'D','i','s','k','P','a','r','t','i','t','i','o','n',0};
2692 struct association *ret = NULL;
2693 struct query *query, *query2 = NULL;
2694 VARIANT val;
2695 HRESULT hr;
2696 UINT i;
2697
2698 if (!(query = create_query())) return NULL;
2699 if ((hr = parse_query( selectW, &query->view, &query->mem )) != S_OK) goto done;
2700 if ((hr = execute_view( query->view )) != S_OK) goto done;
2701
2702 if (!(query2 = create_query())) return FALSE;
2703 if ((hr = parse_query( select2W, &query2->view, &query2->mem )) != S_OK) goto done;
2704 if ((hr = execute_view( query2->view )) != S_OK) goto done;
2705
2706 if (!(ret = heap_alloc_zero( query->view->result_count * sizeof(*ret) ))) goto done;
2707
2708 for (i = 0; i < query->view->result_count; i++)
2709 {
2710 if ((hr = get_propval( query->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done;
2711 if (!(ret[i].ref = heap_strdupW( V_BSTR(&val) ))) goto done;
2712 VariantClear( &val );
2713
2714 if ((hr = get_propval( query2->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done;
2715 if (!(ret[i].ref2 = heap_strdupW( V_BSTR(&val) ))) goto done;
2716 VariantClear( &val );
2717 }
2718
2719 *count = query->view->result_count;
2720
2721done:
2722 if (!ret) free_assocations( ret, query->view->result_count );
2723 free_query( query );
2724 free_query( query2 );
2725 return ret;
2726}
2727
2728static enum fill_status fill_diskdrivetodiskpartition( struct table *table, const struct expr *cond )
2729{
2731 UINT i, row = 0, offset = 0, count = 0;
2733 struct association *assoc;
2734
2736 if (!count)
2737 {
2738 free_assocations( assoc, count );
2740 }
2741 if (!resize_table( table, count, sizeof(*rec) ))
2742 {
2743 free_assocations( assoc, count );
2744 return FILL_STATUS_FAILED;
2745 }
2746
2747 for (i = 0; i < count; i++)
2748 {
2749 rec = (struct record_diskdrivetodiskpartition *)(table->data + offset);
2750 rec->antecedent = assoc[i].ref;
2751 rec->dependent = assoc[i].ref2;
2752 if (!match_row( table, row, cond, &status ))
2753 {
2755 continue;
2756 }
2757 offset += sizeof(*rec);
2758 row++;
2759 }
2760
2761 heap_free( assoc );
2762
2763 TRACE("created %u rows\n", row);
2764 table->num_rows = row;
2765 return status;
2766}
2767
2769{
2770 static const WCHAR ntfsW[] = {'N','T','F','S',0};
2771 WCHAR buffer[MAX_PATH + 1];
2772
2774 return heap_strdupW( buffer );
2775 return heap_strdupW( ntfsW );
2776}
2777
2778static enum fill_status fill_diskpartition( struct table *table, const struct expr *cond )
2779{
2780 static const WCHAR fmtW[] =
2781 {'D','i','s','k',' ','#','%','u',',',' ','P','a','r','t','i','t','i','o','n',' ','#','0',0};
2782 WCHAR device_id[32], root[] = {'A',':','\\',0};
2783 struct record_diskpartition *rec;
2784 UINT i, row = 0, offset = 0, type, index = 0;
2785 UINT64 size = 1024 * 1024 * 1024;
2786 DWORD drives = GetLogicalDrives();
2788
2789 if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
2790
2791 for (i = 0; i < 26; i++)
2792 {
2793 if (drives & (1 << i))
2794 {
2795 root[0] = 'A' + i;
2796 type = GetDriveTypeW( root );
2797 if (type != DRIVE_FIXED && type != DRIVE_REMOVABLE)
2798 continue;
2799
2800 if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2801
2802 rec = (struct record_diskpartition *)(table->data + offset);
2803 rec->bootable = (i == 2) ? -1 : 0;
2804 rec->bootpartition = (i == 2) ? -1 : 0;
2805 swprintf( device_id, fmtW, index );
2807 rec->diskindex = index++;
2808 rec->index = 0;
2810 get_freespace( root, &size );
2811 rec->size = size;
2812 rec->startingoffset = 0;
2813 rec->type = get_filesystem( root );
2814 if (!match_row( table, row, cond, &status ))
2815 {
2817 continue;
2818 }
2819 offset += sizeof(*rec);
2820 row++;
2821 }
2822 }
2823 TRACE("created %u rows\n", row);
2824 table->num_rows = row;
2825 return status;
2826}
2827
2829{
2830 HDC hdc = GetDC( NULL );
2831 UINT32 ret;
2832
2833 if (!hdc) return 32;
2836 *vres = GetDeviceCaps( hdc, VERTRES );
2837 ReleaseDC( NULL, hdc );
2838 return ret;
2839}
2840
2841static enum fill_status fill_displaycontrollerconfig( struct table *table, const struct expr *cond )
2842{
2844 UINT row = 0, hres = 1024, vres = 768;
2846
2847 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2848
2849 rec = (struct record_displaycontrollerconfig *)table->data;
2850 rec->bitsperpixel = get_bitsperpixel( &hres, &vres );
2854 rec->verticalresolution = vres;
2855 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
2856 else row++;
2857
2858 TRACE("created %u rows\n", row);
2859 table->num_rows = row;
2860 return status;
2861}
2862
2864{
2865 static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
2866 DWORD len = sizeof("ddd.ddd.ddd.ddd");
2867 WCHAR *ret;
2868
2869 if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
2870 swprintf( ret, fmtW, (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff );
2871 return ret;
2872}
2873
2874static enum fill_status fill_ip4routetable( struct table *table, const struct expr *cond )
2875{
2876 struct record_ip4routetable *rec;
2877 UINT i, row = 0, offset = 0, size = 0;
2878 MIB_IPFORWARDTABLE *forwards;
2880
2882 if (!(forwards = heap_alloc( size ))) return FILL_STATUS_FAILED;
2883 if (GetIpForwardTable( forwards, &size, TRUE ))
2884 {
2885 heap_free( forwards );
2886 return FILL_STATUS_FAILED;
2887 }
2888 if (!resize_table( table, max(forwards->dwNumEntries, 1), sizeof(*rec) ))
2889 {
2890 heap_free( forwards );
2891 return FILL_STATUS_FAILED;
2892 }
2893
2894 for (i = 0; i < forwards->dwNumEntries; i++)
2895 {
2896 rec = (struct record_ip4routetable *)(table->data + offset);
2897
2898 rec->destination = get_ip4_string( ntohl(forwards->table[i].dwForwardDest) );
2899 rec->interfaceindex = forwards->table[i].dwForwardIfIndex;
2900 rec->nexthop = get_ip4_string( ntohl(forwards->table[i].dwForwardNextHop) );
2901
2902 if (!match_row( table, row, cond, &status ))
2903 {
2905 continue;
2906 }
2907 offset += sizeof(*rec);
2908 row++;
2909 }
2910 TRACE("created %u rows\n", row);
2911 table->num_rows = row;
2912
2913 heap_free( forwards );
2914 return status;
2915}
2916
2918{
2919 WCHAR buf[MAX_PATH + 1] = {0};
2921 return heap_strdupW( buf );
2922}
2924{
2925 static const WCHAR fmtW[] = {'%','0','8','X',0};
2926 DWORD serial = 0;
2927 WCHAR buffer[9];
2928
2930 swprintf( buffer, fmtW, serial );
2931 return heap_strdupW( buffer );
2932}
2933
2934static enum fill_status fill_logicaldisk( struct table *table, const struct expr *cond )
2935{
2936 static const WCHAR fmtW[] = {'%','c',':',0};
2937 WCHAR device_id[3], root[] = {'A',':','\\',0};
2938 struct record_logicaldisk *rec;
2939 UINT i, row = 0, offset = 0, type;
2940 UINT64 size = 1024 * 1024 * 1024;
2941 DWORD drives = GetLogicalDrives();
2943
2944 if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
2945
2946 for (i = 0; i < 26; i++)
2947 {
2948 if (drives & (1 << i))
2949 {
2950 root[0] = 'A' + i;
2951 type = GetDriveTypeW( root );
2953 continue;
2954
2955 if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2956
2957 rec = (struct record_logicaldisk *)(table->data + offset);
2958 swprintf( device_id, fmtW, 'A' + i );
2960 rec->drivetype = type;
2961 rec->filesystem = get_filesystem( root );
2962 rec->freespace = get_freespace( root, &size );
2963 rec->name = heap_strdupW( device_id );
2964 rec->size = size;
2965 rec->volumename = get_volumename( root );
2967 if (!match_row( table, row, cond, &status ))
2968 {
2970 continue;
2971 }
2972 offset += sizeof(*rec);
2973 row++;
2974 }
2975 }
2976 TRACE("created %u rows\n", row);
2977 table->num_rows = row;
2978 return status;
2979}
2980
2982{
2983 static const WCHAR pathW[] =
2984 {'_','_','P','A','T','H',0};
2985 static const WCHAR selectW[] =
2986 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
2987 'D','i','s','k','P','a','r','t','i','t','i','o','n',0};
2988 static const WCHAR select2W[] =
2989 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
2990 'L','o','g','i','c','a','l','D','i','s','k',' ','W','H','E','R','E',' ',
2991 'D','r','i','v','e','T','y','p','e','=','2',' ','O','R',' ','D','r','i','v','e','T','y','p','e','=','3',0};
2992 struct association *ret = NULL;
2993 struct query *query, *query2 = NULL;
2994 VARIANT val;
2995 HRESULT hr;
2996 UINT i;
2997
2998 if (!(query = create_query())) return NULL;
2999 if ((hr = parse_query( selectW, &query->view, &query->mem )) != S_OK) goto done;
3000 if ((hr = execute_view( query->view )) != S_OK) goto done;
3001
3002 if (!(query2 = create_query())) return FALSE;
3003 if ((hr = parse_query( select2W, &query2->view, &query2->mem )) != S_OK) goto done;
3004 if ((hr = execute_view( query2->view )) != S_OK) goto done;
3005
3006 if (!(ret = heap_alloc_zero( query->view->result_count * sizeof(*ret) ))) goto done;
3007
3008 /* assume fixed and removable disks are enumerated in the same order as partitions */
3009 for (i = 0; i < query->view->result_count; i++)
3010 {
3011 if ((hr = get_propval( query->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done;
3012 if (!(ret[i].ref = heap_strdupW( V_BSTR(&val) ))) goto done;
3013 VariantClear( &val );
3014
3015 if ((hr = get_propval( query2->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done;
3016 if (!(ret[i].ref2 = heap_strdupW( V_BSTR(&val) ))) goto done;
3017 VariantClear( &val );
3018 }
3019
3020 *count = query->view->result_count;
3021
3022done:
3023 if (!ret) free_assocations( ret, query->view->result_count );
3024 free_query( query );
3025 free_query( query2 );
3026 return ret;
3027}
3028
3029static enum fill_status fill_logicaldisktopartition( struct table *table, const struct expr *cond )
3030{
3032 UINT i, row = 0, offset = 0, count = 0;
3034 struct association *assoc;
3035
3037 if (!count)
3038 {
3039 free_assocations( assoc, count );
3041 }
3042 if (!resize_table( table, count, sizeof(*rec) ))
3043 {
3044 free_assocations( assoc, count );
3045 return FILL_STATUS_FAILED;
3046 }
3047
3048 for (i = 0; i < count; i++)
3049 {
3050 rec = (struct record_logicaldisktopartition *)(table->data + offset);
3051 rec->antecedent = assoc[i].ref;
3052 rec->dependent = assoc[i].ref2;
3053 if (!match_row( table, row, cond, &status ))
3054 {
3056 continue;
3057 }
3058 offset += sizeof(*rec);
3059 row++;
3060 }
3061
3062 heap_free( assoc );
3063
3064 TRACE("created %u rows\n", row);
3065 table->num_rows = row;
3066 return status;
3067}
3068
3070{
3071 switch (status)
3072 {
3073 case IfOperStatusDown:
3074 return 0; /* Disconnected */
3075 case IfOperStatusUp:
3076 return 2; /* Connected */
3077 default:
3078 ERR("unhandled status %u\n", status);
3079 break;
3080 }
3081 return 0;
3082}
3084{
3085 static const WCHAR fmtW[] =
3086 {'%','0','2','x',':','%','0','2','x',':','%','0','2','x',':',
3087 '%','0','2','x',':','%','0','2','x',':','%','0','2','x',0};
3088 WCHAR *ret;
3089
3090 if (len != 6 || !(ret = heap_alloc( 18 * sizeof(WCHAR) ))) return NULL;
3091 swprintf( ret, fmtW, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5] );
3092 return ret;
3093}
3094static const WCHAR *get_adaptertype( DWORD type, int *id, int *physical )
3095{
3096 static const WCHAR ethernetW[] = {'E','t','h','e','r','n','e','t',' ','8','0','2','.','3',0};
3097 static const WCHAR wirelessW[] = {'W','i','r','e','l','e','s','s',0};
3098 static const WCHAR firewireW[] = {'1','3','9','4',0};
3099 static const WCHAR tunnelW[] = {'T','u','n','n','e','l',0};
3100
3101 switch (type)
3102 {
3104 *id = 0;
3105 *physical = -1;
3106 return ethernetW;
3107 case IF_TYPE_IEEE80211:
3108 *id = 9;
3109 *physical = -1;
3110 return wirelessW;
3111 case IF_TYPE_IEEE1394:
3112 *id = 13;
3113 *physical = -1;
3114 return firewireW;
3115 case IF_TYPE_TUNNEL:
3116 *id = 15;
3117 *physical = 0;
3118 return tunnelW;
3119 default:
3120 *id = -1;
3121 *physical = 0;
3122 return NULL;
3123 }
3124}
3125
3126static enum fill_status fill_networkadapter( struct table *table, const struct expr *cond )
3127{
3128 static const WCHAR fmtW[] = {'%','u',0};
3129 WCHAR device_id[11];
3130 struct record_networkadapter *rec;
3131 IP_ADAPTER_ADDRESSES *aa, *buffer;
3132 UINT row = 0, offset = 0, count = 0;
3133 DWORD size = 0, ret;
3134 int adaptertypeid, physical;
3136
3137 ret = GetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size );
3139
3140 if (!(buffer = heap_alloc( size ))) return FILL_STATUS_FAILED;
3141 if (GetAdaptersAddresses( AF_UNSPEC, 0, NULL, buffer, &size ))
3142 {
3143 heap_free( buffer );
3144 return FILL_STATUS_FAILED;
3145 }
3146 for (aa = buffer; aa; aa = aa->Next)
3147 {
3148 if (aa->IfType != IF_TYPE_SOFTWARE_LOOPBACK) count++;
3149 }
3150 if (!resize_table( table, count, sizeof(*rec) ))
3151 {
3152 heap_free( buffer );
3153 return FILL_STATUS_FAILED;
3154 }
3155 for (aa = buffer; aa; aa = aa->Next)
3156 {
3157 if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue;
3158
3159 rec = (struct record_networkadapter *)(table->data + offset);
3160 swprintf( device_id, fmtW, aa->u.s.IfIndex );
3161 rec->adaptertype = get_adaptertype( aa->IfType, &adaptertypeid, &physical );
3163 rec->description = heap_strdupW( aa->Description );
3165 rec->index = aa->u.s.IfIndex;
3166 rec->interface_index = aa->u.s.IfIndex;
3167 rec->mac_address = get_mac_address( aa->PhysicalAddress, aa->PhysicalAddressLength );
3169 rec->name = heap_strdupW( aa->FriendlyName );
3170 rec->netconnection_status = get_connection_status( aa->OperStatus );
3171 rec->physicaladapter = physical;
3173 rec->speed = 1000000;
3174 if (!match_row( table, row, cond, &status ))
3175 {
3177 continue;
3178 }
3179 offset += sizeof(*rec);
3180 row++;
3181 }
3182 TRACE("created %u rows\n", row);
3183 table->num_rows = row;
3184
3185 heap_free( buffer );
3186 return status;
3187}
3188
3189static WCHAR *get_dnshostname( IP_ADAPTER_UNICAST_ADDRESS *addr )
3190{
3191 const SOCKET_ADDRESS *sa = &addr->Address;
3193
3194 if (!addr) return NULL;
3195 if (GetNameInfoW( sa->lpSockaddr, sa->iSockaddrLength, buf, ARRAY_SIZE( buf ), NULL,
3196 0, NI_NAMEREQD )) return NULL;
3197 return heap_strdupW( buf );
3198}
3199static struct array *get_defaultipgateway( IP_ADAPTER_GATEWAY_ADDRESS *list )
3200{
3201 IP_ADAPTER_GATEWAY_ADDRESS *gateway;
3202 struct array *ret;
3203 ULONG buflen, i = 0, count = 0;
3204 WCHAR **ptr, buf[54]; /* max IPv6 address length */
3205
3206 if (!list) return NULL;
3207 for (gateway = list; gateway; gateway = gateway->Next) count++;
3208
3209 if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
3210 if (!(ptr = heap_alloc( sizeof(*ptr) * count )))
3211 {
3212 heap_free( ret );
3213 return NULL;
3214 }
3215 for (gateway = list; gateway; gateway = gateway->Next)
3216 {
3217 buflen = ARRAY_SIZE( buf );
3218 if (WSAAddressToStringW( gateway->Address.lpSockaddr, gateway->Address.iSockaddrLength,
3219 NULL, buf, &buflen) || !(ptr[i++] = heap_strdupW( buf )))
3220 {
3221 for (; i > 0; i--) heap_free( ptr[i - 1] );
3222 heap_free( ptr );
3223 heap_free( ret );
3224 return NULL;
3225 }
3226 }
3227 ret->elem_size = sizeof(*ptr);
3228 ret->count = count;
3229 ret->ptr = ptr;
3230 return ret;
3231}
3232static struct array *get_dnsserversearchorder( IP_ADAPTER_DNS_SERVER_ADDRESS *list )
3233{
3234 IP_ADAPTER_DNS_SERVER_ADDRESS *server;
3235 struct array *ret;
3236 ULONG buflen, i = 0, count = 0;
3237 WCHAR **ptr, *p, buf[54]; /* max IPv6 address length */
3238
3239 if (!list) return NULL;
3240 for (server = list; server; server = server->Next) count++;
3241
3242 if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
3243 if (!(ptr = heap_alloc( sizeof(*ptr) * count )))
3244 {
3245 heap_free( ret );
3246 return NULL;
3247 }
3248 for (server = list; server; server = server->Next)
3249 {
3250 buflen = ARRAY_SIZE( buf );
3251 if (WSAAddressToStringW( server->Address.lpSockaddr, server->Address.iSockaddrLength,
3252 NULL, buf, &buflen) || !(ptr[i++] = heap_strdupW( buf )))
3253 {
3254 for (; i > 0; i--) heap_free( ptr[i - 1] );
3255 heap_free( ptr );
3256 heap_free( ret );
3257 return NULL;
3258 }
3259 if ((p = wcsrchr( ptr[i - 1], ':' ))) *p = 0;
3260 }
3261 ret->elem_size = sizeof(*ptr);
3262 ret->count = count;
3263 ret->ptr = ptr;
3264 return ret;
3265}
3266
3267#ifndef __REACTOS__
3268
3269static struct array *get_ipaddress( IP_ADAPTER_UNICAST_ADDRESS_LH *list )
3270{
3271 IP_ADAPTER_UNICAST_ADDRESS_LH *address;
3272 struct array *ret;
3273 ULONG buflen, i = 0, count = 0;
3274 WCHAR **ptr, buf[54]; /* max IPv6 address length */
3275
3276 if (!list) return NULL;
3277 for (address = list; address; address = address->Next) count++;
3278
3279 if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
3280 if (!(ptr = heap_alloc( sizeof(*ptr) * count )))
3281 {
3282 heap_free( ret );
3283 return NULL;
3284 }
3285 for (address = list; address; address = address->Next)
3286 {
3287 buflen = ARRAY_SIZE( buf );
3288 if (WSAAddressToStringW( address->Address.lpSockaddr, address->Address.iSockaddrLength,
3289 NULL, buf, &buflen) || !(ptr[i++] = heap_strdupW( buf )))
3290 {
3291 for (; i > 0; i--) heap_free( ptr[i - 1] );
3292 heap_free( ptr );
3293 heap_free( ret );
3294 return NULL;
3295 }
3296 }
3297 ret->elem_size = sizeof(*ptr);
3298 ret->count = count;
3299 ret->ptr = ptr;
3300 return ret;
3301}
3302static struct array *get_ipsubnet( IP_ADAPTER_UNICAST_ADDRESS_LH *list )
3303{
3304 IP_ADAPTER_UNICAST_ADDRESS_LH *address;
3305 struct array *ret;
3306 ULONG i = 0, count = 0;
3307 WCHAR **ptr;
3308
3309 if (!list) return NULL;
3310 for (address = list; address; address = address->Next) count++;
3311
3312 if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
3313 if (!(ptr = heap_alloc( sizeof(*ptr) * count )))
3314 {
3315 heap_free( ret );
3316 return NULL;
3317 }
3318 for (address = list; address; address = address->Next)
3319 {
3320 if (address->Address.lpSockaddr->sa_family == AF_INET)
3321 {
3324 ULONG buflen = ARRAY_SIZE( buf );
3325
3326 memset( &addr, 0, sizeof(addr) );
3327 addr.sin_family = AF_INET;
3328 if (ConvertLengthToIpv4Mask( address->OnLinkPrefixLength, &addr.sin_addr.S_un.S_addr ) != NO_ERROR
3329 || WSAAddressToStringW( (SOCKADDR*)&addr, sizeof(addr), NULL, buf, &buflen))
3330 ptr[i] = NULL;
3331 else
3332 ptr[i] = heap_strdupW( buf );
3333 }
3334 else
3335 {
3336 static const WCHAR fmtW[] = {'%','u',0};
3337 WCHAR buf[11];
3338
3339 swprintf( buf, fmtW, address->OnLinkPrefixLength );
3340 ptr[i] = heap_strdupW( buf );
3341 }
3342 if (!ptr[i++])
3343 {
3344 for (; i > 0; i--) heap_free( ptr[i - 1] );
3345 heap_free( ptr );
3346 heap_free( ret );
3347 return NULL;
3348 }
3349 }
3350 ret->elem_size = sizeof(*ptr);
3351 ret->count = count;
3352 ret->ptr = ptr;
3353 return ret;
3354}
3355
3356#endif /* !__REACTOS__ */
3357
3359{
3360 GUID guid;
3361 WCHAR *ret, *str;
3362 memset( &guid, 0, sizeof(guid) );
3363 guid.Data1 = index;
3364 UuidToStringW( &guid, &str );
3365 ret = heap_strdupW( str );
3366 RpcStringFreeW( &str );
3367 return ret;
3368}
3369
3370static enum fill_status fill_networkadapterconfig( struct table *table, const struct expr *cond )
3371{
3372 struct record_networkadapterconfig *rec;
3373 IP_ADAPTER_ADDRESSES *aa, *buffer;
3374 UINT row = 0, offset = 0, count = 0;
3375 DWORD size = 0, ret;
3377
3378 ret = GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, NULL, NULL, &size );
3380
3381 if (!(buffer = heap_alloc( size ))) return FILL_STATUS_FAILED;
3382 if (GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, NULL, buffer, &size ))
3383 {
3384 heap_free( buffer );
3385 return FILL_STATUS_FAILED;
3386 }
3387 for (aa = buffer; aa; aa = aa->Next)
3388 {
3389 if (aa->IfType != IF_TYPE_SOFTWARE_LOOPBACK) count++;
3390 }
3391 if (!resize_table( table, count, sizeof(*rec) ))
3392 {
3393 heap_free( buffer );
3394 return FILL_STATUS_FAILED;
3395 }
3396 for (aa = buffer; aa; aa = aa->Next)
3397 {
3398 if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue;
3399
3400 rec = (struct record_networkadapterconfig *)(table->data + offset);
3401 rec->defaultipgateway = get_defaultipgateway( aa->FirstGatewayAddress );
3402 rec->description = heap_strdupW( aa->Description );
3403 rec->dhcpenabled = -1;
3404 rec->dnshostname = get_dnshostname( aa->FirstUnicastAddress );
3405 rec->dnsserversearchorder = get_dnsserversearchorder( aa->FirstDnsServerAddress );
3406 rec->index = aa->u.s.IfIndex;
3407#ifndef __REACTOS__
3408 rec->ipaddress = get_ipaddress( aa->FirstUnicastAddress );
3409#endif
3410 rec->ipconnectionmetric = 20;
3411 rec->ipenabled = -1;
3412#ifndef __REACTOS__
3413 rec->ipsubnet = get_ipsubnet( aa->FirstUnicastAddress );
3414#endif
3415 rec->mac_address = get_mac_address( aa->PhysicalAddress, aa->PhysicalAddressLength );
3416 rec->settingid = get_settingid( rec->index );
3417 if (!match_row( table, row, cond, &status ))
3418 {
3420 continue;
3421 }
3422 offset += sizeof(*rec);
3423 row++;
3424 }
3425 TRACE("created %u rows\n", row);
3426 table->num_rows = row;
3427
3428 heap_free( buffer );
3429 return status;
3430}
3431
3432static enum fill_status fill_physicalmemory( struct table *table, const struct expr *cond )
3433{
3434 static const WCHAR dimm0W[] = {'D','I','M','M',' ','0',0};
3435 struct record_physicalmemory *rec;
3437 UINT row = 0;
3438
3439 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
3440
3441 rec = (struct record_physicalmemory *)table->data;
3443 rec->configuredclockspeed = 0;
3444 rec->devicelocator = dimm0W;
3445 rec->memorytype = 9; /* RAM */
3446 rec->partnumber = NULL;
3447 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
3448 else row++;
3449
3450 TRACE("created %u rows\n", row);
3451 table->num_rows = row;
3452 return status;
3453}
3454
3455static enum fill_status fill_pnpentity( struct table *table, const struct expr *cond )
3456{
3457 struct record_pnpentity *rec;
3459 HDEVINFO device_info_set;
3460 SP_DEVINFO_DATA devinfo = {0};
3461 DWORD idx;
3462
3464
3465 devinfo.cbSize = sizeof(devinfo);
3466
3467 idx = 0;
3468 while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo ))
3469 {
3470 /* noop */
3471 }
3472
3473 resize_table( table, idx, sizeof(*rec) );
3474 table->num_rows = 0;
3475 rec = (struct record_pnpentity *)table->data;
3476
3477 idx = 0;
3478 while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo ))
3479 {
3481 if (SetupDiGetDeviceInstanceIdW( device_info_set, &devinfo, device_id,
3483 {
3485
3486 table->num_rows++;
3487 if (!match_row( table, table->num_rows - 1, cond, &status ))
3488 {
3490 table->num_rows--;
3491 }
3492 else
3493 rec++;
3494 }
3495 }
3496
3497 SetupDiDestroyDeviceInfoList( device_info_set );
3498
3499 return status;
3500}
3501
3502static enum fill_status fill_printer( struct table *table, const struct expr *cond )
3503{
3504 static const WCHAR fmtW[] = {'P','r','i','n','t','e','r','%','d',0};
3505 struct record_printer *rec;
3508 DWORD i, offset = 0, count = 0, size = 0, num_rows = 0;
3509 WCHAR id[20];
3510
3512 if (!count) return FILL_STATUS_UNFILTERED;
3513
3514 if (!(info = heap_alloc( size ))) return FILL_STATUS_FAILED;
3516 {
3517 heap_free( info );
3518 return FILL_STATUS_FAILED;
3519 }
3520 if (!resize_table( table, count, sizeof(*rec) ))
3521 {
3522 heap_free( info );
3523 return FILL_STATUS_FAILED;
3524 }
3525
3526 for (i = 0; i < count; i++)
3527 {
3528 rec = (struct record_printer *)(table->data + offset);
3529 rec->attributes = info[i].Attributes;
3530 swprintf( id, fmtW, i );
3531 rec->device_id = heap_strdupW( id );
3532 rec->drivername = heap_strdupW( info[i].pDriverName );
3533 rec->horizontalresolution = info[i].pDevMode->u1.s1.dmPrintQuality;
3534 rec->local = -1;
3535 rec->location = heap_strdupW( info[i].pLocation );
3536 rec->name = heap_strdupW( info[i].pPrinterName );
3537 rec->network = 0;
3538 rec->portname = heap_strdupW( info[i].pPortName );
3539 if (!match_row( table, i, cond, &status ))
3540 {
3542 continue;
3543 }
3544 offset += sizeof(*rec);
3545 num_rows++;
3546 }
3547 TRACE("created %u rows\n", num_rows);
3549
3550 heap_free( info );
3551 return status;
3552}
3553
3554static WCHAR *get_cmdline( DWORD process_id )
3555{
3556 if (process_id == GetCurrentProcessId()) return heap_strdupW( GetCommandLineW() );
3557 return NULL; /* FIXME handle different process case */
3558}
3559
3560static enum fill_status fill_process( struct table *table, const struct expr *cond )
3561{
3562 static const WCHAR fmtW[] = {'%','u',0};
3563 WCHAR handle[11];
3564 struct record_process *rec;
3566 HANDLE snap;
3568 UINT row = 0, offset = 0;
3569
3571 if (snap == INVALID_HANDLE_VALUE) return FILL_STATUS_FAILED;
3572
3573 entry.dwSize = sizeof(entry);
3574 if (!Process32FirstW( snap, &entry )) goto done;
3575 if (!resize_table( table, 8, sizeof(*rec) )) goto done;
3576
3577 do
3578 {
3579 if (!resize_table( table, row + 1, sizeof(*rec) ))
3580 {
3582 goto done;
3583 }
3584
3585 rec = (struct record_process *)(table->data + offset);
3586 rec->caption = heap_strdupW( entry.szExeFile );
3587 rec->commandline = get_cmdline( entry.th32ProcessID );
3588 rec->description = heap_strdupW( entry.szExeFile );
3589 swprintf( handle, fmtW, entry.th32ProcessID );
3590 rec->handle = heap_strdupW( handle );
3591 rec->name = heap_strdupW( entry.szExeFile );
3592 rec->process_id = entry.th32ProcessID;
3593 rec->pprocess_id = entry.th32ParentProcessID;
3594 rec->thread_count = entry.cntThreads;
3595 rec->workingsetsize = 0;
3597 if (!match_row( table, row, cond, &status ))
3598 {
3600 continue;
3601 }
3602 offset += sizeof(*rec);
3603 row++;
3604 } while (Process32NextW( snap, &entry ));
3605
3606 TRACE("created %u rows\n", row);
3607 table->num_rows = row;
3608
3609done:
3610 CloseHandle( snap );
3611 return status;
3612}
3613
3614extern void do_cpuid( unsigned int ax, unsigned int *p );
3615#if defined(_MSC_VER)
3616void do_cpuid( unsigned int ax, unsigned int *p )
3617{
3618 __cpuid( p, ax );
3619}
3620#elif defined(__i386__)
3622 "pushl %esi\n\t"
3623 "pushl %ebx\n\t"
3624 "movl 12(%esp),%eax\n\t"
3625 "movl 16(%esp),%esi\n\t"
3626 "cpuid\n\t"
3627 "movl %eax,(%esi)\n\t"
3628 "movl %ebx,4(%esi)\n\t"
3629 "movl %ecx,8(%esi)\n\t"
3630 "movl %edx,12(%esi)\n\t"
3631 "popl %ebx\n\t"
3632 "popl %esi\n\t"
3633 "ret" )
3634#elif defined(__x86_64__)
3636 "pushq %rsi\n\t"
3637 "pushq %rbx\n\t"
3638 "movq %rcx,%rax\n\t"
3639 "movq %rdx,%rsi\n\t"
3640 "cpuid\n\t"
3641 "movl %eax,(%rsi)\n\t"
3642 "movl %ebx,4(%rsi)\n\t"
3643 "movl %ecx,8(%rsi)\n\t"
3644 "movl %edx,12(%rsi)\n\t"
3645 "popq %rbx\n\t"
3646 "popq %rsi\n\t"
3647 "ret" )
3648#else
3649void do_cpuid( unsigned int ax, unsigned int *p )
3650{
3651 FIXME("\n");
3652}
3653#endif
3654
3655static unsigned int get_processor_model( unsigned int reg0, unsigned int *stepping, unsigned int *family )
3656{
3657 unsigned int model, family_id = (reg0 & (0x0f << 8)) >> 8;
3658
3659 model = (reg0 & (0x0f << 4)) >> 4;
3660 if (family_id == 6 || family_id == 15) model |= (reg0 & (0x0f << 16)) >> 12;
3661 if (family)
3662 {
3663 *family = family_id;
3664 if (family_id == 15) *family += (reg0 & (0xff << 20)) >> 20;
3665 }
3666 *stepping = reg0 & 0x0f;
3667 return model;
3668}
3669static void regs_to_str( unsigned int *regs, unsigned int len, WCHAR *buffer )
3670{
3671 unsigned int i;
3672 unsigned char *p = (unsigned char *)regs;
3673
3674 for (i = 0; i < len; i++) { buffer[i] = *p++; }
3675 buffer[i] = 0;
3676}
3677static void get_processor_manufacturer( WCHAR *manufacturer, UINT len )
3678{
3679 unsigned int tmp, regs[4] = {0, 0, 0, 0};
3680
3681 do_cpuid( 0, regs );
3682 tmp = regs[2]; /* swap edx and ecx */
3683 regs[2] = regs[3];
3684 regs[3] = tmp;
3685
3686 regs_to_str( regs + 1, min( 12, len ), manufacturer );
3687}
3688static const WCHAR *get_osarchitecture(void)
3689{
3692 if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return os_64bitW;
3693 return os_32bitW;
3694}
3696{
3697 static const WCHAR fmtW[] =
3698 {'%','s',' ','F','a','m','i','l','y',' ','%','u',' ',
3699 'M','o','d','e','l',' ','%','u',' ','S','t','e','p','p','i','n','g',' ','%','u',0};
3700 static const WCHAR x86W[] = {'x','8','6',0};
3701 static const WCHAR intel64W[] = {'I','n','t','e','l','6','4',0};
3702 static const WCHAR amd64W[] = {'A','M','D','6','4',0};
3703 static const WCHAR authenticamdW[] = {'A','u','t','h','e','n','t','i','c','A','M','D',0};
3704 const WCHAR *arch;
3705 WCHAR manufacturer[13];
3706 unsigned int regs[4] = {0, 0, 0, 0}, family, model, stepping;
3707
3708 get_processor_manufacturer( manufacturer, ARRAY_SIZE( manufacturer ) );
3709 if (get_osarchitecture() == os_32bitW) arch = x86W;
3710 else if (!wcscmp( manufacturer, authenticamdW )) arch = amd64W;
3711 else arch = intel64W;
3712
3713 do_cpuid( 1, regs );
3714
3715 model = get_processor_model( regs[0], &stepping, &family );
3716 swprintf( caption, fmtW, arch, family, model, stepping );
3717}
3719{
3720 static const WCHAR fmtW[] =
3721 {'M','o','d','e','l',' ','%','u',',',' ','S','t','e','p','p','i','n','g',' ','%','u',0};
3722 unsigned int regs[4] = {0, 0, 0, 0}, model, stepping;
3723
3724 do_cpuid( 1, regs );
3725
3726 model = get_processor_model( regs[0], &stepping, NULL );
3727 swprintf( version, fmtW, model, stepping );
3728}
3730{
3731 unsigned int regs[4] = {0, 0, 0, 0};
3732 do_cpuid( 1, regs );
3733 return regs[0];
3734}
3735static void get_processor_id( WCHAR *processor_id, UINT len )
3736{
3737 static const WCHAR fmtW[] = {'%','0','8','X','%','0','8','X',0};
3738 unsigned int regs[4] = {0, 0, 0, 0};
3739
3740 do_cpuid( 1, regs );
3741 swprintf( processor_id, fmtW, regs[3], regs[0] );
3742}
3744{
3745 unsigned int regs[4] = {0, 0, 0, 0};
3746 int i;
3747
3748 do_cpuid( 0x80000000, regs );
3749 if (regs[0] >= 0x80000004)
3750 {
3751 do_cpuid( 0x80000002, regs );
3752 regs_to_str( regs, 16, name );
3753 do_cpuid( 0x80000003, regs );
3754 regs_to_str( regs, 16, name + 16 );
3755 do_cpuid( 0x80000004, regs );
3756 regs_to_str( regs, 16, name + 32 );
3757 }
3758 for (i = lstrlenW(name) - 1; i >= 0 && name[i] == ' '; i--) name[i] = 0;
3759}
3761{
3765
3766 if ((info = heap_alloc( size )))
3767 {
3769 if (!status) ret = info[index].CurrentMhz;
3770 heap_free( info );
3771 }
3772 return ret;
3773}
3775{
3779
3780 if ((info = heap_alloc( size )))
3781 {
3783 if (!status) ret = info[index].MaxMhz;
3784 heap_free( info );
3785 }
3786 return ret;
3787}
3788
3789static enum fill_status fill_processor( struct table *table, const struct expr *cond )
3790{
3791 static const WCHAR fmtW[] = {'C','P','U','%','u',0};
3792 WCHAR caption[100], device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50];
3793 struct record_processor *rec;
3794#ifdef __REACTOS__
3796#else
3797 UINT i, offset = 0, num_rows = 0, num_logical, num_physical, num_packages;
3798#endif
3800
3801#ifdef __REACTOS__
3802 if (!resize_table( table, count, sizeof(*rec) )) return FILL_STATUS_FAILED;
3803#else
3804 num_logical = get_logical_processor_count( &num_physical, &num_packages );
3805
3806 if (!resize_table( table, num_packages, sizeof(*rec) )) return FILL_STATUS_FAILED;
3807#endif
3808
3814
3815#ifdef __REACTOS__
3817 num_cores /= count;
3818
3819 for (i = 0; i < count; i++)
3820#else
3821 for (i = 0; i < num_packages; i++)
3822#endif
3823 {
3824 rec = (struct record_processor *)(table->data + offset);
3825 rec->addresswidth = get_osarchitecture() == os_32bitW ? 32 : 64;
3826 rec->architecture = get_osarchitecture() == os_32bitW ? 0 : 9;
3827 rec->caption = heap_strdupW( caption );
3828 rec->cpu_status = 1; /* CPU Enabled */
3830 rec->datawidth = get_osarchitecture() == os_32bitW ? 32 : 64;
3832 swprintf( device_id, fmtW, i );
3834 rec->family = 2; /* Unknown */
3835 rec->level = 15;
3838 rec->name = heap_strdupW( name );
3839#ifdef __REACTOS__
3840 rec->num_cores = num_cores;
3842#else
3843 rec->num_cores = num_physical / num_packages;
3844 rec->num_logical_processors = num_logical / num_packages;
3845#endif
3847 rec->processortype = 3; /* central processor */
3849 rec->unique_id = NULL;
3850 rec->version = heap_strdupW( version );
3851 if (!match_row( table, i, cond, &status ))
3852 {
3854 continue;
3855 }
3856 offset += sizeof(*rec);
3857 num_rows++;
3858 }
3859
3860 TRACE("created %u rows\n", num_rows);
3862 return status;
3863}
3864
3866{
3867 static const WCHAR fmtW[] =
3868 {'%','0','4','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u',
3869 '.','%','0','6','u','+','0','0','0',0};
3872 WCHAR *ret;
3873
3874 if (!(ret = heap_alloc( 26 * sizeof(WCHAR) ))) return NULL;
3875
3877 RtlTimeToTimeFields( &ti.liKeBootTime, &tf );
3878 swprintf( ret, fmtW, tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second, tf.Milliseconds * 1000 );
3879 return ret;
3880}
3882{
3883 static const WCHAR fmtW[] =
3884 {'%','0','4','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u',
3885 '.','%','0','6','u','%','+','0','3','d',0};
3887 SYSTEMTIME st;
3888 WCHAR *ret;
3889 DWORD Status;
3890 LONG Bias;
3891
3893
3894 if(Status == TIME_ZONE_ID_INVALID) return NULL;
3895 Bias = tzi.Bias;
3897 Bias+= tzi.DaylightBias;
3898 else
3899 Bias+= tzi.StandardBias;
3900 if (!(ret = heap_alloc( 26 * sizeof(WCHAR) ))) return NULL;
3901
3902 GetLocalTime(&st);
3903 swprintf( ret, fmtW, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds * 1000, -Bias );
3904 return ret;
3905}
3907{
3908 void *redir;
3909 WCHAR *ret;
3910
3911 if (!(ret = heap_alloc( MAX_PATH * sizeof(WCHAR) ))) return NULL;
3915 return ret;
3916}
3918{
3919 WCHAR *ret = heap_alloc( 3 * sizeof(WCHAR) ); /* "c:" */
3920 if (ret && GetEnvironmentVariableW( prop_systemdriveW, ret, 3 )) return ret;
3921 heap_free( ret );
3922 return NULL;
3923}
3924static WCHAR *get_codeset(void)
3925{
3926 static const WCHAR fmtW[] = {'%','u',0};
3927 WCHAR *ret = heap_alloc( 11 * sizeof(WCHAR) );
3928 if (ret) swprintf( ret, fmtW, GetACP() );
3929 return ret;
3930}
3932{
3933 WCHAR *ret = heap_alloc( 6 * sizeof(WCHAR) );
3935 return ret;
3936}
3937static WCHAR *get_locale(void)
3938{
3939 WCHAR *ret = heap_alloc( 5 * sizeof(WCHAR) );
3941 return ret;
3942}
3944{
3945 static const WCHAR fmtW[] = {'%','u',0};
3946 WCHAR *ret = heap_alloc( 11 * sizeof(WCHAR) );
3947 if (ret) swprintf( ret, fmtW, ver->dwBuildNumber );
3948 return ret;
3949}
3951{
3952 static const WCHAR windowsW[] =
3953 {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' '};
3954 static const WCHAR win2000W[] =
3955 {'2','0','0','0',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
3956 static const WCHAR win2003W[] =
3957 {'S','e','r','v','e','r',' ','2','0','0','3',' ','S','t','a','n','d','a','r','d',' ','E','d','i','t','i','o','n',0};
3958 static const WCHAR winxpW[] =
3959 {'X','P',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
3960 static const WCHAR winxp64W[] =
3961 {'X','P',' ','P','r','o','f','e','s','s','i','o','n','a','l',' ','x','6','4',' ','E','d','i','t','i','o','n',0};
3962 static const WCHAR vistaW[] =
3963 {'V','i','s','t','a',' ','U','l','t','i','m','a','t','e',0};
3964 static const WCHAR win2008W[] =
3965 {'S','e','r','v','e','r',' ','2','0','0','8',' ','S','t','a','n','d','a','r','d',0};
3966 static const WCHAR win7W[] =
3967 {'7',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
3968 static const WCHAR win2008r2W[] =
3969 {'S','e','r','v','e','r',' ','2','0','0','8',' ','R','2',' ','S','t','a','n','d','a','r','d',0};
3970 static const WCHAR win8W[] =
3971 {'8',' ','P','r','o',0};
3972 static const WCHAR win81W[] =
3973 {'8','.','1',' ','P','r','o',0};
3974 static const WCHAR win10W[] =
3975 {'1','0',' ','P','r','o',0};
3976 int len = ARRAY_SIZE( windowsW );
3977 WCHAR *ret;
3978
3979 if (!(ret = heap_alloc( len * sizeof(WCHAR) + sizeof(win2003W) ))) return NULL;
3980 memcpy( ret, windowsW, sizeof(windowsW) );
3981 if (ver->dwMajorVersion == 10 && ver->dwMinorVersion == 0) memcpy( ret + len, win10W, sizeof(win10W) );
3982 else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 3) memcpy( ret + len, win8W, sizeof(win8W) );
3983 else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 2) memcpy( ret + len, win81W, sizeof(win81W) );
3984 else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 1)
3985 {
3986 if (ver->wProductType == VER_NT_WORKSTATION) memcpy( ret + len, win7W, sizeof(win7W) );
3987 else memcpy( ret + len, win2008r2W, sizeof(win2008r2W) );
3988 }
3989 else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 0)
3990 {
3991 if (ver->wProductType == VER_NT_WORKSTATION) memcpy( ret + len, vistaW, sizeof(vistaW) );
3992 else memcpy( ret + len, win2008W, sizeof(win2008W) );
3993 }
3994 else if (ver->dwMajorVersion == 5 && ver->dwMinorVersion == 2)
3995 {
3996 if (ver->wProductType == VER_NT_WORKSTATION) memcpy( ret + len, winxp64W, sizeof(winxp64W) );
3997 else memcpy( ret + len, win2003W, sizeof(win2003W) );
3998 }
3999 else if (ver->dwMajorVersion == 5 && ver->dwMinorVersion == 1) memcpy( ret + len, winxpW, sizeof(winxpW) );
4000 else memcpy( ret + len, win2000W, sizeof(win2000W) );
4001 return ret;
4002}
4004{
4005 static const WCHAR partitionW[] =
4006 {'|','C',':','\\','W','I','N','D','O','W','S','|','\\','D','e','v','i','c','e','\\',
4007 'H','a','r','d','d','i','s','k','0','\\','P','a','r','t','i','t','i','o','n','1',0};
4008 int len = lstrlenW( caption );
4009 WCHAR *ret;
4010
4011 if (!(ret = heap_alloc( len * sizeof(WCHAR) + sizeof(partitionW) ))) return NULL;
4012 memcpy( ret, caption, len * sizeof(WCHAR) );
4013 memcpy( ret + len, partitionW, sizeof(partitionW) );
4014 return ret;
4015}
4017{
4018 static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u',0};
4019 WCHAR *ret = heap_alloc( 33 * sizeof(WCHAR) );
4020 if (ret) swprintf( ret, fmtW, ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber );
4021 return ret;
4022}
4023#ifndef __REACTOS__
4025{
4027 GetProductInfo( 6, 0, 0, 0, &ret );
4028 return ret;
4029}
4030#endif
4032{
4035 if (status == TIME_ZONE_ID_INVALID) return 0;
4036 if (status == TIME_ZONE_ID_DAYLIGHT) return -(info.Bias + info.DaylightBias);
4037 return -(info.Bias + info.StandardBias);
4038}
4039
4040static enum fill_status fill_operatingsystem( struct table *table, const struct expr *cond )
4041{
4042 static const WCHAR wineprojectW[] = {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0};
4043 struct record_operatingsystem *rec;
4045 OSVERSIONINFOEXW ver;
4046 UINT row = 0;
4047
4048 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
4049
4050 ver.dwOSVersionInfoSize = sizeof(ver);
4051 GetVersionExW( (OSVERSIONINFOW *)&ver );
4052
4053 rec = (struct record_operatingsystem *)table->data;
4054 rec->buildnumber = get_osbuildnumber( &ver );
4055 rec->caption = get_oscaption( &ver );
4056 rec->codeset = get_codeset();
4058 rec->csdversion = ver.szCSDVersion[0] ? heap_strdupW( ver.szCSDVersion ) : NULL;
4059 rec->csname = get_computername();
4065 rec->locale = get_locale();
4066 rec->manufacturer = wineprojectW;
4067 rec->name = get_osname( rec->caption );
4068#ifndef __REACTOS__
4070#endif
4073 rec->osproductsuite = 2461140; /* Windows XP Professional */
4074 rec->ostype = 18; /* WINNT */
4075 rec->primary = -1;
4079 rec->suitemask = 272; /* Single User + Terminal */
4084 rec->version = get_osversion( &ver );
4085 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
4086 else row++;
4087
4088 TRACE("created %u rows\n", row);
4089 table->num_rows = row;
4090 return status;
4091}
4092
4094{
4095 static const WCHAR filesystem_driverW[] =
4096 {'F','i','l','e',' ','S','y','s','t','e','m',' ','D','r','i','v','e','r',0};
4097 static const WCHAR kernel_driverW[] =
4098 {'K','e','r','n','e','l',' ','D','r','i','v','e','r',0};
4099 static const WCHAR own_processW[] =
4100 {'O','w','n',' ','P','r','o','c','e','s','s',0};
4101 static const WCHAR share_processW[] =
4102 {'S','h','a','r','e',' ','P','r','o','c','e','s','s',0};
4103
4104 if (type & SERVICE_KERNEL_DRIVER) return kernel_driverW;
4105 else if (type & SERVICE_FILE_SYSTEM_DRIVER) return filesystem_driverW;
4106 else if (type & SERVICE_WIN32_OWN_PROCESS) return own_processW;
4107 else if (type & SERVICE_WIN32_SHARE_PROCESS) return share_processW;
4108 else ERR("unhandled type 0x%08x\n", type);
4109 return NULL;
4110}
4112{
4113 static const WCHAR runningW[] =
4114 {'R','u','n','n','i','n','g',0};
4115 static const WCHAR start_pendingW[] =
4116 {'S','t','a','r','t',' ','P','e','n','d','i','n','g',0};
4117 static const WCHAR stop_pendingW[] =
4118 {'S','t','o','p',' ','P','e','n','d','i','n','g',0};
4119 static const WCHAR stoppedW[] =
4120 {'S','t','o','p','p','e','d',0};
4121 static const WCHAR unknownW[] =
4122 {'U','n','k','n','o','w','n',0};
4123
4124 switch (state)
4125 {
4126 case SERVICE_STOPPED: return stoppedW;
4127 case SERVICE_START_PENDING: return start_pendingW;
4128 case SERVICE_STOP_PENDING: return stop_pendingW;
4129 case SERVICE_RUNNING: return runningW;
4130 default:
4131 ERR("unknown state %u\n", state);
4132 return unknownW;
4133 }
4134}
4136{
4137 static const WCHAR bootW[] = {'B','o','o','t',0};
4138 static const WCHAR systemW[] = {'S','y','s','t','e','m',0};
4139 static const WCHAR autoW[] = {'A','u','t','o',0};
4140 static const WCHAR manualW[] = {'M','a','n','u','a','l',0};
4141 static const WCHAR disabledW[] = {'D','i','s','a','b','l','e','d',0};
4142 static const WCHAR unknownW[] = {'U','n','k','n','o','w','n',0};
4143
4144 switch (mode)
4145 {
4146 case SERVICE_BOOT_START: return bootW;
4147 case SERVICE_SYSTEM_START: return systemW;
4148 case SERVICE_AUTO_START: return autoW;
4149 case SERVICE_DEMAND_START: return manualW;
4150 case SERVICE_DISABLED: return disabledW;
4151 default:
4152 ERR("unknown mode 0x%x\n", mode);
4153 return unknownW;
4154 }
4155}
4156static QUERY_SERVICE_CONFIGW *query_service_config( SC_HANDLE manager, const WCHAR *name )
4157{
4159 SC_HANDLE service;
4160 DWORD size;
4161
4162 if (!(service = OpenServiceW( manager, name, SERVICE_QUERY_CONFIG ))) return NULL;
4163 QueryServiceConfigW( service, NULL, 0, &size );
4164 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto done;
4165 if (!(config = heap_alloc( size ))) goto done;
4166 if (QueryServiceConfigW( service, config, size, &size )) goto done;
4167 heap_free( config );
4168 config = NULL;
4169
4170done:
4171 CloseServiceHandle( service );
4172 return config;
4173}
4174
4175static enum fill_status fill_service( struct table *table, const struct expr *cond )
4176{
4177 struct record_service *rec;
4178 SC_HANDLE manager;
4181 WCHAR sysnameW[MAX_COMPUTERNAME_LENGTH + 1];
4182 DWORD len = ARRAY_SIZE( sysnameW );
4183 UINT i, row = 0, offset = 0, size = 256, needed, count;
4185 BOOL ret;
4186
4188 if (!(services = heap_alloc( size ))) goto done;
4189
4191 SERVICE_STATE_ALL, (BYTE *)services, size, &needed,
4192 &count, NULL, NULL );
4193 if (!ret)
4194 {
4195 if (GetLastError() != ERROR_MORE_DATA) goto done;
4196 size = needed;
4197 if (!(tmp = heap_realloc( services, size ))) goto done;
4198 services = tmp;
4200 SERVICE_STATE_ALL, (BYTE *)services, size, &needed,
4201 &count, NULL, NULL );
4202 if (!ret) goto done;
4203 }
4204 if (!resize_table( table, count, sizeof(*rec) )) goto done;
4205
4206 GetComputerNameW( sysnameW, &len );
4208
4209 for (i = 0; i < count; i++)
4210 {
4212
4213 if (!(config = query_service_config( manager, services[i].lpServiceName ))) continue;
4214
4215 status = &services[i].ServiceStatusProcess;
4216 rec = (struct record_service *)(table->data + offset);
4217 rec->accept_pause = (status->dwControlsAccepted & SERVICE_ACCEPT_PAUSE_CONTINUE) ? -1 : 0;
4218 rec->accept_stop = (status->dwControlsAccepted & SERVICE_ACCEPT_STOP) ? -1 : 0;
4220 rec->name = heap_strdupW( services[i].lpServiceName );
4221 rec->process_id = status->dwProcessId;
4222 rec->servicetype = get_service_type( status->dwServiceType );
4223 rec->startmode = get_service_startmode( config->dwStartType );
4224 rec->state = get_service_state( status->dwCurrentState );
4225 rec->systemname = heap_strdupW( sysnameW );
4230 heap_free( config );
4231 if (!match_row( table, row, cond, &fill_status ))
4232 {
4234 continue;
4235 }
4236 offset += sizeof(*rec);
4237 row++;
4238 }
4239
4240 TRACE("created %u rows\n", row);
4241 table->num_rows = row;
4242
4243done:
4244 CloseServiceHandle( manager );
4246 return fill_status;
4247}
4248
4250{
4251 if (!name || !name->Name.Buffer) return NULL;
4252 return heap_strdupW( name->Name.Buffer );
4253}
4255{
4256 struct array *ret;
4257 UINT8 *ptr;
4258
4259 if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
4260 if (!(ptr = heap_alloc( len )))
4261 {
4262 heap_free( ret );
4263 return NULL;
4264 }
4265 memcpy( ptr, sid, len );
4266 ret->elem_size = sizeof(*ptr);
4267 ret->count = len;
4268 ret->ptr = ptr;
4269 return ret;
4270}
4272{
4273 if (!domain || !domain->Domains || !domain->Domains->Name.Buffer) return NULL;
4274 return heap_strdupW( domain->Domains->Name.Buffer );
4275}
4276static const WCHAR *find_sid_str( const struct expr *cond )
4277{
4278 const struct expr *left, *right;
4279 const WCHAR *ret = NULL;
4280
4281 if (!cond || cond->type != EXPR_COMPLEX || cond->u.expr.op != OP_EQ) return NULL;
4282
4283 left = cond->u.expr.left;
4284 right = cond->u.expr.right;
4285 if (left->type == EXPR_PROPVAL && right->type == EXPR_SVAL && !wcsicmp( left->u.propval->name, prop_sidW ))
4286 {
4287 ret = right->u.sval;
4288 }
4289 else if (left->type == EXPR_SVAL && right->type == EXPR_PROPVAL && !wcsicmp( right->u.propval->name, prop_sidW ))
4290 {
4291 ret = left->u.sval;
4292 }
4293 return ret;
4294}
4295
4296static enum fill_status fill_sid( struct table *table, const struct expr *cond )
4297{
4298 PSID sid;
4303 const WCHAR *str;
4304 struct record_sid *rec;
4305 UINT len;
4306
4307 if (!(str = find_sid_str( cond ))) return FILL_STATUS_FAILED;
4308 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
4309
4311 len = GetLengthSid( sid );
4312
4313 memset( &attrs, 0, sizeof(attrs) );
4314 attrs.Length = sizeof(attrs);
4315 if (LsaOpenPolicy( NULL, &attrs, POLICY_ALL_ACCESS, &handle ))
4316 {
4317 LocalFree( sid );
4318 return FILL_STATUS_FAILED;
4319 }
4320 if (LsaLookupSids( handle, 1, &sid, &domain, &name ))
4321 {
4322 LocalFree( sid );
4323 LsaClose( handle );
4324 return FILL_STATUS_FAILED;
4325 }
4326
4327 rec = (struct record_sid *)table->data;
4331 rec->sid = heap_strdupW( str );
4332 rec->sidlength = len;
4333
4334 TRACE("created 1 row\n");
4335 table->num_rows = 1;
4336
4339 LocalFree( sid );
4340 LsaClose( handle );
4341 return FILL_STATUS_FILTERED;
4342}
4343
4345{
4346 const struct smbios_header *hdr;
4347 const struct smbios_chassis *chassis;
4348 UINT offset;
4349
4350 if (!(hdr = find_smbios_entry( SMBIOS_TYPE_CHASSIS, buf, len ))) return NULL;
4351
4352 chassis = (const struct smbios_chassis *)hdr;
4353 offset = (const char *)chassis - buf + chassis->hdr.length;
4354 return get_smbios_string( id, buf, offset, len );
4355}
4356
4358{
4361 return ret;
4362}
4363
4365{
4366 const struct smbios_header *hdr;
4367 const struct smbios_chassis *chassis;
4368
4369 if (!(hdr = find_smbios_entry( SMBIOS_TYPE_CHASSIS, buf, len )) || hdr->length < sizeof(*chassis)) return 0;
4370
4371 chassis = (const struct smbios_chassis *)hdr;
4372 return (chassis->type & 0x80) ? -1 : 0;
4373}
4374
4375static struct array *dup_array( const struct array *src )
4376{
4377 struct array *dst;
4378 if (!(dst = heap_alloc( sizeof(*dst) ))) return NULL;
4379 if (!(dst->ptr = heap_alloc( src->count * src->elem_size )))
4380 {
4381 heap_free( dst );
4382 return NULL;
4383 }
4384 memcpy( dst->ptr, src->ptr, src->count * src->elem_size );
4385 dst->elem_size = src->elem_size;
4386 dst->count = src->count;
4387 return dst;
4388}
4389
4390static struct array *get_systemenclosure_chassistypes( const char *buf, UINT len )
4391{
4392 const struct smbios_header *hdr;
4393 const struct smbios_chassis *chassis;
4394 struct array *ret = NULL;
4395 UINT16 *types;
4396
4397 if (!(hdr = find_smbios_entry( SMBIOS_TYPE_CHASSIS, buf, len )) || hdr->length < sizeof(*chassis)) goto done;
4398 chassis = (const struct smbios_chassis *)hdr;
4399
4400 if (!(ret = heap_alloc( sizeof(*ret) ))) goto done;
4401 if (!(types = heap_alloc( sizeof(*types) )))
4402 {
4403 heap_free( ret );
4404 return NULL;
4405 }
4406 types[0] = chassis->type & ~0x80;
4407
4408 ret->elem_size = sizeof(*types);
4409 ret->count = 1;
4410 ret->ptr = types;
4411
4412done:
4414 return ret;
4415}
4416
4417static enum fill_status fill_systemenclosure( struct table *table, const struct expr *cond )
4418{
4419 struct record_systemenclosure *rec;
4421 UINT row = 0, len;
4422 char *buf;
4423
4424 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
4425
4426 len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 );
4427 if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED;
4429
4430 rec = (struct record_systemenclosure *)table->data;
4438 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
4439 else row++;
4440
4441 heap_free( buf );
4442
4443 TRACE("created %u rows\n", row);
4444 table->num_rows = row;
4445 return status;
4446}
4447
4448#ifndef __REACTOS__
4449static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC *desc )
4450{
4451 static const WCHAR fmtW[] =
4452 {'P','C','I','\\','V','E','N','_','%','0','4','X','&','D','E','V','_','%','0','4','X',
4453 '&','S','U','B','S','Y','S','_','%','0','8','X','&','R','E','V','_','%','0','2','X','\\',
4454 '0','&','D','E','A','D','B','E','E','F','&','0','&','D','E','A','D',0};
4455 UINT len = sizeof(fmtW) + 2;
4456 WCHAR *ret;
4457
4458 if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
4459 swprintf( ret, fmtW, desc->VendorId, desc->DeviceId, desc->SubSysId, desc->Revision );
4460 return ret;
4461}
4462#endif
4463
4464#define HW_VENDOR_AMD 0x1002
4465#define HW_VENDOR_NVIDIA 0x10de
4466#define HW_VENDOR_VMWARE 0x15ad
4467#define HW_VENDOR_INTEL 0x8086
4468
4469#ifndef __REACTOS__
4470
4471static const WCHAR *get_installeddriver( UINT vendorid )
4472{
4473 static const WCHAR driver_amdW[] = {'a','t','i','c','f','x','3','2','.','d','l','l',0};
4474 static const WCHAR driver_intelW[] = {'i','g','d','u','m','d','i','m','3','2','.','d','l','l',0};
4475 static const WCHAR driver_nvidiaW[] = {'n','v','d','3','d','u','m','.','d','l','l',0};
4476 static const WCHAR driver_wineW[] = {'w','i','n','e','.','d','l','l',0};
4477
4478 /* FIXME: wined3d has a better table, but we cannot access this information through dxgi */
4479
4480 if (vendorid == HW_VENDOR_AMD)
4481 return driver_amdW;
4482 else if (vendorid == HW_VENDOR_NVIDIA)
4483 return driver_nvidiaW;
4484 else if (vendorid == HW_VENDOR_INTEL)
4485 return driver_intelW;
4486 return driver_wineW;
4487}
4488
4489static enum fill_status fill_videocontroller( struct table *table, const struct expr *cond )
4490{
4491 static const WCHAR fmtW[] = {'%','u',' ','x',' ','%','u',' ','x',' ','%','I','6','4','u',' ','c','o','l','o','r','s',0};
4492 struct record_videocontroller *rec;
4493 HRESULT hr;
4494 IDXGIFactory *factory = NULL;
4495 IDXGIAdapter *adapter = NULL;
4496 DXGI_ADAPTER_DESC desc;
4497 UINT row = 0, hres = 1024, vres = 768, vidmem = 512 * 1024 * 1024;
4500 WCHAR mode[44];
4501
4502 if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
4503
4504 memset (&desc, 0, sizeof(desc));
4505 hr = CreateDXGIFactory( &IID_IDXGIFactory, (void **)&factory );
4506 if (FAILED(hr)) goto done;
4507
4508 hr = IDXGIFactory_EnumAdapters( factory, 0, &adapter );
4509 if (FAILED(hr)) goto done;
4510
4511 hr = IDXGIAdapter_GetDesc( adapter, &desc );
4512 if (SUCCEEDED(hr))
4513 {
4514 vidmem = desc.DedicatedVideoMemory;
4515 name = desc.Description;
4516 }
4517
4518done:
4519 rec = (struct record_videocontroller *)table->data;
4521 rec->adapter_ram = vidmem;
4522 rec->availability = 3; /* Running or Full Power */
4523 rec->config_errorcode = 0; /* no error */
4524 rec->caption = heap_strdupW( name );
4525 rec->current_bitsperpixel = get_bitsperpixel( &hres, &vres );
4527 rec->current_refreshrate = 0; /* default refresh rate */
4528 rec->current_scanmode = 2; /* Unknown */
4529 rec->current_verticalres = vres;
4530 rec->description = heap_strdupW( name );
4534 rec->installeddriver = get_installeddriver( desc.VendorId );
4535 rec->name = heap_strdupW( name );
4538 rec->videoarchitecture = 2; /* Unknown */
4539 rec->videomemorytype = 2; /* Unknown */
4540 swprintf( mode, fmtW, hres, vres, (UINT64)1 << rec->current_bitsperpixel );
4543 if (!match_row( table, row, cond, &status )) free_row_values( table, row );
4544 else row++;
4545
4546 TRACE("created %u rows\n", row);
4547 table->num_rows = row;
4548
4549 if (adapter) IDXGIAdapter_Release( adapter );
4550 if (factory) IDXGIFactory_Release( factory );
4551 return status;
4552}
4553
4554#endif /* !__REACTOS__ */
4555
4556#define C(c) sizeof(c)/sizeof(c[0]), c
4557#define D(d) sizeof(d)/sizeof(d[0]), 0, (BYTE *)d
4558static struct table builtin_classes[] =
4559{
4562 { class_biosW, C(col_bios), 0, 0, NULL, fill_bios },
4591 { class_sidW, C(col_sid), 0, 0, NULL, fill_sid },
4596#ifndef __REACTOS__
4597 /* Requires dxgi.dll */
4599#endif
4601};
4602#undef C
4603#undef D
4604
4606{
4607 static struct list tables = LIST_INIT( tables );
4608 UINT i;
4609
4611 table_list = &tables;
4612}
unsigned short UINT16
signed int INT32
signed short INT16
unsigned long long UINT64
unsigned char UINT8
unsigned int UINT32
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
INT WSAAPI GetNameInfoW(IN CONST SOCKADDR *pSockaddr, IN socklen_t SockaddrLength, OUT PWCHAR pNodeBuffer, IN DWORD NodeBufferSize, OUT PWCHAR pServiceBuffer, IN DWORD ServiceBufferSize, IN INT Flags)
Definition: addrinfo.c:873
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
static int state
Definition: maze.c:121
unsigned int dir
Definition: maze.c:112
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
LONG NTSTATUS
Definition: precomp.h:26
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:33
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
static const WCHAR prop_cpuscoreW[]
Definition: builtin.c:202
static void get_processor_name(WCHAR *name)
Definition: builtin.c:3743
static const WCHAR prop_dependentW[]
Definition: builtin.c:236
static const WCHAR diskdrive_serialW[]
Definition: builtin.c:942
static const WCHAR prop_servicetypeW[]
Definition: builtin.c:412
static const WCHAR prop_videomodedescriptionW[]
Definition: builtin.c:483
static enum fill_status fill_desktopmonitor(struct table *table, const struct expr *cond)
Definition: builtin.c:2474
static WCHAR * get_dnshostname(IP_ADAPTER_UNICAST_ADDRESS *addr)
Definition: builtin.c:3189
static const WCHAR prop_descriptionW[]
Definition: builtin.c:238
static const WCHAR os_32bitW[]
Definition: builtin.c:948
#define HW_VENDOR_NVIDIA
Definition: builtin.c:4465
static const WCHAR class_networkadapterconfigW[]
Definition: builtin.c:99
static const WCHAR prop_adaptertypeidW[]
Definition: builtin.c:154
#define FLAVOR_ID
Definition: builtin.c:1399
static WCHAR * get_baseboard_manufacturer(const char *buf, UINT len)
Definition: builtin.c:1618
static const WCHAR class_process_getowner_outW[]
Definition: builtin.c:114
static const struct column col_directory[]
Definition: builtin.c:569
static const WCHAR systemenclosure_systemenclosureW[]
Definition: builtin.c:964
static const struct column col_service[]
Definition: builtin.c:787
static WCHAR * get_username(void)
Definition: builtin.c:1950
static const WCHAR baseboard_manufacturerW[]
Definition: builtin.c:882
static const WCHAR cdromdrive_mediatypeW[]
Definition: builtin.c:902
static enum fill_status fill_operatingsystem(struct table *table, const struct expr *cond)
Definition: builtin.c:4040
static const struct column col_cdromdrive[]
Definition: builtin.c:530
static INT16 get_currenttimezone(void)
Definition: builtin.c:4031
static enum fill_status fill_logicaldisktopartition(struct table *table, const struct expr *cond)
Definition: builtin.c:3029
static const WCHAR compsys_modelW[]
Definition: builtin.c:917
static const WCHAR prop_pixelsperxlogicalinchW[]
Definition: builtin.c:380
static const WCHAR prop_csnameW[]
Definition: builtin.c:208
static WCHAR * get_file_version(const WCHAR *filename)
Definition: builtin.c:2337
static const WCHAR prop_serialnumberW[]
Definition: builtin.c:406
static const WCHAR prop_manufacturerW[]
Definition: builtin.c:336
void init_table_list(void)
Definition: builtin.c:4605
static const WCHAR prop_graphicsscoreW[]
Definition: builtin.c:288
static void get_processor_manufacturer(WCHAR *manufacturer, UINT len)
Definition: builtin.c:3677
static enum fill_status fill_service(struct table *table, const struct expr *cond)
Definition: builtin.c:4175
static UINT32 get_bitsperpixel(UINT *hres, UINT *vres)
Definition: builtin.c:2828
static const WCHAR prop_idW[]
Definition: builtin.c:294
static const WCHAR compsysproduct_uuidW[]
Definition: builtin.c:923
static const WCHAR cdromdrive_pnpdeviceidW[]
Definition: builtin.c:906
static const WCHAR prop_totalvirtualmemorysizeW[]
Definition: builtin.c:460
static WCHAR * get_bios_smbiosbiosversion(const char *buf, UINT len)
Definition: builtin.c:1751
static const WCHAR prop_numlogicalprocessorsW[]
Definition: builtin.c:360
static WCHAR * build_dirname(const WCHAR *path, UINT *ret_len)
Definition: builtin.c:2230
static const struct column col_bios[]
Definition: builtin.c:516
static const WCHAR class_sounddeviceW[]
Definition: builtin.c:127
static enum fill_status fill_logicaldisk(struct table *table, const struct expr *cond)
Definition: builtin.c:2934
static const WCHAR prop_architectureW[]
Definition: builtin.c:160
static const struct column col_param[]
Definition: builtin.c:696
static const WCHAR prop_partnumberW[]
Definition: builtin.c:376
static const struct column col_diskpartition[]
Definition: builtin.c:591
static const struct column col_baseboard[]
Definition: builtin.c:506
static const struct column col_pnpentity[]
Definition: builtin.c:718
static enum fill_status fill_bios(struct table *table, const struct expr *cond)
Definition: builtin.c:1758
static const struct record_systemsecurity data_systemsecurity[]
Definition: builtin.c:1433
static const WCHAR prop_directionW[]
Definition: builtin.c:248
static const WCHAR prop_localW[]
Definition: builtin.c:324
static const WCHAR prop_systemdriveW[]
Definition: builtin.c:448
static WCHAR * get_ip4_string(DWORD addr)
Definition: builtin.c:2863
static const WCHAR class_associatorsW[]
Definition: builtin.c:62
static const WCHAR prop_numprocessorsW[]
Definition: builtin.c:362
static WCHAR * get_cmdline(DWORD process_id)
Definition: builtin.c:3554
static const WCHAR prop_typeW[]
Definition: builtin.c:464
static const WCHAR prop_strvalueW[]
Definition: builtin.c:442
static WCHAR * get_referenceddomainname(LSA_REFERENCED_DOMAIN_LIST *domain)
Definition: builtin.c:4271
static struct array * get_ipaddress(IP_ADAPTER_UNICAST_ADDRESS_LH *list)
Definition: builtin.c:3269
static const WCHAR class_biosW[]
Definition: builtin.c:66
static const WCHAR prop_freespaceW[]
Definition: builtin.c:282
static const WCHAR class_directoryW[]
Definition: builtin.c:78
static WCHAR * get_systemdirectory(void)
Definition: builtin.c:3906
static enum fill_status fill_directory(struct table *table, const struct expr *cond)
Definition: builtin.c:2492
static WCHAR * get_smbios_string(BYTE id, const char *buf, UINT offset, UINT buflen)
Definition: builtin.c:1591
static const WCHAR videocontroller_driverversionW[]
Definition: builtin.c:976
static const WCHAR prop_devicelocatorW[]
Definition: builtin.c:244
static const struct column col_networkadapterconfig[]
Definition: builtin.c:649
static UINT64 get_available_physical_memory(void)
Definition: builtin.c:1931
static WCHAR * get_filesystem(const WCHAR *root)
Definition: builtin.c:2768
static const WCHAR prop_familyW[]
Definition: builtin.c:276
static const WCHAR prop_volumenameW[]
Definition: builtin.c:488
static const struct column col_operatingsystem[]
Definition: builtin.c:664
static const WCHAR prop_memorytypeW[]
Definition: builtin.c:346
static const WCHAR prop_currenthorizontalresW[]
Definition: builtin.c:216
static const WCHAR systemenclosure_tagW[]
Definition: builtin.c:966
static const struct column col_quickfixengineering[]
Definition: builtin.c:782
static enum fill_status fill_networkadapterconfig(struct table *table, const struct expr *cond)
Definition: builtin.c:3370
static const WCHAR prop_acceptstopW[]
Definition: builtin.c:142
static const WCHAR physicalmedia_tagW[]
Definition: builtin.c:956
static const WCHAR prop_systemdirectoryW[]
Definition: builtin.c:446
static const WCHAR prop_speedW[]
Definition: builtin.c:432
static const WCHAR prop_currentscanmodeW[]
Definition: builtin.c:222
static void free_assocations(struct association *assoc, UINT count)
Definition: builtin.c:2670
static UINT get_logical_processor_count(UINT *num_physical, UINT *num_packages)
Definition: builtin.c:1878
static const WCHAR diskdrive_modelW[]
Definition: builtin.c:938
static UINT64 get_total_physical_memory(void)
Definition: builtin.c:1922
static const WCHAR quickfixengineering_captionW[]
Definition: builtin.c:958
static const WCHAR prop_currentlanguageW[]
Definition: builtin.c:218
static const WCHAR diskdrive_mediatype_removableW[]
Definition: builtin.c:936
static const WCHAR prop_uuidW[]
Definition: builtin.c:470
static const struct column col_compsys[]
Definition: builtin.c:538
static const WCHAR prop_handleW[]
Definition: builtin.c:286
static const WCHAR prop_macaddressW[]
Definition: builtin.c:334
static const WCHAR class_paramsW[]
Definition: builtin.c:104
static enum fill_status fill_process(struct table *table, const struct expr *cond)
Definition: builtin.c:3560
static UINT16 systemenclosure_chassistypes[]
Definition: builtin.c:1423
static const WCHAR prop_indexW[]
Definition: builtin.c:300
static const WCHAR prop_ipconnectionmetricW[]
Definition: builtin.c:314
static struct array * get_binaryrepresentation(PSID sid, UINT len)
Definition: builtin.c:4254
static const WCHAR class_compsysproductW[]
Definition: builtin.c:72
static const WCHAR prop_assocclassW[]
Definition: builtin.c:162
static const WCHAR baseboard_serialnumberW[]
Definition: builtin.c:884
static const WCHAR prop_localdatetimeW[]
Definition: builtin.c:326
static const WCHAR prop_osproductsuiteW[]
Definition: builtin.c:370
static const WCHAR compsysproduct_nameW[]
Definition: builtin.c:921
static const WCHAR prop_drivernameW[]
Definition: builtin.c:268
static const WCHAR class_displaycontrollerconfigW[]
Definition: builtin.c:86
static void regs_to_str(unsigned int *regs, unsigned int len, WCHAR *buffer)
Definition: builtin.c:3669
static const WCHAR os_64bitW[]
Definition: builtin.c:950
static const WCHAR prop_currentclockspeedW[]
Definition: builtin.c:214
static const WCHAR prop_identifyingnumberW[]
Definition: builtin.c:298
static const WCHAR prop_interfaceindexW[]
Definition: builtin.c:306
static const WCHAR prop_winsatassessmentstateW[]
Definition: builtin.c:492
static UINT get_processor_currentclockspeed(UINT index)
Definition: builtin.c:3760
static const WCHAR prop_osarchitectureW[]
Definition: builtin.c:366
static const WCHAR prop_diskscoreW[]
Definition: builtin.c:250
static const WCHAR class_physicalmemoryW[]
Definition: builtin.c:108
static const WCHAR bios_releasedateW[]
Definition: builtin.c:894
static enum fill_status fill_physicalmemory(struct table *table, const struct expr *cond)
Definition: builtin.c:3432
static const struct column col_logicaldisktopartition[]
Definition: builtin.c:628
static const struct record_stdregprov data_stdregprov[]
Definition: builtin.c:1419
static const WCHAR prop_adaptertypeW[]
Definition: builtin.c:152
static const WCHAR * get_installeddriver(UINT vendorid)
Definition: builtin.c:4471
static WCHAR * get_compsysproduct_name(const char *buf, UINT len)
Definition: builtin.c:2019
static const WCHAR class_baseboardW[]
Definition: builtin.c:64
static struct array * get_systemenclosure_chassistypes(const char *buf, UINT len)
Definition: builtin.c:4390
static const WCHAR os_serialnumberW[]
Definition: builtin.c:954
static UINT seed_dirs(struct dirstack *dirstack, const struct expr *cond, WCHAR root, UINT *count)
Definition: builtin.c:2268
static const WCHAR prop_startmodeW[]
Definition: builtin.c:424
static const WCHAR bios_versionW[]
Definition: builtin.c:900
static const WCHAR prop_sizeW[]
Definition: builtin.c:430
static const WCHAR prop_netconnectionstatusW[]
Definition: builtin.c:352
static const WCHAR prop_commandlineW[]
Definition: builtin.c:194
static WCHAR * get_codeset(void)
Definition: builtin.c:3924
static enum fill_status fill_ip4routetable(struct table *table, const struct expr *cond)
Definition: builtin.c:2874
static const struct column col_sid[]
Definition: builtin.c:804
static const struct column col_systemenclosure[]
Definition: builtin.c:825
static const WCHAR prop_versionW[]
Definition: builtin.c:474
static WCHAR * get_systemdrive(void)
Definition: builtin.c:3917
static const WCHAR prop_currentverticalresW[]
Definition: builtin.c:226
static const struct column col_sounddevice[]
Definition: builtin.c:812
static const WCHAR prop_tagW[]
Definition: builtin.c:452
static const WCHAR bios_descriptionW[]
Definition: builtin.c:890
static enum fill_status fill_datafile(struct table *table, const struct expr *cond)
Definition: builtin.c:2364
static enum fill_status fill_processor(struct table *table, const struct expr *cond)
Definition: builtin.c:3789
static const WCHAR bios_smbiosbiosversionW[]
Definition: builtin.c:898
static const WCHAR prop_freephysicalmemoryW[]
Definition: builtin.c:284
static const WCHAR * peek_dir(struct dirstack *dirstack)
Definition: builtin.c:2175
static const WCHAR prop_methodW[]
Definition: builtin.c:348
static struct table builtin_classes[]
Definition: builtin.c:4558
static void get_processor_caption(WCHAR *caption, UINT len)
Definition: builtin.c:3695
static const WCHAR prop_availabilityW[]
Definition: builtin.c:169
static const WCHAR prop_referenceddomainnameW[]
Definition: builtin.c:400
static const WCHAR prop_interfacetypeW[]
Definition: builtin.c:308
static const WCHAR prop_bootpartitionW[]
Definition: builtin.c:180
static struct association * get_logicaldisktopartition_pairs(UINT *count)
Definition: builtin.c:2981
static WCHAR * get_bios_string(BYTE id, const char *buf, UINT len)
Definition: builtin.c:1691
static const struct column col_physicalmemory[]
Definition: builtin.c:710
static const WCHAR prop_processidW[]
Definition: builtin.c:390
static const WCHAR prop_maxclockspeedW[]
Definition: builtin.c:338
static WCHAR * get_osversion(OSVERSIONINFOEXW *ver)
Definition: builtin.c:4016
static const struct column col_networkadapter[]
Definition: builtin.c:633
static enum fill_status fill_videocontroller(struct table *table, const struct expr *cond)
Definition: builtin.c:4489
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1443
static WCHAR * get_lastbootuptime(void)
Definition: builtin.c:3865
static struct array * get_dnsserversearchorder(IP_ADAPTER_DNS_SERVER_ADDRESS *list)
Definition: builtin.c:3232
static const WCHAR compsys_manufacturerW[]
Definition: builtin.c:915
static const WCHAR prop_mediatypeW[]
Definition: builtin.c:340
static const WCHAR prop_videomemorytypeW[]
Definition: builtin.c:481
static unsigned int get_processor_model(unsigned int reg0, unsigned int *stepping, unsigned int *family)
Definition: builtin.c:3655
static const WCHAR prop_hotfixidW[]
Definition: builtin.c:292
static BOOL push_dir(struct dirstack *dirstack, WCHAR *dir, UINT len)
Definition: builtin.c:2139
static UINT64 get_freespace(const WCHAR *dir, UINT64 *disksize)
Definition: builtin.c:2592
static const WCHAR prop_currentbitsperpixelW[]
Definition: builtin.c:211
static const WCHAR prop_filesystemW[]
Definition: builtin.c:278
static enum fill_status fill_diskdrive(struct table *table, const struct expr *cond)
Definition: builtin.c:2614
static enum fill_status fill_displaycontrollerconfig(struct table *table, const struct expr *cond)
Definition: builtin.c:2841
static const WCHAR prop_totalvisiblememorysizeW[]
Definition: builtin.c:462
static const WCHAR prop_acceptpauseW[]
Definition: builtin.c:140
static const struct column col_processor[]
Definition: builtin.c:748
static const WCHAR systemenclosure_manufacturerW[]
Definition: builtin.c:968
static const WCHAR prop_memberW[]
Definition: builtin.c:342
static WCHAR * convert_bios_date(const WCHAR *str)
Definition: builtin.c:1711
static const struct record_quickfixengineering data_quickfixengineering[]
Definition: builtin.c:1411
static enum fill_status fill_pnpentity(struct table *table, const struct expr *cond)
Definition: builtin.c:3455
static const WCHAR prop_locationW[]
Definition: builtin.c:330
static const WCHAR prop_classW[]
Definition: builtin.c:190
static const WCHAR class_logicaldisktopartitionW[]
Definition: builtin.c:95
static struct association * get_diskdrivetodiskpartition_pairs(UINT *count)
Definition: builtin.c:2682
static const WCHAR os_installdateW[]
Definition: builtin.c:952
static const struct column col_videocontroller[]
Definition: builtin.c:842
static const WCHAR class_sidW[]
Definition: builtin.c:125
static const WCHAR prop_settingidW[]
Definition: builtin.c:414
static const WCHAR class_ip4routetableW[]
Definition: builtin.c:89
static const WCHAR prop_smbiosbiosversionW[]
Definition: builtin.c:418
static const WCHAR prop_servicepackmajorW[]
Definition: builtin.c:408
static const WCHAR class_processorW[]
Definition: builtin.c:117
static WCHAR * get_oscaption(OSVERSIONINFOEXW *ver)
Definition: builtin.c:3950
static const WCHAR class_compsysW[]
Definition: builtin.c:70
static const WCHAR diskdrive_interfacetypeW[]
Definition: builtin.c:930
static const WCHAR prop_parameterW[]
Definition: builtin.c:374
static const WCHAR class_qualifiersW[]
Definition: builtin.c:121
static const WCHAR prop_portnameW[]
Definition: builtin.c:384
static const WCHAR prop_accountnameW[]
Definition: builtin.c:138
#define D(d)
Definition: builtin.c:4557
static const WCHAR prop_skunumberW[]
Definition: builtin.c:416
static const WCHAR diskdrive_mediatype_fixedW[]
Definition: builtin.c:934
static const WCHAR * get_service_startmode(DWORD mode)
Definition: builtin.c:4135
static const WCHAR prop_lastbootuptimeW[]
Definition: builtin.c:320
#define HW_VENDOR_AMD
Definition: builtin.c:4464
static const WCHAR prop_buildnumberW[]
Definition: builtin.c:182
static const WCHAR prop_pnpdeviceidW[]
Definition: builtin.c:382
static const WCHAR prop_capacityW[]
Definition: builtin.c:184
static const WCHAR prop_associatorW[]
Definition: builtin.c:164
static const WCHAR prop_winsprlevelW[]
Definition: builtin.c:494
static WCHAR * get_baseboard_product(const char *buf, UINT len)
Definition: builtin.c:1625
static const WCHAR videocontroller_driverdateW[]
Definition: builtin.c:974
static const WCHAR winsat_timetakenW[]
Definition: builtin.c:980
static void get_processor_id(WCHAR *processor_id, UINT len)
Definition: builtin.c:3735
smbios_type
Definition: builtin.c:1492
@ SMBIOS_TYPE_CHASSIS
Definition: builtin.c:1496
@ SMBIOS_TYPE_SYSTEM
Definition: builtin.c:1494
@ SMBIOS_TYPE_BIOS
Definition: builtin.c:1493
@ SMBIOS_TYPE_BASEBOARD
Definition: builtin.c:1495
static const WCHAR prop_datawidthW[]
Definition: builtin.c:230
static const WCHAR prop_binaryrepresentationW[]
Definition: builtin.c:172
static const WCHAR prop_codesetW[]
Definition: builtin.c:192
static const WCHAR prop_adapterramW[]
Definition: builtin.c:149
static const WCHAR class_diskdrivetodiskpartitionW[]
Definition: builtin.c:82
static const WCHAR prop_servicepackminorW[]
Definition: builtin.c:410
static enum fill_status fill_diskdrivetodiskpartition(struct table *table, const struct expr *cond)
Definition: builtin.c:2728
static const struct record_param data_param[]
Definition: builtin.c:1367
static const struct column col_winsat[]
Definition: builtin.c:869
static const WCHAR prop_vendorW[]
Definition: builtin.c:472
static const WCHAR prop_networkW[]
Definition: builtin.c:354
static BOOL seen_dir(struct dirstack *dirstack, const WCHAR *path)
Definition: builtin.c:2260
static WCHAR * get_countrycode(void)
Definition: builtin.c:3931
static struct dirstack * alloc_dirstack(UINT size)
Definition: builtin.c:2103
static const WCHAR prop_smbiosminorversionW[]
Definition: builtin.c:422
static WCHAR * get_volumeserialnumber(const WCHAR *root)
Definition: builtin.c:2923
static const WCHAR prop_ipenabledW[]
Definition: builtin.c:316
static const WCHAR prop_accessmaskW[]
Definition: builtin.c:144
void do_cpuid(unsigned int ax, unsigned int *p)
Definition: builtin.c:3649
static const WCHAR prop_videoarchitectureW[]
Definition: builtin.c:479
static enum fill_status fill_sid(struct table *table, const struct expr *cond)
Definition: builtin.c:4296
static const WCHAR prop_ipsubnet[]
Definition: builtin.c:318
static const struct record_associator data_associator[]
Definition: builtin.c:1362
static WCHAR * get_localdatetime(void)
Definition: builtin.c:3881
static enum fill_status fill_baseboard(struct table *table, const struct expr *cond)
Definition: builtin.c:1646
static const struct column col_diskdrivetodiskpartition[]
Definition: builtin.c:586
static const WCHAR prop_releasedateW[]
Definition: builtin.c:402
static const WCHAR prop_identificationcodeW[]
Definition: builtin.c:296
static UINT16 get_bios_smbiosmajorversion(const char *buf, UINT len)
Definition: builtin.c:1677
static const WCHAR prop_videoprocessorW[]
Definition: builtin.c:485
static WCHAR * get_osbuildnumber(OSVERSIONINFOEXW *ver)
Definition: builtin.c:3943
static const WCHAR prop_flavorW[]
Definition: builtin.c:280
static enum fill_status fill_printer(struct table *table, const struct expr *cond)
Definition: builtin.c:3502
static const WCHAR prop_cpustatusW[]
Definition: builtin.c:204
static const WCHAR prop_drivetypeW[]
Definition: builtin.c:274
static WCHAR * get_pnpdeviceid(DXGI_ADAPTER_DESC *desc)
Definition: builtin.c:4449
static const WCHAR prop_systemnameW[]
Definition: builtin.c:450
static const WCHAR prop_lockpresentW[]
Definition: builtin.c:332
static const WCHAR prop_physicaladapterW[]
Definition: builtin.c:378
static const WCHAR * get_osarchitecture(void)
Definition: builtin.c:3688
static const WCHAR class_diskdriveW[]
Definition: builtin.c:80
static const WCHAR prop_operatingsystemskuW[]
Definition: builtin.c:364
static const WCHAR class_processor2W[]
Definition: builtin.c:119
static const WCHAR prop_verticalresolutionW[]
Definition: builtin.c:476
static const WCHAR prop_smbiosmajorversionW[]
Definition: builtin.c:420
static const struct column col_process[]
Definition: builtin.c:734
static const WCHAR class_logicaldiskW[]
Definition: builtin.c:91
static UINT get_processor_count(void)
Definition: builtin.c:1835
static WCHAR * get_compsysproduct_vendor(const char *buf, UINT len)
Definition: builtin.c:2051
static const WCHAR prop_intvalueW[]
Definition: builtin.c:310
static const WCHAR prop_attributesW[]
Definition: builtin.c:166
static const WCHAR compsysproduct_vendorW[]
Definition: builtin.c:926
static const WCHAR prop_antecedentW[]
Definition: builtin.c:158
static const WCHAR class_datafileW[]
Definition: builtin.c:74
static const WCHAR compsysproduct_identifyingnumberW[]
Definition: builtin.c:919
static WCHAR * get_settingid(UINT32 index)
Definition: builtin.c:3358
static WCHAR * get_osname(const WCHAR *caption)
Definition: builtin.c:4003
static const WCHAR prop_driverdateW[]
Definition: builtin.c:266
static const struct array systemenclosure_chassistypes_array
Definition: builtin.c:1427
static struct array * get_defaultipgateway(IP_ADAPTER_GATEWAY_ADDRESS *list)
Definition: builtin.c:3199
static const WCHAR class_pnpentityW[]
Definition: builtin.c:110
static const WCHAR prop_driveW[]
Definition: builtin.c:264
static const WCHAR prop_dnshostnameW[]
Definition: builtin.c:256
static const WCHAR prop_levelW[]
Definition: builtin.c:322
static WCHAR * get_compsysproduct_version(const char *buf, UINT len)
Definition: builtin.c:2058
static WCHAR * get_computername(void)
Definition: builtin.c:1940
static const WCHAR * get_service_type(DWORD type)
Definition: builtin.c:4093
static int get_systemenclosure_lockpresent(const char *buf, UINT len)
Definition: builtin.c:4364
static const struct column col_associator[]
Definition: builtin.c:500
static void free_dirstack(struct dirstack *dirstack)
Definition: builtin.c:2131
static WCHAR * get_compsysproduct_identifyingnumber(const char *buf, UINT len)
Definition: builtin.c:2012
static const WCHAR prop_sidlengthW[]
Definition: builtin.c:428
static const WCHAR prop_productW[]
Definition: builtin.c:396
static const WCHAR prop_displaynameW[]
Definition: builtin.c:252
#define HW_VENDOR_INTEL
Definition: builtin.c:4467
static const WCHAR videocontroller_deviceidW[]
Definition: builtin.c:972
static const WCHAR videocontroller_dactypeW[]
Definition: builtin.c:970
static WCHAR * get_baseboard_serialnumber(const char *buf, UINT len)
Definition: builtin.c:1632
static const WCHAR prop_diskindexW[]
Definition: builtin.c:254
static UINT get_processor_maxclockspeed(UINT index)
Definition: builtin.c:3774
static const WCHAR prop_modelW[]
Definition: builtin.c:350
static const WCHAR * get_service_state(DWORD state)
Definition: builtin.c:4111
static const WCHAR cdromdrive_nameW[]
Definition: builtin.c:904
static enum fill_status fill_compsys(struct table *table, const struct expr *cond)
Definition: builtin.c:1968
static const struct column col_systemsecurity[]
Definition: builtin.c:835
static const WCHAR prop_stateW[]
Definition: builtin.c:436
static const WCHAR prop_dnsserversearchorderW[]
Definition: builtin.c:258
static const WCHAR prop_localeW[]
Definition: builtin.c:328
static const WCHAR prop_numcoresW[]
Definition: builtin.c:358
static const WCHAR prop_driverversionW[]
Definition: builtin.c:271
static const struct column col_displaycontrollerconfig[]
Definition: builtin.c:603
static WCHAR * get_compsysproduct_uuid(const char *buf, UINT len)
Definition: builtin.c:2026
static const WCHAR baseboard_versionW[]
Definition: builtin.c:888
static const WCHAR prop_horizontalresolutionW[]
Definition: builtin.c:290
static void get_processor_version(WCHAR *version, UINT len)
Definition: builtin.c:3718
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1462
static enum fill_status fill_compsysproduct(struct table *table, const struct expr *cond)
Definition: builtin.c:2065
static enum fill_status fill_diskpartition(struct table *table, const struct expr *cond)
Definition: builtin.c:2778
static WCHAR * get_volumename(const WCHAR *root)
Definition: builtin.c:2917
static const WCHAR prop_configmanagererrorcodeW[]
Definition: builtin.c:196
static const WCHAR class_cdromdriveW[]
Definition: builtin.c:68
static WCHAR * get_locale(void)
Definition: builtin.c:3937
static const WCHAR prop_pprocessidW[]
Definition: builtin.c:386
static const WCHAR compsysproduct_versionW[]
Definition: builtin.c:928
static const WCHAR videocontroller_statusW[]
Definition: builtin.c:978
static const struct column col_stdregprov[]
Definition: builtin.c:818
static const WCHAR class_quickfixengineeringW[]
Definition: builtin.c:123
static const WCHAR prop_currentrefreshrateW[]
Definition: builtin.c:220
static const WCHAR prop_usernameW[]
Definition: builtin.c:468
static const WCHAR prop_defaultipgatewayW[]
Definition: builtin.c:232
static QUERY_SERVICE_CONFIGW * query_service_config(SC_HANDLE manager, const WCHAR *name)
Definition: builtin.c:4156
static const struct record_qualifier data_qualifier[]
Definition: builtin.c:1406
static const WCHAR networkadapter_pnpdeviceidW[]
Definition: builtin.c:944
static const WCHAR prop_csdversionW[]
Definition: builtin.c:206
static const WCHAR prop_revisionW[]
Definition: builtin.c:404
static const WCHAR prop_nexthopW[]
Definition: builtin.c:356
static WCHAR * build_name(WCHAR drive, const WCHAR *path)
Definition: builtin.c:2201
static WCHAR * build_glob(WCHAR drive, const WCHAR *path, UINT len)
Definition: builtin.c:2181
static const WCHAR bios_manufacturerW[]
Definition: builtin.c:892
static const WCHAR prop_statusinfoW[]
Definition: builtin.c:440
static const WCHAR prop_oslanguageW[]
Definition: builtin.c:368
static const struct record_winsat data_winsat[]
Definition: builtin.c:1437
static enum fill_status fill_systemenclosure(struct table *table, const struct expr *cond)
Definition: builtin.c:4417
static WCHAR * get_bios_manufacturer(const char *buf, UINT len)
Definition: builtin.c:1704
static const struct column col_physicalmedia[]
Definition: builtin.c:705
static const WCHAR prop_timetakenW[]
Definition: builtin.c:456
static const WCHAR class_networkadapterW[]
Definition: builtin.c:97
static const WCHAR prop_totalphysicalmemoryW[]
Definition: builtin.c:458
static const WCHAR prop_processoridW[]
Definition: builtin.c:392
static UINT16 get_bios_smbiosminorversion(const char *buf, UINT len)
Definition: builtin.c:1684
static const WCHAR prop_deviceidW[]
Definition: builtin.c:242
static const WCHAR prop_boolvalueW[]
Definition: builtin.c:176
static const struct column col_diskdrive[]
Definition: builtin.c:574
static struct array * get_ipsubnet(IP_ADAPTER_UNICAST_ADDRESS_LH *list)
Definition: builtin.c:3302
#define C(c)
Definition: builtin.c:4556
static struct array * dup_array(const struct array *src)
Definition: builtin.c:4375
static enum fill_status fill_networkadapter(struct table *table, const struct expr *cond)
Definition: builtin.c:3126
static const struct column col_compsysproduct[]
Definition: builtin.c:551
static WCHAR * get_mac_address(const BYTE *addr, DWORD len)
Definition: builtin.c:3083
static const WCHAR prop_defaultvalueW[]
Definition: builtin.c:234
static const WCHAR prop_workingsetsizeW[]
Definition: builtin.c:496
static WCHAR * get_baseboard_string(BYTE id, const char *buf, UINT len)
Definition: builtin.c:1605
static const WCHAR prop_dhcpenabledW[]
Definition: builtin.c:246
static WCHAR * get_baseboard_version(const char *buf, UINT len)
Definition: builtin.c:1639
static const WCHAR prop_destinationW[]
Definition: builtin.c:240
static const WCHAR prop_currenttimezoneW[]
Definition: builtin.c:224
static WCHAR * get_systemenclosure_manufacturer(const char *buf, UINT len)
Definition: builtin.c:4357
static WCHAR * append_path(const WCHAR *path, const WCHAR *segment, UINT *len)
Definition: builtin.c:2317
static DWORD get_operatingsystemsku(void)
Definition: builtin.c:4024
static const WCHAR class_physicalmediaW[]
Definition: builtin.c:106
#define RSMB
Definition: builtin.c:1547
static const WCHAR prop_addresswidthW[]
Definition: builtin.c:156
static const WCHAR baseboard_tagW[]
Definition: builtin.c:886
static const struct column col_desktopmonitor[]
Definition: builtin.c:565
static const WCHAR prop_d3dscoreW[]
Definition: builtin.c:228
static const WCHAR prop_ipaddressW[]
Definition: builtin.c:312
static const WCHAR prop_bootableW[]
Definition: builtin.c:178
static const WCHAR class_diskpartitionW[]
Definition: builtin.c:84
static const WCHAR prop_statusW[]
Definition: builtin.c:438
static const struct column col_ip4routetable[]
Definition: builtin.c:611
static const WCHAR class_printerW[]
Definition: builtin.c:112
static const WCHAR class_desktopmonitorW[]
Definition: builtin.c:76
static const WCHAR * get_adaptertype(DWORD type, int *id, int *physical)
Definition: builtin.c:3094
static const WCHAR class_videocontrollerW[]
Definition: builtin.c:132
static void clear_dirstack(struct dirstack *dirstack)
Definition: builtin.c:2124
static const struct record_sounddevice data_sounddevice[]
Definition: builtin.c:1415
static const WCHAR prop_primaryW[]
Definition: builtin.c:388
static const WCHAR class_systemenclosureW[]
Definition: builtin.c:129
static const WCHAR prop_domainroleW[]
Definition: builtin.c:262
static const WCHAR prop_ostypeW[]
Definition: builtin.c:372
static const struct column col_printer[]
Definition: builtin.c:722
static const struct column col_logicaldisk[]
Definition: builtin.c:617
static const WCHAR prop_installdateW[]
Definition: builtin.c:302
static const WCHAR * find_sid_str(const struct expr *cond)
Definition: builtin.c:4276
static const WCHAR prop_domainW[]
Definition: builtin.c:260
static WCHAR * get_accountname(LSA_TRANSLATED_NAME *name)
Definition: builtin.c:4249
static const WCHAR prop_adapterdactypeW[]
Definition: builtin.c:147
static WCHAR * pop_dir(struct dirstack *dirstack, UINT *len)
Definition: builtin.c:2163
static const WCHAR prop_configuredclockspeedW[]
Definition: builtin.c:198
static UINT32 get_pixelsperxlogicalinch(void)
Definition: builtin.c:2463
static const WCHAR prop_installeddisplaydriversW[]
Definition: builtin.c:304
static enum fill_status fill_cdromdrive(struct table *table, const struct expr *cond)
Definition: builtin.c:1793
static const WCHAR sounddevice_productnameW[]
Definition: builtin.c:962
static const WCHAR class_winsatW[]
Definition: builtin.c:135
static const WCHAR prop_productnameW[]
Definition: builtin.c:398
static const struct column col_datafile[]
Definition: builtin.c:560
static const WCHAR class_operatingsystemW[]
Definition: builtin.c:102
static const WCHAR prop_startingoffsetW[]
Definition: builtin.c:434
static const WCHAR prop_volumeserialnumberW[]
Definition: builtin.c:490
static const WCHAR prop_suitemaskW[]
Definition: builtin.c:444
static const struct column col_qualifier[]
Definition: builtin.c:771
static const WCHAR prop_memoryscoreW[]
Definition: builtin.c:344
static const WCHAR prop_bitsperpixelW[]
Definition: builtin.c:174
static const WCHAR compsys_domainW[]
Definition: builtin.c:913
static const WCHAR class_logicaldisk2W[]
Definition: builtin.c:93
static const WCHAR compsys_descriptionW[]
Definition: builtin.c:911
static const WCHAR diskdrive_pnpdeviceidW[]
Definition: builtin.c:940
static const WCHAR prop_captionW[]
Definition: builtin.c:186
static const struct record_physicalmedia data_physicalmedia[]
Definition: builtin.c:1402
static const WCHAR prop_uniqueidW[]
Definition: builtin.c:466
static const WCHAR prop_sidW[]
Definition: builtin.c:426
static const WCHAR prop_threadcountW[]
Definition: builtin.c:454
static WCHAR * get_systemenclosure_string(BYTE id, const char *buf, UINT len)
Definition: builtin.c:4344
static UINT16 get_processor_revision(void)
Definition: builtin.c:3729
static const WCHAR quickfixengineering_hotfixidW[]
Definition: builtin.c:960
static const WCHAR bios_serialnumberW[]
Definition: builtin.c:896
static const WCHAR diskdrive_manufacturerW[]
Definition: builtin.c:932
static const WCHAR prop_countrycodeW[]
Definition: builtin.c:200
static WCHAR * get_compsysproduct_string(BYTE id, const char *buf, UINT len)
Definition: builtin.c:1999
static const struct smbios_header * find_smbios_entry(enum smbios_type type, const char *buf, UINT len)
Definition: builtin.c:1549
static const WCHAR prop_processortypeW[]
Definition: builtin.c:394
static WCHAR * get_bios_releasedate(const char *buf, UINT len)
Definition: builtin.c:1743
static const WCHAR prop_chassistypesW[]
Definition: builtin.c:188
static UINT16 get_connection_status(IF_OPER_STATUS status)
Definition: builtin.c:3069
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
FT_UInt sid
Definition: cffcmap.c:139
Definition: list.h:37
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define free
Definition: debug_ros.c:5
struct config_s config
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
NTSTATUS WINAPI LsaOpenPolicy(IN PLSA_UNICODE_STRING SystemName OPTIONAL, IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
Definition: lsa.c:1183
NTSTATUS WINAPI LsaLookupSids(IN LSA_HANDLE PolicyHandle, IN ULONG Count, IN PSID *Sids, OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains, OUT PLSA_TRANSLATED_NAME *Names)
Definition: lsa.c:1069
NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
Definition: lsa.c:701
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
Definition: lsa.c:194
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
BOOL WINAPI ConvertStringSidToSidW(LPCWSTR StringSid, PSID *Sid)
Definition: security.c:3536
DWORD WINAPI GetLengthSid(PSID pSid)
Definition: security.c:919
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define CloseHandle
Definition: compat.h:739
#define wcsrchr
Definition: compat.h:16
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_SHARE_READ
Definition: compat.h:136
#define wcsicmp
Definition: compat.h:15
#define lstrlenW
Definition: compat.h:750
static const WCHAR version[]
Definition: asmname.c:66
static DOUBLE day(DOUBLE time)
Definition: date.c:117
@ EXPR_PROPVAL
Definition: parser.h:273
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
LPWSTR WINAPI GetCommandLineW(VOID)
Definition: proc.c:2013
VOID WINAPI GetNativeSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:207
UINT WINAPI GetSystemFirmwareTable(_In_ DWORD FirmwareTableProviderSignature, _In_ DWORD FirmwareTableID, _Out_writes_bytes_to_opt_(BufferSize, return) PVOID pFirmwareTableBuffer, _In_ DWORD BufferSize)
Definition: sysinfo.c:736
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
BOOL WINAPI Process32NextW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)
Definition: toolhelp.c:1073
HANDLE WINAPI CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID)
Definition: toolhelp.c:1255
BOOL WINAPI Process32FirstW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)
Definition: toolhelp.c:984
BOOL WINAPI Wow64RevertWow64FsRedirection(IN PVOID OldValue)
Definition: utils.c:808
BOOL WINAPI Wow64DisableWow64FsRedirection(IN PVOID *OldValue)
Definition: utils.c:785
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
Definition: timezone.c:262
static const WCHAR slashW[]
Definition: devenum.c:59
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
Definition: devinst.c:1787
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2292
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize, PDWORD RequiredSize)
Definition: devinst.c:1907
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893
static BOOL parse_query(const WCHAR **ptr, parse_data *data, DWORD flags)
Definition: uri.c:2044
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1049
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
struct list * table_list
Definition: main.c:38
HRESULT process_get_owner(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: process.c:65
HRESULT eval_cond(const struct table *table, UINT row, const struct expr *cond, LONGLONG *val, UINT *type)
Definition: query.c:440
void free_query(struct query *query)
Definition: query.c:765
HRESULT execute_view(struct view *view)
Definition: query.c:739
HRESULT get_propval(const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, LONG *flavor)
Definition: query.c:1177
HRESULT reg_create_key(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: reg.c:99
HRESULT reg_get_stringvalue(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: reg.c:391
HRESULT reg_enum_key(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: reg.c:198
HRESULT reg_enum_values(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: reg.c:308
HRESULT security_get_sd(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: security.c:132
HRESULT security_set_sd(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: security.c:187
HRESULT service_stop_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:238
HRESULT service_pause_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:79
HRESULT service_resume_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:124
HRESULT service_start_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:193
void free_row_values(const struct table *table, UINT row)
Definition: table.c:292
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
static const WCHAR month[12][4]
Definition: session.c:2150
#define swprintf
Definition: precomp.h:40
struct nls_table * tables
Definition: nls_base.c:22
#define AF_INET
Definition: tcpip.h:117
#define ULONG_PTR
Definition: config.h:101
static const WCHAR unknownW[]
Definition: engine.c:40
BOOLEAN RtlTimeToTimeFields(IN PLARGE_INTEGER Time, IN PTIME_FIELDS TimeFields)
char ** glob(const char *v)
Definition: fake.c:36
#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
Definition: ntddk_ex.h:208
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
@ SystemTimeOfDayInformation
Definition: ntddk_ex.h:14
@ SystemBasicInformation
Definition: ntddk_ex.h:11
unsigned short WORD
Definition: ntddk_ex.h:93
uint32_t serial
Definition: fsck.fat.h:29
return adapter
Status
Definition: gdiplustypes.h:25
GLuint start
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLsizeiptr size
Definition: glext.h:5919
GLuint address
Definition: glext.h:9393
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLdouble GLdouble right
Definition: glext.h:10859
GLenum mode
Definition: glext.h:6217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLint left
Definition: glext.h:7726
GLenum GLenum dst
Definition: glext.h:6340
GLenum const GLvoid * addr
Definition: glext.h:9621
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
static const WCHAR autoW[]
Definition: htmlbody.c:590
static const WCHAR selectW[]
Definition: htmlelem.c:38
static const WCHAR disabledW[]
Definition: htmlelem.c:3278
HFONT tf
Definition: icontest.c:17
IF_OPER_STATUS
Definition: ifdef.h:184
@ IfOperStatusUp
Definition: ifdef.h:185
@ IfOperStatusDown
Definition: ifdef.h:186
#define iswspace(_c)
Definition: ctype.h:669
#define iswdigit(_c)
Definition: ctype.h:667
#define iswalpha(_c)
Definition: ctype.h:664
NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS, void *, ULONG, void *, ULONG, ULONG *)
@ SystemLogicalProcessorInformationEx
Definition: winternl.h:1001
Definition: msctf.idl:550
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
Definition: intrin_ppc.h:682
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
#define IF_TYPE_IEEE80211
Definition: ipifcons.h:91
#define IF_TYPE_TUNNEL
Definition: ipifcons.h:151
#define IF_TYPE_IEEE1394
Definition: ipifcons.h:164
#define IF_TYPE_SOFTWARE_LOOPBACK
Definition: ipifcons.h:44
#define IF_TYPE_ETHERNET_CSMACD
Definition: ipifcons.h:26
char hdr[14]
Definition: iptest.cpp:33
uint32_t entry
Definition: isohybrid.c:63
int JSAMPARRAY int int num_rows
Definition: jpegint.h:421
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: lang.c:761
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1108
#define DRIVE_CDROM
Definition: machpc98.h:119
const GUID * guid
__u16 date
Definition: mkdosfs.c:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ntohl(x)
Definition: module.h:205
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static const WCHAR desc[]
Definition: protectdata.c:36
HRESULT hres
Definition: protocol.c:465
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:79
static const WCHAR dotdotW[]
Definition: directory.c:81
static const WCHAR dotW[]
Definition: directory.c:80
#define __ASM_GLOBAL_FUNC(name, code)
Definition: port.h:201
#define min(a, b)
Definition: monoChain.cc:55
static const WCHAR systemW[]
Definition: mxwriter.c:50
unsigned int UINT
Definition: ndis.h:50
@ SystemLogicalProcessorInformation
Definition: extypes.h:290
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
#define TIME_ZONE_ID_DAYLIGHT
Definition: rtltypes.h:254
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
#define PRODUCT_UNDEFINED
#define LOCALE_SYSTEM_DEFAULT
NTSTATUS NTAPI NtPowerInformation(IN POWER_INFORMATION_LEVEL PowerInformationLevel, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferLength, OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength)
Definition: power.c:792
struct _PROCESSOR_POWER_INFORMATION PROCESSOR_POWER_INFORMATION
@ ProcessorInformation
Definition: ntpoapi.h:78
#define POLICY_ALL_ACCESS
Definition: ntsecapi.h:77
#define V_BSTR(A)
Definition: oleauto.h:226
static struct query * create_query(void)
Definition: pdh_main.c:152
long LONG
Definition: pedump.c:60
#define EXPR_COMPLEX
Definition: query.h:47
#define OP_EQ
Definition: query.h:36
#define EXPR_SVAL
Definition: query.h:51
#define OP_OR
Definition: query.h:38
INT WSAAPI WSAAddressToStringW(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength)
Definition: rnr.c:128
const WCHAR * str
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
Definition: rpcrt4_main.c:540
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
struct @5011 regs[]
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2068
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2160
BOOL WINAPI QueryServiceConfigW(SC_HANDLE hService, LPQUERY_SERVICE_CONFIGW lpServiceConfig, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
Definition: scm.c:2291
BOOL WINAPI EnumServicesStatusExW(SC_HANDLE hSCManager, SC_ENUM_TYPE InfoLevel, DWORD dwServiceType, DWORD dwServiceState, LPBYTE lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned, LPDWORD lpResumeHandle, LPCWSTR pszGroupName)
Definition: scm.c:1518
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
int __cdecl system(_In_opt_z_ const char *_Command)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define memset(x, y, z)
Definition: compat.h:39
#define DIGCF_ALLCLASSES
Definition: setupapi.h:172
#define DIGCF_PRESENT
Definition: setupapi.h:171
#define STATUS_SUCCESS
Definition: shellext.h:65
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
DWORD dwForwardNextHop
Definition: ipmib.h:74
IF_INDEX dwForwardIfIndex
Definition: ipmib.h:75
DWORD dwForwardDest
Definition: ipmib.h:71
DWORD dwNumEntries
Definition: ipmib.h:97
MIB_IPFORWARDROW table[1]
Definition: ipmib.h:98
WCHAR szCSDVersion[128]
Definition: rtltypes.h:274
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
USHORT wServicePackMinor
Definition: rtltypes.h:276
UCHAR wProductType
Definition: rtltypes.h:278
ULONG dwBuildNumber
Definition: rtltypes.h:272
USHORT wServicePackMajor
Definition: rtltypes.h:275
WORD wYear
Definition: winbase.h:905
WORD wMilliseconds
Definition: winbase.h:912
WORD wMonth
Definition: winbase.h:906
WORD wHour
Definition: winbase.h:909
WORD wSecond
Definition: winbase.h:911
WORD wMinute
Definition: winbase.h:910
WORD wDay
Definition: winbase.h:908
WCHAR * ref2
Definition: builtin.c:2667
WCHAR * ref
Definition: builtin.c:2666
UINT num_allocated
Definition: builtin.c:2100
UINT * len_dirs
Definition: builtin.c:2098
UINT num_dirs
Definition: builtin.c:2099
WCHAR ** dirs
Definition: builtin.c:2097
Definition: cookie.c:42
Definition: query.h:87
struct complex_expr expr
Definition: query.h:91
union expr::@507 u
int type
Definition: query.h:88
Definition: main.c:439
Definition: name.c:39
struct list mem
struct view * view
const WCHAR * assocclass
Definition: builtin.c:986
const WCHAR * associator
Definition: builtin.c:988
const WCHAR * model
Definition: builtin.c:993
const WCHAR * manufacturer
Definition: builtin.c:992
const WCHAR * tag
Definition: builtin.c:997
const WCHAR * version
Definition: builtin.c:998
const WCHAR * serialnumber
Definition: builtin.c:996
const WCHAR * name
Definition: builtin.c:994
const WCHAR * product
Definition: builtin.c:995
UINT16 smbiosmajorversion
Definition: builtin.c:1010
const WCHAR * currentlanguage
Definition: builtin.c:1002
const WCHAR * serialnumber
Definition: builtin.c:1008
const WCHAR * name
Definition: builtin.c:1006
const WCHAR * releasedate
Definition: builtin.c:1007
const WCHAR * version
Definition: builtin.c:1012
const WCHAR * identificationcode
Definition: builtin.c:1004
const WCHAR * smbiosbiosversion
Definition: builtin.c:1009
UINT16 smbiosminorversion
Definition: builtin.c:1011
const WCHAR * description
Definition: builtin.c:1003
const WCHAR * manufacturer
Definition: builtin.c:1005
const WCHAR * drive
Definition: builtin.c:1017
const WCHAR * name
Definition: builtin.c:1019
const WCHAR * device_id
Definition: builtin.c:1016
const WCHAR * pnpdevice_id
Definition: builtin.c:1020
const WCHAR * mediatype
Definition: builtin.c:1018
const WCHAR * description
Definition: builtin.c:1024
const WCHAR * manufacturer
Definition: builtin.c:1027
const WCHAR * domain
Definition: builtin.c:1025
UINT32 num_logical_processors
Definition: builtin.c:1030
const WCHAR * model
Definition: builtin.c:1028
const WCHAR * name
Definition: builtin.c:1029
const WCHAR * username
Definition: builtin.c:1033
UINT64 total_physical_memory
Definition: builtin.c:1032
const WCHAR * identifyingnumber
Definition: builtin.c:1037
const WCHAR * name
Definition: builtin.c:1046
const WCHAR * version
Definition: builtin.c:1047
UINT32 pixelsperxlogicalinch
Definition: builtin.c:1051
UINT32 accessmask
Definition: builtin.c:1055
const WCHAR * name
Definition: builtin.c:1056
const WCHAR * device_id
Definition: builtin.c:1060
const WCHAR * manufacturer
Definition: builtin.c:1063
const WCHAR * model
Definition: builtin.c:1065
const WCHAR * pnpdevice_id
Definition: builtin.c:1066
const WCHAR * interfacetype
Definition: builtin.c:1062
const WCHAR * serialnumber
Definition: builtin.c:1067
const WCHAR * mediatype
Definition: builtin.c:1064
const WCHAR * pnpdevice_id
Definition: builtin.c:1082
const WCHAR * device_id
Definition: builtin.c:1079
const WCHAR * type
Definition: builtin.c:1085
const WCHAR * nexthop
Definition: builtin.c:1099
const WCHAR * destination
Definition: builtin.c:1097
const WCHAR * volumeserialnumber
Definition: builtin.c:1110
const WCHAR * volumename
Definition: builtin.c:1109
const WCHAR * filesystem
Definition: builtin.c:1105
const WCHAR * device_id
Definition: builtin.c:1103
const WCHAR * name
Definition: builtin.c:1107
const WCHAR * mac_address
Definition: builtin.c:1125
const WCHAR * name
Definition: builtin.c:1127
const WCHAR * device_id
Definition: builtin.c:1122
const WCHAR * adaptertype
Definition: builtin.c:1119
const WCHAR * description
Definition: builtin.c:1121
UINT16 netconnection_status
Definition: builtin.c:1128
const WCHAR * manufacturer
Definition: builtin.c:1126
const WCHAR * pnpdevice_id
Definition: builtin.c:1130
const WCHAR * settingid
Definition: builtin.c:1146
const struct array * dnsserversearchorder
Definition: builtin.c:1139
const WCHAR * mac_address
Definition: builtin.c:1145
const struct array * defaultipgateway
Definition: builtin.c:1135
const struct array * ipaddress
Definition: builtin.c:1141
const struct array * ipsubnet
Definition: builtin.c:1144
const WCHAR * dnshostname
Definition: builtin.c:1138
const WCHAR * description
Definition: builtin.c:1136
const WCHAR * installdate
Definition: builtin.c:1158
UINT64 totalvisiblememorysize
Definition: builtin.c:1177
const WCHAR * csdversion
Definition: builtin.c:1154
const WCHAR * buildnumber
Definition: builtin.c:1150
UINT64 totalvirtualmemorysize
Definition: builtin.c:1176
const WCHAR * localdatetime
Definition: builtin.c:1160
const WCHAR * osarchitecture
Definition: builtin.c:1165
const WCHAR * systemdirectory
Definition: builtin.c:1174
const WCHAR * systemdrive
Definition: builtin.c:1175
const WCHAR * name
Definition: builtin.c:1163
const WCHAR * codeset
Definition: builtin.c:1152
const WCHAR * csname
Definition: builtin.c:1155
const WCHAR * countrycode
Definition: builtin.c:1153
const WCHAR * lastbootuptime
Definition: builtin.c:1159
const WCHAR * locale
Definition: builtin.c:1161
const WCHAR * caption
Definition: builtin.c:1151
const WCHAR * manufacturer
Definition: builtin.c:1162
const WCHAR * serialnumber
Definition: builtin.c:1170
const WCHAR * version
Definition: builtin.c:1178
INT32 direction
Definition: builtin.c:1184
const WCHAR * parameter
Definition: builtin.c:1185
UINT32 type
Definition: builtin.c:1186
const WCHAR * method
Definition: builtin.c:1183
UINT32 defaultvalue
Definition: builtin.c:1187
const WCHAR * tag
Definition: builtin.c:1192
const WCHAR * serialnumber
Definition: builtin.c:1191
const WCHAR * devicelocator
Definition: builtin.c:1198
const WCHAR * partnumber
Definition: builtin.c:1200
UINT32 configuredclockspeed
Definition: builtin.c:1197
const WCHAR * device_id
Definition: builtin.c:1204
UINT32 attributes
Definition: builtin.c:1208
const WCHAR * portname
Definition: builtin.c:1216
const WCHAR * name
Definition: builtin.c:1214
UINT32 horizontalresolution
Definition: builtin.c:1211
const WCHAR * drivername
Definition: builtin.c:1210
const WCHAR * location
Definition: builtin.c:1213
const WCHAR * device_id
Definition: builtin.c:1209
class_method * get_owner
Definition: builtin.c:1230
UINT32 process_id
Definition: builtin.c:1226
const WCHAR * commandline
Definition: builtin.c:1221
UINT32 pprocess_id
Definition: builtin.c:1225
UINT32 thread_count
Definition: builtin.c:1227
const WCHAR * description
Definition: builtin.c:1222
const WCHAR * handle
Definition: builtin.c:1223
const WCHAR * caption
Definition: builtin.c:1220
UINT64 workingsetsize
Definition: builtin.c:1228
const WCHAR * name
Definition: builtin.c:1224
UINT16 datawidth
Definition: builtin.c:1239
const WCHAR * device_id
Definition: builtin.c:1241
UINT16 processortype
Definition: builtin.c:1250
UINT16 addresswidth
Definition: builtin.c:1234
UINT16 cpu_status
Definition: builtin.c:1237
const WCHAR * name
Definition: builtin.c:1246
UINT16 revision
Definition: builtin.c:1251
UINT32 num_logical_processors
Definition: builtin.c:1248
const WCHAR * description
Definition: builtin.c:1240
UINT32 maxclockspeed
Definition: builtin.c:1245
const WCHAR * processor_id
Definition: builtin.c:1249
UINT32 currentclockspeed
Definition: builtin.c:1238
const WCHAR * caption
Definition: builtin.c:1236
UINT32 num_cores
Definition: builtin.c:1247
const WCHAR * version
Definition: builtin.c:1253
const WCHAR * unique_id
Definition: builtin.c:1252
const WCHAR * manufacturer
Definition: builtin.c:1244
UINT16 architecture
Definition: builtin.c:1235
const WCHAR * member
Definition: builtin.c:1258
const WCHAR * strvalue
Definition: builtin.c:1263
const WCHAR * name
Definition: builtin.c:1261
const WCHAR * caption
Definition: builtin.c:1268
const WCHAR * hotfixid
Definition: builtin.c:1269
const WCHAR * displayname
Definition: builtin.c:1275
class_method * stop_service
Definition: builtin.c:1286
const WCHAR * startmode
Definition: builtin.c:1279
const WCHAR * servicetype
Definition: builtin.c:1278
const WCHAR * state
Definition: builtin.c:1280
const WCHAR * systemname
Definition: builtin.c:1281
class_method * pause_service
Definition: builtin.c:1283
class_method * resume_service
Definition: builtin.c:1284
int accept_pause
Definition: builtin.c:1273
UINT32 process_id
Definition: builtin.c:1277
class_method * start_service
Definition: builtin.c:1285
const WCHAR * name
Definition: builtin.c:1276
const WCHAR * accountname
Definition: builtin.c:1290
const WCHAR * referenceddomainname
Definition: builtin.c:1292
const struct array * binaryrepresentation
Definition: builtin.c:1291
const WCHAR * sid
Definition: builtin.c:1293
UINT32 sidlength
Definition: builtin.c:1294
const WCHAR * productname
Definition: builtin.c:1299
const WCHAR * name
Definition: builtin.c:1298
class_method * createkey
Definition: builtin.c:1304
class_method * enumkey
Definition: builtin.c:1305
class_method * enumvalues
Definition: builtin.c:1306
class_method * getstringvalue
Definition: builtin.c:1307
const WCHAR * caption
Definition: builtin.c:1316
const WCHAR * manufacturer
Definition: builtin.c:1320
const WCHAR * tag
Definition: builtin.c:1322
const WCHAR * name
Definition: builtin.c:1321
const struct array * chassistypes
Definition: builtin.c:1317
const WCHAR * description
Definition: builtin.c:1318
class_method * setsd
Definition: builtin.c:1312
class_method * getsd
Definition: builtin.c:1311
UINT32 current_bitsperpixel
Definition: builtin.c:1331
const WCHAR * caption
Definition: builtin.c:1329
const WCHAR * adapter_dactype
Definition: builtin.c:1326
const WCHAR * driverversion
Definition: builtin.c:1339
const WCHAR * pnpdevice_id
Definition: builtin.c:1342
const WCHAR * videomodedescription
Definition: builtin.c:1346
const WCHAR * device_id
Definition: builtin.c:1337
const WCHAR * description
Definition: builtin.c:1336
UINT32 current_horizontalres
Definition: builtin.c:1332
const WCHAR * installeddriver
Definition: builtin.c:1340
UINT32 current_verticalres
Definition: builtin.c:1335
const WCHAR * status
Definition: builtin.c:1343
const WCHAR * driverdate
Definition: builtin.c:1338
const WCHAR * name
Definition: builtin.c:1341
UINT32 current_refreshrate
Definition: builtin.c:1333
const WCHAR * videoprocessor
Definition: builtin.c:1347
FLOAT cpuscore
Definition: builtin.c:1351
UINT32 winsatassessmentstate
Definition: builtin.c:1357
FLOAT d3dscore
Definition: builtin.c:1352
FLOAT diskscrore
Definition: builtin.c:1353
FLOAT winsprlevel
Definition: builtin.c:1358
FLOAT graphicsscore
Definition: builtin.c:1354
FLOAT memoryscore
Definition: builtin.c:1355
const WCHAR * timetaken
Definition: builtin.c:1356
Definition: send.c:48
struct smbios_header hdr
Definition: builtin.c:1508
BYTE vendor
Definition: builtin.c:1518
BYTE version
Definition: builtin.c:1519
BYTE size
Definition: builtin.c:1522
WORD start
Definition: builtin.c:1520
UINT64 characteristics
Definition: builtin.c:1523
BYTE date
Definition: builtin.c:1521
struct smbios_header hdr
Definition: builtin.c:1517
BYTE asset_tag
Definition: builtin.c:1533
struct smbios_header hdr
Definition: builtin.c:1528
BYTE major_version
Definition: builtin.c:1485
BYTE minor_version
Definition: builtin.c:1486
BYTE calling_method
Definition: builtin.c:1484
BYTE product
Definition: builtin.c:1540
BYTE version
Definition: builtin.c:1541
struct smbios_header hdr
Definition: builtin.c:1538
Definition: ps.c:97
UINT num_rows
UINT num_rows_allocated
BYTE * data
Definition: cmds.c:130
#define max(a, b)
Definition: svc.c:63
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx testl eax jnz xchgl ecx incl TEMP esp ecx subl ebx pushl ecx ecx edx ecx shrl ecx mm0 mm4 mm0 mm4 mm1 mm5 mm1 mm5 mm2 mm6 mm2 mm6 mm3 mm7 mm3 mm7 paddd mm0 paddd mm4 paddd mm0 paddd mm4 paddd mm0 paddd mm4 movq mm1 movq mm5 psrlq mm1 psrlq mm5 paddd mm0 paddd mm4 psrad mm0 psrad mm4 packssdw mm0 packssdw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz popl ecx andl ecx jecxz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 psrlq mm1 paddd mm0 psrad mm0 packssdw mm0 movd eax movw ax
Definition: synth_sse3d.h:180
#define LIST_INIT(head)
Definition: queue.h:197
#define TH32CS_SNAPPROCESS
Definition: tlhelp32.h:26
#define towupper(c)
Definition: wctype.h:99
float FLOAT
Definition: typedefs.h:69
int64_t LONGLONG
Definition: typedefs.h:68
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
PBYTE vidmem
Definition: vgavideo.c:18
static rfbScreenInfoPtr server
Definition: vnc.c:74
@ CIM_REFERENCE
Definition: wbemcli.idl:253
@ CIM_UINT32
Definition: wbemcli.idl:249
@ CIM_UINT8
Definition: wbemcli.idl:247
@ CIM_BOOLEAN
Definition: wbemcli.idl:244
@ CIM_UINT16
Definition: wbemcli.idl:248
@ CIM_DATETIME
Definition: wbemcli.idl:252
@ CIM_REAL32
Definition: wbemcli.idl:241
@ CIM_UINT64
Definition: wbemcli.idl:251
@ CIM_SINT16
Definition: wbemcli.idl:239
@ CIM_STRING
Definition: wbemcli.idl:243
@ CIM_SINT32
Definition: wbemcli.idl:240
@ CIM_FLAG_ARRAY
Definition: wbemcli.idl:255
static const WCHAR method_enumvaluesW[]
static const WCHAR param_valuenameW[]
#define COL_FLAG_DYNAMIC
static const WCHAR class_serviceW[]
HRESULT() class_method(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **)
static const WCHAR param_userW[]
static WCHAR * heap_strdupAW(const char *src)
static const WCHAR method_getownerW[]
static const WCHAR method_pauseserviceW[]
static const WCHAR method_enumkeyW[]
static const WCHAR param_namesW[]
static const WCHAR method_setsdW[]
#define COL_FLAG_KEY
static const WCHAR method_startserviceW[]
static const WCHAR class_stdregprovW[]
static const WCHAR param_typesW[]
static const WCHAR method_createkeyW[]
static const WCHAR method_resumeserviceW[]
static const WCHAR param_valueW[]
static const WCHAR class_processW[]
static const WCHAR method_getstringvalueW[]
static const WCHAR param_returnvalueW[]
static const WCHAR param_sdW[]
static const WCHAR class_systemsecurityW[]
static const WCHAR param_domainW[]
fill_status
@ FILL_STATUS_UNFILTERED
@ FILL_STATUS_FAILED
@ FILL_STATUS_FILTERED
static const WCHAR prop_nameW[]
static const WCHAR method_getsdW[]
#define COL_FLAG_METHOD
static const WCHAR param_defkeyW[]
static const WCHAR method_stopserviceW[]
static const WCHAR param_subkeynameW[]
int ret
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2790
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
DWORD WINAPI GetLogicalDrives(void)
Definition: disk.c:110
#define TIME_ZONE_ID_INVALID
Definition: winbase.h:286
#define DRIVE_FIXED
Definition: winbase.h:252
#define DRIVE_REMOVABLE
Definition: winbase.h:251
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:243
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define VERTRES
Definition: wingdi.h:717
#define LOGPIXELSX
Definition: wingdi.h:718
#define BITSPIXEL
Definition: wingdi.h:720
UINT WINAPI GetACP(void)
Definition: nls.c:2307
#define LOCALE_ICOUNTRY
Definition: winnls.h:30
#define LOCALE_ILANGUAGE
Definition: winnls.h:25
#define AF_UNSPEC
Definition: winsock.h:344
#define PRINTER_ENUM_LOCAL
Definition: winspool.h:896
WINBOOL WINAPI EnumPrintersW(DWORD Flags, LPWSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
#define SERVICE_STOPPED
Definition: winsvc.h:21
#define SERVICE_STATE_ALL
Definition: winsvc.h:52
#define SERVICE_ACCEPT_STOP
Definition: winsvc.h:28
#define SC_MANAGER_ENUMERATE_SERVICE
Definition: winsvc.h:16
#define SERVICE_STOP_PENDING
Definition: winsvc.h:23
#define SERVICE_START_PENDING
Definition: winsvc.h:22
#define SERVICE_RUNNING
Definition: winsvc.h:24
#define SERVICE_ACCEPT_PAUSE_CONTINUE
Definition: winsvc.h:29
@ SC_ENUM_PROCESS_INFO
Definition: winsvc.h:122
#define SERVICE_QUERY_CONFIG
Definition: winsvc.h:53
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define NI_NAMEREQD
Definition: ws2def.h:355
#define NI_MAXHOST
Definition: ws2def.h:359
#define INET_ADDRSTRLEN
Definition: ws2ipdef.h:131
#define SERVICE_TYPE_ALL
Definition: cmtypes.h:969
#define SERVICE_DEMAND_START
Definition: cmtypes.h:978
#define SERVICE_KERNEL_DRIVER
Definition: cmtypes.h:953
#define SERVICE_WIN32_SHARE_PROCESS
Definition: cmtypes.h:963
#define SERVICE_DISABLED
Definition: cmtypes.h:979
#define SERVICE_AUTO_START
Definition: cmtypes.h:977
#define SERVICE_BOOT_START
Definition: cmtypes.h:975
#define SERVICE_WIN32_OWN_PROCESS
Definition: cmtypes.h:962
#define SERVICE_SYSTEM_START
Definition: cmtypes.h:976
#define SERVICE_FILE_SYSTEM_DRIVER
Definition: cmtypes.h:954
@ RelationProcessorCore
Definition: ketypes.h:82
@ RelationProcessorPackage
Definition: ketypes.h:85
@ RelationAll
Definition: ketypes.h:87
#define LTP_PC_SMT
Definition: ketypes.h:23
#define VER_NT_WORKSTATION
static unsigned int block
Definition: xmlmemory.c:101
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193