-
Notifications
You must be signed in to change notification settings - Fork 0
Methods
Producer functions make calls to WinRT and supported Win32 API's to get relevant system, user and hardware information. After retrieving this information, these functions format and store the data in a given cylonStruct.
-
void produceUsername(struct cylonStruct& tf)
-
This function calls the Windows UserInformation GetDisplayNameAsync() method to retrieve the username of the current logged in user. To allow rapid refreshes of a cylonStruct, a blocking loop prevents the function from proceeding until the asynchronous response has replied with a result. Finally, the function converts the result into a wstring and stores it in the provided cylonStruct.
-
void produceTimeZone(struct cyclonStruct& tory)
-
This function calls the Windows method GetTimeZoneInformation, and stores the received bias and time zone names in the given cylonStruct. Additionally, a conversion is done on the DWORD result of the GetTimeZoneInformation call, and the result is stored as the dst member variable of the cylonStruct.
-
void produceDateTime(struct cylonStruct& tory)
-
This function calls the Windows method GetLocalTime, and stores the resulting responses for hours, minutes, seconds, milliseconds, day, date, month, and year in the provided cylonStruct.
-
void produceDeviceName(struct cylonStruct& tory)
-
This function calls a Windows socket WSAStartup, and makes a request for the host's name via gethostname. After receiving the host name, WSACleanup() is called. The method then converts the host name to a wstring and stores it in the provided cylonStruct.
-
void produceProcessorInfo(struct cylonStruct& tf)
-
This function calls the Windows GetNativeSystemInfo method and fills a local SYSTEM_INFO object. The cylonStruct's processor architecture variable is set via an if-else interpretation of that object's wProcessorArchitecture enum. Additionally, the cylonStruct's pageSize, minAppAddress, maxAppAddress, processorCount, and allocationGranularity are all gleaned from the SYSTEM_INFO object.
-
void produceMemoryInfo(struct cylonStruct& tf)
-
Due to constraints on Windows RT, this function checks for the presence of the IsWow64Process() function in the Kernel32.lib (traditionally unaccessible by WinRT apps). If the Kernel function is not located, the given cylonStruct's architecture is set to 32-bit and a minimum RAM of 1GB. If the function is located, a call is made using the current process. If the value returned is true, the architecture is set to 64-bit and a minimum RAM of 2GB, otherwise, both values default to the 32-bit/1GB scheme.
-
void produceAccountPicture(struct cylonStruct& tf)
-
This function retrieves the SmallImage format of the account picture for the presently logged-in user on the current machine. For debugging purposes, the image's file type extension is also retrieved and converted into a wstring. Both of these objects are then stored in the provided cylonStruct for later use.
-
void produceDeviceTypeInformation(struct cylonStruct& tf, std::string type)
-
This function retrieves a DeviceInformationCollection^ object like the previous method, but can filter results based on type (video capture, audio capture, audio render, image scanner, location aware, portable storage device, or all, where all recreates the results of the previous method). It then sets the local device count and device collection variables for the specified type given in the string argument.
-
void produceDeviceTypesInformation(struct cylonStruct& tf)
-
This function calls produceDeviceTypeInformation for video capture, audio capture, audio render, location aware, portable storage, and image scanning devices and sets all of the local variables for the provided cylonStruct for each of the retrieved DeviceInformationCollection^ objects and their sizes.
-
void produceDisplayInformation(struct cylonStruct& tf)
-
This function creates a new instance of a displayStruct (for storing the metadata of the primary display device) using the Windows DisplayInformation class, and creates an additional "parent" deviceStruct to represent the displayStruct within the master list of devices. The deviceStruct's displayIndex value is set to the current size of the display devices list of the provided cylonStruct, and then both of the created structures are stored within the appropriately typed lists of the cylonStruct.
-
void produceMouseInformation(struct cylonStruct& tf)
-
This function creates a new instance of a mouseStruct (for storing the metadata of all the available mice for the current machine) using the Windows MouseCapabilities class, and creates an additional "parent" deviceStruct to represent the mouseStruct in the master list of devices. The deviceStruct is then inserted into the devices list for the provided cylonStruct.
Builder functions are similar to constructors. They call various producers to create an object, and then return the fully formed structure for consumption by another method.
- struct cylonStruct buildTory()
- This function acts a constructor for a new cylonStruct in the WinRT environment. The struct is initialized and then filled many of the above producer methods, finally returning the new cylonStruct.