winrt-Windows.Security.DataProtection 2.0.0b1__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.
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.1
2
+ Name: winrt-Windows.Security.DataProtection
3
+ Version: 2.0.0b1
4
+ Summary: Python projection of Windows Runtime (WinRT) APIs
5
+ License: MIT
6
+ Project-URL: Repository, https://github.com/pywrint/pywrinrt
7
+ Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: Implementation :: CPython
11
+ Classifier: Intended Audience :: Developers
12
+ Requires-Python: <3.13,>=3.9
13
+ Description-Content-Type: text/markdown
14
+ Provides-Extra: all
15
+
16
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
17
+
18
+ # winrt-Windows.Security.DataProtection
19
+
20
+ Windows Runtime (WinRT) APIs for for the `Windows.Security.DataProtection` namespace.
21
+
22
+ This package provides the `winrt.windows.security.dataprotection` module.
@@ -0,0 +1,7 @@
1
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
2
+
3
+ # winrt-Windows.Security.DataProtection
4
+
5
+ Windows Runtime (WinRT) APIs for for the `Windows.Security.DataProtection` namespace.
6
+
7
+ This package provides the `winrt.windows.security.dataprotection` module.
@@ -0,0 +1,6 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ winrt-Windows.Foundation[all]==2.0.0-beta.1
4
+ winrt-Windows.Storage[all]==2.0.0-beta.1
5
+ winrt-Windows.Storage.Streams[all]==2.0.0-beta.1
6
+ winrt-Windows.System[all]==2.0.0-beta.1
@@ -0,0 +1,742 @@
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ #include "py.Windows.Security.DataProtection.h"
4
+
5
+
6
+ namespace py::cpp::Windows::Security::DataProtection
7
+ {
8
+ // ----- UserDataAvailabilityStateChangedEventArgs class --------------------
9
+
10
+ static PyObject* _new_UserDataAvailabilityStateChangedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
11
+ {
12
+ static_assert(py::py_type<winrt::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs>::type_name);
13
+ py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs>::type_name);
14
+ return nullptr;
15
+ }
16
+
17
+ static void _dealloc_UserDataAvailabilityStateChangedEventArgs(py::wrapper::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs* self) noexcept
18
+ {
19
+ auto tp = Py_TYPE(self);
20
+ std::destroy_at(&self->obj);
21
+ tp->tp_free(self);
22
+ Py_DECREF(tp);
23
+ }
24
+
25
+ static PyObject* UserDataAvailabilityStateChangedEventArgs_GetDeferral(py::wrapper::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs* self, PyObject* args) noexcept
26
+ {
27
+ auto arg_count = PyTuple_Size(args);
28
+
29
+ if (arg_count == 0)
30
+ {
31
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataAvailabilityStateChangedEventArgs", L"GetDeferral", 0))
32
+ {
33
+ py::set_arg_count_version_error(0);
34
+ return nullptr;
35
+ }
36
+
37
+ try
38
+ {
39
+ return py::convert(self->obj.GetDeferral());
40
+ }
41
+ catch (...)
42
+ {
43
+ py::to_PyErr();
44
+ return nullptr;
45
+ }
46
+ }
47
+ else
48
+ {
49
+ py::set_invalid_arg_count_error(arg_count);
50
+ return nullptr;
51
+ }
52
+ }
53
+
54
+ static PyObject* _assign_array_UserDataAvailabilityStateChangedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
55
+ {
56
+ auto array = std::make_unique<py::ComArray<winrt::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs>>();
57
+ if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
58
+ {
59
+ return nullptr;
60
+ }
61
+ Py_RETURN_NONE;
62
+ }
63
+
64
+ static PyObject* _from_UserDataAvailabilityStateChangedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
65
+ {
66
+ try
67
+ {
68
+ auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
69
+ return py::convert(return_value.as<winrt::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs>());
70
+ }
71
+ catch (...)
72
+ {
73
+ py::to_PyErr();
74
+ return nullptr;
75
+ }
76
+ }
77
+
78
+ static PyMethodDef _methods_UserDataAvailabilityStateChangedEventArgs[] = {
79
+ { "get_deferral", reinterpret_cast<PyCFunction>(UserDataAvailabilityStateChangedEventArgs_GetDeferral), METH_VARARGS, nullptr },
80
+ { "_assign_array_", _assign_array_UserDataAvailabilityStateChangedEventArgs, METH_O | METH_STATIC, nullptr },
81
+ { "_from", reinterpret_cast<PyCFunction>(_from_UserDataAvailabilityStateChangedEventArgs), METH_O | METH_STATIC, nullptr },
82
+ { }
83
+ };
84
+
85
+ static PyGetSetDef _getset_UserDataAvailabilityStateChangedEventArgs[] = {
86
+ { }
87
+ };
88
+
89
+ static PyType_Slot _type_slots_UserDataAvailabilityStateChangedEventArgs[] =
90
+ {
91
+ { Py_tp_new, reinterpret_cast<void*>(_new_UserDataAvailabilityStateChangedEventArgs) },
92
+ { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataAvailabilityStateChangedEventArgs) },
93
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataAvailabilityStateChangedEventArgs) },
94
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataAvailabilityStateChangedEventArgs) },
95
+ { },
96
+ };
97
+
98
+ static PyType_Spec type_spec_UserDataAvailabilityStateChangedEventArgs =
99
+ {
100
+ "winrt._winrt_windows_security_dataprotection.UserDataAvailabilityStateChangedEventArgs",
101
+ sizeof(py::wrapper::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs),
102
+ 0,
103
+ Py_TPFLAGS_DEFAULT,
104
+ _type_slots_UserDataAvailabilityStateChangedEventArgs
105
+ };
106
+
107
+ // ----- UserDataBufferUnprotectResult class --------------------
108
+
109
+ static PyObject* _new_UserDataBufferUnprotectResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
110
+ {
111
+ static_assert(py::py_type<winrt::Windows::Security::DataProtection::UserDataBufferUnprotectResult>::type_name);
112
+ py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::DataProtection::UserDataBufferUnprotectResult>::type_name);
113
+ return nullptr;
114
+ }
115
+
116
+ static void _dealloc_UserDataBufferUnprotectResult(py::wrapper::Windows::Security::DataProtection::UserDataBufferUnprotectResult* self) noexcept
117
+ {
118
+ auto tp = Py_TYPE(self);
119
+ std::destroy_at(&self->obj);
120
+ tp->tp_free(self);
121
+ Py_DECREF(tp);
122
+ }
123
+
124
+ static PyObject* UserDataBufferUnprotectResult_get_Status(py::wrapper::Windows::Security::DataProtection::UserDataBufferUnprotectResult* self, void* /*unused*/) noexcept
125
+ {
126
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.DataProtection.UserDataBufferUnprotectResult", L"Status"))
127
+ {
128
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
129
+ return nullptr;
130
+ }
131
+
132
+ try
133
+ {
134
+ return py::convert(self->obj.Status());
135
+ }
136
+ catch (...)
137
+ {
138
+ py::to_PyErr();
139
+ return nullptr;
140
+ }
141
+ }
142
+
143
+ static PyObject* UserDataBufferUnprotectResult_get_UnprotectedBuffer(py::wrapper::Windows::Security::DataProtection::UserDataBufferUnprotectResult* self, void* /*unused*/) noexcept
144
+ {
145
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.DataProtection.UserDataBufferUnprotectResult", L"UnprotectedBuffer"))
146
+ {
147
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
148
+ return nullptr;
149
+ }
150
+
151
+ try
152
+ {
153
+ return py::convert(self->obj.UnprotectedBuffer());
154
+ }
155
+ catch (...)
156
+ {
157
+ py::to_PyErr();
158
+ return nullptr;
159
+ }
160
+ }
161
+
162
+ static PyObject* _assign_array_UserDataBufferUnprotectResult(PyObject* /*unused*/, PyObject* arg) noexcept
163
+ {
164
+ auto array = std::make_unique<py::ComArray<winrt::Windows::Security::DataProtection::UserDataBufferUnprotectResult>>();
165
+ if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
166
+ {
167
+ return nullptr;
168
+ }
169
+ Py_RETURN_NONE;
170
+ }
171
+
172
+ static PyObject* _from_UserDataBufferUnprotectResult(PyObject* /*unused*/, PyObject* arg) noexcept
173
+ {
174
+ try
175
+ {
176
+ auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
177
+ return py::convert(return_value.as<winrt::Windows::Security::DataProtection::UserDataBufferUnprotectResult>());
178
+ }
179
+ catch (...)
180
+ {
181
+ py::to_PyErr();
182
+ return nullptr;
183
+ }
184
+ }
185
+
186
+ static PyMethodDef _methods_UserDataBufferUnprotectResult[] = {
187
+ { "_assign_array_", _assign_array_UserDataBufferUnprotectResult, METH_O | METH_STATIC, nullptr },
188
+ { "_from", reinterpret_cast<PyCFunction>(_from_UserDataBufferUnprotectResult), METH_O | METH_STATIC, nullptr },
189
+ { }
190
+ };
191
+
192
+ static PyGetSetDef _getset_UserDataBufferUnprotectResult[] = {
193
+ { "status", reinterpret_cast<getter>(UserDataBufferUnprotectResult_get_Status), nullptr, nullptr, nullptr },
194
+ { "unprotected_buffer", reinterpret_cast<getter>(UserDataBufferUnprotectResult_get_UnprotectedBuffer), nullptr, nullptr, nullptr },
195
+ { }
196
+ };
197
+
198
+ static PyType_Slot _type_slots_UserDataBufferUnprotectResult[] =
199
+ {
200
+ { Py_tp_new, reinterpret_cast<void*>(_new_UserDataBufferUnprotectResult) },
201
+ { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataBufferUnprotectResult) },
202
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataBufferUnprotectResult) },
203
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataBufferUnprotectResult) },
204
+ { },
205
+ };
206
+
207
+ static PyType_Spec type_spec_UserDataBufferUnprotectResult =
208
+ {
209
+ "winrt._winrt_windows_security_dataprotection.UserDataBufferUnprotectResult",
210
+ sizeof(py::wrapper::Windows::Security::DataProtection::UserDataBufferUnprotectResult),
211
+ 0,
212
+ Py_TPFLAGS_DEFAULT,
213
+ _type_slots_UserDataBufferUnprotectResult
214
+ };
215
+
216
+ // ----- UserDataProtectionManager class --------------------
217
+
218
+ static PyObject* _new_UserDataProtectionManager(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
219
+ {
220
+ static_assert(py::py_type<winrt::Windows::Security::DataProtection::UserDataProtectionManager>::type_name);
221
+ py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::DataProtection::UserDataProtectionManager>::type_name);
222
+ return nullptr;
223
+ }
224
+
225
+ static void _dealloc_UserDataProtectionManager(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self) noexcept
226
+ {
227
+ auto tp = Py_TYPE(self);
228
+ std::destroy_at(&self->obj);
229
+ tp->tp_free(self);
230
+ Py_DECREF(tp);
231
+ }
232
+
233
+ static PyObject* UserDataProtectionManager_GetStorageItemProtectionInfoAsync(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self, PyObject* args) noexcept
234
+ {
235
+ auto arg_count = PyTuple_Size(args);
236
+
237
+ if (arg_count == 1)
238
+ {
239
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"GetStorageItemProtectionInfoAsync", 1))
240
+ {
241
+ py::set_arg_count_version_error(1);
242
+ return nullptr;
243
+ }
244
+
245
+ try
246
+ {
247
+ auto param0 = py::convert_to<winrt::Windows::Storage::IStorageItem>(args, 0);
248
+
249
+ return py::convert(self->obj.GetStorageItemProtectionInfoAsync(param0));
250
+ }
251
+ catch (...)
252
+ {
253
+ py::to_PyErr();
254
+ return nullptr;
255
+ }
256
+ }
257
+ else
258
+ {
259
+ py::set_invalid_arg_count_error(arg_count);
260
+ return nullptr;
261
+ }
262
+ }
263
+
264
+ static PyObject* UserDataProtectionManager_IsContinuedDataAvailabilityExpected(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self, PyObject* args) noexcept
265
+ {
266
+ auto arg_count = PyTuple_Size(args);
267
+
268
+ if (arg_count == 1)
269
+ {
270
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"IsContinuedDataAvailabilityExpected", 1))
271
+ {
272
+ py::set_arg_count_version_error(1);
273
+ return nullptr;
274
+ }
275
+
276
+ try
277
+ {
278
+ auto param0 = py::convert_to<winrt::Windows::Security::DataProtection::UserDataAvailability>(args, 0);
279
+
280
+ return py::convert(self->obj.IsContinuedDataAvailabilityExpected(param0));
281
+ }
282
+ catch (...)
283
+ {
284
+ py::to_PyErr();
285
+ return nullptr;
286
+ }
287
+ }
288
+ else
289
+ {
290
+ py::set_invalid_arg_count_error(arg_count);
291
+ return nullptr;
292
+ }
293
+ }
294
+
295
+ static PyObject* UserDataProtectionManager_ProtectBufferAsync(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self, PyObject* args) noexcept
296
+ {
297
+ auto arg_count = PyTuple_Size(args);
298
+
299
+ if (arg_count == 2)
300
+ {
301
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"ProtectBufferAsync", 2))
302
+ {
303
+ py::set_arg_count_version_error(2);
304
+ return nullptr;
305
+ }
306
+
307
+ try
308
+ {
309
+ auto param0 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 0);
310
+ auto param1 = py::convert_to<winrt::Windows::Security::DataProtection::UserDataAvailability>(args, 1);
311
+
312
+ return py::convert(self->obj.ProtectBufferAsync(param0, param1));
313
+ }
314
+ catch (...)
315
+ {
316
+ py::to_PyErr();
317
+ return nullptr;
318
+ }
319
+ }
320
+ else
321
+ {
322
+ py::set_invalid_arg_count_error(arg_count);
323
+ return nullptr;
324
+ }
325
+ }
326
+
327
+ static PyObject* UserDataProtectionManager_ProtectStorageItemAsync(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self, PyObject* args) noexcept
328
+ {
329
+ auto arg_count = PyTuple_Size(args);
330
+
331
+ if (arg_count == 2)
332
+ {
333
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"ProtectStorageItemAsync", 2))
334
+ {
335
+ py::set_arg_count_version_error(2);
336
+ return nullptr;
337
+ }
338
+
339
+ try
340
+ {
341
+ auto param0 = py::convert_to<winrt::Windows::Storage::IStorageItem>(args, 0);
342
+ auto param1 = py::convert_to<winrt::Windows::Security::DataProtection::UserDataAvailability>(args, 1);
343
+
344
+ return py::convert(self->obj.ProtectStorageItemAsync(param0, param1));
345
+ }
346
+ catch (...)
347
+ {
348
+ py::to_PyErr();
349
+ return nullptr;
350
+ }
351
+ }
352
+ else
353
+ {
354
+ py::set_invalid_arg_count_error(arg_count);
355
+ return nullptr;
356
+ }
357
+ }
358
+
359
+ static PyObject* UserDataProtectionManager_TryGetDefault(PyObject* /*unused*/, PyObject* args) noexcept
360
+ {
361
+ auto arg_count = PyTuple_Size(args);
362
+
363
+ if (arg_count == 0)
364
+ {
365
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"TryGetDefault", 0))
366
+ {
367
+ py::set_arg_count_version_error(0);
368
+ return nullptr;
369
+ }
370
+
371
+ try
372
+ {
373
+ return py::convert(winrt::Windows::Security::DataProtection::UserDataProtectionManager::TryGetDefault());
374
+ }
375
+ catch (...)
376
+ {
377
+ py::to_PyErr();
378
+ return nullptr;
379
+ }
380
+ }
381
+ else
382
+ {
383
+ py::set_invalid_arg_count_error(arg_count);
384
+ return nullptr;
385
+ }
386
+ }
387
+
388
+ static PyObject* UserDataProtectionManager_TryGetForUser(PyObject* /*unused*/, PyObject* args) noexcept
389
+ {
390
+ auto arg_count = PyTuple_Size(args);
391
+
392
+ if (arg_count == 1)
393
+ {
394
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"TryGetForUser", 1))
395
+ {
396
+ py::set_arg_count_version_error(1);
397
+ return nullptr;
398
+ }
399
+
400
+ try
401
+ {
402
+ auto param0 = py::convert_to<winrt::Windows::System::User>(args, 0);
403
+
404
+ return py::convert(winrt::Windows::Security::DataProtection::UserDataProtectionManager::TryGetForUser(param0));
405
+ }
406
+ catch (...)
407
+ {
408
+ py::to_PyErr();
409
+ return nullptr;
410
+ }
411
+ }
412
+ else
413
+ {
414
+ py::set_invalid_arg_count_error(arg_count);
415
+ return nullptr;
416
+ }
417
+ }
418
+
419
+ static PyObject* UserDataProtectionManager_UnprotectBufferAsync(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self, PyObject* args) noexcept
420
+ {
421
+ auto arg_count = PyTuple_Size(args);
422
+
423
+ if (arg_count == 1)
424
+ {
425
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"UnprotectBufferAsync", 1))
426
+ {
427
+ py::set_arg_count_version_error(1);
428
+ return nullptr;
429
+ }
430
+
431
+ try
432
+ {
433
+ auto param0 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 0);
434
+
435
+ return py::convert(self->obj.UnprotectBufferAsync(param0));
436
+ }
437
+ catch (...)
438
+ {
439
+ py::to_PyErr();
440
+ return nullptr;
441
+ }
442
+ }
443
+ else
444
+ {
445
+ py::set_invalid_arg_count_error(arg_count);
446
+ return nullptr;
447
+ }
448
+ }
449
+
450
+ static PyObject* UserDataProtectionManager_add_DataAvailabilityStateChanged(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self, PyObject* arg) noexcept
451
+ {
452
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"DataAvailabilityStateChanged"))
453
+ {
454
+ PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
455
+ return nullptr;
456
+ }
457
+
458
+ try
459
+ {
460
+ auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Security::DataProtection::UserDataProtectionManager, winrt::Windows::Security::DataProtection::UserDataAvailabilityStateChangedEventArgs>>(arg);
461
+
462
+ return py::convert(self->obj.DataAvailabilityStateChanged(param0));
463
+ }
464
+ catch (...)
465
+ {
466
+ py::to_PyErr();
467
+ return nullptr;
468
+ }
469
+ }
470
+
471
+ static PyObject* UserDataProtectionManager_remove_DataAvailabilityStateChanged(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager* self, PyObject* arg) noexcept
472
+ {
473
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Security.DataProtection.UserDataProtectionManager", L"DataAvailabilityStateChanged"))
474
+ {
475
+ PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
476
+ return nullptr;
477
+ }
478
+
479
+ try
480
+ {
481
+ auto param0 = py::convert_to<winrt::event_token>(arg);
482
+
483
+ self->obj.DataAvailabilityStateChanged(param0);
484
+ Py_RETURN_NONE;
485
+ }
486
+ catch (...)
487
+ {
488
+ py::to_PyErr();
489
+ return nullptr;
490
+ }
491
+ }
492
+
493
+ static PyObject* _assign_array_UserDataProtectionManager(PyObject* /*unused*/, PyObject* arg) noexcept
494
+ {
495
+ auto array = std::make_unique<py::ComArray<winrt::Windows::Security::DataProtection::UserDataProtectionManager>>();
496
+ if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
497
+ {
498
+ return nullptr;
499
+ }
500
+ Py_RETURN_NONE;
501
+ }
502
+
503
+ static PyObject* _from_UserDataProtectionManager(PyObject* /*unused*/, PyObject* arg) noexcept
504
+ {
505
+ try
506
+ {
507
+ auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
508
+ return py::convert(return_value.as<winrt::Windows::Security::DataProtection::UserDataProtectionManager>());
509
+ }
510
+ catch (...)
511
+ {
512
+ py::to_PyErr();
513
+ return nullptr;
514
+ }
515
+ }
516
+
517
+ static PyMethodDef _methods_UserDataProtectionManager[] = {
518
+ { "get_storage_item_protection_info_async", reinterpret_cast<PyCFunction>(UserDataProtectionManager_GetStorageItemProtectionInfoAsync), METH_VARARGS, nullptr },
519
+ { "is_continued_data_availability_expected", reinterpret_cast<PyCFunction>(UserDataProtectionManager_IsContinuedDataAvailabilityExpected), METH_VARARGS, nullptr },
520
+ { "protect_buffer_async", reinterpret_cast<PyCFunction>(UserDataProtectionManager_ProtectBufferAsync), METH_VARARGS, nullptr },
521
+ { "protect_storage_item_async", reinterpret_cast<PyCFunction>(UserDataProtectionManager_ProtectStorageItemAsync), METH_VARARGS, nullptr },
522
+ { "unprotect_buffer_async", reinterpret_cast<PyCFunction>(UserDataProtectionManager_UnprotectBufferAsync), METH_VARARGS, nullptr },
523
+ { "add_data_availability_state_changed", reinterpret_cast<PyCFunction>(UserDataProtectionManager_add_DataAvailabilityStateChanged), METH_O, nullptr },
524
+ { "remove_data_availability_state_changed", reinterpret_cast<PyCFunction>(UserDataProtectionManager_remove_DataAvailabilityStateChanged), METH_O, nullptr },
525
+ { "_assign_array_", _assign_array_UserDataProtectionManager, METH_O | METH_STATIC, nullptr },
526
+ { "_from", reinterpret_cast<PyCFunction>(_from_UserDataProtectionManager), METH_O | METH_STATIC, nullptr },
527
+ { }
528
+ };
529
+
530
+ static PyGetSetDef _getset_UserDataProtectionManager[] = {
531
+ { }
532
+ };
533
+
534
+ static PyType_Slot _type_slots_UserDataProtectionManager[] =
535
+ {
536
+ { Py_tp_new, reinterpret_cast<void*>(_new_UserDataProtectionManager) },
537
+ { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataProtectionManager) },
538
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataProtectionManager) },
539
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataProtectionManager) },
540
+ { },
541
+ };
542
+
543
+ static PyType_Spec type_spec_UserDataProtectionManager =
544
+ {
545
+ "winrt._winrt_windows_security_dataprotection.UserDataProtectionManager",
546
+ sizeof(py::wrapper::Windows::Security::DataProtection::UserDataProtectionManager),
547
+ 0,
548
+ Py_TPFLAGS_DEFAULT,
549
+ _type_slots_UserDataProtectionManager
550
+ };
551
+
552
+ static PyGetSetDef getset_UserDataProtectionManager_Static[] = {
553
+ { }
554
+ };
555
+
556
+ static PyMethodDef methods_UserDataProtectionManager_Static[] = {
557
+ { "try_get_default", reinterpret_cast<PyCFunction>(UserDataProtectionManager_TryGetDefault), METH_VARARGS, nullptr },
558
+ { "try_get_for_user", reinterpret_cast<PyCFunction>(UserDataProtectionManager_TryGetForUser), METH_VARARGS, nullptr },
559
+ { }
560
+ };
561
+
562
+ static PyType_Slot type_slots_UserDataProtectionManager_Static[] =
563
+ {
564
+ { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
565
+ { Py_tp_getset, reinterpret_cast<void*>(getset_UserDataProtectionManager_Static) },
566
+ { Py_tp_methods, reinterpret_cast<void*>(methods_UserDataProtectionManager_Static) },
567
+ { }
568
+ };
569
+
570
+ static PyType_Spec type_spec_UserDataProtectionManager_Static =
571
+ {
572
+ "winrt._winrt_windows_security_dataprotection.UserDataProtectionManager_Static",
573
+ static_cast<int>(PyType_Type.tp_basicsize),
574
+ static_cast<int>(PyType_Type.tp_itemsize),
575
+ Py_TPFLAGS_DEFAULT,
576
+ type_slots_UserDataProtectionManager_Static
577
+ };
578
+
579
+ // ----- UserDataStorageItemProtectionInfo class --------------------
580
+
581
+ static PyObject* _new_UserDataStorageItemProtectionInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
582
+ {
583
+ static_assert(py::py_type<winrt::Windows::Security::DataProtection::UserDataStorageItemProtectionInfo>::type_name);
584
+ py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::DataProtection::UserDataStorageItemProtectionInfo>::type_name);
585
+ return nullptr;
586
+ }
587
+
588
+ static void _dealloc_UserDataStorageItemProtectionInfo(py::wrapper::Windows::Security::DataProtection::UserDataStorageItemProtectionInfo* self) noexcept
589
+ {
590
+ auto tp = Py_TYPE(self);
591
+ std::destroy_at(&self->obj);
592
+ tp->tp_free(self);
593
+ Py_DECREF(tp);
594
+ }
595
+
596
+ static PyObject* UserDataStorageItemProtectionInfo_get_Availability(py::wrapper::Windows::Security::DataProtection::UserDataStorageItemProtectionInfo* self, void* /*unused*/) noexcept
597
+ {
598
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.DataProtection.UserDataStorageItemProtectionInfo", L"Availability"))
599
+ {
600
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
601
+ return nullptr;
602
+ }
603
+
604
+ try
605
+ {
606
+ return py::convert(self->obj.Availability());
607
+ }
608
+ catch (...)
609
+ {
610
+ py::to_PyErr();
611
+ return nullptr;
612
+ }
613
+ }
614
+
615
+ static PyObject* _assign_array_UserDataStorageItemProtectionInfo(PyObject* /*unused*/, PyObject* arg) noexcept
616
+ {
617
+ auto array = std::make_unique<py::ComArray<winrt::Windows::Security::DataProtection::UserDataStorageItemProtectionInfo>>();
618
+ if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
619
+ {
620
+ return nullptr;
621
+ }
622
+ Py_RETURN_NONE;
623
+ }
624
+
625
+ static PyObject* _from_UserDataStorageItemProtectionInfo(PyObject* /*unused*/, PyObject* arg) noexcept
626
+ {
627
+ try
628
+ {
629
+ auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
630
+ return py::convert(return_value.as<winrt::Windows::Security::DataProtection::UserDataStorageItemProtectionInfo>());
631
+ }
632
+ catch (...)
633
+ {
634
+ py::to_PyErr();
635
+ return nullptr;
636
+ }
637
+ }
638
+
639
+ static PyMethodDef _methods_UserDataStorageItemProtectionInfo[] = {
640
+ { "_assign_array_", _assign_array_UserDataStorageItemProtectionInfo, METH_O | METH_STATIC, nullptr },
641
+ { "_from", reinterpret_cast<PyCFunction>(_from_UserDataStorageItemProtectionInfo), METH_O | METH_STATIC, nullptr },
642
+ { }
643
+ };
644
+
645
+ static PyGetSetDef _getset_UserDataStorageItemProtectionInfo[] = {
646
+ { "availability", reinterpret_cast<getter>(UserDataStorageItemProtectionInfo_get_Availability), nullptr, nullptr, nullptr },
647
+ { }
648
+ };
649
+
650
+ static PyType_Slot _type_slots_UserDataStorageItemProtectionInfo[] =
651
+ {
652
+ { Py_tp_new, reinterpret_cast<void*>(_new_UserDataStorageItemProtectionInfo) },
653
+ { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataStorageItemProtectionInfo) },
654
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataStorageItemProtectionInfo) },
655
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataStorageItemProtectionInfo) },
656
+ { },
657
+ };
658
+
659
+ static PyType_Spec type_spec_UserDataStorageItemProtectionInfo =
660
+ {
661
+ "winrt._winrt_windows_security_dataprotection.UserDataStorageItemProtectionInfo",
662
+ sizeof(py::wrapper::Windows::Security::DataProtection::UserDataStorageItemProtectionInfo),
663
+ 0,
664
+ Py_TPFLAGS_DEFAULT,
665
+ _type_slots_UserDataStorageItemProtectionInfo
666
+ };
667
+
668
+ // ----- Windows.Security.DataProtection Initialization --------------------
669
+ PyDoc_STRVAR(module_doc, "Windows::Security::DataProtection");
670
+
671
+
672
+ static PyModuleDef module_def
673
+ = {PyModuleDef_HEAD_INIT,
674
+ "_winrt_windows_security_dataprotection",
675
+ module_doc,
676
+ 0,
677
+ nullptr,
678
+ nullptr,
679
+ nullptr,
680
+ nullptr,
681
+ nullptr};
682
+
683
+ } // py::cpp::Windows::Security::DataProtection
684
+
685
+ PyMODINIT_FUNC PyInit__winrt_windows_security_dataprotection(void) noexcept
686
+ {
687
+ using namespace py::cpp::Windows::Security::DataProtection;
688
+
689
+ if (py::import_winrt_runtime() == -1)
690
+ {
691
+ return nullptr;
692
+ }
693
+
694
+ py::pyobj_handle module{PyModule_Create(&module_def)};
695
+
696
+ if (!module)
697
+ {
698
+ return nullptr;
699
+ }
700
+
701
+ auto object_type = py::get_object_type();
702
+ if (!object_type)
703
+ {
704
+ return nullptr;
705
+ }
706
+
707
+ py::pyobj_handle object_bases{PyTuple_Pack(1, object_type)};
708
+
709
+ if (!object_bases)
710
+ {
711
+ return nullptr;
712
+ }
713
+
714
+ if (py::register_python_type(module.get(), &type_spec_UserDataAvailabilityStateChangedEventArgs, object_bases.get(), nullptr) == -1)
715
+ {
716
+ return nullptr;
717
+ }
718
+
719
+ if (py::register_python_type(module.get(), &type_spec_UserDataBufferUnprotectResult, object_bases.get(), nullptr) == -1)
720
+ {
721
+ return nullptr;
722
+ }
723
+
724
+ py::pyobj_handle type_UserDataProtectionManager_Static{PyType_FromSpec(&type_spec_UserDataProtectionManager_Static)};
725
+ if (!type_UserDataProtectionManager_Static)
726
+ {
727
+ return nullptr;
728
+ }
729
+
730
+ if (py::register_python_type(module.get(), &type_spec_UserDataProtectionManager, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_UserDataProtectionManager_Static.get())) == -1)
731
+ {
732
+ return nullptr;
733
+ }
734
+
735
+ if (py::register_python_type(module.get(), &type_spec_UserDataStorageItemProtectionInfo, object_bases.get(), nullptr) == -1)
736
+ {
737
+ return nullptr;
738
+ }
739
+
740
+
741
+ return module.detach();
742
+ }
@@ -0,0 +1,43 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ [build-system]
4
+ requires = ["setuptools", "setuptools-scm", "winrt-sdk"]
5
+ build-backend = "setuptools.build_meta"
6
+
7
+ [project]
8
+ name = "winrt-Windows.Security.DataProtection"
9
+ description = "Python projection of Windows Runtime (WinRT) APIs"
10
+ readme = "README.md"
11
+ license = { text = "MIT" }
12
+ classifiers = [
13
+ "Operating System :: Microsoft :: Windows",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: Implementation :: CPython",
16
+ "Intended Audience :: Developers",
17
+ ]
18
+ dynamic = ["version", "dependencies", "optional-dependencies"]
19
+ requires-python = ">=3.9,<3.13"
20
+
21
+ [project.urls]
22
+ # Homepage = "https://github.com/pywrint/pywrinrt"
23
+ # Documentation = "https://readthedocs.org"
24
+ Repository = "https://github.com/pywrint/pywrinrt"
25
+ Changelog = "https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md"
26
+
27
+ [tool.setuptools.dynamic]
28
+ version = { file = "pywinrt-version.txt" }
29
+ dependencies = { file = "requirements.txt" }
30
+ optional-dependencies.all = { file = "all-requirements.txt" }
31
+
32
+ [tool.cibuildwheel]
33
+ # use local winrt-sdk build dependency
34
+ environment = { PYTHONPATH="../winrt-sdk/src" }
35
+ # don't install winrt-sdk from PyPI
36
+ build-frontend = { name = "build", args = ["--skip-dependency-check", "--no-isolation"] }
37
+ # don't build for PyPy
38
+ skip = "pp*"
39
+ # suppress warnings about ARM64 testing
40
+ test-skip = "*-win_arm64"
41
+
42
+ [tool.cibuildwheel.windows]
43
+ archs = ["x86", "AMD64", "ARM64"]
@@ -0,0 +1,3 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ winrt-runtime==2.0.0-beta.1
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,17 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ from setuptools import Extension, setup
4
+ from winrt_sdk import get_include_dirs
5
+
6
+ setup(
7
+ ext_modules=[
8
+ Extension(
9
+ "winrt._winrt_windows_security_dataprotection",
10
+ sources=["py.Windows.Security.DataProtection.cpp"],
11
+ include_dirs=get_include_dirs(),
12
+ extra_compile_args=["/std:c++20", "/permissive-"],
13
+ libraries=["windowsapp"],
14
+ )
15
+ ],
16
+ package_data={"winrt": ["*.pyi"]},
17
+ )
@@ -0,0 +1,54 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ import datetime
4
+ import sys
5
+ import types
6
+ import typing
7
+ import uuid as _uuid
8
+ from builtins import property as _property
9
+
10
+ import winrt._winrt
11
+ import winrt.system
12
+ import winrt.windows.foundation
13
+ import winrt.windows.storage
14
+ import winrt.windows.storage.streams
15
+ import winrt.windows.system
16
+
17
+ from winrt.windows.security.dataprotection import UserDataAvailability, UserDataBufferUnprotectStatus, UserDataStorageItemProtectionStatus
18
+
19
+ Self = typing.TypeVar('Self')
20
+
21
+ class UserDataAvailabilityStateChangedEventArgs(winrt.system.Object):
22
+ @staticmethod
23
+ def _from(obj: winrt.system.Object, /) -> UserDataAvailabilityStateChangedEventArgs: ...
24
+ def get_deferral(self) -> typing.Optional[winrt.windows.foundation.Deferral]: ...
25
+
26
+ class UserDataBufferUnprotectResult(winrt.system.Object):
27
+ @staticmethod
28
+ def _from(obj: winrt.system.Object, /) -> UserDataBufferUnprotectResult: ...
29
+ @_property
30
+ def status(self) -> UserDataBufferUnprotectStatus: ...
31
+ @_property
32
+ def unprotected_buffer(self) -> typing.Optional[winrt.windows.storage.streams.IBuffer]: ...
33
+
34
+ class UserDataProtectionManager_Static(type):
35
+ def try_get_default(cls) -> typing.Optional[UserDataProtectionManager]: ...
36
+ def try_get_for_user(cls, user: typing.Optional[winrt.windows.system.User], /) -> typing.Optional[UserDataProtectionManager]: ...
37
+
38
+ class UserDataProtectionManager(winrt.system.Object, metaclass=UserDataProtectionManager_Static):
39
+ @staticmethod
40
+ def _from(obj: winrt.system.Object, /) -> UserDataProtectionManager: ...
41
+ def get_storage_item_protection_info_async(self, storage_item: typing.Optional[winrt.windows.storage.IStorageItem], /) -> winrt.windows.foundation.IAsyncOperation[UserDataStorageItemProtectionInfo]: ...
42
+ def is_continued_data_availability_expected(self, availability: UserDataAvailability, /) -> bool: ...
43
+ def protect_buffer_async(self, unprotected_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], availability: UserDataAvailability, /) -> winrt.windows.foundation.IAsyncOperation[winrt.windows.storage.streams.IBuffer]: ...
44
+ def protect_storage_item_async(self, storage_item: typing.Optional[winrt.windows.storage.IStorageItem], availability: UserDataAvailability, /) -> winrt.windows.foundation.IAsyncOperation[UserDataStorageItemProtectionStatus]: ...
45
+ def unprotect_buffer_async(self, protected_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], /) -> winrt.windows.foundation.IAsyncOperation[UserDataBufferUnprotectResult]: ...
46
+ def add_data_availability_state_changed(self, handler: winrt.windows.foundation.TypedEventHandler[UserDataProtectionManager, UserDataAvailabilityStateChangedEventArgs], /) -> winrt.windows.foundation.EventRegistrationToken: ...
47
+ def remove_data_availability_state_changed(self, token: winrt.windows.foundation.EventRegistrationToken, /) -> None: ...
48
+
49
+ class UserDataStorageItemProtectionInfo(winrt.system.Object):
50
+ @staticmethod
51
+ def _from(obj: winrt.system.Object, /) -> UserDataStorageItemProtectionInfo: ...
52
+ @_property
53
+ def availability(self) -> UserDataAvailability: ...
54
+
@@ -0,0 +1,35 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ import enum
4
+
5
+ import winrt.system
6
+ from winrt import _winrt_windows_security_dataprotection
7
+
8
+ __all__ = [
9
+ "UserDataAvailability",
10
+ "UserDataBufferUnprotectStatus",
11
+ "UserDataStorageItemProtectionStatus",
12
+ "UserDataAvailabilityStateChangedEventArgs",
13
+ "UserDataBufferUnprotectResult",
14
+ "UserDataProtectionManager",
15
+ "UserDataStorageItemProtectionInfo",
16
+ ]
17
+
18
+ class UserDataAvailability(enum.IntEnum):
19
+ ALWAYS = 0
20
+ AFTER_FIRST_UNLOCK = 1
21
+ WHILE_UNLOCKED = 2
22
+
23
+ class UserDataBufferUnprotectStatus(enum.IntEnum):
24
+ SUCCEEDED = 0
25
+ UNAVAILABLE = 1
26
+
27
+ class UserDataStorageItemProtectionStatus(enum.IntEnum):
28
+ SUCCEEDED = 0
29
+ NOT_PROTECTABLE = 1
30
+ DATA_UNAVAILABLE = 2
31
+
32
+ UserDataAvailabilityStateChangedEventArgs = _winrt_windows_security_dataprotection.UserDataAvailabilityStateChangedEventArgs
33
+ UserDataBufferUnprotectResult = _winrt_windows_security_dataprotection.UserDataBufferUnprotectResult
34
+ UserDataProtectionManager = _winrt_windows_security_dataprotection.UserDataProtectionManager
35
+ UserDataStorageItemProtectionInfo = _winrt_windows_security_dataprotection.UserDataStorageItemProtectionInfo
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.1
2
+ Name: winrt-Windows.Security.DataProtection
3
+ Version: 2.0.0b1
4
+ Summary: Python projection of Windows Runtime (WinRT) APIs
5
+ License: MIT
6
+ Project-URL: Repository, https://github.com/pywrint/pywrinrt
7
+ Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: Implementation :: CPython
11
+ Classifier: Intended Audience :: Developers
12
+ Requires-Python: <3.13,>=3.9
13
+ Description-Content-Type: text/markdown
14
+ Provides-Extra: all
15
+
16
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
17
+
18
+ # winrt-Windows.Security.DataProtection
19
+
20
+ Windows Runtime (WinRT) APIs for for the `Windows.Security.DataProtection` namespace.
21
+
22
+ This package provides the `winrt.windows.security.dataprotection` module.
@@ -0,0 +1,14 @@
1
+ README.md
2
+ all-requirements.txt
3
+ py.Windows.Security.DataProtection.cpp
4
+ pyproject.toml
5
+ pywinrt-version.txt
6
+ requirements.txt
7
+ setup.py
8
+ winrt/_winrt_windows_security_dataprotection.pyi
9
+ winrt/windows/security/dataprotection/__init__.py
10
+ winrt_Windows.Security.DataProtection.egg-info/PKG-INFO
11
+ winrt_Windows.Security.DataProtection.egg-info/SOURCES.txt
12
+ winrt_Windows.Security.DataProtection.egg-info/dependency_links.txt
13
+ winrt_Windows.Security.DataProtection.egg-info/requires.txt
14
+ winrt_Windows.Security.DataProtection.egg-info/top_level.txt
@@ -0,0 +1,7 @@
1
+ winrt-runtime==2.0.0-beta.1
2
+
3
+ [all]
4
+ winrt-Windows.Foundation[all]==2.0.0-beta.1
5
+ winrt-Windows.Storage[all]==2.0.0-beta.1
6
+ winrt-Windows.Storage.Streams[all]==2.0.0-beta.1
7
+ winrt-Windows.System[all]==2.0.0-beta.1