winrt-Windows.System.Diagnostics 2.1.0__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/PKG-INFO +7 -7
  2. winrt_windows_system_diagnostics-2.2.0/all-requirements.txt +6 -0
  3. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/py.Windows.System.Diagnostics.cpp +469 -70
  4. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/pyproject.toml +3 -2
  5. winrt_windows_system_diagnostics-2.2.0/pywinrt-version.txt +1 -0
  6. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/requirements.txt +2 -2
  7. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/winrt/_winrt_windows_system_diagnostics.pyi +1 -1
  8. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/winrt/windows/system/diagnostics/__init__.py +1 -1
  9. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/winrt_Windows.System.Diagnostics.egg-info/PKG-INFO +7 -7
  10. winrt_windows_system_diagnostics-2.2.0/winrt_Windows.System.Diagnostics.egg-info/requires.txt +7 -0
  11. winrt_windows_system_diagnostics-2.1.0/all-requirements.txt +0 -6
  12. winrt_windows_system_diagnostics-2.1.0/pywinrt-version.txt +0 -1
  13. winrt_windows_system_diagnostics-2.1.0/winrt_Windows.System.Diagnostics.egg-info/requires.txt +0 -7
  14. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/README.md +0 -0
  15. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/setup.cfg +0 -0
  16. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/setup.py +0 -0
  17. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/winrt/windows/system/diagnostics/py.typed +0 -0
  18. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/winrt_Windows.System.Diagnostics.egg-info/SOURCES.txt +0 -0
  19. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/winrt_Windows.System.Diagnostics.egg-info/dependency_links.txt +0 -0
  20. {winrt_windows_system_diagnostics-2.1.0 → winrt_windows_system_diagnostics-2.2.0}/winrt_Windows.System.Diagnostics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.System.Diagnostics
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -10,14 +10,14 @@ Classifier: Operating System :: Microsoft :: Windows
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
- Requires-Python: <3.13,>=3.9
13
+ Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.1.0
15
+ Requires-Dist: winrt-runtime==2.2.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Data.Json[all]==2.1.0; extra == "all"
18
- Requires-Dist: winrt-Windows.Foundation[all]==2.1.0; extra == "all"
19
- Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.1.0; extra == "all"
20
- Requires-Dist: winrt-Windows.System[all]==2.1.0; extra == "all"
17
+ Requires-Dist: winrt-Windows.Data.Json[all]==2.2.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.Foundation[all]==2.2.0; extra == "all"
19
+ Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.2.0; extra == "all"
20
+ Requires-Dist: winrt-Windows.System[all]==2.2.0; extra == "all"
21
21
 
22
22
  <!-- warning: Please don't edit this file. It was automatically generated. -->
23
23
 
@@ -0,0 +1,6 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
+
3
+ winrt-Windows.Data.Json[all]==2.2.0
4
+ winrt-Windows.Foundation[all]==2.2.0
5
+ winrt-Windows.Foundation.Collections[all]==2.2.0
6
+ winrt-Windows.System[all]==2.2.0
@@ -1,4 +1,4 @@
1
- // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  #include "py.Windows.System.Diagnostics.h"
4
4
 
@@ -25,7 +25,14 @@ namespace py::cpp::Windows::System::Diagnostics
25
25
  {
26
26
  try
27
27
  {
28
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.DiagnosticActionResult", L"ExtendedError"))
28
+ static std::optional<bool> is_property_present{};
29
+
30
+ if (!is_property_present.has_value())
31
+ {
32
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.DiagnosticActionResult", L"ExtendedError");
33
+ }
34
+
35
+ if (!is_property_present.value())
29
36
  {
30
37
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
31
38
  return nullptr;
@@ -44,7 +51,14 @@ namespace py::cpp::Windows::System::Diagnostics
44
51
  {
45
52
  try
46
53
  {
47
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.DiagnosticActionResult", L"Results"))
54
+ static std::optional<bool> is_property_present{};
55
+
56
+ if (!is_property_present.has_value())
57
+ {
58
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.DiagnosticActionResult", L"Results");
59
+ }
60
+
61
+ if (!is_property_present.value())
48
62
  {
49
63
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
50
64
  return nullptr;
@@ -135,7 +149,14 @@ namespace py::cpp::Windows::System::Diagnostics
135
149
  {
136
150
  try
137
151
  {
138
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"GetDefault", 0))
152
+ static std::optional<bool> is_overload_present{};
153
+
154
+ if (!is_overload_present.has_value())
155
+ {
156
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"GetDefault", 0);
157
+ }
158
+
159
+ if (!is_overload_present.value())
139
160
  {
140
161
  py::set_arg_count_version_error(0);
141
162
  return nullptr;
@@ -164,7 +185,14 @@ namespace py::cpp::Windows::System::Diagnostics
164
185
  {
165
186
  try
166
187
  {
167
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"GetForUser", 1))
188
+ static std::optional<bool> is_overload_present{};
189
+
190
+ if (!is_overload_present.has_value())
191
+ {
192
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"GetForUser", 1);
193
+ }
194
+
195
+ if (!is_overload_present.value())
168
196
  {
169
197
  py::set_arg_count_version_error(1);
170
198
  return nullptr;
@@ -195,7 +223,14 @@ namespace py::cpp::Windows::System::Diagnostics
195
223
  {
196
224
  try
197
225
  {
198
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"RunDiagnosticActionAsync", 1))
226
+ static std::optional<bool> is_overload_present{};
227
+
228
+ if (!is_overload_present.has_value())
229
+ {
230
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"RunDiagnosticActionAsync", 1);
231
+ }
232
+
233
+ if (!is_overload_present.value())
199
234
  {
200
235
  py::set_arg_count_version_error(1);
201
236
  return nullptr;
@@ -226,7 +261,14 @@ namespace py::cpp::Windows::System::Diagnostics
226
261
  {
227
262
  try
228
263
  {
229
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"RunDiagnosticActionFromStringAsync", 1))
264
+ static std::optional<bool> is_overload_present{};
265
+
266
+ if (!is_overload_present.has_value())
267
+ {
268
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"RunDiagnosticActionFromStringAsync", 1);
269
+ }
270
+
271
+ if (!is_overload_present.value())
230
272
  {
231
273
  py::set_arg_count_version_error(1);
232
274
  return nullptr;
@@ -253,7 +295,14 @@ namespace py::cpp::Windows::System::Diagnostics
253
295
  {
254
296
  try
255
297
  {
256
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"IsSupported"))
298
+ static std::optional<bool> is_property_present{};
299
+
300
+ if (!is_property_present.has_value())
301
+ {
302
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.DiagnosticInvoker", L"IsSupported");
303
+ }
304
+
305
+ if (!is_property_present.value())
257
306
  {
258
307
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
259
308
  return nullptr;
@@ -372,7 +421,14 @@ namespace py::cpp::Windows::System::Diagnostics
372
421
  {
373
422
  try
374
423
  {
375
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessCpuUsage", L"GetReport", 0))
424
+ static std::optional<bool> is_overload_present{};
425
+
426
+ if (!is_overload_present.has_value())
427
+ {
428
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessCpuUsage", L"GetReport", 0);
429
+ }
430
+
431
+ if (!is_overload_present.value())
376
432
  {
377
433
  py::set_arg_count_version_error(0);
378
434
  return nullptr;
@@ -464,7 +520,14 @@ namespace py::cpp::Windows::System::Diagnostics
464
520
  {
465
521
  try
466
522
  {
467
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessCpuUsageReport", L"KernelTime"))
523
+ static std::optional<bool> is_property_present{};
524
+
525
+ if (!is_property_present.has_value())
526
+ {
527
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessCpuUsageReport", L"KernelTime");
528
+ }
529
+
530
+ if (!is_property_present.value())
468
531
  {
469
532
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
470
533
  return nullptr;
@@ -483,7 +546,14 @@ namespace py::cpp::Windows::System::Diagnostics
483
546
  {
484
547
  try
485
548
  {
486
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessCpuUsageReport", L"UserTime"))
549
+ static std::optional<bool> is_property_present{};
550
+
551
+ if (!is_property_present.has_value())
552
+ {
553
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessCpuUsageReport", L"UserTime");
554
+ }
555
+
556
+ if (!is_property_present.value())
487
557
  {
488
558
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
489
559
  return nullptr;
@@ -574,7 +644,14 @@ namespace py::cpp::Windows::System::Diagnostics
574
644
  {
575
645
  try
576
646
  {
577
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"GetAppDiagnosticInfos", 0))
647
+ static std::optional<bool> is_overload_present{};
648
+
649
+ if (!is_overload_present.has_value())
650
+ {
651
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"GetAppDiagnosticInfos", 0);
652
+ }
653
+
654
+ if (!is_overload_present.value())
578
655
  {
579
656
  py::set_arg_count_version_error(0);
580
657
  return nullptr;
@@ -603,7 +680,14 @@ namespace py::cpp::Windows::System::Diagnostics
603
680
  {
604
681
  try
605
682
  {
606
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"GetForCurrentProcess", 0))
683
+ static std::optional<bool> is_overload_present{};
684
+
685
+ if (!is_overload_present.has_value())
686
+ {
687
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"GetForCurrentProcess", 0);
688
+ }
689
+
690
+ if (!is_overload_present.value())
607
691
  {
608
692
  py::set_arg_count_version_error(0);
609
693
  return nullptr;
@@ -632,7 +716,14 @@ namespace py::cpp::Windows::System::Diagnostics
632
716
  {
633
717
  try
634
718
  {
635
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"GetForProcesses", 0))
719
+ static std::optional<bool> is_overload_present{};
720
+
721
+ if (!is_overload_present.has_value())
722
+ {
723
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"GetForProcesses", 0);
724
+ }
725
+
726
+ if (!is_overload_present.value())
636
727
  {
637
728
  py::set_arg_count_version_error(0);
638
729
  return nullptr;
@@ -661,7 +752,14 @@ namespace py::cpp::Windows::System::Diagnostics
661
752
  {
662
753
  try
663
754
  {
664
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"TryGetForProcessId", 1))
755
+ static std::optional<bool> is_overload_present{};
756
+
757
+ if (!is_overload_present.has_value())
758
+ {
759
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"TryGetForProcessId", 1);
760
+ }
761
+
762
+ if (!is_overload_present.value())
665
763
  {
666
764
  py::set_arg_count_version_error(1);
667
765
  return nullptr;
@@ -688,7 +786,14 @@ namespace py::cpp::Windows::System::Diagnostics
688
786
  {
689
787
  try
690
788
  {
691
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"CpuUsage"))
789
+ static std::optional<bool> is_property_present{};
790
+
791
+ if (!is_property_present.has_value())
792
+ {
793
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"CpuUsage");
794
+ }
795
+
796
+ if (!is_property_present.value())
692
797
  {
693
798
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
694
799
  return nullptr;
@@ -707,7 +812,14 @@ namespace py::cpp::Windows::System::Diagnostics
707
812
  {
708
813
  try
709
814
  {
710
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"DiskUsage"))
815
+ static std::optional<bool> is_property_present{};
816
+
817
+ if (!is_property_present.has_value())
818
+ {
819
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"DiskUsage");
820
+ }
821
+
822
+ if (!is_property_present.value())
711
823
  {
712
824
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
713
825
  return nullptr;
@@ -726,7 +838,14 @@ namespace py::cpp::Windows::System::Diagnostics
726
838
  {
727
839
  try
728
840
  {
729
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"ExecutableFileName"))
841
+ static std::optional<bool> is_property_present{};
842
+
843
+ if (!is_property_present.has_value())
844
+ {
845
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"ExecutableFileName");
846
+ }
847
+
848
+ if (!is_property_present.value())
730
849
  {
731
850
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
732
851
  return nullptr;
@@ -745,7 +864,14 @@ namespace py::cpp::Windows::System::Diagnostics
745
864
  {
746
865
  try
747
866
  {
748
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"MemoryUsage"))
867
+ static std::optional<bool> is_property_present{};
868
+
869
+ if (!is_property_present.has_value())
870
+ {
871
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"MemoryUsage");
872
+ }
873
+
874
+ if (!is_property_present.value())
749
875
  {
750
876
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
751
877
  return nullptr;
@@ -764,7 +890,14 @@ namespace py::cpp::Windows::System::Diagnostics
764
890
  {
765
891
  try
766
892
  {
767
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"Parent"))
893
+ static std::optional<bool> is_property_present{};
894
+
895
+ if (!is_property_present.has_value())
896
+ {
897
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"Parent");
898
+ }
899
+
900
+ if (!is_property_present.value())
768
901
  {
769
902
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
770
903
  return nullptr;
@@ -783,7 +916,14 @@ namespace py::cpp::Windows::System::Diagnostics
783
916
  {
784
917
  try
785
918
  {
786
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"ProcessId"))
919
+ static std::optional<bool> is_property_present{};
920
+
921
+ if (!is_property_present.has_value())
922
+ {
923
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"ProcessId");
924
+ }
925
+
926
+ if (!is_property_present.value())
787
927
  {
788
928
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
789
929
  return nullptr;
@@ -802,7 +942,14 @@ namespace py::cpp::Windows::System::Diagnostics
802
942
  {
803
943
  try
804
944
  {
805
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"ProcessStartTime"))
945
+ static std::optional<bool> is_property_present{};
946
+
947
+ if (!is_property_present.has_value())
948
+ {
949
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"ProcessStartTime");
950
+ }
951
+
952
+ if (!is_property_present.value())
806
953
  {
807
954
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
808
955
  return nullptr;
@@ -821,7 +968,14 @@ namespace py::cpp::Windows::System::Diagnostics
821
968
  {
822
969
  try
823
970
  {
824
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"IsPackaged"))
971
+ static std::optional<bool> is_property_present{};
972
+
973
+ if (!is_property_present.has_value())
974
+ {
975
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiagnosticInfo", L"IsPackaged");
976
+ }
977
+
978
+ if (!is_property_present.value())
825
979
  {
826
980
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
827
981
  return nullptr;
@@ -947,7 +1101,14 @@ namespace py::cpp::Windows::System::Diagnostics
947
1101
  {
948
1102
  try
949
1103
  {
950
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiskUsage", L"GetReport", 0))
1104
+ static std::optional<bool> is_overload_present{};
1105
+
1106
+ if (!is_overload_present.has_value())
1107
+ {
1108
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessDiskUsage", L"GetReport", 0);
1109
+ }
1110
+
1111
+ if (!is_overload_present.value())
951
1112
  {
952
1113
  py::set_arg_count_version_error(0);
953
1114
  return nullptr;
@@ -1039,7 +1200,14 @@ namespace py::cpp::Windows::System::Diagnostics
1039
1200
  {
1040
1201
  try
1041
1202
  {
1042
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"BytesReadCount"))
1203
+ static std::optional<bool> is_property_present{};
1204
+
1205
+ if (!is_property_present.has_value())
1206
+ {
1207
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"BytesReadCount");
1208
+ }
1209
+
1210
+ if (!is_property_present.value())
1043
1211
  {
1044
1212
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1045
1213
  return nullptr;
@@ -1058,7 +1226,14 @@ namespace py::cpp::Windows::System::Diagnostics
1058
1226
  {
1059
1227
  try
1060
1228
  {
1061
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"BytesWrittenCount"))
1229
+ static std::optional<bool> is_property_present{};
1230
+
1231
+ if (!is_property_present.has_value())
1232
+ {
1233
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"BytesWrittenCount");
1234
+ }
1235
+
1236
+ if (!is_property_present.value())
1062
1237
  {
1063
1238
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1064
1239
  return nullptr;
@@ -1077,7 +1252,14 @@ namespace py::cpp::Windows::System::Diagnostics
1077
1252
  {
1078
1253
  try
1079
1254
  {
1080
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"OtherBytesCount"))
1255
+ static std::optional<bool> is_property_present{};
1256
+
1257
+ if (!is_property_present.has_value())
1258
+ {
1259
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"OtherBytesCount");
1260
+ }
1261
+
1262
+ if (!is_property_present.value())
1081
1263
  {
1082
1264
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1083
1265
  return nullptr;
@@ -1096,7 +1278,14 @@ namespace py::cpp::Windows::System::Diagnostics
1096
1278
  {
1097
1279
  try
1098
1280
  {
1099
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"OtherOperationCount"))
1281
+ static std::optional<bool> is_property_present{};
1282
+
1283
+ if (!is_property_present.has_value())
1284
+ {
1285
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"OtherOperationCount");
1286
+ }
1287
+
1288
+ if (!is_property_present.value())
1100
1289
  {
1101
1290
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1102
1291
  return nullptr;
@@ -1115,7 +1304,14 @@ namespace py::cpp::Windows::System::Diagnostics
1115
1304
  {
1116
1305
  try
1117
1306
  {
1118
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"ReadOperationCount"))
1307
+ static std::optional<bool> is_property_present{};
1308
+
1309
+ if (!is_property_present.has_value())
1310
+ {
1311
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"ReadOperationCount");
1312
+ }
1313
+
1314
+ if (!is_property_present.value())
1119
1315
  {
1120
1316
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1121
1317
  return nullptr;
@@ -1134,7 +1330,14 @@ namespace py::cpp::Windows::System::Diagnostics
1134
1330
  {
1135
1331
  try
1136
1332
  {
1137
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"WriteOperationCount"))
1333
+ static std::optional<bool> is_property_present{};
1334
+
1335
+ if (!is_property_present.has_value())
1336
+ {
1337
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessDiskUsageReport", L"WriteOperationCount");
1338
+ }
1339
+
1340
+ if (!is_property_present.value())
1138
1341
  {
1139
1342
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1140
1343
  return nullptr;
@@ -1229,7 +1432,14 @@ namespace py::cpp::Windows::System::Diagnostics
1229
1432
  {
1230
1433
  try
1231
1434
  {
1232
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessMemoryUsage", L"GetReport", 0))
1435
+ static std::optional<bool> is_overload_present{};
1436
+
1437
+ if (!is_overload_present.has_value())
1438
+ {
1439
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.ProcessMemoryUsage", L"GetReport", 0);
1440
+ }
1441
+
1442
+ if (!is_overload_present.value())
1233
1443
  {
1234
1444
  py::set_arg_count_version_error(0);
1235
1445
  return nullptr;
@@ -1321,7 +1531,14 @@ namespace py::cpp::Windows::System::Diagnostics
1321
1531
  {
1322
1532
  try
1323
1533
  {
1324
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"NonPagedPoolSizeInBytes"))
1534
+ static std::optional<bool> is_property_present{};
1535
+
1536
+ if (!is_property_present.has_value())
1537
+ {
1538
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"NonPagedPoolSizeInBytes");
1539
+ }
1540
+
1541
+ if (!is_property_present.value())
1325
1542
  {
1326
1543
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1327
1544
  return nullptr;
@@ -1340,7 +1557,14 @@ namespace py::cpp::Windows::System::Diagnostics
1340
1557
  {
1341
1558
  try
1342
1559
  {
1343
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PageFaultCount"))
1560
+ static std::optional<bool> is_property_present{};
1561
+
1562
+ if (!is_property_present.has_value())
1563
+ {
1564
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PageFaultCount");
1565
+ }
1566
+
1567
+ if (!is_property_present.value())
1344
1568
  {
1345
1569
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1346
1570
  return nullptr;
@@ -1359,7 +1583,14 @@ namespace py::cpp::Windows::System::Diagnostics
1359
1583
  {
1360
1584
  try
1361
1585
  {
1362
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PageFileSizeInBytes"))
1586
+ static std::optional<bool> is_property_present{};
1587
+
1588
+ if (!is_property_present.has_value())
1589
+ {
1590
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PageFileSizeInBytes");
1591
+ }
1592
+
1593
+ if (!is_property_present.value())
1363
1594
  {
1364
1595
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1365
1596
  return nullptr;
@@ -1378,7 +1609,14 @@ namespace py::cpp::Windows::System::Diagnostics
1378
1609
  {
1379
1610
  try
1380
1611
  {
1381
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PagedPoolSizeInBytes"))
1612
+ static std::optional<bool> is_property_present{};
1613
+
1614
+ if (!is_property_present.has_value())
1615
+ {
1616
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PagedPoolSizeInBytes");
1617
+ }
1618
+
1619
+ if (!is_property_present.value())
1382
1620
  {
1383
1621
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1384
1622
  return nullptr;
@@ -1397,7 +1635,14 @@ namespace py::cpp::Windows::System::Diagnostics
1397
1635
  {
1398
1636
  try
1399
1637
  {
1400
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakNonPagedPoolSizeInBytes"))
1638
+ static std::optional<bool> is_property_present{};
1639
+
1640
+ if (!is_property_present.has_value())
1641
+ {
1642
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakNonPagedPoolSizeInBytes");
1643
+ }
1644
+
1645
+ if (!is_property_present.value())
1401
1646
  {
1402
1647
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1403
1648
  return nullptr;
@@ -1416,7 +1661,14 @@ namespace py::cpp::Windows::System::Diagnostics
1416
1661
  {
1417
1662
  try
1418
1663
  {
1419
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakPageFileSizeInBytes"))
1664
+ static std::optional<bool> is_property_present{};
1665
+
1666
+ if (!is_property_present.has_value())
1667
+ {
1668
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakPageFileSizeInBytes");
1669
+ }
1670
+
1671
+ if (!is_property_present.value())
1420
1672
  {
1421
1673
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1422
1674
  return nullptr;
@@ -1435,7 +1687,14 @@ namespace py::cpp::Windows::System::Diagnostics
1435
1687
  {
1436
1688
  try
1437
1689
  {
1438
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakPagedPoolSizeInBytes"))
1690
+ static std::optional<bool> is_property_present{};
1691
+
1692
+ if (!is_property_present.has_value())
1693
+ {
1694
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakPagedPoolSizeInBytes");
1695
+ }
1696
+
1697
+ if (!is_property_present.value())
1439
1698
  {
1440
1699
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1441
1700
  return nullptr;
@@ -1454,7 +1713,14 @@ namespace py::cpp::Windows::System::Diagnostics
1454
1713
  {
1455
1714
  try
1456
1715
  {
1457
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakVirtualMemorySizeInBytes"))
1716
+ static std::optional<bool> is_property_present{};
1717
+
1718
+ if (!is_property_present.has_value())
1719
+ {
1720
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakVirtualMemorySizeInBytes");
1721
+ }
1722
+
1723
+ if (!is_property_present.value())
1458
1724
  {
1459
1725
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1460
1726
  return nullptr;
@@ -1473,7 +1739,14 @@ namespace py::cpp::Windows::System::Diagnostics
1473
1739
  {
1474
1740
  try
1475
1741
  {
1476
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakWorkingSetSizeInBytes"))
1742
+ static std::optional<bool> is_property_present{};
1743
+
1744
+ if (!is_property_present.has_value())
1745
+ {
1746
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PeakWorkingSetSizeInBytes");
1747
+ }
1748
+
1749
+ if (!is_property_present.value())
1477
1750
  {
1478
1751
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1479
1752
  return nullptr;
@@ -1492,7 +1765,14 @@ namespace py::cpp::Windows::System::Diagnostics
1492
1765
  {
1493
1766
  try
1494
1767
  {
1495
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PrivatePageCount"))
1768
+ static std::optional<bool> is_property_present{};
1769
+
1770
+ if (!is_property_present.has_value())
1771
+ {
1772
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"PrivatePageCount");
1773
+ }
1774
+
1775
+ if (!is_property_present.value())
1496
1776
  {
1497
1777
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1498
1778
  return nullptr;
@@ -1511,7 +1791,14 @@ namespace py::cpp::Windows::System::Diagnostics
1511
1791
  {
1512
1792
  try
1513
1793
  {
1514
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"VirtualMemorySizeInBytes"))
1794
+ static std::optional<bool> is_property_present{};
1795
+
1796
+ if (!is_property_present.has_value())
1797
+ {
1798
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"VirtualMemorySizeInBytes");
1799
+ }
1800
+
1801
+ if (!is_property_present.value())
1515
1802
  {
1516
1803
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1517
1804
  return nullptr;
@@ -1530,7 +1817,14 @@ namespace py::cpp::Windows::System::Diagnostics
1530
1817
  {
1531
1818
  try
1532
1819
  {
1533
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"WorkingSetSizeInBytes"))
1820
+ static std::optional<bool> is_property_present{};
1821
+
1822
+ if (!is_property_present.has_value())
1823
+ {
1824
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.ProcessMemoryUsageReport", L"WorkingSetSizeInBytes");
1825
+ }
1826
+
1827
+ if (!is_property_present.value())
1534
1828
  {
1535
1829
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1536
1830
  return nullptr;
@@ -1631,7 +1925,14 @@ namespace py::cpp::Windows::System::Diagnostics
1631
1925
  {
1632
1926
  try
1633
1927
  {
1634
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemCpuUsage", L"GetReport", 0))
1928
+ static std::optional<bool> is_overload_present{};
1929
+
1930
+ if (!is_overload_present.has_value())
1931
+ {
1932
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemCpuUsage", L"GetReport", 0);
1933
+ }
1934
+
1935
+ if (!is_overload_present.value())
1635
1936
  {
1636
1937
  py::set_arg_count_version_error(0);
1637
1938
  return nullptr;
@@ -1723,7 +2024,14 @@ namespace py::cpp::Windows::System::Diagnostics
1723
2024
  {
1724
2025
  try
1725
2026
  {
1726
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemCpuUsageReport", L"IdleTime"))
2027
+ static std::optional<bool> is_property_present{};
2028
+
2029
+ if (!is_property_present.has_value())
2030
+ {
2031
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemCpuUsageReport", L"IdleTime");
2032
+ }
2033
+
2034
+ if (!is_property_present.value())
1727
2035
  {
1728
2036
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1729
2037
  return nullptr;
@@ -1742,7 +2050,14 @@ namespace py::cpp::Windows::System::Diagnostics
1742
2050
  {
1743
2051
  try
1744
2052
  {
1745
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemCpuUsageReport", L"KernelTime"))
2053
+ static std::optional<bool> is_property_present{};
2054
+
2055
+ if (!is_property_present.has_value())
2056
+ {
2057
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemCpuUsageReport", L"KernelTime");
2058
+ }
2059
+
2060
+ if (!is_property_present.value())
1746
2061
  {
1747
2062
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1748
2063
  return nullptr;
@@ -1761,7 +2076,14 @@ namespace py::cpp::Windows::System::Diagnostics
1761
2076
  {
1762
2077
  try
1763
2078
  {
1764
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemCpuUsageReport", L"UserTime"))
2079
+ static std::optional<bool> is_property_present{};
2080
+
2081
+ if (!is_property_present.has_value())
2082
+ {
2083
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemCpuUsageReport", L"UserTime");
2084
+ }
2085
+
2086
+ if (!is_property_present.value())
1765
2087
  {
1766
2088
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1767
2089
  return nullptr;
@@ -1853,7 +2175,14 @@ namespace py::cpp::Windows::System::Diagnostics
1853
2175
  {
1854
2176
  try
1855
2177
  {
1856
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"GetForCurrentSystem", 0))
2178
+ static std::optional<bool> is_overload_present{};
2179
+
2180
+ if (!is_overload_present.has_value())
2181
+ {
2182
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"GetForCurrentSystem", 0);
2183
+ }
2184
+
2185
+ if (!is_overload_present.value())
1857
2186
  {
1858
2187
  py::set_arg_count_version_error(0);
1859
2188
  return nullptr;
@@ -1882,7 +2211,14 @@ namespace py::cpp::Windows::System::Diagnostics
1882
2211
  {
1883
2212
  try
1884
2213
  {
1885
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"IsArchitectureSupported", 1))
2214
+ static std::optional<bool> is_overload_present{};
2215
+
2216
+ if (!is_overload_present.has_value())
2217
+ {
2218
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"IsArchitectureSupported", 1);
2219
+ }
2220
+
2221
+ if (!is_overload_present.value())
1886
2222
  {
1887
2223
  py::set_arg_count_version_error(1);
1888
2224
  return nullptr;
@@ -1909,7 +2245,14 @@ namespace py::cpp::Windows::System::Diagnostics
1909
2245
  {
1910
2246
  try
1911
2247
  {
1912
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"CpuUsage"))
2248
+ static std::optional<bool> is_property_present{};
2249
+
2250
+ if (!is_property_present.has_value())
2251
+ {
2252
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"CpuUsage");
2253
+ }
2254
+
2255
+ if (!is_property_present.value())
1913
2256
  {
1914
2257
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1915
2258
  return nullptr;
@@ -1928,7 +2271,14 @@ namespace py::cpp::Windows::System::Diagnostics
1928
2271
  {
1929
2272
  try
1930
2273
  {
1931
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"MemoryUsage"))
2274
+ static std::optional<bool> is_property_present{};
2275
+
2276
+ if (!is_property_present.has_value())
2277
+ {
2278
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"MemoryUsage");
2279
+ }
2280
+
2281
+ if (!is_property_present.value())
1932
2282
  {
1933
2283
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1934
2284
  return nullptr;
@@ -1947,7 +2297,14 @@ namespace py::cpp::Windows::System::Diagnostics
1947
2297
  {
1948
2298
  try
1949
2299
  {
1950
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"PreferredArchitecture"))
2300
+ static std::optional<bool> is_property_present{};
2301
+
2302
+ if (!is_property_present.has_value())
2303
+ {
2304
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemDiagnosticInfo", L"PreferredArchitecture");
2305
+ }
2306
+
2307
+ if (!is_property_present.value())
1951
2308
  {
1952
2309
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
1953
2310
  return nullptr;
@@ -2066,7 +2423,14 @@ namespace py::cpp::Windows::System::Diagnostics
2066
2423
  {
2067
2424
  try
2068
2425
  {
2069
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemMemoryUsage", L"GetReport", 0))
2426
+ static std::optional<bool> is_overload_present{};
2427
+
2428
+ if (!is_overload_present.has_value())
2429
+ {
2430
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Diagnostics.SystemMemoryUsage", L"GetReport", 0);
2431
+ }
2432
+
2433
+ if (!is_overload_present.value())
2070
2434
  {
2071
2435
  py::set_arg_count_version_error(0);
2072
2436
  return nullptr;
@@ -2158,7 +2522,14 @@ namespace py::cpp::Windows::System::Diagnostics
2158
2522
  {
2159
2523
  try
2160
2524
  {
2161
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemMemoryUsageReport", L"AvailableSizeInBytes"))
2525
+ static std::optional<bool> is_property_present{};
2526
+
2527
+ if (!is_property_present.has_value())
2528
+ {
2529
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemMemoryUsageReport", L"AvailableSizeInBytes");
2530
+ }
2531
+
2532
+ if (!is_property_present.value())
2162
2533
  {
2163
2534
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2164
2535
  return nullptr;
@@ -2177,7 +2548,14 @@ namespace py::cpp::Windows::System::Diagnostics
2177
2548
  {
2178
2549
  try
2179
2550
  {
2180
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemMemoryUsageReport", L"CommittedSizeInBytes"))
2551
+ static std::optional<bool> is_property_present{};
2552
+
2553
+ if (!is_property_present.has_value())
2554
+ {
2555
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemMemoryUsageReport", L"CommittedSizeInBytes");
2556
+ }
2557
+
2558
+ if (!is_property_present.value())
2181
2559
  {
2182
2560
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2183
2561
  return nullptr;
@@ -2196,7 +2574,14 @@ namespace py::cpp::Windows::System::Diagnostics
2196
2574
  {
2197
2575
  try
2198
2576
  {
2199
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemMemoryUsageReport", L"TotalPhysicalSizeInBytes"))
2577
+ static std::optional<bool> is_property_present{};
2578
+
2579
+ if (!is_property_present.has_value())
2580
+ {
2581
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Diagnostics.SystemMemoryUsageReport", L"TotalPhysicalSizeInBytes");
2582
+ }
2583
+
2584
+ if (!is_property_present.value())
2200
2585
  {
2201
2586
  PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2202
2587
  return nullptr;
@@ -2308,7 +2693,8 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_diagnostics(void) noexcept
2308
2693
  return nullptr;
2309
2694
  }
2310
2695
 
2311
- if (py::register_python_type(module.get(), &type_spec_DiagnosticActionResult, object_bases.get(), nullptr) == -1)
2696
+ py::pytype_handle DiagnosticActionResult_type{py::register_python_type(module.get(), &type_spec_DiagnosticActionResult, object_bases.get(), nullptr)};
2697
+ if (!DiagnosticActionResult_type)
2312
2698
  {
2313
2699
  return nullptr;
2314
2700
  }
@@ -2319,17 +2705,20 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_diagnostics(void) noexcept
2319
2705
  return nullptr;
2320
2706
  }
2321
2707
 
2322
- if (py::register_python_type(module.get(), &type_spec_DiagnosticInvoker, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_DiagnosticInvoker_Static.get())) == -1)
2708
+ py::pytype_handle DiagnosticInvoker_type{py::register_python_type(module.get(), &type_spec_DiagnosticInvoker, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_DiagnosticInvoker_Static.get()))};
2709
+ if (!DiagnosticInvoker_type)
2323
2710
  {
2324
2711
  return nullptr;
2325
2712
  }
2326
2713
 
2327
- if (py::register_python_type(module.get(), &type_spec_ProcessCpuUsage, object_bases.get(), nullptr) == -1)
2714
+ py::pytype_handle ProcessCpuUsage_type{py::register_python_type(module.get(), &type_spec_ProcessCpuUsage, object_bases.get(), nullptr)};
2715
+ if (!ProcessCpuUsage_type)
2328
2716
  {
2329
2717
  return nullptr;
2330
2718
  }
2331
2719
 
2332
- if (py::register_python_type(module.get(), &type_spec_ProcessCpuUsageReport, object_bases.get(), nullptr) == -1)
2720
+ py::pytype_handle ProcessCpuUsageReport_type{py::register_python_type(module.get(), &type_spec_ProcessCpuUsageReport, object_bases.get(), nullptr)};
2721
+ if (!ProcessCpuUsageReport_type)
2333
2722
  {
2334
2723
  return nullptr;
2335
2724
  }
@@ -2340,37 +2729,44 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_diagnostics(void) noexcept
2340
2729
  return nullptr;
2341
2730
  }
2342
2731
 
2343
- if (py::register_python_type(module.get(), &type_spec_ProcessDiagnosticInfo, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_ProcessDiagnosticInfo_Static.get())) == -1)
2732
+ py::pytype_handle ProcessDiagnosticInfo_type{py::register_python_type(module.get(), &type_spec_ProcessDiagnosticInfo, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_ProcessDiagnosticInfo_Static.get()))};
2733
+ if (!ProcessDiagnosticInfo_type)
2344
2734
  {
2345
2735
  return nullptr;
2346
2736
  }
2347
2737
 
2348
- if (py::register_python_type(module.get(), &type_spec_ProcessDiskUsage, object_bases.get(), nullptr) == -1)
2738
+ py::pytype_handle ProcessDiskUsage_type{py::register_python_type(module.get(), &type_spec_ProcessDiskUsage, object_bases.get(), nullptr)};
2739
+ if (!ProcessDiskUsage_type)
2349
2740
  {
2350
2741
  return nullptr;
2351
2742
  }
2352
2743
 
2353
- if (py::register_python_type(module.get(), &type_spec_ProcessDiskUsageReport, object_bases.get(), nullptr) == -1)
2744
+ py::pytype_handle ProcessDiskUsageReport_type{py::register_python_type(module.get(), &type_spec_ProcessDiskUsageReport, object_bases.get(), nullptr)};
2745
+ if (!ProcessDiskUsageReport_type)
2354
2746
  {
2355
2747
  return nullptr;
2356
2748
  }
2357
2749
 
2358
- if (py::register_python_type(module.get(), &type_spec_ProcessMemoryUsage, object_bases.get(), nullptr) == -1)
2750
+ py::pytype_handle ProcessMemoryUsage_type{py::register_python_type(module.get(), &type_spec_ProcessMemoryUsage, object_bases.get(), nullptr)};
2751
+ if (!ProcessMemoryUsage_type)
2359
2752
  {
2360
2753
  return nullptr;
2361
2754
  }
2362
2755
 
2363
- if (py::register_python_type(module.get(), &type_spec_ProcessMemoryUsageReport, object_bases.get(), nullptr) == -1)
2756
+ py::pytype_handle ProcessMemoryUsageReport_type{py::register_python_type(module.get(), &type_spec_ProcessMemoryUsageReport, object_bases.get(), nullptr)};
2757
+ if (!ProcessMemoryUsageReport_type)
2364
2758
  {
2365
2759
  return nullptr;
2366
2760
  }
2367
2761
 
2368
- if (py::register_python_type(module.get(), &type_spec_SystemCpuUsage, object_bases.get(), nullptr) == -1)
2762
+ py::pytype_handle SystemCpuUsage_type{py::register_python_type(module.get(), &type_spec_SystemCpuUsage, object_bases.get(), nullptr)};
2763
+ if (!SystemCpuUsage_type)
2369
2764
  {
2370
2765
  return nullptr;
2371
2766
  }
2372
2767
 
2373
- if (py::register_python_type(module.get(), &type_spec_SystemCpuUsageReport, object_bases.get(), nullptr) == -1)
2768
+ py::pytype_handle SystemCpuUsageReport_type{py::register_python_type(module.get(), &type_spec_SystemCpuUsageReport, object_bases.get(), nullptr)};
2769
+ if (!SystemCpuUsageReport_type)
2374
2770
  {
2375
2771
  return nullptr;
2376
2772
  }
@@ -2381,17 +2777,20 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_diagnostics(void) noexcept
2381
2777
  return nullptr;
2382
2778
  }
2383
2779
 
2384
- if (py::register_python_type(module.get(), &type_spec_SystemDiagnosticInfo, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_SystemDiagnosticInfo_Static.get())) == -1)
2780
+ py::pytype_handle SystemDiagnosticInfo_type{py::register_python_type(module.get(), &type_spec_SystemDiagnosticInfo, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_SystemDiagnosticInfo_Static.get()))};
2781
+ if (!SystemDiagnosticInfo_type)
2385
2782
  {
2386
2783
  return nullptr;
2387
2784
  }
2388
2785
 
2389
- if (py::register_python_type(module.get(), &type_spec_SystemMemoryUsage, object_bases.get(), nullptr) == -1)
2786
+ py::pytype_handle SystemMemoryUsage_type{py::register_python_type(module.get(), &type_spec_SystemMemoryUsage, object_bases.get(), nullptr)};
2787
+ if (!SystemMemoryUsage_type)
2390
2788
  {
2391
2789
  return nullptr;
2392
2790
  }
2393
2791
 
2394
- if (py::register_python_type(module.get(), &type_spec_SystemMemoryUsageReport, object_bases.get(), nullptr) == -1)
2792
+ py::pytype_handle SystemMemoryUsageReport_type{py::register_python_type(module.get(), &type_spec_SystemMemoryUsageReport, object_bases.get(), nullptr)};
2793
+ if (!SystemMemoryUsageReport_type)
2395
2794
  {
2396
2795
  return nullptr;
2397
2796
  }
@@ -16,7 +16,7 @@ classifiers = [
16
16
  "Intended Audience :: Developers",
17
17
  ]
18
18
  dynamic = ["version", "dependencies", "optional-dependencies"]
19
- requires-python = ">=3.9,<3.13"
19
+ requires-python = ">=3.9,<3.14"
20
20
 
21
21
  [project.urls]
22
22
  # Homepage = "https://github.com/pywinrt/pywinrt"
@@ -36,7 +36,8 @@ optional-dependencies.all = { file = "all-requirements.txt" }
36
36
  # use local winrt-sdk build dependency
37
37
  environment = { PYTHONPATH="../winrt-sdk/src" }
38
38
  # don't install winrt-sdk from PyPI
39
- build-frontend = { name = "build", args = ["--skip-dependency-check", "--no-isolation"] }
39
+ build-frontend = { name = "build[uv]", args = ["--skip-dependency-check", "--no-isolation"] }
40
+ before-build = "uv pip install setuptools"
40
41
  # don't build for PyPy
41
42
  skip = "pp*"
42
43
  # suppress warnings about ARM64 testing
@@ -1,3 +1,3 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
- winrt-runtime==2.1.0
3
+ winrt-runtime==2.2.0
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  import datetime
4
4
  import sys
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  import enum
4
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.System.Diagnostics
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -10,14 +10,14 @@ Classifier: Operating System :: Microsoft :: Windows
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
- Requires-Python: <3.13,>=3.9
13
+ Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.1.0
15
+ Requires-Dist: winrt-runtime==2.2.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Data.Json[all]==2.1.0; extra == "all"
18
- Requires-Dist: winrt-Windows.Foundation[all]==2.1.0; extra == "all"
19
- Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.1.0; extra == "all"
20
- Requires-Dist: winrt-Windows.System[all]==2.1.0; extra == "all"
17
+ Requires-Dist: winrt-Windows.Data.Json[all]==2.2.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.Foundation[all]==2.2.0; extra == "all"
19
+ Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.2.0; extra == "all"
20
+ Requires-Dist: winrt-Windows.System[all]==2.2.0; extra == "all"
21
21
 
22
22
  <!-- warning: Please don't edit this file. It was automatically generated. -->
23
23
 
@@ -0,0 +1,7 @@
1
+ winrt-runtime==2.2.0
2
+
3
+ [all]
4
+ winrt-Windows.Data.Json[all]==2.2.0
5
+ winrt-Windows.Foundation[all]==2.2.0
6
+ winrt-Windows.Foundation.Collections[all]==2.2.0
7
+ winrt-Windows.System[all]==2.2.0
@@ -1,6 +0,0 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0
2
-
3
- winrt-Windows.Data.Json[all]==2.1.0
4
- winrt-Windows.Foundation[all]==2.1.0
5
- winrt-Windows.Foundation.Collections[all]==2.1.0
6
- winrt-Windows.System[all]==2.1.0
@@ -1,7 +0,0 @@
1
- winrt-runtime==2.1.0
2
-
3
- [all]
4
- winrt-Windows.Data.Json[all]==2.1.0
5
- winrt-Windows.Foundation[all]==2.1.0
6
- winrt-Windows.Foundation.Collections[all]==2.1.0
7
- winrt-Windows.System[all]==2.1.0