-
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 merely sets the value of the memoryBytes member variable of the given cylonStruct to 1 billion (aka 1 GB of RAM).
-
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 produceDeviceInformation(struct cylonStruct& tf)
-
This function retrieves a DeviceInformationCollection^ object containing DeviceInformation entries for all installed devices on the current machine using the FindAllAsync() method, and then sets the member data for installedDeviceCount and installDevices on the given cylonStruct.
-
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.
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.
Standard getter methods that return the member variables of a given cylonStruct, these include:
- unsigned int getFosterMilliseconds(struct cylonStruct tf)
- unsigned int getFosterSeconds(struct cylonStruct tf)
- unsigned int getFosterMinutes(struct cylonStruct tf)
- unsigned int getFosterHours(struct cylonStruct tf)
- unsigned int getFosterDay(struct cylonStruct tf)
- unsigned int getFosterDate(struct cylonStruct tf)
- unsigned int getFosterMonth(struct cylonStruct tf)
- unsigned int getFosterYear(struct cylonStruct tf)
- long getFosterTimeZone(struct cylonStruct tf)
- unsigned int getFosterDST(struct cylonStruct tf)
- std::wstring getFosterTimeZoneName(struct cylonStruct tf)
- std::wstring getFosterUsername(struct cylonStruct tf)
- std::wstring getFosterDeviceName(struct cylonStruct tf)
- unsigned short getFosterArchitecture(struct cylonStruct tf)
- unsigned short getFosterProcessorLevel(struct cyclonStruct tf)
- unsigned long getFosterPageSize(struct cylonStruct tf)
- unsigned long getFosterProcessorCount(struct cylonStruct tf)
- unsigned long getFosterAllocationGranularity(struct cylonStruct tf)
- void getFosterMinAppAddress(struct cylonStruct tf)*
- void getFosterMaxAppAddress(struct cylonStruct tf)*
- std::wstring getFosterPictureType(struct cylonStruct tf)
- Windows::Storage::IStorageFile^ getFosterPictureFile(struct cylonStruct tf)