Commit Graph

2 Commits

Author SHA1 Message Date
Philip Withnall
9acebef777 gwin32: Use gsize internally in g_wcsdup()
This allows it to handle strings up to length `G_MAXSIZE` — previously
it would overflow with such strings.

Update the several copies of it identically.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2319
2021-02-04 16:17:21 +00:00
Руслан Ижбулатов
e9b09911f6 gio: Add g_win32_package_parser_enum_packages()
This function enumerates all user-accessible UWP packages
and calls the user-provided callback for each package.

This can be used to make GLib aware of the UWP applications
installed in the system.

The function works by using IPackageManager/IPackage UWP interfaces
and XmlLite COM library to parse package manifests.

The function requires COM, and initializes it to a single-thread
appartment model. To ensure this doesn't break anything, either
only use it in a separate thread (COM is initialized on a per-thread
basis), or make sure that the main thread also uses the same COM
model (it's OK to initialize COM multiple times, as long as the same
model is used and as long as init/uninit calls are paired correctly).
2020-12-23 01:43:38 +00:00