From a3173bf08c5f243a7c9ce191b2cb422bb46403c0 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 14:47:46 +0200 Subject: [PATCH 01/13] Update CHANGELOG --- CHANGELOG.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9137ec8bed..8de5624739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,37 @@ ## 3.0.0 +- This release includes an overhaul of the COM and WinRT API generation, as + described below. Apps and packages that call traditional Win32 APIs should not + require changes, but apps that use COM or the highly-experimental WinRT APIs + should expect to make changes. - [BREAKING CHANGE] COM and Windows Runtime methods and properties are now camelCased, not TitleCased. This is inconvenient, but it avoids a whole class of name clashes and aligns COM and WinRT APIs more closely with Dart idioms. As the projections get smarter with more helpers, we think this is the right call for the future and worth a one-time tax to fix. -- TODO: Add other changes. +- [BREAKING CHANGE] You can now cast to a new COM interface without needing the IID for the target interface. Instead of: + +```dart + final modalWindow = IModalWindow(fileDialog.toInterface(IID_IModalWindow)); +``` + +write: + +```dart + final modalWindow = IModalWindow.from(fileDialog); +``` + +- [BREAKING CHANGE] WinRT classes now support projection of `List`s and + `String`s directly. +- [BREAKING CHANGE] The WinRT `fromPointer` method is now `fromRawPointer`. +- `GUIDFromString` now supports an optional custom allocator parameter. +- Added various APIs from iphlpapi.dll for tracking and renewing IP addresses. +- Added `DisableThreadLibraryCalls`, `FindStringOrdinal`, `GetConsoleCP`, `GetConsoleOutputCP`, `GetModuleHandleExW`, `GetNumberOfConsoleInputEvents`, `GetVolumeInformation`, `GetVolumeInformationByHandle`, `PeekConsoleInput`, `ReadConsoleInputW`, `SetErrorMode`, `SetThreadErrorMode`, `SizeofResource` APIs from kernel32.dll +- Added `GetClassFile` API from ole32.dll +- Added `SetupDiGetDeviceInstanceId`, `SetupDiGetDeviceRegistryPropertyW` APIs from setupapi.dll +- Added `GetAltTabInfoW`, `GetClassNameW`, `GetGUIThreadInfo` APIs from user32.dll +- Added various foundational WinRT types, including `IIterable`, `IIterator`, `IKeyValuePair`, `IMapView`, `IVector`, `IVectorView`, `IPropertyValue`, `IReference`, with tremendous thanks again to @halildurmus, who has driven much of the recent WinRT work. +- Major reworking of the WinRT generation code, thanks to @halildurmus. ## 2.7.0 From be5bdbfab00037f212d82f9d4046219548d7064a Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 14:57:49 +0200 Subject: [PATCH 02/13] Move WinRT APIs to a separate library --- example/appcontainer.dart | 2 +- example/calendar.dart | 2 +- example/shell_notify_icon/_menu.dart | 2 +- example/storage.dart | 2 +- example/tetris/pieceset.dart | 2 +- example/winrt_picker.dart | 2 +- lib/win32.dart | 78 +------------------ lib/winrt.dart | 94 +++++++++++++++++++++++ test/string_test.dart | 2 +- test/winrt_calendar_test.dart | 2 +- test/winrt_collections_test.dart | 2 +- test/winrt_helpers_test.dart | 2 +- test/winrt_ireference_test.dart | 2 +- test/winrt_map_helpers_test.dart | 4 +- test/winrt_phonenumberformatter_test.dart | 2 +- test/winrt_propertyvalue_test.dart | 2 +- test/winrt_test.dart | 2 +- 17 files changed, 110 insertions(+), 94 deletions(-) create mode 100644 lib/winrt.dart diff --git a/example/appcontainer.dart b/example/appcontainer.dart index 093f008b26..f7f51bc013 100644 --- a/example/appcontainer.dart +++ b/example/appcontainer.dart @@ -8,7 +8,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; bool isAppContainer() { final phToken = calloc(); diff --git a/example/calendar.dart b/example/calendar.dart index 535df97fd1..97e1836dc1 100644 --- a/example/calendar.dart +++ b/example/calendar.dart @@ -4,7 +4,7 @@ // Simple example of calling WinRT APIs -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; String calendarData(Calendar calendar) => 'Calendar: ${calendar.getCalendarSystem()}\n' diff --git a/example/shell_notify_icon/_menu.dart b/example/shell_notify_icon/_menu.dart index 137655386a..7ca02d90e4 100644 --- a/example/shell_notify_icon/_menu.dart +++ b/example/shell_notify_icon/_menu.dart @@ -2,7 +2,7 @@ import 'dart:ffi'; import 'dart:math'; import 'package:ffi/ffi.dart'; -import 'package:win32/win32.dart' hide Point; +import 'package:win32/win32.dart'; import '_app.dart' as app; import '_tray.dart' as tray; diff --git a/example/storage.dart b/example/storage.dart index d1d030dcfb..0aee5917eb 100644 --- a/example/storage.dart +++ b/example/storage.dart @@ -1,4 +1,4 @@ -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; void main() { winrtInitialize(); diff --git a/example/tetris/pieceset.dart b/example/tetris/pieceset.dart index 8ad9dddd79..393e69b38b 100644 --- a/example/tetris/pieceset.dart +++ b/example/tetris/pieceset.dart @@ -1,6 +1,6 @@ import 'dart:math' show Random; -import 'package:win32/win32.dart' hide Point; +import 'package:win32/win32.dart'; import 'piece.dart'; diff --git a/example/winrt_picker.dart b/example/winrt_picker.dart index e74d9ffa74..cc40ecd704 100644 --- a/example/winrt_picker.dart +++ b/example/winrt_picker.dart @@ -7,7 +7,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; void main() async { winrtInitialize(); diff --git a/lib/win32.dart b/lib/win32.dart index e0c7f2a165..d69e6eb3a9 100644 --- a/lib/win32.dart +++ b/lib/win32.dart @@ -140,11 +140,8 @@ export 'src/api_ms_win_core_winrt_string_l1_1_0.dart'; export 'src/api_ms_win_ro_typeresolution_l1_1_0.dart'; export 'src/api_ms_win_wsl_api_l1_1_0.dart'; -// COM and Windows Runtime foundational exports +// COM foundational exports export 'src/combase.dart'; -export 'src/winrt_callbacks.dart'; -export 'src/winrt_constants.dart'; -export 'src/winrt_helpers.dart'; // COM interfaces export 'src/com/iapplicationactivationmanager.dart'; @@ -250,76 +247,3 @@ export 'src/com/iwbemlocator.dart'; export 'src/com/iwbemobjectaccess.dart'; export 'src/com/iwbemrefresher.dart'; export 'src/com/iwbemservices.dart'; - -// Windows Runtime classes and interfaces -export 'src/winrt/data/json/ijsonarray.dart'; -export 'src/winrt/data/json/ijsonobject.dart'; -export 'src/winrt/data/json/ijsonobjectwithdefaultvalues.dart'; -export 'src/winrt/data/json/ijsonvalue.dart'; -export 'src/winrt/data/json/jsonarray.dart'; -export 'src/winrt/data/json/jsonobject.dart'; -export 'src/winrt/data/json/jsonvalue.dart'; -export 'src/winrt/data/xml/dom/ixmlnodelist.dart'; -export 'src/winrt/devices/enumeration/devicepicker.dart'; -export 'src/winrt/devices/enumeration/devicepickerfilter.dart'; -export 'src/winrt/devices/enumeration/idevicepicker.dart'; -export 'src/winrt/devices/enumeration/idevicepickerfilter.dart'; -export 'src/winrt/devices/sensors/ipedometerreading.dart'; -export 'src/winrt/devices/sensors/pedometerreading.dart'; -export 'src/winrt/foundation/collections/iiterable.dart'; -export 'src/winrt/foundation/collections/iiterator.dart'; -export 'src/winrt/foundation/collections/ikeyvaluepair.dart'; -export 'src/winrt/foundation/collections/imap.dart'; -export 'src/winrt/foundation/collections/imapview.dart'; -export 'src/winrt/foundation/collections/ivector.dart'; -export 'src/winrt/foundation/collections/ivectorview.dart'; -export 'src/winrt/foundation/collections/propertyset.dart'; -export 'src/winrt/foundation/collections/stringmap.dart'; -export 'src/winrt/foundation/collections/valueset.dart'; -export 'src/winrt/foundation/iasyncaction.dart'; -export 'src/winrt/foundation/iasyncinfo.dart'; -export 'src/winrt/foundation/iasyncoperation.dart'; -export 'src/winrt/foundation/ipropertyvalue.dart'; -export 'src/winrt/foundation/ireference.dart'; -export 'src/winrt/foundation/propertyvalue.dart'; -export 'src/winrt/gaming/input/gamepad.dart'; -export 'src/winrt/gaming/input/igamecontroller.dart'; -export 'src/winrt/gaming/input/igamecontrollerbatteryinfo.dart'; -export 'src/winrt/gaming/input/igamepad.dart'; -export 'src/winrt/globalization/calendar.dart'; -export 'src/winrt/globalization/icalendar.dart'; -export 'src/winrt/globalization/phonenumberformatting/iphonenumberformatter.dart'; -export 'src/winrt/globalization/phonenumberformatting/phonenumberformatter.dart'; -export 'src/winrt/graphics/printing3d/iprinting3dmultiplepropertymaterial.dart'; -export 'src/winrt/graphics/printing3d/printing3dmultiplepropertymaterial.dart'; -export 'src/winrt/media/mediaproperties/mediapropertyset.dart'; -export 'src/winrt/networking/connectivity/inetworkinformationstatics.dart'; -export 'src/winrt/networking/ihostname.dart'; -export 'src/winrt/storage/applicationdata.dart'; -export 'src/winrt/storage/iapplicationdata.dart'; -export 'src/winrt/storage/istorageitem.dart'; -export 'src/winrt/storage/iuserdatapathsstatics.dart'; -export 'src/winrt/storage/pickers/ifileopenpicker.dart'; -export 'src/winrt/storage/userdatapaths.dart'; -export 'src/winrt/ui/notifications/itoastnotificationfactory.dart'; -export 'src/winrt/ui/notifications/itoastnotificationmanagerstatics.dart'; -export 'src/winrt/ui/notifications/toastnotification.dart'; - -// Windows Runtime Enumerations -export 'src/winrt/data/json/enums.g.dart'; -export 'src/winrt/devices/enumeration/enums.g.dart'; -export 'src/winrt/devices/sensors/enums.g.dart'; -export 'src/winrt/foundation/enums.g.dart'; -export 'src/winrt/gaming/input/enums.g.dart'; -export 'src/winrt/globalization/enums.g.dart'; -export 'src/winrt/globalization/phonenumberformatting/enums.g.dart'; -export 'src/winrt/networking/enums.g.dart'; -export 'src/winrt/storage/enums.g.dart'; -export 'src/winrt/storage/pickers/enums.g.dart'; -export 'src/winrt/ui/notifications/enums.g.dart'; -export 'src/winrt/ui/popups/enums.g.dart'; - -// Windows Runtime Structs -export 'src/winrt/foundation/structs.g.dart'; -export 'src/winrt/foundation/numerics/structs.g.dart'; -export 'src/winrt/gaming/input/structs.g.dart'; diff --git a/lib/winrt.dart b/lib/winrt.dart new file mode 100644 index 0000000000..440f6b6b8a --- /dev/null +++ b/lib/winrt.dart @@ -0,0 +1,94 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// ignore_for_file: directives_ordering + +/// Support for programming against the WinRT API on Windows operating systems. +/// +/// +library winrt; + +// The WinRT API builds on the underlying Win32 API, and so it is also exported +// here. +export 'win32.dart'; + +// WinRT foundational exports +export 'src/winrt_callbacks.dart'; +export 'src/winrt_constants.dart'; +export 'src/winrt_helpers.dart'; + +// Windows Runtime enumerations +export 'src/winrt/data/json/enums.g.dart'; + +// Windows Runtime classes and interfaces +export 'src/winrt/data/json/ijsonarray.dart'; +export 'src/winrt/data/json/ijsonobject.dart'; +export 'src/winrt/data/json/ijsonobjectwithdefaultvalues.dart'; +export 'src/winrt/data/json/ijsonvalue.dart'; +export 'src/winrt/data/json/jsonarray.dart'; +export 'src/winrt/data/json/jsonobject.dart'; +export 'src/winrt/data/json/jsonvalue.dart'; +export 'src/winrt/data/xml/dom/ixmlnodelist.dart'; +export 'src/winrt/devices/enumeration/devicepicker.dart'; +export 'src/winrt/devices/enumeration/devicepickerfilter.dart'; +export 'src/winrt/devices/enumeration/enums.g.dart'; +export 'src/winrt/devices/enumeration/idevicepicker.dart'; +export 'src/winrt/devices/enumeration/idevicepickerfilter.dart'; +export 'src/winrt/devices/sensors/enums.g.dart'; +export 'src/winrt/devices/sensors/ipedometerreading.dart'; +export 'src/winrt/devices/sensors/pedometerreading.dart'; +export 'src/winrt/foundation/collections/iiterable.dart'; +export 'src/winrt/foundation/collections/iiterator.dart'; +export 'src/winrt/foundation/collections/ikeyvaluepair.dart'; +export 'src/winrt/foundation/collections/imap.dart'; +export 'src/winrt/foundation/collections/imapview.dart'; +export 'src/winrt/foundation/collections/ivector.dart'; +export 'src/winrt/foundation/collections/ivectorview.dart'; +export 'src/winrt/foundation/collections/propertyset.dart'; +export 'src/winrt/foundation/collections/stringmap.dart'; +export 'src/winrt/foundation/collections/valueset.dart'; +export 'src/winrt/foundation/enums.g.dart'; +export 'src/winrt/foundation/iasyncaction.dart'; +export 'src/winrt/foundation/iasyncinfo.dart'; +export 'src/winrt/foundation/iasyncoperation.dart'; +export 'src/winrt/foundation/ipropertyvalue.dart'; +export 'src/winrt/foundation/ireference.dart'; +export 'src/winrt/foundation/numerics/structs.g.dart'; +export 'src/winrt/foundation/propertyvalue.dart'; + +// Windows Runtime structs +export 'src/winrt/foundation/structs.g.dart'; +export 'src/winrt/foundation/winrt_enum.dart'; +export 'src/winrt/gaming/input/enums.g.dart'; +export 'src/winrt/gaming/input/gamepad.dart'; +export 'src/winrt/gaming/input/igamecontroller.dart'; +export 'src/winrt/gaming/input/igamecontrollerbatteryinfo.dart'; +export 'src/winrt/gaming/input/igamepad.dart'; +export 'src/winrt/gaming/input/structs.g.dart'; +export 'src/winrt/globalization/calendar.dart'; +export 'src/winrt/globalization/enums.g.dart'; +export 'src/winrt/globalization/icalendar.dart'; +export 'src/winrt/globalization/phonenumberformatting/enums.g.dart'; +export 'src/winrt/globalization/phonenumberformatting/iphonenumberformatter.dart'; +export 'src/winrt/globalization/phonenumberformatting/phonenumberformatter.dart'; +export 'src/winrt/graphics/printing3d/iprinting3dmultiplepropertymaterial.dart'; +export 'src/winrt/graphics/printing3d/printing3dmultiplepropertymaterial.dart'; +export 'src/winrt/internal/map_helpers.dart'; +export 'src/winrt/media/mediaproperties/mediapropertyset.dart'; +export 'src/winrt/networking/connectivity/inetworkinformationstatics.dart'; +export 'src/winrt/networking/enums.g.dart'; +export 'src/winrt/networking/ihostname.dart'; +export 'src/winrt/storage/applicationdata.dart'; +export 'src/winrt/storage/enums.g.dart'; +export 'src/winrt/storage/iapplicationdata.dart'; +export 'src/winrt/storage/istorageitem.dart'; +export 'src/winrt/storage/iuserdatapathsstatics.dart'; +export 'src/winrt/storage/pickers/enums.g.dart'; +export 'src/winrt/storage/pickers/ifileopenpicker.dart'; +export 'src/winrt/storage/userdatapaths.dart'; +export 'src/winrt/ui/notifications/enums.g.dart'; +export 'src/winrt/ui/notifications/itoastnotificationfactory.dart'; +export 'src/winrt/ui/notifications/itoastnotificationmanagerstatics.dart'; +export 'src/winrt/ui/notifications/toastnotification.dart'; +export 'src/winrt/ui/popups/enums.g.dart'; diff --git a/test/string_test.dart b/test/string_test.dart index d8d8835573..6934d5323c 100644 --- a/test/string_test.dart +++ b/test/string_test.dart @@ -2,7 +2,7 @@ import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; const testString = "If my grandmother had wheels, she'd be a motorbike"; diff --git a/test/winrt_calendar_test.dart b/test/winrt_calendar_test.dart index 5f65460978..fb42c981ac 100644 --- a/test/winrt_calendar_test.dart +++ b/test/winrt_calendar_test.dart @@ -3,7 +3,7 @@ @TestOn('windows') import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; // Exhaustively test the WinRT calendar object to make sure overrides, // properties and methods are working correctly. diff --git a/test/winrt_collections_test.dart b/test/winrt_collections_test.dart index b5bdf36355..66258862f5 100644 --- a/test/winrt_collections_test.dart +++ b/test/winrt_collections_test.dart @@ -4,7 +4,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; // Exhaustively test the WinRT Collections to make sure constructors, // properties and methods are working correctly. diff --git a/test/winrt_helpers_test.dart b/test/winrt_helpers_test.dart index 9a6dd7ff46..1dae02b4b1 100644 --- a/test/winrt_helpers_test.dart +++ b/test/winrt_helpers_test.dart @@ -1,5 +1,5 @@ import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; // Test the WinRT helper functions to make sure everything is working correctly. diff --git a/test/winrt_ireference_test.dart b/test/winrt_ireference_test.dart index 07389f98cd..85a194e1f9 100644 --- a/test/winrt_ireference_test.dart +++ b/test/winrt_ireference_test.dart @@ -4,7 +4,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; // Test the WinRT IReference types to make sure everything is working // correctly. diff --git a/test/winrt_map_helpers_test.dart b/test/winrt_map_helpers_test.dart index 7eb6816b89..27d6a8c280 100644 --- a/test/winrt_map_helpers_test.dart +++ b/test/winrt_map_helpers_test.dart @@ -1,7 +1,5 @@ import 'package:test/test.dart'; -import 'package:win32/src/winrt/foundation/winrt_enum.dart'; -import 'package:win32/src/winrt/internal/map_helpers.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; // Test the WinRT map helper functions to make sure everything is working // correctly. diff --git a/test/winrt_phonenumberformatter_test.dart b/test/winrt_phonenumberformatter_test.dart index 6580abce2a..d8bfe18ec4 100644 --- a/test/winrt_phonenumberformatter_test.dart +++ b/test/winrt_phonenumberformatter_test.dart @@ -4,7 +4,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; // Test the WinRT phone number formatter object to make sure overrides, // properties and methods are working correctly. diff --git a/test/winrt_propertyvalue_test.dart b/test/winrt_propertyvalue_test.dart index e6abf522f1..264e24c331 100644 --- a/test/winrt_propertyvalue_test.dart +++ b/test/winrt_propertyvalue_test.dart @@ -4,7 +4,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; // Test the WinRT PropertyValue object to make sure overrides, properties and // methods are working correctly. diff --git a/test/winrt_test.dart b/test/winrt_test.dart index b2a5c27845..e2bf045e33 100644 --- a/test/winrt_test.dart +++ b/test/winrt_test.dart @@ -2,7 +2,7 @@ import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; -import 'package:win32/win32.dart'; +import 'package:win32/winrt.dart'; void main() { if (isWindowsRuntimeAvailable()) { From f2e93ac5a2588fc8165caabb3f27a0e6c104c4d1 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 15:03:23 +0200 Subject: [PATCH 03/13] Remove ApplicationData --- example/storage.dart | 15 --------------- lib/winrt.dart | 2 -- 2 files changed, 17 deletions(-) delete mode 100644 example/storage.dart diff --git a/example/storage.dart b/example/storage.dart deleted file mode 100644 index 0aee5917eb..0000000000 --- a/example/storage.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:win32/winrt.dart'; - -void main() { - winrtInitialize(); - - // Requires a package identity. - final currAppData = ApplicationData.current; - print(currAppData.trustLevel); - final localFolder = IStorageItem.fromRawPointer(currAppData.localFolder); - final localPath = localFolder.path; - - print('Local folder path: $localPath'); - - winrtUninitialize(); -} diff --git a/lib/winrt.dart b/lib/winrt.dart index 440f6b6b8a..283e6bdd9b 100644 --- a/lib/winrt.dart +++ b/lib/winrt.dart @@ -79,9 +79,7 @@ export 'src/winrt/media/mediaproperties/mediapropertyset.dart'; export 'src/winrt/networking/connectivity/inetworkinformationstatics.dart'; export 'src/winrt/networking/enums.g.dart'; export 'src/winrt/networking/ihostname.dart'; -export 'src/winrt/storage/applicationdata.dart'; export 'src/winrt/storage/enums.g.dart'; -export 'src/winrt/storage/iapplicationdata.dart'; export 'src/winrt/storage/istorageitem.dart'; export 'src/winrt/storage/iuserdatapathsstatics.dart'; export 'src/winrt/storage/pickers/enums.g.dart'; From 1a66877d1f2492b6d30575bd79b024a9277cee5e Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 15:10:13 +0200 Subject: [PATCH 04/13] Separate out winmd from winrt; retain WinRT string helpers --- lib/src/utils.dart | 35 +++++++++++ lib/src/winmd_constants.dart | 60 +++++++++++++++++++ .../winrt/data/json/ijsonarraystatics.dart | 1 - .../winrt/data/json/ijsonobjectstatics.dart | 1 - .../winrt/data/json/ijsonvaluestatics.dart | 1 - lib/src/winrt/internal/hstring_array.dart | 2 +- lib/src/winrt_constants.dart | 55 +---------------- lib/src/winrt_helpers.dart | 32 ---------- lib/win32.dart | 1 + 9 files changed, 98 insertions(+), 90 deletions(-) create mode 100644 lib/src/winmd_constants.dart diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 368bcc5dac..7db09c7ef2 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -10,9 +10,12 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; +import 'api_ms_win_core_winrt_string_l1_1_0.dart'; import 'constants.dart'; +import 'exceptions.dart'; import 'extensions/int_to_hexstring.dart'; import 'kernel32.dart'; +import 'macros.dart'; import 'shell32.dart'; import 'structs.g.dart'; import 'types.dart'; @@ -102,6 +105,38 @@ void printStruct(Pointer struct, int sizeInBytes) { /// [free] when it has been used. LPWSTR TEXT(String string) => string.toNativeUtf16(); +/// Takes a `HSTRING` (a WinRT String handle), and converts it to a Dart +/// `String`. +/// +/// {@category winrt} +String convertFromHString(int hstring) => + WindowsGetStringRawBuffer(hstring, nullptr).toDartString(); + +/// Takes a Dart String and converts it to an `HSTRING` (a WinRT String), +/// returning an integer handle. +/// +/// The caller is responsible for deleting the `HSTRING` when it is no longer +/// used, through a call to `WindowsDeleteString(HSTRING hstr)`, which +/// decrements the reference count of that string. If the reference count +/// reaches 0, the Windows Runtime deallocates the buffer. +/// +/// {@category winrt} +int convertToHString(String string) { + final hString = calloc(); + final stringPtr = string.toNativeUtf16(); + // Create a HSTRING representing the object + try { + final hr = WindowsCreateString(stringPtr, string.length, hString); + if (FAILED(hr)) { + throw WindowsException(hr); + } else { + return hString.value; + } + } finally { + free(stringPtr); + } +} + /// Allocates memory for a Unicode string and returns a pointer. /// /// The parameter indicates how many characters should be allocated. The diff --git a/lib/src/winmd_constants.dart b/lib/src/winmd_constants.dart new file mode 100644 index 0000000000..2b0ea68927 --- /dev/null +++ b/lib/src/winmd_constants.dart @@ -0,0 +1,60 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Enums and constants used for Windows Metadata + +// ignore_for_file: constant_identifier_names + +/// @nodoc +const CLSID_CorMetaDataDispenser = '{E5CB7A31-7512-11D2-89CE-0080C792E5D8}'; + +/// Contains flag values that control metadata behavior upon opening manifest +/// files. +/// +/// {@category Enum} +class CorOpenFlags { + /// Indicates that the file should be opened for reading only. + static const ofRead = 0x00000000; + + /// Indicates that the file should be opened for writing. + static const ofWrite = 0x00000001; + + /// A mask for reading and writing. + static const ofReadWriteMask = 0x00000001; + + /// Indicates that the file should be read into memory. Metadata should + /// maintain its own copy. + static const ofCopyMemory = 0x00000002; + + /// Obsolete. This flag is ignored. + static const ofCacheImage = 0x00000004; + + /// Obsolete. This flag is ignored. + static const ofManifestMetadata = 0x00000008; + + /// Indicates that the file should be opened for reading, and that a call to + /// QueryInterface for an IMetaDataEmit cannot be made. + static const ofReadOnly = 0x00000010; + + /// Indicates that the memory was allocated using a call to CoTaskMemAlloc and + /// will be freed by the metadata. + static const ofTakeOwnership = 0x00000020; + + /// Obsolete. This flag is ignored. + static const ofNoTypeLib = 0x00000080; + + /// Indicates that automatic transforms of .winmd files should be disabled. In + /// other words, the projection of a Windows Runtime type to a .NET Framework + /// type should be disabled. + static const ofNoTransform = 0x00001000; + + /// Reserved for internal use. + static const ofReserved1 = 0x00000100; + + /// Reserved for internal use. + static const ofReserved2 = 0x00000200; + + /// Reserved for internal use. + static const ofReserved = 0xffffff40; +} diff --git a/lib/src/winrt/data/json/ijsonarraystatics.dart b/lib/src/winrt/data/json/ijsonarraystatics.dart index a1b7adee43..126e647c7a 100644 --- a/lib/src/winrt/data/json/ijsonarraystatics.dart +++ b/lib/src/winrt/data/json/ijsonarraystatics.dart @@ -14,7 +14,6 @@ import '../../../macros.dart'; import '../../../types.dart'; import '../../../utils.dart'; import '../../../winrt/data/json/jsonarray.dart'; -import '../../../winrt_helpers.dart'; /// @nodoc const IID_IJsonArrayStatics = '{DB1434A9-E164-499F-93E2-8A8F49BB90BA}'; diff --git a/lib/src/winrt/data/json/ijsonobjectstatics.dart b/lib/src/winrt/data/json/ijsonobjectstatics.dart index 23bf32cb4a..899bf202b4 100644 --- a/lib/src/winrt/data/json/ijsonobjectstatics.dart +++ b/lib/src/winrt/data/json/ijsonobjectstatics.dart @@ -14,7 +14,6 @@ import '../../../macros.dart'; import '../../../types.dart'; import '../../../utils.dart'; import '../../../winrt/data/json/jsonobject.dart'; -import '../../../winrt_helpers.dart'; /// @nodoc const IID_IJsonObjectStatics = '{2289F159-54DE-45D8-ABCC-22603FA066A0}'; diff --git a/lib/src/winrt/data/json/ijsonvaluestatics.dart b/lib/src/winrt/data/json/ijsonvaluestatics.dart index 2b3f55caa3..26705e862e 100644 --- a/lib/src/winrt/data/json/ijsonvaluestatics.dart +++ b/lib/src/winrt/data/json/ijsonvaluestatics.dart @@ -14,7 +14,6 @@ import '../../../macros.dart'; import '../../../types.dart'; import '../../../utils.dart'; import '../../../winrt/data/json/jsonvalue.dart'; -import '../../../winrt_helpers.dart'; /// @nodoc const IID_IJsonValueStatics = '{5F6B544A-2F53-48E1-91A3-F78B50A6345C}'; diff --git a/lib/src/winrt/internal/hstring_array.dart b/lib/src/winrt/internal/hstring_array.dart index 9d37df2f8a..26fe870a3a 100644 --- a/lib/src/winrt/internal/hstring_array.dart +++ b/lib/src/winrt/internal/hstring_array.dart @@ -8,7 +8,7 @@ import 'dart:ffi'; import '../../api_ms_win_core_winrt_string_l1_1_0.dart'; import '../../types.dart'; -import '../../winrt_helpers.dart'; +import '../../utils.dart'; extension HStringHelper on Pointer { /// Creates a [List] from `Pointer`. diff --git a/lib/src/winrt_constants.dart b/lib/src/winrt_constants.dart index 6ee595a622..8e63c517ae 100644 --- a/lib/src/winrt_constants.dart +++ b/lib/src/winrt_constants.dart @@ -2,63 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Enums and constants used by WinRT +// Enums and constants used by WinRT projection // ignore_for_file: camel_case_types, constant_identifier_names -/// @nodoc -const CLSID_CorMetaDataDispenser = '{E5CB7A31-7512-11D2-89CE-0080C792E5D8}'; - -/// Contains flag values that control metadata behavior upon opening manifest -/// files. -/// -/// {@category Enum} -class CorOpenFlags { - /// Indicates that the file should be opened for reading only. - static const ofRead = 0x00000000; - - /// Indicates that the file should be opened for writing. - static const ofWrite = 0x00000001; - - /// A mask for reading and writing. - static const ofReadWriteMask = 0x00000001; - - /// Indicates that the file should be read into memory. Metadata should - /// maintain its own copy. - static const ofCopyMemory = 0x00000002; - - /// Obsolete. This flag is ignored. - static const ofCacheImage = 0x00000004; - - /// Obsolete. This flag is ignored. - static const ofManifestMetadata = 0x00000008; - - /// Indicates that the file should be opened for reading, and that a call to - /// QueryInterface for an IMetaDataEmit cannot be made. - static const ofReadOnly = 0x00000010; - - /// Indicates that the memory was allocated using a call to CoTaskMemAlloc and - /// will be freed by the metadata. - static const ofTakeOwnership = 0x00000020; - - /// Obsolete. This flag is ignored. - static const ofNoTypeLib = 0x00000080; - - /// Indicates that automatic transforms of .winmd files should be disabled. In - /// other words, the projection of a Windows Runtime type to a .NET Framework - /// type should be disabled. - static const ofNoTransform = 0x00001000; - - /// Reserved for internal use. - static const ofReserved1 = 0x00000100; - - /// Reserved for internal use. - static const ofReserved2 = 0x00000200; - - /// Reserved for internal use. - static const ofReserved = 0xffffff40; -} - // IIterable> IIDs const IID_IIterable_IKeyValuePair_GUID_BackgroundTaskRegistration = '{62AE0FDA-B238-554F-A275-1DC16D6CA03A}'; diff --git a/lib/src/winrt_helpers.dart b/lib/src/winrt_helpers.dart index e76824d81e..7a98800c13 100644 --- a/lib/src/winrt_helpers.dart +++ b/lib/src/winrt_helpers.dart @@ -41,38 +41,6 @@ extension WinRTStringConversion on Pointer { String toDartString() => convertFromHString(value); } -/// Takes a `HSTRING` (a WinRT String handle), and converts it to a Dart -/// `String`. -/// -/// {@category winrt} -String convertFromHString(int hstring) => - WindowsGetStringRawBuffer(hstring, nullptr).toDartString(); - -/// Takes a Dart String and converts it to an `HSTRING` (a WinRT String), -/// returning an integer handle. -/// -/// The caller is responsible for deleting the `HSTRING` when it is no longer -/// used, through a call to `WindowsDeleteString(HSTRING hstr)`, which -/// decrements the reference count of that string. If the reference count -/// reaches 0, the Windows Runtime deallocates the buffer. -/// -/// {@category winrt} -int convertToHString(String string) { - final hString = calloc(); - final stringPtr = string.toNativeUtf16(); - // Create a HSTRING representing the object - try { - final hr = WindowsCreateString(stringPtr, string.length, hString); - if (FAILED(hr)) { - throw WindowsException(hr); - } else { - return hString.value; - } - } finally { - free(stringPtr); - } -} - /// Creates a WinRT object. /// /// ```dart diff --git a/lib/win32.dart b/lib/win32.dart index d69e6eb3a9..8b4f36ff55 100644 --- a/lib/win32.dart +++ b/lib/win32.dart @@ -90,6 +90,7 @@ export 'src/structs.g.dart' servent; export 'src/variant.dart'; export 'src/utils.dart'; +export 'src/winmd_constants.dart'; // Useful extension methods export 'src/extensions/dialogs.dart'; From 4b625e572b974598c15585591e1149752a8177ad Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 15:16:15 +0200 Subject: [PATCH 05/13] Add note in CHANGELOG about new WinRT library --- CHANGELOG.md | 25 ++++++++++++++++++++----- lib/winrt.dart | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8de5624739..427f25b147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,18 @@ described below. Apps and packages that call traditional Win32 APIs should not require changes, but apps that use COM or the highly-experimental WinRT APIs should expect to make changes. +- [BREAKING CHANGE] WinRT APIs have been moved to a separate library. This + provides isolation for apps that only use traditional APIs (Win32/COM) from + the more experimental WinRT APIs. To use WinRT from your code, change your + import statement to `import 'package:win32/winrt.dart';`. The WinRT library + also exports all Win32 APIs, so you don't have to import both libraries. - [BREAKING CHANGE] COM and Windows Runtime methods and properties are now camelCased, not TitleCased. This is inconvenient, but it avoids a whole class of name clashes and aligns COM and WinRT APIs more closely with Dart idioms. As the projections get smarter with more helpers, we think this is the right call for the future and worth a one-time tax to fix. -- [BREAKING CHANGE] You can now cast to a new COM interface without needing the IID for the target interface. Instead of: +- [BREAKING CHANGE] You can now cast to a new COM interface without needing the + IID for the target interface. Instead of: ```dart final modalWindow = IModalWindow(fileDialog.toInterface(IID_IModalWindow)); @@ -26,11 +32,20 @@ write: - [BREAKING CHANGE] The WinRT `fromPointer` method is now `fromRawPointer`. - `GUIDFromString` now supports an optional custom allocator parameter. - Added various APIs from iphlpapi.dll for tracking and renewing IP addresses. -- Added `DisableThreadLibraryCalls`, `FindStringOrdinal`, `GetConsoleCP`, `GetConsoleOutputCP`, `GetModuleHandleExW`, `GetNumberOfConsoleInputEvents`, `GetVolumeInformation`, `GetVolumeInformationByHandle`, `PeekConsoleInput`, `ReadConsoleInputW`, `SetErrorMode`, `SetThreadErrorMode`, `SizeofResource` APIs from kernel32.dll +- Added `DisableThreadLibraryCalls`, `FindStringOrdinal`, `GetConsoleCP`, + `GetConsoleOutputCP`, `GetModuleHandleExW`, `GetNumberOfConsoleInputEvents`, + `GetVolumeInformation`, `GetVolumeInformationByHandle`, `PeekConsoleInput`, + `ReadConsoleInputW`, `SetErrorMode`, `SetThreadErrorMode`, `SizeofResource` + APIs from kernel32.dll - Added `GetClassFile` API from ole32.dll -- Added `SetupDiGetDeviceInstanceId`, `SetupDiGetDeviceRegistryPropertyW` APIs from setupapi.dll -- Added `GetAltTabInfoW`, `GetClassNameW`, `GetGUIThreadInfo` APIs from user32.dll -- Added various foundational WinRT types, including `IIterable`, `IIterator`, `IKeyValuePair`, `IMapView`, `IVector`, `IVectorView`, `IPropertyValue`, `IReference`, with tremendous thanks again to @halildurmus, who has driven much of the recent WinRT work. +- Added `SetupDiGetDeviceInstanceId`, `SetupDiGetDeviceRegistryPropertyW` APIs + from setupapi.dll +- Added `GetAltTabInfoW`, `GetClassNameW`, `GetGUIThreadInfo` APIs from + user32.dll +- Added various foundational WinRT types, including `IIterable`, `IIterator`, + `IKeyValuePair`, `IMapView`, `IVector`, `IVectorView`, `IPropertyValue`, + `IReference`, with tremendous thanks again to @halildurmus, who has driven + much of the recent WinRT work. - Major reworking of the WinRT generation code, thanks to @halildurmus. ## 2.7.0 diff --git a/lib/winrt.dart b/lib/winrt.dart index 283e6bdd9b..84b61356b5 100644 --- a/lib/winrt.dart +++ b/lib/winrt.dart @@ -6,7 +6,7 @@ /// Support for programming against the WinRT API on Windows operating systems. /// -/// +/// The WinRT API is unstable, experimental and under active development. library winrt; // The WinRT API builds on the underlying Win32 API, and so it is also exported From dd28a901c69ce81588e5b1f4932906c8f26e62d9 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 15:40:21 +0200 Subject: [PATCH 06/13] Bump test version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7b05305efb..87a444dfd3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,4 +26,4 @@ dev_dependencies: path: ^1.8.2 # Running the test suite. - test: ^1.21.3 \ No newline at end of file + test: ^1.21.5 \ No newline at end of file From a8d2d1a73663568543a8b904027a310d0b6a6d82 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 15:51:22 +0200 Subject: [PATCH 07/13] Fix export order --- lib/winrt.dart | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/winrt.dart b/lib/winrt.dart index 84b61356b5..3a8160bdde 100644 --- a/lib/winrt.dart +++ b/lib/winrt.dart @@ -17,9 +17,8 @@ export 'win32.dart'; export 'src/winrt_callbacks.dart'; export 'src/winrt_constants.dart'; export 'src/winrt_helpers.dart'; - -// Windows Runtime enumerations -export 'src/winrt/data/json/enums.g.dart'; +export 'src/winrt/foundation/winrt_enum.dart'; +export 'src/winrt/internal/map_helpers.dart'; // Windows Runtime classes and interfaces export 'src/winrt/data/json/ijsonarray.dart'; @@ -32,10 +31,8 @@ export 'src/winrt/data/json/jsonvalue.dart'; export 'src/winrt/data/xml/dom/ixmlnodelist.dart'; export 'src/winrt/devices/enumeration/devicepicker.dart'; export 'src/winrt/devices/enumeration/devicepickerfilter.dart'; -export 'src/winrt/devices/enumeration/enums.g.dart'; export 'src/winrt/devices/enumeration/idevicepicker.dart'; export 'src/winrt/devices/enumeration/idevicepickerfilter.dart'; -export 'src/winrt/devices/sensors/enums.g.dart'; export 'src/winrt/devices/sensors/ipedometerreading.dart'; export 'src/winrt/devices/sensors/pedometerreading.dart'; export 'src/winrt/foundation/collections/iiterable.dart'; @@ -48,45 +45,48 @@ export 'src/winrt/foundation/collections/ivectorview.dart'; export 'src/winrt/foundation/collections/propertyset.dart'; export 'src/winrt/foundation/collections/stringmap.dart'; export 'src/winrt/foundation/collections/valueset.dart'; -export 'src/winrt/foundation/enums.g.dart'; export 'src/winrt/foundation/iasyncaction.dart'; export 'src/winrt/foundation/iasyncinfo.dart'; export 'src/winrt/foundation/iasyncoperation.dart'; export 'src/winrt/foundation/ipropertyvalue.dart'; export 'src/winrt/foundation/ireference.dart'; -export 'src/winrt/foundation/numerics/structs.g.dart'; export 'src/winrt/foundation/propertyvalue.dart'; - -// Windows Runtime structs -export 'src/winrt/foundation/structs.g.dart'; -export 'src/winrt/foundation/winrt_enum.dart'; -export 'src/winrt/gaming/input/enums.g.dart'; export 'src/winrt/gaming/input/gamepad.dart'; export 'src/winrt/gaming/input/igamecontroller.dart'; export 'src/winrt/gaming/input/igamecontrollerbatteryinfo.dart'; export 'src/winrt/gaming/input/igamepad.dart'; -export 'src/winrt/gaming/input/structs.g.dart'; export 'src/winrt/globalization/calendar.dart'; -export 'src/winrt/globalization/enums.g.dart'; export 'src/winrt/globalization/icalendar.dart'; -export 'src/winrt/globalization/phonenumberformatting/enums.g.dart'; export 'src/winrt/globalization/phonenumberformatting/iphonenumberformatter.dart'; export 'src/winrt/globalization/phonenumberformatting/phonenumberformatter.dart'; export 'src/winrt/graphics/printing3d/iprinting3dmultiplepropertymaterial.dart'; export 'src/winrt/graphics/printing3d/printing3dmultiplepropertymaterial.dart'; -export 'src/winrt/internal/map_helpers.dart'; export 'src/winrt/media/mediaproperties/mediapropertyset.dart'; export 'src/winrt/networking/connectivity/inetworkinformationstatics.dart'; -export 'src/winrt/networking/enums.g.dart'; export 'src/winrt/networking/ihostname.dart'; -export 'src/winrt/storage/enums.g.dart'; export 'src/winrt/storage/istorageitem.dart'; export 'src/winrt/storage/iuserdatapathsstatics.dart'; -export 'src/winrt/storage/pickers/enums.g.dart'; export 'src/winrt/storage/pickers/ifileopenpicker.dart'; export 'src/winrt/storage/userdatapaths.dart'; -export 'src/winrt/ui/notifications/enums.g.dart'; export 'src/winrt/ui/notifications/itoastnotificationfactory.dart'; export 'src/winrt/ui/notifications/itoastnotificationmanagerstatics.dart'; export 'src/winrt/ui/notifications/toastnotification.dart'; + +// Windows Runtime enumerations +export 'src/winrt/data/json/enums.g.dart'; +export 'src/winrt/devices/enumeration/enums.g.dart'; +export 'src/winrt/devices/sensors/enums.g.dart'; +export 'src/winrt/foundation/enums.g.dart'; +export 'src/winrt/gaming/input/enums.g.dart'; +export 'src/winrt/globalization/enums.g.dart'; +export 'src/winrt/globalization/phonenumberformatting/enums.g.dart'; +export 'src/winrt/networking/enums.g.dart'; +export 'src/winrt/storage/enums.g.dart'; +export 'src/winrt/storage/pickers/enums.g.dart'; +export 'src/winrt/ui/notifications/enums.g.dart'; export 'src/winrt/ui/popups/enums.g.dart'; + +// Windows Runtime structs +export 'src/winrt/foundation/structs.g.dart'; +export 'src/winrt/foundation/numerics/structs.g.dart'; +export 'src/winrt/gaming/input/structs.g.dart'; From d2d3f053c9784172cbc5f8ef1929a1c5f52b151d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Durmu=C5=9F?= Date: Tue, 30 Aug 2022 17:29:49 +0300 Subject: [PATCH 08/13] Remove `IXmlNodeList` --- lib/src/winrt/data/xml/dom/ixmlnode.dart | 1 - lib/src/winrt/data/xml/dom/ixmlnodelist.dart | 80 ------------------- lib/winrt.dart | 1 - tool/generator/lib/src/inputs/interfaces.dart | 1 - 4 files changed, 83 deletions(-) delete mode 100644 lib/src/winrt/data/xml/dom/ixmlnode.dart delete mode 100644 lib/src/winrt/data/xml/dom/ixmlnodelist.dart diff --git a/lib/src/winrt/data/xml/dom/ixmlnode.dart b/lib/src/winrt/data/xml/dom/ixmlnode.dart deleted file mode 100644 index 8b13789179..0000000000 --- a/lib/src/winrt/data/xml/dom/ixmlnode.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/src/winrt/data/xml/dom/ixmlnodelist.dart b/lib/src/winrt/data/xml/dom/ixmlnodelist.dart deleted file mode 100644 index a2321aee15..0000000000 --- a/lib/src/winrt/data/xml/dom/ixmlnodelist.dart +++ /dev/null @@ -1,80 +0,0 @@ -// ixmlnodelist.dart - -// THIS FILE IS GENERATED AUTOMATICALLY AND SHOULD NOT BE EDITED DIRECTLY. - -// ignore_for_file: unused_import, directives_ordering -// ignore_for_file: constant_identifier_names, non_constant_identifier_names -// ignore_for_file: no_leading_underscores_for_local_identifiers - -import 'dart:ffi'; - -import 'package:ffi/ffi.dart'; - -import '../../../../api_ms_win_core_winrt_string_l1_1_0.dart'; -import '../../../../combase.dart'; -import '../../../../exceptions.dart'; -import '../../../../macros.dart'; -import '../../../../utils.dart'; -import '../../../../types.dart'; -import '../../../../winrt_callbacks.dart'; -import '../../../../winrt_helpers.dart'; - -import '../../../../winrt/internal/hstring_array.dart'; - -import '../../../../winrt/data/xml/dom/ixmlnode.dart'; -import '../../../../com/iinspectable.dart'; - -/// @nodoc -const IID_IXmlNodeList = '{8C60AD77-83A4-4EC1-9C54-7BA429E13DA6}'; - -/// {@category Interface} -/// {@category winrt} -class IXmlNodeList extends IInspectable { - // vtable begins at 6, is 2 entries long. - IXmlNodeList.fromRawPointer(super.ptr); - - factory IXmlNodeList.from(IInspectable interface) => - IXmlNodeList.fromRawPointer(interface.toInterface(IID_IXmlNodeList)); - - int get length { - final retValuePtr = calloc(); - - try { - final hr = ptr.ref.vtable - .elementAt(6) - .cast< - Pointer< - NativeFunction)>>>() - .value - .asFunction< - int Function( - Pointer, Pointer)>()(ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - final retValue = retValuePtr.value; - return retValue; - } finally { - free(retValuePtr); - } - } - - Pointer item(int index) { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(7) - .cast< - Pointer< - NativeFunction< - HRESULT Function( - Pointer, Uint32 index, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, index, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } -} diff --git a/lib/winrt.dart b/lib/winrt.dart index 3a8160bdde..bd85c81979 100644 --- a/lib/winrt.dart +++ b/lib/winrt.dart @@ -28,7 +28,6 @@ export 'src/winrt/data/json/ijsonvalue.dart'; export 'src/winrt/data/json/jsonarray.dart'; export 'src/winrt/data/json/jsonobject.dart'; export 'src/winrt/data/json/jsonvalue.dart'; -export 'src/winrt/data/xml/dom/ixmlnodelist.dart'; export 'src/winrt/devices/enumeration/devicepicker.dart'; export 'src/winrt/devices/enumeration/devicepickerfilter.dart'; export 'src/winrt/devices/enumeration/idevicepicker.dart'; diff --git a/tool/generator/lib/src/inputs/interfaces.dart b/tool/generator/lib/src/inputs/interfaces.dart index 35e8d94d88..acde1ad13c 100644 --- a/tool/generator/lib/src/inputs/interfaces.dart +++ b/tool/generator/lib/src/inputs/interfaces.dart @@ -105,7 +105,6 @@ const comInterfacesToGenerate = { }; final windowsRuntimeTypesToGenerate = { - 'Windows.Data.Xml.Dom.IXmlNodeList', 'Windows.Devices.Sensors.PedometerReading', 'Windows.Foundation.IAsyncInfo', 'Windows.Foundation.IClosable', From a5c76f506805f33717ce5c4490da576d6f0aecbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Durmu=C5=9F?= Date: Tue, 30 Aug 2022 17:32:32 +0300 Subject: [PATCH 09/13] Sort namespaces correctly --- tool/generator/lib/src/inputs/interfaces.dart | 2 +- tool/generator/test/utils_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/generator/lib/src/inputs/interfaces.dart b/tool/generator/lib/src/inputs/interfaces.dart index acde1ad13c..9d65d28e7e 100644 --- a/tool/generator/lib/src/inputs/interfaces.dart +++ b/tool/generator/lib/src/inputs/interfaces.dart @@ -119,8 +119,8 @@ final windowsRuntimeTypesToGenerate = { 'Windows.Networking.IHostName', 'Windows.Storage.IApplicationDataStatics', 'Windows.Storage.IStorageItem', - 'Windows.Storage.Pickers.IFileOpenPicker', 'Windows.Storage.UserDataPaths', + 'Windows.Storage.Pickers.IFileOpenPicker', 'Windows.UI.Notifications.IToastNotificationManagerStatics', 'Windows.UI.Notifications.NotificationData', 'Windows.UI.Notifications.ToastNotification', diff --git a/tool/generator/test/utils_test.dart b/tool/generator/test/utils_test.dart index 06653b4ab8..39c0fcf0cd 100644 --- a/tool/generator/test/utils_test.dart +++ b/tool/generator/test/utils_test.dart @@ -169,8 +169,8 @@ void main() { 'Windows.Networking.IHostName', 'Windows.Storage.IApplicationDataStatics', 'Windows.Storage.IStorageItem', - 'Windows.Storage.Pickers.IFileOpenPicker', 'Windows.Storage.UserDataPaths', + 'Windows.Storage.Pickers.IFileOpenPicker', 'Windows.UI.Notifications.IToastNotificationManagerStatics', 'Windows.UI.Notifications.ToastNotification', ]), From eea4b6136cba11d9d50b9da608753a60b9a590b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Durmu=C5=9F?= Date: Tue, 30 Aug 2022 17:37:03 +0300 Subject: [PATCH 10/13] Fix export order --- lib/winrt.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/winrt.dart b/lib/winrt.dart index bd85c81979..da634d3ad6 100644 --- a/lib/winrt.dart +++ b/lib/winrt.dart @@ -34,6 +34,12 @@ export 'src/winrt/devices/enumeration/idevicepicker.dart'; export 'src/winrt/devices/enumeration/idevicepickerfilter.dart'; export 'src/winrt/devices/sensors/ipedometerreading.dart'; export 'src/winrt/devices/sensors/pedometerreading.dart'; +export 'src/winrt/foundation/iasyncaction.dart'; +export 'src/winrt/foundation/iasyncinfo.dart'; +export 'src/winrt/foundation/iasyncoperation.dart'; +export 'src/winrt/foundation/ipropertyvalue.dart'; +export 'src/winrt/foundation/ireference.dart'; +export 'src/winrt/foundation/propertyvalue.dart'; export 'src/winrt/foundation/collections/iiterable.dart'; export 'src/winrt/foundation/collections/iiterator.dart'; export 'src/winrt/foundation/collections/ikeyvaluepair.dart'; @@ -44,12 +50,6 @@ export 'src/winrt/foundation/collections/ivectorview.dart'; export 'src/winrt/foundation/collections/propertyset.dart'; export 'src/winrt/foundation/collections/stringmap.dart'; export 'src/winrt/foundation/collections/valueset.dart'; -export 'src/winrt/foundation/iasyncaction.dart'; -export 'src/winrt/foundation/iasyncinfo.dart'; -export 'src/winrt/foundation/iasyncoperation.dart'; -export 'src/winrt/foundation/ipropertyvalue.dart'; -export 'src/winrt/foundation/ireference.dart'; -export 'src/winrt/foundation/propertyvalue.dart'; export 'src/winrt/gaming/input/gamepad.dart'; export 'src/winrt/gaming/input/igamecontroller.dart'; export 'src/winrt/gaming/input/igamecontrollerbatteryinfo.dart'; @@ -61,12 +61,12 @@ export 'src/winrt/globalization/phonenumberformatting/phonenumberformatter.dart' export 'src/winrt/graphics/printing3d/iprinting3dmultiplepropertymaterial.dart'; export 'src/winrt/graphics/printing3d/printing3dmultiplepropertymaterial.dart'; export 'src/winrt/media/mediaproperties/mediapropertyset.dart'; -export 'src/winrt/networking/connectivity/inetworkinformationstatics.dart'; export 'src/winrt/networking/ihostname.dart'; +export 'src/winrt/networking/connectivity/inetworkinformationstatics.dart'; export 'src/winrt/storage/istorageitem.dart'; export 'src/winrt/storage/iuserdatapathsstatics.dart'; -export 'src/winrt/storage/pickers/ifileopenpicker.dart'; export 'src/winrt/storage/userdatapaths.dart'; +export 'src/winrt/storage/pickers/ifileopenpicker.dart'; export 'src/winrt/ui/notifications/itoastnotificationfactory.dart'; export 'src/winrt/ui/notifications/itoastnotificationmanagerstatics.dart'; export 'src/winrt/ui/notifications/toastnotification.dart'; From d674c74d6260dfcd2ffe377a1727b5002af3f6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Durmu=C5=9F?= Date: Tue, 30 Aug 2022 17:47:55 +0300 Subject: [PATCH 11/13] Fix code examples --- doc/winrt.md | 2 +- lib/src/winrt_helpers.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/winrt.md b/doc/winrt.md index c9a21b7761..87f7749625 100644 --- a/doc/winrt.md +++ b/doc/winrt.md @@ -24,7 +24,7 @@ to the object type desired. For example: ```dart final comObject = CreateObject('Windows.Globalization.Calendar', IID_ICalendar); -final calendar = ICalendar.from(comObject); +final calendar = ICalendar.fromRawPointer(comObject); ``` The object should be disposed of when it is no longer in use, for example: diff --git a/lib/src/winrt_helpers.dart b/lib/src/winrt_helpers.dart index 7a98800c13..c360cafa31 100644 --- a/lib/src/winrt_helpers.dart +++ b/lib/src/winrt_helpers.dart @@ -45,7 +45,7 @@ extension WinRTStringConversion on Pointer { /// /// ```dart /// final object = CreateObject('Windows.Globalization.Calendar', IID_ICalendar); -/// final calendar = ICalendar.from(object); +/// final calendar = ICalendar.fromRawPointer(object); /// ``` /// /// {@category winrt} From 44bd1a361632d6284e2467af2dd1709c4a2e59a5 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 19:19:37 +0200 Subject: [PATCH 12/13] Minor tidy up --- example/dump.dart | 4 +- lib/src/winrt/storage/applicationdata.dart | 97 ------ lib/src/winrt/storage/iapplicationdata.dart | 294 ------------------ .../storage/iapplicationdatastatics.dart | 57 ---- 4 files changed, 2 insertions(+), 450 deletions(-) delete mode 100644 lib/src/winrt/storage/applicationdata.dart delete mode 100644 lib/src/winrt/storage/iapplicationdata.dart delete mode 100644 lib/src/winrt/storage/iapplicationdatastatics.dart diff --git a/example/dump.dart b/example/dump.dart index 30f847e92e..cecf52f4bb 100644 --- a/example/dump.dart +++ b/example/dump.dart @@ -36,10 +36,9 @@ Map getExports(String module) { } final modulePtr = module.toNativeUtf16(); - final mask = '*'.toNativeUtf16(); final baseOfDll = - SymLoadModuleEx(hProcess, 0, modulePtr, nullptr, 0, 0, nullptr, 0); + SymLoadModuleEx(hProcess, NULL, modulePtr, nullptr, 0, 0, nullptr, 0); if (baseOfDll == 0) { print('SymLoadModuleEx failed.'); @@ -48,6 +47,7 @@ Map getExports(String module) { exit(1); } + final mask = '*'.toNativeUtf16(); if (SymEnumSymbols( hProcess, baseOfDll, diff --git a/lib/src/winrt/storage/applicationdata.dart b/lib/src/winrt/storage/applicationdata.dart deleted file mode 100644 index a11bbad2f7..0000000000 --- a/lib/src/winrt/storage/applicationdata.dart +++ /dev/null @@ -1,97 +0,0 @@ -// applicationdata.dart - -// THIS FILE IS GENERATED AUTOMATICALLY AND SHOULD NOT BE EDITED DIRECTLY. - -// ignore_for_file: unused_import, directives_ordering -// ignore_for_file: constant_identifier_names, non_constant_identifier_names -// ignore_for_file: no_leading_underscores_for_local_identifiers - -import 'dart:ffi'; - -import 'package:ffi/ffi.dart'; - -import '../../api_ms_win_core_winrt_string_l1_1_0.dart'; -import '../../com/iinspectable.dart'; -import '../../combase.dart'; -import '../../exceptions.dart'; -import '../internal/hstring_array.dart'; -import '../../macros.dart'; -import '../../types.dart'; -import '../../utils.dart'; -import '../../winrt_callbacks.dart'; -import '../../winrt_helpers.dart'; -import 'iapplicationdata.dart'; -import 'iapplicationdatastatics.dart'; -import '../../winrt/foundation/iasyncaction.dart'; -import '../../winrt/foundation/iasyncoperation.dart'; -import '../../winrt/system/user.dart'; - -/// {@category Class} -/// {@category winrt} -class ApplicationData extends IInspectable implements IApplicationData { - ApplicationData.fromRawPointer(super.ptr); - - static const _className = 'Windows.Storage.ApplicationData'; - - // IApplicationDataStatics methods - static ApplicationData get current { - final activationFactory = - CreateActivationFactory(_className, IID_IApplicationDataStatics); - - try { - final result = ApplicationData.fromRawPointer( - IApplicationDataStatics.fromRawPointer(activationFactory).current); - return result; - } finally { - free(activationFactory); - } - } - - // IApplicationData methods - late final _iApplicationData = - IApplicationData.fromRawPointer(toInterface(IID_IApplicationData)); - - @override - int get version => _iApplicationData.version; - - @override - Pointer setVersionAsync(int desiredVersion, - Pointer> handler) => - _iApplicationData.setVersionAsync(desiredVersion, handler); - - @override - Pointer clearAllAsync() => _iApplicationData.clearAllAsync(); - - @override - Pointer clearAsync(int locality) => - _iApplicationData.clearAsync(locality); - - @override - Pointer get localSettings => _iApplicationData.localSettings; - - @override - Pointer get roamingSettings => _iApplicationData.roamingSettings; - - @override - Pointer get localFolder => _iApplicationData.localFolder; - - @override - Pointer get roamingFolder => _iApplicationData.roamingFolder; - - @override - Pointer get temporaryFolder => _iApplicationData.temporaryFolder; - - @override - int add_DataChanged(Pointer> handler) => - _iApplicationData.add_DataChanged(handler); - - @override - void remove_DataChanged(int token) => - _iApplicationData.remove_DataChanged(token); - - @override - void signalDataChanged() => _iApplicationData.signalDataChanged(); - - @override - int get roamingStorageQuota => _iApplicationData.roamingStorageQuota; -} diff --git a/lib/src/winrt/storage/iapplicationdata.dart b/lib/src/winrt/storage/iapplicationdata.dart deleted file mode 100644 index 935b927172..0000000000 --- a/lib/src/winrt/storage/iapplicationdata.dart +++ /dev/null @@ -1,294 +0,0 @@ -// iapplicationdata.dart - -// THIS FILE IS GENERATED AUTOMATICALLY AND SHOULD NOT BE EDITED DIRECTLY. - -// ignore_for_file: unused_import, directives_ordering -// ignore_for_file: constant_identifier_names, non_constant_identifier_names -// ignore_for_file: no_leading_underscores_for_local_identifiers - -import 'dart:ffi'; - -import 'package:ffi/ffi.dart'; - -import '../../api_ms_win_core_winrt_string_l1_1_0.dart'; -import '../../com/iinspectable.dart'; -import '../../combase.dart'; -import '../../exceptions.dart'; -import '../internal/hstring_array.dart'; -import '../../macros.dart'; -import '../../types.dart'; -import '../../utils.dart'; -import '../../winrt_callbacks.dart'; -import '../../winrt_helpers.dart'; -import 'applicationdata.dart'; -import '../../winrt/foundation/iasyncaction.dart'; - -/// @nodoc -const IID_IApplicationData = '{C3DA6FB7-B744-4B45-B0B8-223A0938D0DC}'; - -/// {@category Interface} -/// {@category winrt} -class IApplicationData extends IInspectable { - // vtable begins at 6, is 13 entries long. - IApplicationData.fromRawPointer(super.ptr); - - factory IApplicationData.from(IInspectable interface) => - IApplicationData.fromRawPointer( - interface.toInterface(IID_IApplicationData)); - - int get version { - final retValuePtr = calloc(); - - try { - final hr = ptr.ref.vtable - .elementAt(6) - .cast< - Pointer< - NativeFunction)>>>() - .value - .asFunction< - int Function( - Pointer, Pointer)>()(ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - final retValue = retValuePtr.value; - return retValue; - } finally { - free(retValuePtr); - } - } - - Pointer setVersionAsync(int desiredVersion, - Pointer> handler) { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(7) - .cast< - Pointer< - NativeFunction< - HRESULT Function( - Pointer, - Uint32 desiredVersion, - Pointer< - NativeFunction< - ApplicationDataSetVersionHandler>> - handler, - Pointer)>>>() - .value - .asFunction< - int Function( - Pointer, - int desiredVersion, - Pointer> - handler, - Pointer)>()( - ptr.ref.lpVtbl, desiredVersion, handler, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - Pointer clearAllAsync() { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(8) - .cast< - Pointer< - NativeFunction< - HRESULT Function(Pointer, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - Pointer clearAsync(int locality) { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(9) - .cast< - Pointer< - NativeFunction< - HRESULT Function( - Pointer, Int32 locality, Pointer)>>>() - .value - .asFunction< - int Function(Pointer, int locality, Pointer)>()( - ptr.ref.lpVtbl, locality, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - Pointer get localSettings { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(10) - .cast< - Pointer< - NativeFunction< - HRESULT Function(Pointer, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - Pointer get roamingSettings { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(11) - .cast< - Pointer< - NativeFunction< - HRESULT Function(Pointer, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - Pointer get localFolder { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(12) - .cast< - Pointer< - NativeFunction< - HRESULT Function(Pointer, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - Pointer get roamingFolder { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(13) - .cast< - Pointer< - NativeFunction< - HRESULT Function(Pointer, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - Pointer get temporaryFolder { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(14) - .cast< - Pointer< - NativeFunction< - HRESULT Function(Pointer, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } - - int add_DataChanged(Pointer> handler) { - final retValuePtr = calloc(); - - try { - final hr = ptr.ref.vtable - .elementAt(15) - .cast< - Pointer< - NativeFunction< - HRESULT Function( - Pointer, - Pointer> handler, - Pointer)>>>() - .value - .asFunction< - int Function( - Pointer, - Pointer> handler, - Pointer)>()(ptr.ref.lpVtbl, handler, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - final retValue = retValuePtr.value; - return retValue; - } finally { - free(retValuePtr); - } - } - - void remove_DataChanged(int token) { - final hr = ptr.ref.vtable - .elementAt(16) - .cast< - Pointer>>() - .value - .asFunction()(ptr.ref.lpVtbl, token); - - if (FAILED(hr)) throw WindowsException(hr); - } - - void signalDataChanged() { - final hr = ptr.ref.vtable - .elementAt(17) - .cast>>() - .value - .asFunction()(ptr.ref.lpVtbl); - - if (FAILED(hr)) throw WindowsException(hr); - } - - int get roamingStorageQuota { - final retValuePtr = calloc(); - - try { - final hr = ptr.ref.vtable - .elementAt(18) - .cast< - Pointer< - NativeFunction)>>>() - .value - .asFunction< - int Function( - Pointer, Pointer)>()(ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - final retValue = retValuePtr.value; - return retValue; - } finally { - free(retValuePtr); - } - } -} diff --git a/lib/src/winrt/storage/iapplicationdatastatics.dart b/lib/src/winrt/storage/iapplicationdatastatics.dart deleted file mode 100644 index 1eca2d1991..0000000000 --- a/lib/src/winrt/storage/iapplicationdatastatics.dart +++ /dev/null @@ -1,57 +0,0 @@ -// iapplicationdatastatics.dart - -// THIS FILE IS GENERATED AUTOMATICALLY AND SHOULD NOT BE EDITED DIRECTLY. - -// ignore_for_file: unused_import, directives_ordering -// ignore_for_file: constant_identifier_names, non_constant_identifier_names -// ignore_for_file: no_leading_underscores_for_local_identifiers - -import 'dart:ffi'; - -import 'package:ffi/ffi.dart'; - -import '../../api_ms_win_core_winrt_string_l1_1_0.dart'; -import '../../combase.dart'; -import '../../exceptions.dart'; -import '../../macros.dart'; -import '../../utils.dart'; -import '../../types.dart'; -import '../../winrt_callbacks.dart'; -import '../../winrt_helpers.dart'; - -import '../../winrt/internal/hstring_array.dart'; - -import '../../winrt/storage/applicationdata.dart'; -import '../../com/iinspectable.dart'; - -/// @nodoc -const IID_IApplicationDataStatics = '{5612147B-E843-45E3-94D8-06169E3C8E17}'; - -/// {@category Interface} -/// {@category winrt} -class IApplicationDataStatics extends IInspectable { - // vtable begins at 6, is 1 entries long. - IApplicationDataStatics.fromRawPointer(super.ptr); - - factory IApplicationDataStatics.from(IInspectable interface) => - IApplicationDataStatics.fromRawPointer( - interface.toInterface(IID_IApplicationDataStatics)); - - Pointer get current { - final retValuePtr = calloc(); - - final hr = ptr.ref.vtable - .elementAt(6) - .cast< - Pointer< - NativeFunction< - HRESULT Function(Pointer, Pointer)>>>() - .value - .asFunction)>()( - ptr.ref.lpVtbl, retValuePtr); - - if (FAILED(hr)) throw WindowsException(hr); - - return retValuePtr; - } -} From 0a8099be6f9aba4428909b420d52a05c465689e2 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 30 Aug 2022 19:28:24 +0200 Subject: [PATCH 13/13] Remove IApplicationDataStatics --- tool/generator/lib/src/inputs/interfaces.dart | 1 - tool/generator/test/utils_test.dart | 2 -- 2 files changed, 3 deletions(-) diff --git a/tool/generator/lib/src/inputs/interfaces.dart b/tool/generator/lib/src/inputs/interfaces.dart index 9d65d28e7e..9e5d2ae661 100644 --- a/tool/generator/lib/src/inputs/interfaces.dart +++ b/tool/generator/lib/src/inputs/interfaces.dart @@ -117,7 +117,6 @@ final windowsRuntimeTypesToGenerate = { 'Windows.Globalization.PhoneNumberFormatting.PhoneNumberInfo', 'Windows.Graphics.Printing3D.Printing3DMultiplePropertyMaterial', 'Windows.Networking.IHostName', - 'Windows.Storage.IApplicationDataStatics', 'Windows.Storage.IStorageItem', 'Windows.Storage.UserDataPaths', 'Windows.Storage.Pickers.IFileOpenPicker', diff --git a/tool/generator/test/utils_test.dart b/tool/generator/test/utils_test.dart index 39c0fcf0cd..b8db7d2174 100644 --- a/tool/generator/test/utils_test.dart +++ b/tool/generator/test/utils_test.dart @@ -167,7 +167,6 @@ void main() { 'Windows.Globalization.PhoneNumberFormatting.PhoneNumberFormatter', 'Windows.Globalization.PhoneNumberFormatting.PhoneNumberInfo', 'Windows.Networking.IHostName', - 'Windows.Storage.IApplicationDataStatics', 'Windows.Storage.IStorageItem', 'Windows.Storage.UserDataPaths', 'Windows.Storage.Pickers.IFileOpenPicker', @@ -211,7 +210,6 @@ void main() { NamespaceGroup( namespace: 'Windows.Storage', types: [ - 'Windows.Storage.IApplicationDataStatics', 'Windows.Storage.IStorageItem', 'Windows.Storage.UserDataPaths' ],