ReactOS  0.4.13-dev-100-gc8611ae
builtin.c File Reference
#include "config.h"
#include <stdarg.h>
#include <fcntl.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "winsock2.h"
#include "ws2tcpip.h"
#include "initguid.h"
#include "wbemcli.h"
#include "wbemprov.h"
#include "iphlpapi.h"
#include "netioapi.h"
#include "tlhelp32.h"
#include "d3d10.h"
#include "winternl.h"
#include "winioctl.h"
#include "winsvc.h"
#include "winver.h"
#include "sddl.h"
#include "ntsecapi.h"
#include "winspool.h"
#include "setupapi.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
#include "pshpack1.h"
#include "poppack.h"
Include dependency graph for builtin.c:

Go to the source code of this file.

Classes

struct  record_baseboard
 
struct  record_bios
 
struct  record_cdromdrive
 
struct  record_computersystem
 
struct  record_computersystemproduct
 
struct  record_datafile
 
struct  record_desktopmonitor
 
struct  record_directory
 
struct  record_diskdrive
 
struct  record_diskpartition
 
struct  record_ip4routetable
 
struct  record_logicaldisk
 
struct  record_networkadapter
 
struct  record_networkadapterconfig
 
struct  record_operatingsystem
 
struct  record_param
 
struct  record_physicalmedia
 
struct  record_physicalmemory
 
struct  record_pnpentity
 
struct  record_printer
 
struct  record_process
 
struct  record_processor
 
struct  record_qualifier
 
struct  record_service
 
struct  record_sid
 
struct  record_sounddevice
 
struct  record_stdregprov
 
struct  record_systemsecurity
 
struct  record_systemenclosure
 
struct  record_videocontroller
 
struct  dirstack
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 
#define WIN32_NO_STATUS
 
#define USE_WS_PREFIX
 
#define FLAVOR_ID
 
#define HW_VENDOR_AMD   0x1002
 
#define HW_VENDOR_NVIDIA   0x10de
 
#define HW_VENDOR_VMWARE   0x15ad
 
#define HW_VENDOR_INTEL   0x8086
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wbemprox)
 
static BOOL match_row (const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
 
static BOOL resize_table (struct table *table, UINT row_count, UINT row_size)
 
static enum fill_status fill_cdromdrive (struct table *table, const struct expr *cond)
 
static UINT get_processor_count (void)
 
static UINT get_logical_processor_count (UINT *num_cores)
 
static UINT64 get_total_physical_memory (void)
 
static UINT64 get_available_physical_memory (void)
 
static WCHARget_computername (void)
 
static WCHARget_username (void)
 
static enum fill_status fill_compsys (struct table *table, const struct expr *cond)
 
static WCHARget_compsysproduct_uuid (void)
 
static enum fill_status fill_compsysproduct (struct table *table, const struct expr *cond)
 
static struct dirstackalloc_dirstack (UINT size)
 
static void clear_dirstack (struct dirstack *dirstack)
 
static void free_dirstack (struct dirstack *dirstack)
 
static BOOL push_dir (struct dirstack *dirstack, WCHAR *dir, UINT len)
 
static WCHARpop_dir (struct dirstack *dirstack, UINT *len)
 
static const WCHARpeek_dir (struct dirstack *dirstack)
 
static WCHARbuild_glob (WCHAR drive, const WCHAR *path, UINT len)
 
static WCHARbuild_name (WCHAR drive, const WCHAR *path)
 
static WCHARbuild_dirname (const WCHAR *path, UINT *ret_len)
 
static BOOL seen_dir (struct dirstack *dirstack, const WCHAR *path)
 
static UINT seed_dirs (struct dirstack *dirstack, const struct expr *cond, WCHAR root, UINT *count)
 
static WCHARappend_path (const WCHAR *path, const WCHAR *segment, UINT *len)
 
static WCHARget_file_version (const WCHAR *filename)
 
static enum fill_status fill_datafile (struct table *table, const struct expr *cond)
 
static UINT32 get_pixelsperxlogicalinch (void)
 
static enum fill_status fill_desktopmonitor (struct table *table, const struct expr *cond)
 
static enum fill_status fill_directory (struct table *table, const struct expr *cond)
 
static UINT64 get_freespace (const WCHAR *dir, UINT64 *disksize)
 
static enum fill_status fill_diskdrive (struct table *table, const struct expr *cond)
 
static WCHARget_filesystem (const WCHAR *root)
 
static enum fill_status fill_diskpartition (struct table *table, const struct expr *cond)
 
static WCHARget_ip4_string (DWORD addr)
 
static enum fill_status fill_ip4routetable (struct table *table, const struct expr *cond)
 
static WCHARget_volumename (const WCHAR *root)
 
static WCHARget_volumeserialnumber (const WCHAR *root)
 
static enum fill_status fill_logicaldisk (struct table *table, const struct expr *cond)
 
static UINT16 get_connection_status (IF_OPER_STATUS status)
 
static WCHARget_mac_address (const BYTE *addr, DWORD len)
 
static const WCHARget_adaptertype (DWORD type, int *physical)
 
static enum fill_status fill_networkadapter (struct table *table, const struct expr *cond)
 
static WCHARget_dnshostname (IP_ADAPTER_UNICAST_ADDRESS *addr)
 
static struct arrayget_defaultipgateway (IP_ADAPTER_GATEWAY_ADDRESS *list)
 
static struct arrayget_dnsserversearchorder (IP_ADAPTER_DNS_SERVER_ADDRESS *list)
 
static struct arrayget_ipaddress (IP_ADAPTER_UNICAST_ADDRESS_LH *list)
 
static struct arrayget_ipsubnet (IP_ADAPTER_UNICAST_ADDRESS_LH *list)
 
static WCHARget_settingid (UINT32 index)
 
static enum fill_status fill_networkadapterconfig (struct table *table, const struct expr *cond)
 
static enum fill_status fill_physicalmemory (struct table *table, const struct expr *cond)
 
static enum fill_status fill_pnpentity (struct table *table, const struct expr *cond)
 
static enum fill_status fill_printer (struct table *table, const struct expr *cond)
 
static WCHARget_cmdline (DWORD process_id)
 
static enum fill_status fill_process (struct table *table, const struct expr *cond)
 
static void do_cpuid (unsigned int ax, unsigned int *p)
 
static const WCHARget_osarchitecture (void)
 
static void get_processor_caption (WCHAR *caption)
 
static void get_processor_version (WCHAR *version)
 
static UINT16 get_processor_revision (void)
 
static void get_processor_id (WCHAR *processor_id)
 
static void regs_to_str (unsigned int *regs, unsigned int len, WCHAR *buffer)
 
static void get_processor_manufacturer (WCHAR *manufacturer)
 
static void get_processor_name (WCHAR *name)
 
static UINT get_processor_currentclockspeed (UINT index)
 
static UINT get_processor_maxclockspeed (UINT index)
 
static enum fill_status fill_processor (struct table *table, const struct expr *cond)
 
static WCHARget_lastbootuptime (void)
 
static WCHARget_localdatetime (void)
 
static WCHARget_systemdirectory (void)
 
static WCHARget_codeset (void)
 
static WCHARget_countrycode (void)
 
static WCHARget_locale (void)
 
static WCHARget_osbuildnumber (OSVERSIONINFOEXW *ver)
 
static WCHARget_oscaption (OSVERSIONINFOEXW *ver)
 
static WCHARget_osname (const WCHAR *caption)
 
static WCHARget_osversion (OSVERSIONINFOEXW *ver)
 
static enum fill_status fill_os (struct table *table, const struct expr *cond)
 
static const WCHARget_service_type (DWORD type)
 
static const WCHARget_service_state (DWORD state)
 
static const WCHARget_service_startmode (DWORD mode)
 
static QUERY_SERVICE_CONFIGWquery_service_config (SC_HANDLE manager, const WCHAR *name)
 
static enum fill_status fill_service (struct table *table, const struct expr *cond)
 
static WCHARget_accountname (LSA_TRANSLATED_NAME *name)
 
static struct arrayget_binaryrepresentation (PSID sid, UINT len)
 
static WCHARget_referenceddomainname (LSA_REFERENCED_DOMAIN_LIST *domain)
 
static const WCHARfind_sid_str (const struct expr *cond)
 
static enum fill_status fill_sid (struct table *table, const struct expr *cond)
 
static UINT32 get_bits_per_pixel (UINT *hres, UINT *vres)
 
static WCHARget_pnpdeviceid (DXGI_ADAPTER_DESC *desc)
 
static const WCHARget_installeddriver (UINT vendorid)
 
static enum fill_status fill_videocontroller (struct table *table, const struct expr *cond)
 
void init_table_list (void)
 

Variables

static const WCHAR class_baseboardW []
 
static const WCHAR class_biosW []
 
static const WCHAR class_cdromdriveW []
 
static const WCHAR class_compsysW []
 
static const WCHAR class_compsysproductW []
 
static const WCHAR class_datafileW []
 
static const WCHAR class_desktopmonitorW []
 
static const WCHAR class_directoryW []
 
static const WCHAR class_diskdriveW []
 
static const WCHAR class_diskpartitionW []
 
static const WCHAR class_ip4routetableW []
 
static const WCHAR class_logicaldiskW []
 
static const WCHAR class_logicaldisk2W []
 
static const WCHAR class_networkadapterW []
 
static const WCHAR class_networkadapterconfigW []
 
static const WCHAR class_osW []
 
static const WCHAR class_paramsW []
 
static const WCHAR class_physicalmediaW []
 
static const WCHAR class_physicalmemoryW []
 
static const WCHAR class_pnpentityW []
 
static const WCHAR class_printerW []
 
static const WCHAR class_process_getowner_outW []
 
static const WCHAR class_processorW []
 
static const WCHAR class_processor2W []
 
static const WCHAR class_qualifiersW []
 
static const WCHAR class_sidW []
 
static const WCHAR class_sounddeviceW []
 
static const WCHAR class_systemenclosureW []
 
static const WCHAR class_videocontrollerW []
 
static const WCHAR prop_accountnameW []
 
static const WCHAR prop_acceptpauseW []
 
static const WCHAR prop_acceptstopW []
 
static const WCHAR prop_accessmaskW []
 
static const WCHAR prop_adapterdactypeW []
 
static const WCHAR prop_adapterramW []
 
static const WCHAR prop_adaptertypeW []
 
static const WCHAR prop_addresswidthW []
 
static const WCHAR prop_architectureW []
 
static const WCHAR prop_attributesW []
 
static const WCHAR prop_availabilityW []
 
static const WCHAR prop_binaryrepresentationW []
 
static const WCHAR prop_bootableW []
 
static const WCHAR prop_bootpartitionW []
 
static const WCHAR prop_buildnumberW []
 
static const WCHAR prop_capacityW []
 
static const WCHAR prop_captionW []
 
static const WCHAR prop_chassistypesW []
 
static const WCHAR prop_classW []
 
static const WCHAR prop_codesetW []
 
static const WCHAR prop_commandlineW []
 
static const WCHAR prop_configmanagererrorcodeW []
 
static const WCHAR prop_countrycodeW []
 
static const WCHAR prop_cpustatusW []
 
static const WCHAR prop_csdversionW []
 
static const WCHAR prop_currentbitsperpixelW []
 
static const WCHAR prop_currentclockspeedW []
 
static const WCHAR prop_currenthorizontalresW []
 
static const WCHAR prop_currentrefreshrateW []
 
static const WCHAR prop_currentscanmodeW []
 
static const WCHAR prop_currentverticalresW []
 
static const WCHAR prop_datawidthW []
 
static const WCHAR prop_defaultipgatewayW []
 
static const WCHAR prop_defaultvalueW []
 
static const WCHAR prop_descriptionW []
 
static const WCHAR prop_destinationW []
 
static const WCHAR prop_deviceidW []
 
static const WCHAR prop_dhcpenabledW []
 
static const WCHAR prop_directionW []
 
static const WCHAR prop_displaynameW []
 
static const WCHAR prop_diskindexW []
 
static const WCHAR prop_dnshostnameW []
 
static const WCHAR prop_dnsserversearchorderW []
 
static const WCHAR prop_domainW []
 
static const WCHAR prop_domainroleW []
 
static const WCHAR prop_driveW []
 
static const WCHAR prop_driverdateW []
 
static const WCHAR prop_drivernameW []
 
static const WCHAR prop_driverversionW []
 
static const WCHAR prop_drivetypeW []
 
static const WCHAR prop_familyW []
 
static const WCHAR prop_filesystemW []
 
static const WCHAR prop_flavorW []
 
static const WCHAR prop_freespaceW []
 
static const WCHAR prop_freephysicalmemoryW []
 
static const WCHAR prop_handleW []
 
static const WCHAR prop_horizontalresolutionW []
 
static const WCHAR prop_idW []
 
static const WCHAR prop_identificationcodeW []
 
static const WCHAR prop_identifyingnumberW []
 
static const WCHAR prop_indexW []
 
static const WCHAR prop_installdateW []
 
static const WCHAR prop_installeddisplaydriversW []
 
static const WCHAR prop_interfaceindexW []
 
static const WCHAR prop_interfacetypeW []
 
static const WCHAR prop_intvalueW []
 
static const WCHAR prop_ipaddressW []
 
static const WCHAR prop_ipconnectionmetricW []
 
static const WCHAR prop_ipenabledW []
 
static const WCHAR prop_ipsubnet []
 
static const WCHAR prop_lastbootuptimeW []
 
static const WCHAR prop_levelW []
 
static const WCHAR prop_localW []
 
static const WCHAR prop_localdatetimeW []
 
static const WCHAR prop_localeW []
 
static const WCHAR prop_locationW []
 
static const WCHAR prop_lockpresentW []
 
static const WCHAR prop_macaddressW []
 
static const WCHAR prop_manufacturerW []
 
static const WCHAR prop_maxclockspeedW []
 
static const WCHAR prop_mediatypeW []
 
static const WCHAR prop_memberW []
 
static const WCHAR prop_memorytypeW []
 
static const WCHAR prop_methodW []
 
static const WCHAR prop_modelW []
 
static const WCHAR prop_netconnectionstatusW []
 
static const WCHAR prop_networkW []
 
static const WCHAR prop_nexthopW []
 
static const WCHAR prop_numcoresW []
 
static const WCHAR prop_numlogicalprocessorsW []
 
static const WCHAR prop_numprocessorsW []
 
static const WCHAR prop_osarchitectureW []
 
static const WCHAR prop_oslanguageW []
 
static const WCHAR prop_osproductsuiteW []
 
static const WCHAR prop_ostypeW []
 
static const WCHAR prop_parameterW []
 
static const WCHAR prop_physicaladapterW []
 
static const WCHAR prop_pixelsperxlogicalinchW []
 
static const WCHAR prop_pnpdeviceidW []
 
static const WCHAR prop_portnameW []
 
static const WCHAR prop_pprocessidW []
 
static const WCHAR prop_primaryW []
 
static const WCHAR prop_processidW []
 
static const WCHAR prop_processoridW []
 
static const WCHAR prop_processortypeW []
 
static const WCHAR prop_productW []
 
static const WCHAR prop_productnameW []
 
static const WCHAR prop_referenceddomainnameW []
 
static const WCHAR prop_releasedateW []
 
static const WCHAR prop_revisionW []
 
static const WCHAR prop_serialnumberW []
 
static const WCHAR prop_servicepackmajorW []
 
static const WCHAR prop_servicepackminorW []
 
static const WCHAR prop_servicetypeW []
 
static const WCHAR prop_settingidW []
 
static const WCHAR prop_skunumberW []
 
static const WCHAR prop_smbiosbiosversionW []
 
static const WCHAR prop_smbiosmajorversionW []
 
static const WCHAR prop_smbiosminorversionW []
 
static const WCHAR prop_startmodeW []
 
static const WCHAR prop_sidW []
 
static const WCHAR prop_sidlengthW []
 
static const WCHAR prop_sizeW []
 
static const WCHAR prop_speedW []
 
static const WCHAR prop_startingoffsetW []
 
static const WCHAR prop_stateW []
 
static const WCHAR prop_statusW []
 
static const WCHAR prop_statusinfoW []
 
static const WCHAR prop_strvalueW []
 
static const WCHAR prop_suitemaskW []
 
static const WCHAR prop_systemdirectoryW []
 
static const WCHAR prop_systemnameW []
 
static const WCHAR prop_tagW []
 
static const WCHAR prop_threadcountW []
 
static const WCHAR prop_totalphysicalmemoryW []
 
static const WCHAR prop_totalvirtualmemorysizeW []
 
static const WCHAR prop_totalvisiblememorysizeW []
 
static const WCHAR prop_typeW []
 
static const WCHAR prop_uniqueidW []
 
static const WCHAR prop_usernameW []
 
static const WCHAR prop_uuidW []
 
static const WCHAR prop_varianttypeW []
 
static const WCHAR prop_vendorW []
 
static const WCHAR prop_versionW []
 
static const WCHAR prop_videoarchitectureW []
 
static const WCHAR prop_videomemorytypeW []
 
static const WCHAR prop_videomodedescriptionW []
 
static const WCHAR prop_videoprocessorW []
 
static const WCHAR prop_volumenameW []
 
static const WCHAR prop_volumeserialnumberW []
 
static const WCHAR prop_workingsetsizeW []
 
static const struct column col_baseboard []
 
static const struct column col_bios []
 
static const struct column col_cdromdrive []
 
static const struct column col_compsys []
 
static const struct column col_compsysproduct []
 
static const struct column col_datafile []
 
static const struct column col_desktopmonitor []
 
static const struct column col_directory []
 
static const struct column col_diskdrive []
 
static const struct column col_diskpartition []
 
static const struct column col_ip4routetable []
 
static const struct column col_logicaldisk []
 
static const struct column col_networkadapter []
 
static const struct column col_networkadapterconfig []
 
static const struct column col_os []
 
static const struct column col_param []
 
static const struct column col_physicalmedia []
 
static const struct column col_physicalmemory []
 
static const struct column col_pnpentity []
 
static const struct column col_printer []
 
static const struct column col_process []
 
static const struct column col_processor []
 
static const struct column col_qualifier []
 
static const struct column col_service []
 
static const struct column col_sid []
 
static const struct column col_sounddevice []
 
static const struct column col_stdregprov []
 
static const struct column col_systemenclosure []
 
static const struct column col_systemsecurity []
 
static const struct column col_videocontroller []
 
static const WCHAR baseboard_manufacturerW []
 
static const WCHAR baseboard_serialnumberW []
 
static const WCHAR baseboard_tagW []
 
static const WCHAR baseboard_versionW []
 
static const WCHAR bios_descriptionW []
 
static const WCHAR bios_manufacturerW []
 
static const WCHAR bios_nameW []
 
static const WCHAR bios_releasedateW []
 
static const WCHAR bios_serialnumberW []
 
static const WCHAR bios_smbiosbiosversionW []
 
static const WCHAR bios_versionW []
 
static const WCHAR cdromdrive_mediatypeW []
 
static const WCHAR cdromdrive_nameW []
 
static const WCHAR cdromdrive_pnpdeviceidW []
 
static const WCHAR compsys_descriptionW []
 
static const WCHAR compsys_domainW []
 
static const WCHAR compsys_manufacturerW []
 
static const WCHAR compsys_modelW []
 
static const WCHAR compsysproduct_identifyingnumberW []
 
static const WCHAR compsysproduct_nameW []
 
static const WCHAR compsysproduct_uuidW []
 
static const WCHAR compsysproduct_vendorW []
 
static const WCHAR compsysproduct_versionW []
 
static const WCHAR diskdrive_interfacetypeW []
 
static const WCHAR diskdrive_manufacturerW []
 
static const WCHAR diskdrive_mediatype_fixedW []
 
static const WCHAR diskdrive_mediatype_removableW []
 
static const WCHAR diskdrive_modelW []
 
static const WCHAR diskdrive_pnpdeviceidW []
 
static const WCHAR diskdrive_serialW []
 
static const WCHAR networkadapter_pnpdeviceidW []
 
static const WCHAR os_32bitW []
 
static const WCHAR os_64bitW []
 
static const WCHAR os_installdateW []
 
static const WCHAR os_serialnumberW []
 
static const WCHAR physicalmedia_tagW []
 
static const WCHAR sounddevice_productnameW []
 
static const WCHAR systemenclosure_systemenclosureW []
 
static const WCHAR systemenclosure_tagW []
 
static const WCHAR systemenclosure_manufacturerW []
 
static const WCHAR videocontroller_dactypeW []
 
static const WCHAR videocontroller_deviceidW []
 
static const WCHAR videocontroller_driverdateW []
 
static const WCHAR videocontroller_driverversionW []
 
static const WCHAR videocontroller_statusW []
 
static const struct record_baseboard data_baseboard []
 
static const struct record_bios data_bios []
 
static const struct record_param data_param []
 
static const struct record_physicalmedia data_physicalmedia []
 
static const struct record_qualifier data_qualifier []
 
static const struct record_sounddevice data_sounddevice []
 
static const struct record_stdregprov data_stdregprov []
 
static UINT16 systemenclosure_chassistypes []
 
static const struct array systemenclosure_chassistypes_array
 
static const struct record_systemenclosure data_systemenclosure []
 
static const struct record_systemsecurity data_systemsecurity []
 
static struct table builtin_classes []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file builtin.c.

◆ FLAVOR_ID

◆ HW_VENDOR_AMD

#define HW_VENDOR_AMD   0x1002

Definition at line 3472 of file builtin.c.

◆ HW_VENDOR_INTEL

#define HW_VENDOR_INTEL   0x8086

Definition at line 3475 of file builtin.c.

◆ HW_VENDOR_NVIDIA

#define HW_VENDOR_NVIDIA   0x10de

Definition at line 3473 of file builtin.c.

◆ HW_VENDOR_VMWARE

#define HW_VENDOR_VMWARE   0x15ad

Definition at line 3474 of file builtin.c.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 21 of file builtin.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 20 of file builtin.c.

◆ USE_WS_PREFIX

#define USE_WS_PREFIX

Definition at line 45 of file builtin.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 34 of file builtin.c.

Function Documentation

◆ alloc_dirstack()

static struct dirstack* alloc_dirstack ( UINT  size)
static

Definition at line 1573 of file builtin.c.

1574 {
1575  struct dirstack *dirstack;
1576 
1577  if (!(dirstack = heap_alloc( sizeof(*dirstack) ))) return NULL;
1578  if (!(dirstack->dirs = heap_alloc( sizeof(WCHAR *) * size )))
1579  {
1580  heap_free( dirstack );
1581  return NULL;
1582  }
1583  if (!(dirstack->len_dirs = heap_alloc( sizeof(UINT) * size )))
1584  {
1585  heap_free( dirstack->dirs );
1586  heap_free( dirstack );
1587  return NULL;
1588  }
1589  dirstack->num_dirs = 0;
1591  return dirstack;
1592 }
UINT num_allocated
Definition: builtin.c:1570
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
WCHAR ** dirs
Definition: builtin.c:1567
UINT * len_dirs
Definition: builtin.c:1568
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT num_dirs
Definition: builtin.c:1569
unsigned int UINT
Definition: ndis.h:50
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by fill_datafile(), and fill_directory().

◆ append_path()

static WCHAR* append_path ( const WCHAR path,
const WCHAR segment,
UINT len 
)
static

Definition at line 1787 of file builtin.c.

1788 {
1789  UINT len_path = 0, len_segment = strlenW( segment );
1790  WCHAR *ret;
1791 
1792  *len = 0;
1793  if (path) len_path = strlenW( path );
1794  if (!(ret = heap_alloc( (len_path + len_segment + 2) * sizeof(WCHAR) ))) return NULL;
1795  if (path && len_path)
1796  {
1797  memcpy( ret, path, len_path * sizeof(WCHAR) );
1798  ret[len_path] = '\\';
1799  *len += len_path + 1;
1800  }
1801  memcpy( ret + *len, segment, len_segment * sizeof(WCHAR) );
1802  *len += len_segment;
1803  ret[*len] = 0;
1804  return ret;
1805 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50

Referenced by fill_datafile(), and fill_directory().

◆ build_dirname()

static WCHAR* build_dirname ( const WCHAR path,
UINT ret_len 
)
static

Definition at line 1700 of file builtin.c.

1701 {
1702  const WCHAR *p = path, *start;
1703  UINT len, i;
1704  WCHAR *ret;
1705 
1706  if (!isalphaW( p[0] ) || p[1] != ':' || p[2] != '\\' || p[3] != '\\' || !p[4]) return NULL;
1707  start = path + 4;
1708  len = strlenW( start );
1709  p = start + len - 1;
1710  if (*p == '\\') return NULL;
1711 
1712  while (p >= start && *p != '\\') { len--; p--; };
1713  while (p >= start && *p == '\\') { len--; p--; };
1714 
1715  if (!(ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
1716  for (i = 0, p = start; p < start + len; p++)
1717  {
1718  if (p[0] == '\\' && p[1] == '\\')
1719  {
1720  ret[i++] = '\\';
1721  p++;
1722  }
1723  else ret[i++] = *p;
1724  }
1725  ret[i] = 0;
1726  *ret_len = i;
1727  return ret;
1728 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLsizei const GLchar ** path
Definition: glext.h:7234
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:79
int ret
GLenum GLsizei len
Definition: glext.h:6722
GLuint start
Definition: gl.h:1545
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50
WINE_UNICODE_INLINE int isalphaW(WCHAR wc)
Definition: unicode.h:195
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by seed_dirs().

◆ build_glob()

static WCHAR* build_glob ( WCHAR  drive,
const WCHAR path,
UINT  len 
)
static

Definition at line 1651 of file builtin.c.

1652 {
1653  UINT i = 0;
1654  WCHAR *ret;
1655 
1656  if (!(ret = heap_alloc( (len + 6) * sizeof(WCHAR) ))) return NULL;
1657  ret[i++] = drive;
1658  ret[i++] = ':';
1659  ret[i++] = '\\';
1660  if (path && len)
1661  {
1662  memcpy( ret + i, path, len * sizeof(WCHAR) );
1663  i += len;
1664  ret[i++] = '\\';
1665  }
1666  ret[i++] = '*';
1667  ret[i] = 0;
1668  return ret;
1669 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static char drive[2]
Definition: batch.c:28
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50

Referenced by fill_datafile(), and fill_directory().

◆ build_name()

static WCHAR* build_name ( WCHAR  drive,
const WCHAR path 
)
static

Definition at line 1671 of file builtin.c.

1672 {
1673  UINT i = 0, len = 0;
1674  const WCHAR *p;
1675  WCHAR *ret;
1676 
1677  for (p = path; *p; p++)
1678  {
1679  if (*p == '\\') len += 2;
1680  else len++;
1681  };
1682  if (!(ret = heap_alloc( (len + 5) * sizeof(WCHAR) ))) return NULL;
1683  ret[i++] = drive;
1684  ret[i++] = ':';
1685  ret[i++] = '\\';
1686  ret[i++] = '\\';
1687  for (p = path; *p; p++)
1688  {
1689  if (*p != '\\') ret[i++] = *p;
1690  else
1691  {
1692  ret[i++] = '\\';
1693  ret[i++] = '\\';
1694  }
1695  }
1696  ret[i] = 0;
1697  return ret;
1698 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
static char drive[2]
Definition: batch.c:28
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by fill_datafile(), and fill_directory().

◆ clear_dirstack()

static void clear_dirstack ( struct dirstack dirstack)
static

Definition at line 1594 of file builtin.c.

1595 {
1596  UINT i;
1597  for (i = 0; i < dirstack->num_dirs; i++) heap_free( dirstack->dirs[i] );
1598  dirstack->num_dirs = 0;
1599 }
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
WCHAR ** dirs
Definition: builtin.c:1567
UINT num_dirs
Definition: builtin.c:1569
unsigned int UINT
Definition: ndis.h:50
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by fill_datafile(), fill_directory(), and free_dirstack().

◆ do_cpuid()

static void do_cpuid ( unsigned int  ax,
unsigned int p 
)
inlinestatic

Definition at line 2819 of file builtin.c.

2820 {
2821 #ifdef __i386__
2822 #ifdef _MSC_VER
2823  __cpuid(p, ax);
2824 #else
2825  __asm__("pushl %%ebx\n\t"
2826  "cpuid\n\t"
2827  "movl %%ebx, %%esi\n\t"
2828  "popl %%ebx"
2829  : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3])
2830  : "0" (ax));
2831 #endif
2832 #endif
2833 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
ecx edi ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx eax jnz xchgl ecx incl TEMP esp ecx subl ebx pushl ecx ecx edx ecx 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 mm1 mm5 paddd mm0 paddd mm4 mm0 mm4 packssdw mm0 packssdw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz popl ecx ecx jecxz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 mm1 paddd mm0 mm0 packssdw mm0 movd eax movw ax
Definition: synth_sse3d.h:171
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
Definition: intrin_ppc.h:682
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by get_processor_caption(), get_processor_id(), get_processor_manufacturer(), get_processor_name(), get_processor_revision(), and get_processor_version().

◆ fill_cdromdrive()

static enum fill_status fill_cdromdrive ( struct table table,
const struct expr cond 
)
static

Definition at line 1337 of file builtin.c.

1338 {
1339  static const WCHAR fmtW[] = {'%','c',':',0};
1340  WCHAR drive[3], root[] = {'A',':','\\',0};
1341  struct record_cdromdrive *rec;
1342  UINT i, row = 0, offset = 0;
1343  DWORD drives = GetLogicalDrives();
1345 
1346  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1347 
1348  for (i = 0; i < 26; i++)
1349  {
1350  if (drives & (1 << i))
1351  {
1352  root[0] = 'A' + i;
1353  if (GetDriveTypeW( root ) != DRIVE_CDROM)
1354  continue;
1355 
1356  if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1357 
1358  rec = (struct record_cdromdrive *)(table->data + offset);
1360  sprintfW( drive, fmtW, 'A' + i );
1361  rec->drive = heap_strdupW( drive );
1363  rec->name = cdromdrive_nameW;
1365  if (!match_row( table, row, cond, &status ))
1366  {
1368  continue;
1369  }
1370  offset += sizeof(*rec);
1371  row++;
1372  }
1373  }
1374  TRACE("created %u rows\n", row);
1375  table->num_rows = row;
1376  return status;
1377 }
const WCHAR * pnpdevice_id
Definition: builtin.c:913
UINT num_rows
GLintptr offset
Definition: glext.h:5920
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
const WCHAR * mediatype
Definition: builtin.c:911
const WCHAR * drive
Definition: builtin.c:910
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
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
const WCHAR * device_id
Definition: builtin.c:909
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:110
fill_status
BYTE * data
#define sprintfW
Definition: unicode.h:58
#define DRIVE_CDROM
Definition: winbase.h:251
unsigned int UINT
Definition: ndis.h:50
static const WCHAR cdromdrive_nameW[]
Definition: builtin.c:808
static const WCHAR cdromdrive_mediatypeW[]
Definition: builtin.c:806
const WCHAR * name
Definition: builtin.c:912
static const WCHAR cdromdrive_pnpdeviceidW[]
Definition: builtin.c:810
static SERVICE_STATUS status
Definition: service.c:31
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
Definition: ps.c:97

◆ fill_compsys()

static enum fill_status fill_compsys ( struct table table,
const struct expr cond 
)
static

Definition at line 1467 of file builtin.c.

1468 {
1469  struct record_computersystem *rec;
1471  UINT row = 0;
1472 
1473  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1474 
1475  rec = (struct record_computersystem *)table->data;
1477  rec->domain = compsys_domainW;
1478  rec->domainrole = 0; /* standalone workstation */
1480  rec->model = compsys_modelW;
1481  rec->name = get_computername();
1485  rec->username = get_username();
1486  if (!match_row( table, row, cond, &status )) free_row_values( table, row );
1487  else row++;
1488 
1489  TRACE("created %u rows\n", row);
1490  table->num_rows = row;
1491  return status;
1492 }
static UINT get_logical_processor_count(UINT *num_cores)
Definition: builtin.c:1387
static UINT64 get_total_physical_memory(void)
Definition: builtin.c:1421
const WCHAR * description
Definition: builtin.c:917
static WCHAR * get_username(void)
Definition: builtin.c:1449
const WCHAR * model
Definition: builtin.c:921
UINT num_rows
static const WCHAR compsys_modelW[]
Definition: builtin.c:821
static const WCHAR compsys_domainW[]
Definition: builtin.c:817
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
UINT64 total_physical_memory
Definition: builtin.c:925
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR compsys_descriptionW[]
Definition: builtin.c:815
#define TRACE(s)
Definition: solgame.cpp:4
const WCHAR * manufacturer
Definition: builtin.c:920
const WCHAR * username
Definition: builtin.c:926
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
const WCHAR * name
Definition: builtin.c:922
fill_status
BYTE * data
unsigned int UINT
Definition: ndis.h:50
UINT32 num_logical_processors
Definition: builtin.c:923
static WCHAR * get_computername(void)
Definition: builtin.c:1439
const WCHAR * domain
Definition: builtin.c:918
static SERVICE_STATUS status
Definition: service.c:31
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 compsys_manufacturerW[]
Definition: builtin.c:819
Definition: ps.c:97
static UINT get_processor_count(void)
Definition: builtin.c:1379

◆ fill_compsysproduct()

static enum fill_status fill_compsysproduct ( struct table table,
const struct expr cond 
)
static

Definition at line 1542 of file builtin.c.

1543 {
1544  struct record_computersystemproduct *rec;
1546  UINT row = 0;
1547 
1548  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1549 
1550  rec = (struct record_computersystemproduct *)table->data;
1552  rec->name = compsysproduct_nameW;
1553  rec->skunumber = NULL;
1554  rec->uuid = get_compsysproduct_uuid();
1557  if (!match_row( table, row, cond, &status )) free_row_values( table, row );
1558  else row++;
1559 
1560  TRACE("created %u rows\n", row);
1561  table->num_rows = row;
1562  return status;
1563 }
UINT num_rows
static const WCHAR compsysproduct_nameW[]
Definition: builtin.c:825
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
const WCHAR * skunumber
Definition: builtin.c:932
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
static const WCHAR compsysproduct_identifyingnumberW[]
Definition: builtin.c:823
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
const WCHAR * identifyingnumber
Definition: builtin.c:930
static const WCHAR compsysproduct_versionW[]
Definition: builtin.c:832
fill_status
static WCHAR * get_compsysproduct_uuid(void)
Definition: builtin.c:1494
BYTE * data
unsigned int UINT
Definition: ndis.h:50
static const WCHAR compsysproduct_vendorW[]
Definition: builtin.c:830
static SERVICE_STATUS status
Definition: service.c:31
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
Definition: ps.c:97

◆ fill_datafile()

static enum fill_status fill_datafile ( struct table table,
const struct expr cond 
)
static

Definition at line 1834 of file builtin.c.

1835 {
1836  static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0};
1837  struct record_datafile *rec;
1838  UINT i, len, row = 0, offset = 0, num_expected_rows;
1839  WCHAR *glob = NULL, *path = NULL, *new_path, root[] = {'A',':','\\',0};
1840  DWORD drives = GetLogicalDrives();
1842  HANDLE handle;
1843  struct dirstack *dirstack;
1845 
1846  if (!resize_table( table, 8, sizeof(*rec) )) return FILL_STATUS_FAILED;
1847 
1848  dirstack = alloc_dirstack(2);
1849 
1850  for (i = 0; i < 26; i++)
1851  {
1852  if (!(drives & (1 << i))) continue;
1853 
1854  root[0] = 'A' + i;
1855  if (GetDriveTypeW( root ) != DRIVE_FIXED) continue;
1856 
1857  num_expected_rows = 0;
1858  if (!seed_dirs( dirstack, cond, root[0], &num_expected_rows )) clear_dirstack( dirstack );
1859 
1860  for (;;)
1861  {
1862  heap_free( glob );
1863  heap_free( path );
1864  path = pop_dir( dirstack, &len );
1865  if (!(glob = build_glob( root[0], path, len )))
1866  {
1868  goto done;
1869  }
1871  {
1872  do
1873  {
1874  if (!resize_table( table, row + 1, sizeof(*rec) ))
1875  {
1877  FindClose( handle );
1878  goto done;
1879  }
1880  if (!strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) continue;
1881  new_path = append_path( path, data.cFileName, &len );
1882 
1883  if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
1884  {
1885  if (push_dir( dirstack, new_path, len )) continue;
1886  heap_free( new_path );
1887  FindClose( handle );
1889  goto done;
1890  }
1891  rec = (struct record_datafile *)(table->data + offset);
1892  rec->name = build_name( root[0], new_path );
1893  rec->version = get_file_version( rec->name );
1894  if (!match_row( table, row, cond, &status ))
1895  {
1897  continue;
1898  }
1899  else if (num_expected_rows && row == num_expected_rows - 1)
1900  {
1901  row++;
1902  FindClose( handle );
1904  goto done;
1905  }
1906  offset += sizeof(*rec);
1907  row++;
1908  }
1909  while (FindNextFileW( handle, &data ));
1910  FindClose( handle );
1911  }
1912  if (!peek_dir( dirstack )) break;
1913  }
1914  }
1915 
1916 done:
1918  heap_free( glob );
1919  heap_free( path );
1920 
1921  TRACE("created %u rows\n", row);
1922  table->num_rows = row;
1923  return status;
1924 }
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
static void free_dirstack(struct dirstack *dirstack)
Definition: builtin.c:1601
UINT num_rows
static WCHAR * build_name(WCHAR drive, const WCHAR *path)
Definition: builtin.c:1671
GLintptr offset
Definition: glext.h:5920
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
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
smooth NULL
Definition: ftsmooth.c:416
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
const WCHAR * name
Definition: builtin.c:939
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static void clear_dirstack(struct dirstack *dirstack)
Definition: builtin.c:1594
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define DRIVE_FIXED
Definition: winbase.h:249
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:110
static struct dirstack * alloc_dirstack(UINT size)
Definition: builtin.c:1573
fill_status
static WCHAR * pop_dir(struct dirstack *dirstack, UINT *len)
Definition: builtin.c:1633
BYTE * data
Definition: services.c:325
static WCHAR * append_path(const WCHAR *path, const WCHAR *segment, UINT *len)
Definition: builtin.c:1787
char ** glob(const char *v)
Definition: fake.c:36
unsigned int UINT
Definition: ndis.h:50
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static WCHAR * build_glob(WCHAR drive, const WCHAR *path, UINT len)
Definition: builtin.c:1651
static const WCHAR dotdotW[]
Definition: directory.c:81
const WCHAR * version
Definition: builtin.c:940
static UINT seed_dirs(struct dirstack *dirstack, const struct expr *cond, WCHAR root, UINT *count)
Definition: builtin.c:1738
static SERVICE_STATUS status
Definition: service.c:31
static const WCHAR dotW[]
Definition: directory.c:80
static BOOL push_dir(struct dirstack *dirstack, WCHAR *dir, UINT len)
Definition: builtin.c:1609
static WCHAR * get_file_version(const WCHAR *filename)
Definition: builtin.c:1807
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 * peek_dir(struct dirstack *dirstack)
Definition: builtin.c:1645
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
Definition: ps.c:97

◆ fill_desktopmonitor()

static enum fill_status fill_desktopmonitor ( struct table table,
const struct expr cond 
)
static

Definition at line 1937 of file builtin.c.

1938 {
1939  struct record_desktopmonitor *rec;
1941  UINT row = 0;
1942 
1943  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
1944 
1945  rec = (struct record_desktopmonitor *)table->data;
1947 
1948  if (match_row( table, row, cond, &status )) row++;
1949 
1950  TRACE("created %u rows\n", row);
1951  table->num_rows = row;
1952  return status;
1953 }
UINT num_rows
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
#define TRACE(s)
Definition: solgame.cpp:4
static UINT32 get_pixelsperxlogicalinch(void)
Definition: builtin.c:1926
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
fill_status
BYTE * data
unsigned int UINT
Definition: ndis.h:50
UINT32 pixelsperxlogicalinch
Definition: builtin.c:944
static SERVICE_STATUS status
Definition: service.c:31
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
Definition: ps.c:97

◆ fill_directory()

static enum fill_status fill_directory ( struct table table,
const struct expr cond 
)
static

Definition at line 1955 of file builtin.c.

1956 {
1957  static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0};
1958  struct record_directory *rec;
1959  UINT i, len, row = 0, offset = 0, num_expected_rows;
1960  WCHAR *glob = NULL, *path = NULL, *new_path, root[] = {'A',':','\\',0};
1961  DWORD drives = GetLogicalDrives();
1963  HANDLE handle;
1964  struct dirstack *dirstack;
1966 
1967  if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
1968 
1969  dirstack = alloc_dirstack(2);
1970 
1971  for (i = 0; i < 26; i++)
1972  {
1973  if (!(drives & (1 << i))) continue;
1974 
1975  root[0] = 'A' + i;
1976  if (GetDriveTypeW( root ) != DRIVE_FIXED) continue;
1977 
1978  num_expected_rows = 0;
1979  if (!seed_dirs( dirstack, cond, root[0], &num_expected_rows )) clear_dirstack( dirstack );
1980 
1981  for (;;)
1982  {
1983  heap_free( glob );
1984  heap_free( path );
1985  path = pop_dir( dirstack, &len );
1986  if (!(glob = build_glob( root[0], path, len )))
1987  {
1989  goto done;
1990  }
1992  {
1993  do
1994  {
1995  if (!resize_table( table, row + 1, sizeof(*rec) ))
1996  {
1997  FindClose( handle );
1999  goto done;
2000  }
2001  if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
2002  !strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW ))
2003  continue;
2004 
2005  new_path = append_path( path, data.cFileName, &len );
2006  if (!(push_dir( dirstack, new_path, len )))
2007  {
2008  heap_free( new_path );
2009  FindClose( handle );
2011  goto done;
2012  }
2013  rec = (struct record_directory *)(table->data + offset);
2014  rec->accessmask = FILE_ALL_ACCESS;
2015  rec->name = build_name( root[0], new_path );
2016  if (!match_row( table, row, cond, &status ))
2017  {
2019  continue;
2020  }
2021  else if (num_expected_rows && row == num_expected_rows - 1)
2022  {
2023  row++;
2024  FindClose( handle );
2026  goto done;
2027  }
2028  offset += sizeof(*rec);
2029  row++;
2030  }
2031  while (FindNextFileW( handle, &data ));
2032  FindClose( handle );
2033  }
2034  if (!peek_dir( dirstack )) break;
2035  }
2036  }
2037 
2038 done:
2040  heap_free( glob );
2041  heap_free( path );
2042 
2043  TRACE("created %u rows\n", row);
2044  table->num_rows = row;
2045  return status;
2046 }
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
static void free_dirstack(struct dirstack *dirstack)
Definition: builtin.c:1601
UINT num_rows
static WCHAR * build_name(WCHAR drive, const WCHAR *path)
Definition: builtin.c:1671
GLintptr offset
Definition: glext.h:5920
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
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
UINT32 accessmask
Definition: builtin.c:948
smooth NULL
Definition: ftsmooth.c:416
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
const WCHAR * name
Definition: builtin.c:949
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static void clear_dirstack(struct dirstack *dirstack)
Definition: builtin.c:1594
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define DRIVE_FIXED
Definition: winbase.h:249
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:110
static struct dirstack * alloc_dirstack(UINT size)
Definition: builtin.c:1573
fill_status
static WCHAR * pop_dir(struct dirstack *dirstack, UINT *len)
Definition: builtin.c:1633
BYTE * data
Definition: services.c:325
static WCHAR * append_path(const WCHAR *path, const WCHAR *segment, UINT *len)
Definition: builtin.c:1787
char ** glob(const char *v)
Definition: fake.c:36
unsigned int UINT
Definition: ndis.h:50
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static WCHAR * build_glob(WCHAR drive, const WCHAR *path, UINT len)
Definition: builtin.c:1651
static const WCHAR dotdotW[]
Definition: directory.c:81
static UINT seed_dirs(struct dirstack *dirstack, const struct expr *cond, WCHAR root, UINT *count)
Definition: builtin.c:1738
static SERVICE_STATUS status
Definition: service.c:31
static const WCHAR dotW[]
Definition: directory.c:80
static BOOL push_dir(struct dirstack *dirstack, WCHAR *dir, UINT len)
Definition: builtin.c:1609
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 * peek_dir(struct dirstack *dirstack)
Definition: builtin.c:1645
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
Definition: ps.c:97

◆ fill_diskdrive()

static enum fill_status fill_diskdrive ( struct table table,
const struct expr cond 
)
static

Definition at line 2070 of file builtin.c.

2071 {
2072  static const WCHAR fmtW[] =
2073  {'\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','%','u',0};
2074  WCHAR device_id[ARRAY_SIZE( fmtW ) + 10], root[] = {'A',':','\\',0};
2075  struct record_diskdrive *rec;
2076  UINT i, row = 0, offset = 0, index = 0, type;
2077  UINT64 size = 1024 * 1024 * 1024;
2078  DWORD drives = GetLogicalDrives();
2080 
2081  if (!resize_table( table, 2, sizeof(*rec) )) return FILL_STATUS_FAILED;
2082 
2083  for (i = 0; i < 26; i++)
2084  {
2085  if (drives & (1 << i))
2086  {
2087  root[0] = 'A' + i;
2088  type = GetDriveTypeW( root );
2089  if (type != DRIVE_FIXED && type != DRIVE_REMOVABLE)
2090  continue;
2091 
2092  if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2093 
2094  rec = (struct record_diskdrive *)(table->data + offset);
2095  sprintfW( device_id, fmtW, index );
2096  rec->device_id = heap_strdupW( device_id );
2097  rec->index = index;
2100  if (type == DRIVE_FIXED)
2102  else
2104  rec->model = diskdrive_modelW;
2107  get_freespace( root, &size );
2108  rec->size = size;
2109  if (!match_row( table, row, cond, &status ))
2110  {
2112  continue;
2113  }
2114  offset += sizeof(*rec);
2115  index++;
2116  row++;
2117  }
2118  }
2119  TRACE("created %u rows\n", row);
2120  table->num_rows = row;
2121  return status;
2122 }
const WCHAR * manufacturer
Definition: builtin.c:956
const WCHAR * mediatype
Definition: builtin.c:957
static UINT64 get_freespace(const WCHAR *dir, UINT64 *disksize)
Definition: builtin.c:2048
UINT num_rows
GLintptr offset
Definition: glext.h:5920
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const WCHAR * device_id
Definition: builtin.c:953
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
#define DRIVE_REMOVABLE
Definition: winbase.h:248
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
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
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
static const WCHAR diskdrive_mediatype_fixedW[]
Definition: builtin.c:838
GLuint index
Definition: glext.h:6031
const WCHAR * pnpdevice_id
Definition: builtin.c:959
static const WCHAR diskdrive_modelW[]
Definition: builtin.c:842
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR diskdrive_pnpdeviceidW[]
Definition: builtin.c:844
const WCHAR * interfacetype
Definition: builtin.c:955
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
static const WCHAR diskdrive_interfacetypeW[]
Definition: builtin.c:834
#define index(s, c)
Definition: various.h:29
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
UINT32 index
Definition: builtin.c:954
#define DRIVE_FIXED
Definition: winbase.h:249
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:110
const WCHAR * serialnumber
Definition: builtin.c:960
fill_status
BYTE * data
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR diskdrive_mediatype_removableW[]
Definition: builtin.c:840
#define sprintfW
Definition: unicode.h:58
unsigned int UINT
Definition: ndis.h:50
static const WCHAR diskdrive_manufacturerW[]
Definition: builtin.c:836
unsigned long long UINT64
const WCHAR * model
Definition: builtin.c:958
static SERVICE_STATUS status
Definition: service.c:31
static const WCHAR diskdrive_serialW[]
Definition: builtin.c:846
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
Definition: ps.c:97

◆ fill_diskpartition()

static enum fill_status fill_diskpartition ( struct table table,
const struct expr cond 
)
static

Definition at line 2134 of file builtin.c.

2135 {
2136  static const WCHAR fmtW[] =
2137  {'D','i','s','k',' ','#','%','u',',',' ','P','a','r','t','i','t','i','o','n',' ','#','0',0};
2138  WCHAR device_id[32], root[] = {'A',':','\\',0};
2139  struct record_diskpartition *rec;
2140  UINT i, row = 0, offset = 0, type, index = 0;
2141  UINT64 size = 1024 * 1024 * 1024;
2142  DWORD drives = GetLogicalDrives();
2144 
2145  if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
2146 
2147  for (i = 0; i < 26; i++)
2148  {
2149  if (drives & (1 << i))
2150  {
2151  root[0] = 'A' + i;
2152  type = GetDriveTypeW( root );
2153  if (type != DRIVE_FIXED && type != DRIVE_REMOVABLE)
2154  continue;
2155 
2156  if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2157 
2158  rec = (struct record_diskpartition *)(table->data + offset);
2159  rec->bootable = (i == 2) ? -1 : 0;
2160  rec->bootpartition = (i == 2) ? -1 : 0;
2161  sprintfW( device_id, fmtW, index );
2162  rec->device_id = heap_strdupW( device_id );
2163  rec->diskindex = index;
2164  rec->index = 0;
2166  get_freespace( root, &size );
2167  rec->size = size;
2168  rec->startingoffset = 0;
2169  rec->type = get_filesystem( root );
2170  if (!match_row( table, row, cond, &status ))
2171  {
2173  continue;
2174  }
2175  offset += sizeof(*rec);
2176  row++;
2177  index++;
2178  }
2179  }
2180  TRACE("created %u rows\n", row);
2181  table->num_rows = row;
2182  return status;
2183 }
UINT64 startingoffset
Definition: builtin.c:972
static UINT64 get_freespace(const WCHAR *dir, UINT64 *disksize)
Definition: builtin.c:2048
UINT num_rows
GLintptr offset
Definition: glext.h:5920
const WCHAR * pnpdevice_id
Definition: builtin.c:970
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static WCHAR * get_filesystem(const WCHAR *root)
Definition: builtin.c:2124
const WCHAR * device_id
Definition: builtin.c:953
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
#define DRIVE_REMOVABLE
Definition: winbase.h:248
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
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
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
#define index(s, c)
Definition: various.h:29
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define DRIVE_FIXED
Definition: winbase.h:249
const WCHAR * type
Definition: builtin.c:973
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:110
fill_status
BYTE * data
#define sprintfW
Definition: unicode.h:58
unsigned int UINT
Definition: ndis.h:50
unsigned long long UINT64
const WCHAR * device_id
Definition: builtin.c:967
static SERVICE_STATUS status
Definition: service.c:31
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
Definition: ps.c:97

◆ fill_ip4routetable()

static enum fill_status fill_ip4routetable ( struct table table,
const struct expr cond 
)
static

Definition at line 2195 of file builtin.c.

2196 {
2197  struct record_ip4routetable *rec;
2198  UINT i, row = 0, offset = 0, size = 0;
2199  MIB_IPFORWARDTABLE *forwards;
2201 
2203  if (!(forwards = heap_alloc( size ))) return FILL_STATUS_FAILED;
2204  if (GetIpForwardTable( forwards, &size, TRUE ))
2205  {
2206  heap_free( forwards );
2207  return FILL_STATUS_FAILED;
2208  }
2209  if (!resize_table( table, max(forwards->dwNumEntries, 1), sizeof(*rec) ))
2210  {
2211  heap_free( forwards );
2212  return FILL_STATUS_FAILED;
2213  }
2214 
2215  for (i = 0; i < forwards->dwNumEntries; i++)
2216  {
2217  rec = (struct record_ip4routetable *)(table->data + offset);
2218 
2219  rec->destination = get_ip4_string( ntohl(forwards->table[i].dwForwardDest) );
2220  rec->interfaceindex = forwards->table[i].dwForwardIfIndex;
2221  rec->nexthop = get_ip4_string( ntohl(forwards->table[i].dwForwardNextHop) );
2222 
2223  if (!match_row( table, row, cond, &status ))
2224  {
2226  continue;
2227  }
2228  offset += sizeof(*rec);
2229  row++;
2230  }
2231  TRACE("created %u rows\n", row);
2232  table->num_rows = row;
2233 
2234  heap_free( forwards );
2235  return status;
2236 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
UINT num_rows
GLintptr offset
Definition: glext.h:5920
const WCHAR * destination
Definition: builtin.c:977
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
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
smooth NULL
Definition: ftsmooth.c:416
IF_INDEX dwForwardIfIndex
Definition: ipmib.h:75
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
DWORD dwForwardNextHop
Definition: ipmib.h:74
static WCHAR * get_ip4_string(DWORD addr)
Definition: builtin.c:2185
DWORD dwNumEntries
Definition: ipmib.h:97
DWORD dwForwardDest
Definition: ipmib.h:71
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
MIB_IPFORWARDROW table[1]
Definition: ipmib.h:98
fill_status
DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
BYTE * data
unsigned int UINT
Definition: ndis.h:50
const WCHAR * nexthop
Definition: builtin.c:979
static SERVICE_STATUS status
Definition: service.c:31
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 BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ntohl(x)
Definition: module.h:203
Definition: ps.c:97

◆ fill_logicaldisk()

static enum fill_status fill_logicaldisk ( struct table table,
const struct expr cond 
)
static

Definition at line 2255 of file builtin.c.

2256 {
2257  static const WCHAR fmtW[] = {'%','c',':',0};
2258  WCHAR device_id[3], root[] = {'A',':','\\',0};
2259  struct record_logicaldisk *rec;
2260  UINT i, row = 0, offset = 0, type;
2261  UINT64 size = 1024 * 1024 * 1024;
2262  DWORD drives = GetLogicalDrives();
2264 
2265  if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
2266 
2267  for (i = 0; i < 26; i++)
2268  {
2269  if (drives & (1 << i))
2270  {
2271  root[0] = 'A' + i;
2272  type = GetDriveTypeW( root );
2273  if (type != DRIVE_FIXED && type != DRIVE_CDROM && type != DRIVE_REMOVABLE)
2274  continue;
2275 
2276  if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2277 
2278  rec = (struct record_logicaldisk *)(table->data + offset);
2279  sprintfW( device_id, fmtW, 'A' + i );
2280  rec->device_id = heap_strdupW( device_id );
2281  rec->drivetype = type;
2282  rec->filesystem = get_filesystem( root );
2283  rec->freespace = get_freespace( root, &size );
2284  rec->name = heap_strdupW( device_id );
2285  rec->size = size;
2286  rec->volumename = get_volumename( root );
2288  if (!match_row( table, row, cond, &status ))
2289  {
2291  continue;
2292  }
2293  offset += sizeof(*rec);
2294  row++;
2295  }
2296  }
2297  TRACE("created %u rows\n", row);
2298  table->num_rows = row;
2299  return status;
2300 }
static UINT64 get_freespace(const WCHAR *dir, UINT64 *disksize)
Definition: builtin.c:2048
UINT num_rows
GLintptr offset
Definition: glext.h:5920
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static WCHAR * get_filesystem(const WCHAR *root)
Definition: builtin.c:2124
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
#define DRIVE_REMOVABLE
Definition: winbase.h:248
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
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
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
const WCHAR * device_id
Definition: builtin.c:983
UINT64 freespace
Definition: builtin.c:986
const WCHAR * name
Definition: builtin.c:987
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
static WCHAR * get_volumeserialnumber(const WCHAR *root)
Definition: builtin.c:2244
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define DRIVE_FIXED
Definition: winbase.h:249
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:110
const WCHAR * volumeserialnumber
Definition: builtin.c:990
fill_status
BYTE * data
#define sprintfW
Definition: unicode.h:58
#define DRIVE_CDROM
Definition: winbase.h:251
unsigned int UINT
Definition: ndis.h:50
static WCHAR * get_volumename(const WCHAR *root)
Definition: builtin.c:2238
UINT32 drivetype
Definition: builtin.c:984
const WCHAR * filesystem
Definition: builtin.c:985
unsigned long long UINT64
static SERVICE_STATUS status
Definition: service.c:31
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
const WCHAR * volumename
Definition: builtin.c:989
Definition: ps.c:97

◆ fill_networkadapter()

static enum fill_status fill_networkadapter ( struct table table,
const struct expr cond 
)
static

Definition at line 2344 of file builtin.c.

2345 {
2346  static const WCHAR fmtW[] = {'%','u',0};
2347  WCHAR device_id[11];
2348  struct record_networkadapter *rec;
2349  IP_ADAPTER_ADDRESSES *aa, *buffer;
2350  UINT row = 0, offset = 0, count = 0;
2351  DWORD size = 0, ret;
2352  int physical;
2354 
2355  ret = GetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size );
2357 
2358  if (!(buffer = heap_alloc( size ))) return FILL_STATUS_FAILED;
2359  if (GetAdaptersAddresses( AF_UNSPEC, 0, NULL, buffer, &size ))
2360  {
2361  heap_free( buffer );
2362  return FILL_STATUS_FAILED;
2363  }
2364  for (aa = buffer; aa; aa = aa->Next)
2365  {
2366  if (aa->IfType != IF_TYPE_SOFTWARE_LOOPBACK) count++;
2367  }
2368  if (!resize_table( table, count, sizeof(*rec) ))
2369  {
2370  heap_free( buffer );
2371  return FILL_STATUS_FAILED;
2372  }
2373  for (aa = buffer; aa; aa = aa->Next)
2374  {
2375  if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue;
2376 
2377  rec = (struct record_networkadapter *)(table->data + offset);
2378  sprintfW( device_id, fmtW, aa->u.s.IfIndex );
2379  rec->adaptertype = get_adaptertype( aa->IfType, &physical );
2380  rec->device_id = heap_strdupW( device_id );
2381  rec->index = aa->u.s.IfIndex;
2382  rec->interface_index = aa->u.s.IfIndex;
2383  rec->mac_address = get_mac_address( aa->PhysicalAddress, aa->PhysicalAddressLength );
2385  rec->name = heap_strdupW( aa->FriendlyName );
2386  rec->netconnection_status = get_connection_status( aa->OperStatus );
2387  rec->physicaladapter = physical;
2389  rec->speed = 1000000;
2390  if (!match_row( table, row, cond, &status ))
2391  {
2393  continue;
2394  }
2395  offset += sizeof(*rec);
2396  row++;
2397  }
2398  TRACE("created %u rows\n", row);
2399  table->num_rows = row;
2400 
2401  heap_free( buffer );
2402  return status;
2403 }
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
GLuint GLuint GLsizei count
Definition: gl.h:1545
UINT num_rows
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
UINT16 netconnection_status
Definition: builtin.c:1001
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
const WCHAR * mac_address
Definition: builtin.c:998
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
static const WCHAR * get_adaptertype(DWORD type, int *physical)
Definition: builtin.c:2327
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
const WCHAR * device_id
Definition: builtin.c:983
static WCHAR * get_mac_address(const BYTE *addr, DWORD len)
Definition: builtin.c:2316
#define IF_TYPE_SOFTWARE_LOOPBACK
Definition: ipifcons.h:44
const WCHAR * name
Definition: builtin.c:1000
smooth NULL
Definition: ftsmooth.c:416
static UINT16 get_connection_status(IF_OPER_STATUS status)
Definition: builtin.c:2302
#define AF_UNSPEC
Definition: winsock.h:344
UINT32 interface_index
Definition: builtin.c:997
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * pnpdevice_id
Definition: builtin.c:1003
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
const WCHAR * adaptertype
Definition: builtin.c:994
int ret
fill_status
const WCHAR * device_id
Definition: builtin.c:995
BYTE * data
#define sprintfW
Definition: unicode.h:58
unsigned int UINT
Definition: ndis.h:50
static const WCHAR networkadapter_pnpdeviceidW[]
Definition: builtin.c:848
static SERVICE_STATUS status
Definition: service.c:31
const WCHAR * manufacturer
Definition: builtin.c:999
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 BOOL heap_free(void *mem)
Definition: appwiz.h:75
static const WCHAR compsys_manufacturerW[]
Definition: builtin.c:819
Definition: ps.c:97

◆ fill_networkadapterconfig()

static enum fill_status fill_networkadapterconfig ( struct table table,
const struct expr cond 
)
static

Definition at line 2582 of file builtin.c.

2583 {
2584  struct record_networkadapterconfig *rec;
2585  IP_ADAPTER_ADDRESSES *aa, *buffer;
2586  UINT row = 0, offset = 0, count = 0;
2587  DWORD size = 0, ret;
2589 
2590  ret = GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, NULL, NULL, &size );
2592 
2593  if (!(buffer = heap_alloc( size ))) return FILL_STATUS_FAILED;
2594  if (GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, NULL, buffer, &size ))
2595  {
2596  heap_free( buffer );
2597  return FILL_STATUS_FAILED;
2598  }
2599  for (aa = buffer; aa; aa = aa->Next)
2600  {
2601  if (aa->IfType != IF_TYPE_SOFTWARE_LOOPBACK) count++;
2602  }
2603  if (!resize_table( table, count, sizeof(*rec) ))
2604  {
2605  heap_free( buffer );
2606  return FILL_STATUS_FAILED;
2607  }
2608  for (aa = buffer; aa; aa = aa->Next)
2609  {
2610  if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue;
2611 
2612  rec = (struct record_networkadapterconfig *)(table->data + offset);
2613  rec->defaultipgateway = get_defaultipgateway( aa->FirstGatewayAddress );
2614  rec->description = heap_strdupW( aa->Description );
2615  rec->dhcpenabled = -1;
2616  rec->dnshostname = get_dnshostname( aa->FirstUnicastAddress );
2617  rec->dnsserversearchorder = get_dnsserversearchorder( aa->FirstDnsServerAddress );
2618  rec->index = aa->u.s.IfIndex;
2619 #ifndef __REACTOS__
2620  rec->ipaddress = get_ipaddress( aa->FirstUnicastAddress );
2621 #endif
2622  rec->ipconnectionmetric = 20;
2623  rec->ipenabled = -1;
2624 #ifndef __REACTOS__
2625  rec->ipsubnet = get_ipsubnet( aa->FirstUnicastAddress );
2626 #endif
2627  rec->mac_address = get_mac_address( aa->PhysicalAddress, aa->PhysicalAddressLength );
2628  rec->settingid = get_settingid( rec->index );
2629  if (!match_row( table, row, cond, &status ))
2630  {
2632  continue;
2633  }
2634  offset += sizeof(*rec);
2635  row++;
2636  }
2637  TRACE("created %u rows\n", row);
2638  table->num_rows = row;
2639 
2640  heap_free( buffer );
2641  return status;
2642 }
static struct array * get_dnsserversearchorder(IP_ADAPTER_DNS_SERVER_ADDRESS *list)
Definition: builtin.c:2447
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
static struct array * get_ipsubnet(IP_ADAPTER_UNICAST_ADDRESS_LH *list)
Definition: builtin.c:2515
GLuint GLuint GLsizei count
Definition: gl.h:1545
UINT num_rows
const WCHAR * description
Definition: builtin.c:1009
const struct array * defaultipgateway
Definition: builtin.c:1008
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
static WCHAR * get_dnshostname(IP_ADAPTER_UNICAST_ADDRESS *addr)
Definition: builtin.c:2405
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * mac_address
Definition: builtin.c:1018
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
static WCHAR * get_mac_address(const BYTE *addr, DWORD len)
Definition: builtin.c:2316
#define IF_TYPE_SOFTWARE_LOOPBACK
Definition: ipifcons.h:44
smooth NULL
Definition: ftsmooth.c:416
static struct array * get_ipaddress(IP_ADAPTER_UNICAST_ADDRESS_LH *list)
Definition: builtin.c:2483
#define AF_UNSPEC
Definition: winsock.h:344
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
const struct array * dnsserversearchorder
Definition: builtin.c:1012
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
const WCHAR * dnshostname
Definition: builtin.c:1011
int ret
fill_status
BYTE * data
const struct array * ipsubnet
Definition: builtin.c:1017
unsigned int UINT
Definition: ndis.h:50
static WCHAR * get_settingid(UINT32 index)
Definition: builtin.c:2570
static struct array * get_defaultipgateway(IP_ADAPTER_GATEWAY_ADDRESS *list)
Definition: builtin.c:2415
const WCHAR * settingid
Definition: builtin.c:1019
static SERVICE_STATUS status
Definition: service.c:31
const struct array * ipaddress
Definition: builtin.c:1014
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 BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: ps.c:97

◆ fill_os()

static enum fill_status fill_os ( struct table table,
const struct expr cond 
)
static

Definition at line 3149 of file builtin.c.

3150 {
3151  struct record_operatingsystem *rec;
3153  OSVERSIONINFOEXW ver;
3154  UINT row = 0;
3155 
3156  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
3157 
3158  ver.dwOSVersionInfoSize = sizeof(ver);
3159  GetVersionExW( (OSVERSIONINFOW *)&ver );
3160 
3161  rec = (struct record_operatingsystem *)table->data;
3162  rec->buildnumber = get_osbuildnumber( &ver );
3163  rec->caption = get_oscaption( &ver );
3164  rec->codeset = get_codeset();
3165  rec->countrycode = get_countrycode();
3166  rec->csdversion = ver.szCSDVersion[0] ? heap_strdupW( ver.szCSDVersion ) : NULL;
3171  rec->locale = get_locale();
3172  rec->name = get_osname( rec->caption );
3175  rec->osproductsuite = 2461140; /* Windows XP Professional */
3176  rec->ostype = 18; /* WINNT */
3177  rec->primary = -1;
3181  rec->suitemask = 272; /* Single User + Terminal */
3185  rec->version = get_osversion( &ver );
3186  if (!match_row( table, row, cond, &status )) free_row_values( table, row );
3187  else row++;
3188 
3189  TRACE("created %u rows\n", row);
3190  table->num_rows = row;
3191  return status;
3192 }
static UINT64 get_available_physical_memory(void)
Definition: builtin.c:1430
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:265
static UINT64 get_total_physical_memory(void)
Definition: builtin.c:1421
const WCHAR * locale
Definition: builtin.c:1032
static const WCHAR * get_osarchitecture(void)
Definition: builtin.c:2834
UINT num_rows
const WCHAR * countrycode
Definition: builtin.c:1026
static WCHAR * get_systemdirectory(void)
Definition: builtin.c:3038
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
const WCHAR * serialnumber
Definition: builtin.c:1039
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
UINT64 totalvisiblememorysize
Definition: builtin.c:1045
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
const WCHAR * installdate
Definition: builtin.c:1029
const WCHAR * buildnumber
Definition: builtin.c:1023
const WCHAR * csdversion
Definition: builtin.c:1027
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
const WCHAR * codeset
Definition: builtin.c:1025
smooth NULL
Definition: ftsmooth.c:416
static WCHAR * get_lastbootuptime(void)
Definition: builtin.c:2997
const WCHAR * version
Definition: builtin.c:1046
#define TRACE(s)
Definition: solgame.cpp:4
const WCHAR * localdatetime
Definition: builtin.c:1031
const WCHAR * name
Definition: builtin.c:1033
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: lang.c:751
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
const WCHAR * caption
Definition: builtin.c:1024
const WCHAR * lastbootuptime
Definition: builtin.c:1030
UINT64 totalvirtualmemorysize
Definition: builtin.c:1044
WCHAR szCSDVersion[128]
Definition: rtltypes.h:270
static WCHAR * get_oscaption(OSVERSIONINFOEXW *ver)
Definition: builtin.c:3075
const WCHAR * osarchitecture
Definition: builtin.c:1034
static WCHAR * get_codeset(void)
Definition: builtin.c:3049
fill_status
static const WCHAR os_installdateW[]
Definition: builtin.c:856
BYTE * data
USHORT wServicePackMajor
Definition: rtltypes.h:271
static WCHAR * get_osname(const WCHAR *caption)
Definition: builtin.c:3128
static const WCHAR os_serialnumberW[]
Definition: builtin.c:858
unsigned int UINT
Definition: ndis.h:50
static WCHAR * get_osversion(OSVERSIONINFOEXW *ver)
Definition: builtin.c:3141
static WCHAR * get_locale(void)
Definition: builtin.c:3062
const WCHAR * systemdirectory
Definition: builtin.c:1043
static WCHAR * get_osbuildnumber(OSVERSIONINFOEXW *ver)
Definition: builtin.c:3068
static WCHAR * get_localdatetime(void)
Definition: builtin.c:3013
static WCHAR * get_countrycode(void)
Definition: builtin.c:3056
static SERVICE_STATUS status
Definition: service.c:31
USHORT wServicePackMinor
Definition: rtltypes.h:272
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
Definition: ps.c:97

◆ fill_physicalmemory()

static enum fill_status fill_physicalmemory ( struct table table,
const struct expr cond 
)
static

Definition at line 2644 of file builtin.c.

2645 {
2646  struct record_physicalmemory *rec;
2648  UINT row = 0;
2649 
2650  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
2651 
2652  rec = (struct record_physicalmemory *)table->data;
2654  rec->memorytype = 9; /* RAM */
2655  if (!match_row( table, row, cond, &status )) free_row_values( table, row );
2656  else row++;
2657 
2658  TRACE("created %u rows\n", row);
2659  table->num_rows = row;
2660  return status;
2661 }
static UINT64 get_total_physical_memory(void)
Definition: builtin.c:1421
UINT num_rows
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
fill_status
BYTE * data
unsigned int UINT
Definition: ndis.h:50
static SERVICE_STATUS status
Definition: service.c:31
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
Definition: ps.c:97

◆ fill_pnpentity()

static enum fill_status fill_pnpentity ( struct table table,
const struct expr cond 
)
static

Definition at line 2663 of file builtin.c.

2664 {
2665  struct record_pnpentity *rec;
2667  HDEVINFO device_info_set;
2668  SP_DEVINFO_DATA devinfo = {0};
2669  DWORD idx;
2670 
2672 
2673  devinfo.cbSize = sizeof(devinfo);
2674 
2675  idx = 0;
2676  while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo ))
2677  {
2678  /* noop */
2679  }
2680 
2681  resize_table( table, idx, sizeof(*rec) );
2682  table->num_rows = 0;
2683  rec = (struct record_pnpentity *)table->data;
2684 
2685  idx = 0;
2686  while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo ))
2687  {
2689  if (SetupDiGetDeviceInstanceIdW( device_info_set, &devinfo, device_id,
2691  {
2692  rec->device_id = heap_strdupW( device_id );
2693 
2694  table->num_rows++;
2695  if (!match_row( table, table->num_rows - 1, cond, &status ))
2696  {
2698  table->num_rows--;
2699  }
2700  else
2701  rec++;
2702  }
2703  }
2704 
2705  SetupDiDestroyDeviceInfoList( device_info_set );
2706 
2707  return status;
2708 }
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
Definition: devinst.c:1792
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2297
UINT num_rows
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
while(1)
Definition: macro.lex.yy.c:740
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2898
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
#define DIGCF_ALLCLASSES
Definition: setupapi.h:172
fill_status
BYTE * data
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize, PDWORD RequiredSize)
Definition: devinst.c:1912
const WCHAR * device_id
Definition: builtin.c:1070
static SERVICE_STATUS status
Definition: service.c:31
#define DIGCF_PRESENT
Definition: setupapi.h:171
Definition: ps.c:97

◆ fill_printer()

static enum fill_status fill_printer ( struct table table,
const struct expr cond 
)
static

Definition at line 2710 of file builtin.c.

2711 {
2712  static const WCHAR fmtW[] = {'P','r','i','n','t','e','r','%','d',0};
2713  struct record_printer *rec;
2716  DWORD i, offset = 0, count = 0, size = 0, num_rows = 0;
2717  WCHAR id[20];
2718 
2721 
2722  if (!(info = heap_alloc( size ))) return FILL_STATUS_FAILED;
2724  {
2725  heap_free( info );
2726  return FILL_STATUS_FAILED;
2727  }
2728  if (!resize_table( table, count, sizeof(*rec) ))
2729  {
2730  heap_free( info );
2731  return FILL_STATUS_FAILED;
2732  }
2733 
2734  for (i = 0; i < count; i++)
2735  {
2736  rec = (struct record_printer *)(table->data + offset);
2737  rec->attributes = info[i].Attributes;
2738  sprintfW( id, fmtW, i );
2739  rec->device_id = heap_strdupW( id );
2740  rec->drivername = heap_strdupW( info[i].pDriverName );
2741  rec->horizontalresolution = info[i].pDevMode->u1.s1.dmPrintQuality;
2742  rec->local = -1;
2743  rec->location = heap_strdupW( info[i].pLocation );
2744  rec->name = heap_strdupW( info[i].pPrinterName );
2745  rec->network = 0;
2746  rec->portname = heap_strdupW( info[i].pPortName );
2747  if (!match_row( table, i, cond, &status ))
2748  {
2749  free_row_values( table, i );
2750  continue;
2751  }
2752  offset += sizeof(*rec);
2753  num_rows++;
2754  }
2755  TRACE("created %u rows\n", num_rows);
2756  table->num_rows = num_rows;
2757 
2758  heap_free( info );
2759  return status;
2760 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
UINT num_rows
GLintptr offset
Definition: glext.h:5920
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
struct _test_info info[]
Definition: SetCursorPos.c:19
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
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
const WCHAR * portname
Definition: builtin.c:1082
const WCHAR * location
Definition: builtin.c:1079
smooth NULL
Definition: ftsmooth.c:416
const WCHAR * name
Definition: builtin.c:1080
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT32 horizontalresolution
Definition: builtin.c:1077
int JSAMPARRAY int int num_rows
Definition: jpegint.h:412
#define PRINTER_ENUM_LOCAL
Definition: winspool.h:803
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
WINBOOL WINAPI EnumPrintersW(DWORD Flags, LPWSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
const WCHAR * device_id
Definition: builtin.c:1075
unsigned char BYTE
Definition: mem.h:68
fill_status
BYTE * data
UINT32 attributes
Definition: builtin.c:1074
#define sprintfW
Definition: unicode.h:58
const WCHAR * drivername
Definition: builtin.c:1076
static SERVICE_STATUS status
Definition: service.c:31
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
Definition: ps.c:97

◆ fill_process()

static enum fill_status fill_process ( struct table table,
const struct expr cond 
)
static

Definition at line 2768 of file builtin.c.

2769 {
2770  static const WCHAR fmtW[] = {'%','u',0};
2771  WCHAR handle[11];
2772  struct record_process *rec;
2774  HANDLE snap;
2776  UINT row = 0, offset = 0;
2777 
2779  if (snap == INVALID_HANDLE_VALUE) return FILL_STATUS_FAILED;
2780 
2781  entry.dwSize = sizeof(entry);
2782  if (!Process32FirstW( snap, &entry )) goto done;
2783  if (!resize_table( table, 8, sizeof(*rec) )) goto done;
2784 
2785  do
2786  {
2787  if (!resize_table( table, row + 1, sizeof(*rec) )) goto done;
2788 
2789  rec = (struct record_process *)(table->data + offset);
2790  rec->caption = heap_strdupW( entry.szExeFile );
2791  rec->commandline = get_cmdline( entry.th32ProcessID );
2792  rec->description = heap_strdupW( entry.szExeFile );
2793  sprintfW( handle, fmtW, entry.th32ProcessID );
2794  rec->handle = heap_strdupW( handle );
2795  rec->name = heap_strdupW( entry.szExeFile );
2796  rec->process_id = entry.th32ProcessID;
2797  rec->pprocess_id = entry.th32ParentProcessID;
2798  rec->thread_count = entry.cntThreads;
2799  rec->workingsetsize = 0;
2801  if (!match_row( table, row, cond, &status ))
2802  {
2804  continue;
2805  }
2806  offset += sizeof(*rec);
2807  row++;
2808  } while (Process32NextW( snap, &entry ));
2809 
2810  TRACE("created %u rows\n", row);
2811  table->num_rows = row;
2813 
2814 done:
2815  CloseHandle( snap );
2816  return status;
2817 }
#define CloseHandle
Definition: compat.h:398
UINT num_rows
const WCHAR * name
Definition: builtin.c:1090
uint8_t entry
Definition: isohybrid.c:63
GLintptr offset
Definition: glext.h:5920
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
HRESULT process_get_owner(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: process.c:66
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
BOOL WINAPI Process32FirstW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)
Definition: toolhelp.c:984
const WCHAR * handle
Definition: builtin.c:1089
class_method * get_owner
Definition: builtin.c:1096
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
UINT32 process_id
Definition: builtin.c:1092
BOOL WINAPI Process32NextW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)
Definition: toolhelp.c:1073
fill_status
const WCHAR * description
Definition: builtin.c:1088
BYTE * data
#define sprintfW
Definition: unicode.h:58
#define TH32CS_SNAPPROCESS
Definition: tlhelp32.h:26
unsigned int UINT
Definition: ndis.h:50
UINT64 workingsetsize
Definition: builtin.c:1094
HANDLE WINAPI CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID)
Definition: toolhelp.c:1255
const WCHAR * commandline
Definition: builtin.c:1087
UINT32 thread_count
Definition: builtin.c:1093
static WCHAR * get_cmdline(DWORD process_id)
Definition: builtin.c:2762
UINT32 pprocess_id
Definition: builtin.c:1091
static SERVICE_STATUS status
Definition: service.c:31
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
const WCHAR * caption
Definition: builtin.c:1086
Definition: ps.c:97

◆ fill_processor()

static enum fill_status fill_processor ( struct table table,
const struct expr cond 
)
static

Definition at line 2940 of file builtin.c.

2941 {
2942  static const WCHAR fmtW[] = {'C','P','U','%','u',0};
2943  WCHAR caption[100], device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50];
2944  struct record_processor *rec;
2947 
2948  if (!resize_table( table, count, sizeof(*rec) )) return FILL_STATUS_FAILED;
2949 
2955 
2957  num_cores /= count;
2958 
2959  for (i = 0; i < count; i++)
2960  {
2961  rec = (struct record_processor *)(table->data + offset);
2962  rec->addresswidth = get_osarchitecture() == os_32bitW ? 32 : 64;
2963  rec->architecture = get_osarchitecture() == os_32bitW ? 0 : 9;
2964  rec->caption = heap_strdupW( caption );
2965  rec->cpu_status = 1; /* CPU Enabled */
2967  rec->datawidth = get_osarchitecture() == os_32bitW ? 32 : 64;
2968  rec->description = heap_strdupW( caption );
2969  sprintfW( device_id, fmtW, i );
2970  rec->device_id = heap_strdupW( device_id );
2971  rec->family = 2; /* Unknown */
2972  rec->level = 15;
2975  rec->name = heap_strdupW( name );
2976  rec->num_cores = num_cores;
2979  rec->processortype = 3; /* central processor */
2981  rec->unique_id = NULL;
2982  rec->version = heap_strdupW( version );
2983  if (!match_row( table, i, cond, &status ))
2984  {
2985  free_row_values( table, i );
2986  continue;
2987  }
2988  offset += sizeof(*rec);
2989  num_rows++;
2990  }
2991 
2992  TRACE("created %u rows\n", num_rows);
2993  table->num_rows = num_rows;
2994  return status;
2995 }
static UINT get_logical_processor_count(UINT *num_cores)
Definition: builtin.c:1387
const WCHAR * version
Definition: builtin.c:1119
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const WCHAR * get_osarchitecture(void)
Definition: builtin.c:2834
UINT num_rows
UINT16 processortype
Definition: builtin.c:1116
const WCHAR * unique_id
Definition: builtin.c:1118
GLintptr offset
Definition: glext.h:5920
static void get_processor_id(WCHAR *processor_id)
Definition: builtin.c:2869
UINT16 datawidth
Definition: builtin.c:1105
UINT16 architecture
Definition: builtin.c:1101
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
static void get_processor_caption(WCHAR *caption)
Definition: builtin.c:2841
UINT16 addresswidth
Definition: builtin.c:1100
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
const WCHAR * name
Definition: builtin.c:1112
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
UINT32 num_logical_processors
Definition: builtin.c:1114
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
UINT32 maxclockspeed
Definition: builtin.c:1111
const WCHAR * description
Definition: builtin.c:1106
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
const WCHAR * caption
Definition: builtin.c:1102
UINT16 cpu_status
Definition: builtin.c:1103
UINT32 num_cores
Definition: builtin.c:1113
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * processor_id
Definition: builtin.c:1115
int JSAMPARRAY int int num_rows
Definition: jpegint.h:412
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
static UINT get_processor_maxclockspeed(UINT index)
Definition: builtin.c:2925
UINT32 currentclockspeed
Definition: builtin.c:1104
static UINT get_processor_currentclockspeed(UINT index)
Definition: builtin.c:2911
const WCHAR * device_id
Definition: builtin.c:1107
static const WCHAR os_32bitW[]
Definition: builtin.c:852
static void get_processor_name(WCHAR *name)
Definition: builtin.c:2896
fill_status
UINT16 revision
Definition: builtin.c:1117
BYTE * data
#define sprintfW
Definition: unicode.h:58
static void get_processor_version(WCHAR *version)
Definition: builtin.c:2854
const WCHAR * manufacturer
Definition: builtin.c:1110
unsigned int UINT
Definition: ndis.h:50
static UINT16 get_processor_revision(void)
Definition: builtin.c:2863
Definition: name.c:36
static SERVICE_STATUS status
Definition: service.c:31
static void get_processor_manufacturer(WCHAR *manufacturer)
Definition: builtin.c:2885
const WCHAR * caption
Definition: builtin.c:1086
Definition: ps.c:97
static UINT get_processor_count(void)
Definition: builtin.c:1379

◆ fill_service()

static enum fill_status fill_service ( struct table table,
const struct expr cond 
)
static

Definition at line 3276 of file builtin.c.

3277 {
3278  struct record_service *rec;
3279  SC_HANDLE manager;
3282  WCHAR sysnameW[MAX_COMPUTERNAME_LENGTH + 1];
3283  DWORD len = ARRAY_SIZE( sysnameW );
3284  UINT i, row = 0, offset = 0, size = 256, needed, count;
3286  BOOL ret;
3287 
3289  if (!(services = heap_alloc( size ))) goto done;
3290 
3292  SERVICE_STATE_ALL, (BYTE *)services, size, &needed,
3293  &count, NULL, NULL );
3294  if (!ret)
3295  {
3296  if (GetLastError() != ERROR_MORE_DATA) goto done;
3297  size = needed;
3298  if (!(tmp = heap_realloc( services, size ))) goto done;
3299  services = tmp;
3301  SERVICE_STATE_ALL, (BYTE *)services, size, &needed,
3302  &count, NULL, NULL );
3303  if (!ret) goto done;
3304  }
3305  if (!resize_table( table, count, sizeof(*rec) )) goto done;
3306 
3307  GetComputerNameW( sysnameW, &len );
3309 
3310  for (i = 0; i < count; i++)
3311  {
3313 
3314  if (!(config = query_service_config( manager, services[i].lpServiceName ))) continue;
3315 
3316  status = &services[i].ServiceStatusProcess;
3317  rec = (struct record_service *)(table->data + offset);
3318  rec->accept_pause = (status->dwControlsAccepted & SERVICE_ACCEPT_PAUSE_CONTINUE) ? -1 : 0;
3319  rec->accept_stop = (status->dwControlsAccepted & SERVICE_ACCEPT_STOP) ? -1 : 0;
3321  rec->name = heap_strdupW( services[i].lpServiceName );
3322  rec->process_id = status->dwProcessId;
3323  rec->servicetype = get_service_type( status->dwServiceType );
3324  rec->startmode = get_service_startmode( config->dwStartType );
3325  rec->state = get_service_state( status->dwCurrentState );
3326  rec->systemname = heap_strdupW( sysnameW );
3331  heap_free( config );
3332  if (!match_row( table, row, cond, &fill_status ))
3333  {
3335  continue;
3336  }
3337  offset += sizeof(*rec);
3338  row++;
3339  }
3340 
3341  TRACE("created %u rows\n", row);
3342  table->num_rows = row;
3343 
3344 done:
3345  CloseServiceHandle( manager );
3346  heap_free( services );
3347  return fill_status;
3348 }
HRESULT service_pause_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:80
#define SC_MANAGER_ENUMERATE_SERVICE
Definition: winsvc.h:16
struct config_s config
static const WCHAR * get_service_startmode(DWORD mode)
Definition: builtin.c:3236
HRESULT service_stop_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:239
GLuint GLuint GLsizei count
Definition: gl.h:1545
UINT num_rows
const WCHAR * servicetype
Definition: builtin.c:1138
#define SERVICE_ACCEPT_STOP
Definition: winsvc.h:28
GLintptr offset
Definition: glext.h:5920
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SERVICE_STATE_ALL
Definition: winsvc.h:52
const WCHAR * systemname
Definition: builtin.c:1141
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:440
static QUERY_SERVICE_CONFIGW * query_service_config(SC_HANDLE manager, const WCHAR *name)
Definition: builtin.c:3257
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
UINT32 process_id
Definition: builtin.c:1137
int accept_pause
Definition: builtin.c:1133
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
const WCHAR * displayname
Definition: builtin.c:1135
HRESULT service_start_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:194
unsigned int BOOL
Definition: ntddk_ex.h:94
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
class_method * pause_service
Definition: builtin.c:1143
#define SERVICE_TYPE_ALL
Definition: cmtypes.h:967
const WCHAR * name
Definition: builtin.c:1136
#define SERVICE_ACCEPT_PAUSE_CONTINUE
Definition: winsvc.h:29
HRESULT service_resume_service(IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out)
Definition: service.c:125
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
int ret
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2011
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
const WCHAR * startmode
Definition: builtin.c:1139
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
class_method * stop_service
Definition: builtin.c:1146
fill_status
static const WCHAR * get_service_type(DWORD type)
Definition: builtin.c:3194
BYTE * data
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
class_method * resume_service
Definition: builtin.c:1144
static const WCHAR * get_service_state(DWORD state)
Definition: builtin.c:3212
class_method * start_service
Definition: builtin.c:1145
static SERVICE_STATUS status
Definition: service.c:31
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:1513
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2730
const WCHAR * state
Definition: builtin.c:1140
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 BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: ps.c:97

◆ fill_sid()

static enum fill_status fill_sid ( struct table table,
const struct expr cond 
)
static

Definition at line 3397 of file builtin.c.

3398 {
3399  PSID sid;
3403  LSA_OBJECT_ATTRIBUTES attrs;
3404  const WCHAR *str;
3405  struct record_sid *rec;
3406  UINT len;
3407 
3408  if (!(str = find_sid_str( cond ))) return FILL_STATUS_FAILED;
3409  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
3410 
3412  len = GetLengthSid( sid );
3413 
3414  memset( &attrs, 0, sizeof(attrs) );
3415  attrs.Length = sizeof(attrs);
3416  if (LsaOpenPolicy( NULL, &attrs, POLICY_ALL_ACCESS, &handle ))
3417  {
3418  LocalFree( sid );
3419  return FILL_STATUS_FAILED;
3420  }
3421  if (LsaLookupSids( handle, 1, &sid, &domain, &name ))
3422  {
3423  LocalFree( sid );
3424  LsaClose( handle );
3425  return FILL_STATUS_FAILED;
3426  }
3427 
3428  rec = (struct record_sid *)table->data;
3429  rec->accountname = get_accountname( name );
3432  rec->sid = heap_strdupW( str );
3433  rec->sidlength = len;
3434 
3435  TRACE("created 1 row\n");
3436  table->num_rows = 1;
3437 
3438  LsaFreeMemory( domain );
3439  LsaFreeMemory( name );
3440  LocalFree( sid );
3441  LsaClose( handle );
3442  return FILL_STATUS_FILTERED;
3443 }
static WCHAR * get_accountname(LSA_TRANSLATED_NAME *name)
Definition: builtin.c:3350
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
const WCHAR * referenceddomainname
Definition: builtin.c:1152
UINT32 sidlength
Definition: builtin.c:1154
UINT num_rows
BOOL WINAPI ConvertStringSidToSidW(LPCWSTR StringSid, PSID *Sid)
Definition: security.c:3212
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
Definition: lsa.c:192
static WCHAR * get_referenceddomainname(LSA_REFERENCED_DOMAIN_LIST *domain)
Definition: builtin.c:3372
FT_UInt sid
Definition: cffcmap.c:139
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
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:1067
const WCHAR * accountname
Definition: builtin.c:1150
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:1181
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
Definition: lsa.c:699
const struct array * binaryrepresentation
Definition: builtin.c:1151
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD WINAPI GetLengthSid(PSID pSid)
Definition: security.c:798
static const WCHAR * find_sid_str(const struct expr *cond)
Definition: builtin.c:3377
GLenum GLsizei len
Definition: glext.h:6722
static struct array * get_binaryrepresentation(PSID sid, UINT len)
Definition: builtin.c:3355
BYTE * data
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
const WCHAR * sid
Definition: builtin.c:1153
unsigned int UINT
Definition: ndis.h:50
#define POLICY_ALL_ACCESS
Definition: ntsecapi.h:77
Definition: name.c:36
#define memset(x, y, z)
Definition: compat.h:39
GLuint const GLchar * name
Definition: glext.h:6031

◆ fill_videocontroller()

static enum fill_status fill_videocontroller ( struct table table,
const struct expr cond 
)
static

Definition at line 3495 of file builtin.c.

3496 {
3497  static const WCHAR fmtW[] = {'%','u',' ','x',' ','%','u',' ','x',' ','%','I','6','4','u',' ','c','o','l','o','r','s',0};
3498  struct record_videocontroller *rec;
3499  HRESULT hr;
3500  IDXGIFactory *factory = NULL;
3501  IDXGIAdapter *adapter = NULL;
3502  DXGI_ADAPTER_DESC desc;
3503  UINT row = 0, hres = 1024, vres = 768, vidmem = 512 * 1024 * 1024;
3506  WCHAR mode[44];
3507 
3508  if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
3509 
3510  memset (&desc, 0, sizeof(desc));
3511  hr = CreateDXGIFactory( &IID_IDXGIFactory, (void **)&factory );
3512  if (FAILED(hr)) goto done;
3513 
3514  hr = IDXGIFactory_EnumAdapters( factory, 0, &adapter );
3515  if (FAILED(hr)) goto done;
3516 
3517  hr = IDXGIAdapter_GetDesc( adapter, &desc );
3518  if (SUCCEEDED(hr))
3519  {
3520  vidmem = desc.DedicatedVideoMemory;
3521  name = desc.Description;
3522  }
3523 
3524 done:
3525  rec = (struct record_videocontroller *)table->data;
3527  rec->adapter_ram = vidmem;
3528  rec->availability = 3; /* Running or Full Power */
3529  rec->config_errorcode = 0; /* no error */
3530  rec->caption = heap_strdupW( name );
3531  rec->current_bitsperpixel = get_bits_per_pixel( &hres, &vres );
3532  rec->current_horizontalres = hres;
3533  rec->current_refreshrate = 0; /* default refresh rate */
3534  rec->current_scanmode = 2; /* Unknown */
3535  rec->current_verticalres = vres;
3536  rec->description = heap_strdupW( name );
3540  rec->installeddriver = get_installeddriver( desc.VendorId );
3541  rec->name = heap_strdupW( name );
3542  rec->pnpdevice_id = get_pnpdeviceid( &desc );
3544  rec->videoarchitecture = 2; /* Unknown */
3545  rec->videomemorytype = 2; /* Unknown */
3546  wsprintfW( mode, fmtW, hres, vres, (UINT64)1 << rec->current_bitsperpixel );
3548  rec->videoprocessor = heap_strdupW( name );
3549  if (!match_row( table, row, cond, &status )) free_row_values( table, row );
3550  else row++;
3551 
3552  TRACE("created %u rows\n", row);
3553  table->num_rows = row;
3554 
3555  if (adapter) IDXGIAdapter_Release( adapter );
3556  if (factory) IDXGIFactory_Release( factory );
3557  return status;
3558 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
PBYTE vidmem
Definition: vgavideo.c:18
static const WCHAR videocontroller_deviceidW[]
Definition: builtin.c:873
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * driverversion
Definition: builtin.c:1199
UINT num_rows
static BOOL resize_table(struct table *table, UINT row_count, UINT row_size)
Definition: builtin.c:1318
const WCHAR * pnpdevice_id
Definition: builtin.c:1202
static const WCHAR videocontroller_statusW[]
Definition: builtin.c:879
const WCHAR * status
Definition: builtin.c:1203
void free_row_values(const struct table *table, UINT row)
Definition: table.c:281
static const WCHAR videocontroller_dactypeW[]
Definition: builtin.c:871
Definition: main.c:440
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
const WCHAR * videoprocessor
Definition: builtin.c:1207
const WCHAR * adapter_dactype
Definition: builtin.c:1186
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
UINT32 current_bitsperpixel
Definition: builtin.c:1191
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static BOOL match_row(const struct table *table, UINT row, const struct expr *cond, enum fill_status *status)
Definition: builtin.c:1299
static const WCHAR * get_installeddriver(UINT vendorid)
Definition: builtin.c:3477
const WCHAR * videomodedescription
Definition: builtin.c:1206
static UINT32 get_bits_per_pixel(UINT *hres, UINT *vres)
Definition: builtin.c:3447
GLenum mode
Definition: glext.h:6217
UINT32 current_verticalres
Definition: builtin.c:1195
const WCHAR * installeddriver
Definition: builtin.c:1200
static WCHAR * get_pnpdeviceid(DXGI_ADAPTER_DESC *desc)
Definition: builtin.c:3459
fill_status
const WCHAR * device_id
Definition: builtin.c:1197
const WCHAR * driverdate
Definition: builtin.c:1198
BYTE * data
const WCHAR * description
Definition: builtin.c:1196
UINT32 current_horizontalres
Definition: builtin.c:1192