| ... |
... |
@@ -184,33 +184,12 @@ index 000000000..51e2845ea |
|
184
|
184
|
+ HRESULT GetInterface([in] REFIID iid, [out, iid_is(iid)] void **object);
|
|
185
|
185
|
+ };
|
|
186
|
186
|
+}
|
|
187
|
|
-diff --git a/mingw-w64-headers/include/wrl/client.h b/mingw-w64-headers/include/wrl/client.h
|
|
188
|
|
-index 07cedbe4e..4adf5772c 100644
|
|
189
|
|
---- a/mingw-w64-headers/include/wrl/client.h
|
|
190
|
|
-+++ b/mingw-w64-headers/include/wrl/client.h
|
|
191
|
|
-@@ -9,12 +9,15 @@
|
|
192
|
|
-
|
|
193
|
|
- #include <cstddef>
|
|
194
|
|
- #include <unknwn.h>
|
|
195
|
|
--/* #include <weakreference.h> */
|
|
196
|
|
-+#include <weakreference.h>
|
|
197
|
|
- #include <roapi.h>
|
|
198
|
|
-
|
|
199
|
|
- /* #include <wrl/def.h> */
|
|
200
|
|
- #include <wrl/internal.h>
|
|
201
|
|
-
|
|
202
|
|
-+#define WrlFinal final
|
|
203
|
|
-+#define WrlSealed sealed
|
|
204
|
|
-+
|
|
205
|
|
- namespace Microsoft {
|
|
206
|
|
- namespace WRL {
|
|
207
|
|
- namespace Details {
|
|
208
|
187
|
diff --git a/mingw-w64-headers/include/wrl/event.h b/mingw-w64-headers/include/wrl/event.h
|
|
209
|
188
|
new file mode 100644
|
|
210
|
|
-index 000000000..2e883e241
|
|
|
189
|
+index 000000000..f3ad2826c
|
|
211
|
190
|
--- /dev/null
|
|
212
|
191
|
+++ b/mingw-w64-headers/include/wrl/event.h
|
|
213
|
|
-@@ -0,0 +1,368 @@
|
|
|
192
|
+@@ -0,0 +1,52 @@
|
|
214
|
193
|
+#ifndef _WRL_EVENT_H_
|
|
215
|
194
|
+#define _WRL_EVENT_H_
|
|
216
|
195
|
+
|
| ... |
... |
@@ -226,183 +205,9 @@ index 000000000..2e883e241 |
|
226
|
205
|
+
|
|
227
|
206
|
+namespace Microsoft {
|
|
228
|
207
|
+ namespace WRL {
|
|
229
|
|
-+ enum DelegateCheckMode {
|
|
230
|
|
-+ NoCheck = 1
|
|
231
|
|
-+ };
|
|
232
|
|
-+
|
|
233
|
|
-+ template<DelegateCheckMode delegateCheckMode> struct DelegateTraits;
|
|
234
|
|
-+
|
|
235
|
|
-+ template<> struct DelegateTraits<NoCheck> {
|
|
236
|
|
-+ static HRESULT CheckReturn(HRESULT hr) {
|
|
237
|
|
-+ return 0;
|
|
238
|
|
-+ }
|
|
239
|
|
-+ };
|
|
240
|
|
-+
|
|
241
|
|
-+ extern __declspec(selectany) const DelegateCheckMode DefaultDelegateCheckMode = NoCheck;
|
|
242
|
|
-+
|
|
243
|
|
-+ enum InvokeMode {
|
|
244
|
|
-+ StopOnFirstError = 1,
|
|
245
|
|
-+ FireAll = 2,
|
|
246
|
|
-+ };
|
|
247
|
|
-+
|
|
248
|
|
-+ template<InvokeMode invokeModeValue> struct InvokeModeOptions {
|
|
249
|
|
-+ static const InvokeMode invokeMode = invokeModeValue;
|
|
250
|
|
-+ };
|
|
251
|
|
-+
|
|
252
|
|
-+ template<InvokeMode invokeMode> struct InvokeTraits;
|
|
253
|
|
-+
|
|
254
|
|
-+ template<typename TDelegateInterface, typename EventSourceOptions>
|
|
255
|
|
-+ class EventSource;
|
|
256
|
|
-+
|
|
257
|
208
|
+ namespace Details {
|
|
258
|
209
|
+ template<typename TDelegateInterface>
|
|
259
|
|
-+ void* GetDelegateBucketAssist(TDelegateInterface *pDelegate) {
|
|
260
|
|
-+ return nullptr;
|
|
261
|
|
-+ }
|
|
262
|
|
-+
|
|
263
|
|
-+ template<typename TMemberFunction> struct ArgTraits {
|
|
264
|
|
-+ static const int args = -1;
|
|
265
|
|
-+ };
|
|
266
|
|
-+
|
|
267
|
|
-+ template<typename TDelegateInterface>
|
|
268
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(void)> {
|
|
269
|
|
-+ static const int args = 0;
|
|
270
|
|
-+ };
|
|
271
|
|
-+
|
|
272
|
|
-+ template<typename TDelegateInterface, typename TArg1>
|
|
273
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1)> {
|
|
274
|
|
-+ static const int args = 1;
|
|
275
|
|
-+ typedef TArg1 Arg1Type;
|
|
276
|
|
-+ };
|
|
277
|
|
-+
|
|
278
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2>
|
|
279
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2)>
|
|
280
|
|
-+ {
|
|
281
|
|
-+ static const int args = 2;
|
|
282
|
|
-+ typedef TArg1 Arg1Type;
|
|
283
|
|
-+ typedef TArg2 Arg2Type;
|
|
284
|
|
-+ };
|
|
285
|
|
-+
|
|
286
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2, typename TArg3>
|
|
287
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2, TArg3)>
|
|
288
|
|
-+ {
|
|
289
|
|
-+ static const int args = 3;
|
|
290
|
|
-+ typedef TArg1 Arg1Type;
|
|
291
|
|
-+ typedef TArg2 Arg2Type;
|
|
292
|
|
-+ typedef TArg3 Arg3Type;
|
|
293
|
|
-+ };
|
|
294
|
|
-+
|
|
295
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2, typename TArg3, typename TArg4>
|
|
296
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2, TArg3, TArg4)>
|
|
297
|
|
-+ {
|
|
298
|
|
-+ static const int args = 4;
|
|
299
|
|
-+ typedef TArg1 Arg1Type;
|
|
300
|
|
-+ typedef TArg2 Arg2Type;
|
|
301
|
|
-+ typedef TArg3 Arg3Type;
|
|
302
|
|
-+ typedef TArg4 Arg4Type;
|
|
303
|
|
-+ };
|
|
304
|
|
-+
|
|
305
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5>
|
|
306
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2, TArg3, TArg4, TArg5)>
|
|
307
|
|
-+ {
|
|
308
|
|
-+ static const int args = 5;
|
|
309
|
|
-+ typedef TArg1 Arg1Type;
|
|
310
|
|
-+ typedef TArg2 Arg2Type;
|
|
311
|
|
-+ typedef TArg3 Arg3Type;
|
|
312
|
|
-+ typedef TArg4 Arg4Type;
|
|
313
|
|
-+ typedef TArg5 Arg5Type;
|
|
314
|
|
-+ };
|
|
315
|
|
-+
|
|
316
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6>
|
|
317
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6)>
|
|
318
|
|
-+ {
|
|
319
|
|
-+ static const int args = 6;
|
|
320
|
|
-+ typedef TArg1 Arg1Type;
|
|
321
|
|
-+ typedef TArg2 Arg2Type;
|
|
322
|
|
-+ typedef TArg3 Arg3Type;
|
|
323
|
|
-+ typedef TArg4 Arg4Type;
|
|
324
|
|
-+ typedef TArg5 Arg5Type;
|
|
325
|
|
-+ typedef TArg6 Arg6Type;
|
|
326
|
|
-+ };
|
|
327
|
|
-+
|
|
328
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7>
|
|
329
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7)>
|
|
330
|
|
-+ {
|
|
331
|
|
-+ static const int args = 7;
|
|
332
|
|
-+ typedef TArg1 Arg1Type;
|
|
333
|
|
-+ typedef TArg2 Arg2Type;
|
|
334
|
|
-+ typedef TArg3 Arg3Type;
|
|
335
|
|
-+ typedef TArg4 Arg4Type;
|
|
336
|
|
-+ typedef TArg5 Arg5Type;
|
|
337
|
|
-+ typedef TArg6 Arg6Type;
|
|
338
|
|
-+ typedef TArg7 Arg7Type;
|
|
339
|
|
-+ };
|
|
340
|
|
-+
|
|
341
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8>
|
|
342
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8)>
|
|
343
|
|
-+ {
|
|
344
|
|
-+ static const int args = 8;
|
|
345
|
|
-+ typedef TArg1 Arg1Type;
|
|
346
|
|
-+ typedef TArg2 Arg2Type;
|
|
347
|
|
-+ typedef TArg3 Arg3Type;
|
|
348
|
|
-+ typedef TArg4 Arg4Type;
|
|
349
|
|
-+ typedef TArg5 Arg5Type;
|
|
350
|
|
-+ typedef TArg6 Arg6Type;
|
|
351
|
|
-+ typedef TArg7 Arg7Type;
|
|
352
|
|
-+ typedef TArg8 Arg8Type;
|
|
353
|
|
-+ };
|
|
354
|
|
-+
|
|
355
|
|
-+ template<typename TDelegateInterface, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9>
|
|
356
|
|
-+ struct ArgTraits<HRESULT(STDMETHODCALLTYPE TDelegateInterface::*)(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9)>
|
|
357
|
|
-+ {
|
|
358
|
|
-+ static const int args = 9;
|
|
359
|
|
-+ typedef TArg1 Arg1Type;
|
|
360
|
|
-+ typedef TArg2 Arg2Type;
|
|
361
|
|
-+ typedef TArg3 Arg3Type;
|
|
362
|
|
-+ typedef TArg4 Arg4Type;
|
|
363
|
|
-+ typedef TArg5 Arg5Type;
|
|
364
|
|
-+ typedef TArg6 Arg6Type;
|
|
365
|
|
-+ typedef TArg7 Arg7Type;
|
|
366
|
|
-+ typedef TArg8 Arg8Type;
|
|
367
|
|
-+ typedef TArg9 Arg9Type;
|
|
368
|
|
-+ };
|
|
369
|
|
-+
|
|
370
|
|
-+ template<typename TDelegateInterface, bool isImplements = __is_base_of(ImplementsBase, TDelegateInterface)>
|
|
371
|
|
-+ struct ArgTraitsHelper;
|
|
372
|
|
-+
|
|
373
|
|
-+ template<typename TDelegateInterface>
|
|
374
|
|
-+ struct ArgTraitsHelper<TDelegateInterface, false>
|
|
375
|
|
-+ {
|
|
376
|
|
-+ typedef decltype(&TDelegateInterface::Invoke) methodType;
|
|
377
|
|
-+ typedef ArgTraits<methodType> Traits;
|
|
378
|
|
-+ static const int args = Traits::args;
|
|
379
|
|
-+ typedef TDelegateInterface Interface;
|
|
380
|
|
-+ };
|
|
381
|
|
-+
|
|
382
|
|
-+ template<typename TDelegateInterface>
|
|
383
|
|
-+ struct ArgTraitsHelper<TDelegateInterface, true> {};
|
|
384
|
|
-+
|
|
385
|
|
-+ template<typename TDelegateInterface> class DelegateArgTraits {};
|
|
386
|
|
-+
|
|
387
|
|
-+ template<typename TDelegateInterface, typename ...TArgs>
|
|
388
|
|
-+ class DelegateArgTraits<HRESULT (STDMETHODCALLTYPE TDelegateInterface::*)(TArgs...)>
|
|
389
|
|
-+ {
|
|
390
|
|
-+ template<typename TCallback, DelegateCheckMode checkMode>
|
|
391
|
|
-+ struct DelegateInvokeHelper WrlSealed : public ::Microsoft::WRL::RuntimeClass<RuntimeClassFlags<Delegate>, TDelegateInterface>, RemoveReference<TCallback>::Type {
|
|
392
|
|
-+ DelegateInvokeHelper(TCallback&& callback) noexcept {}
|
|
393
|
|
-+
|
|
394
|
|
-+ HRESULT STDMETHODCALLTYPE Invoke(TArgs... args) noexcept override {
|
|
395
|
|
-+ return 0;
|
|
396
|
|
-+ }
|
|
397
|
|
-+ };
|
|
398
|
|
-+
|
|
399
|
|
-+ public:
|
|
400
|
|
-+ template<typename TImplements, DelegateCheckMode checkMode = DefaultDelegateCheckMode, typename TLambda>
|
|
401
|
|
-+ static ComPtr<TImplements> Callback(TLambda&& callback) noexcept {
|
|
402
|
|
-+ ComPtr<TImplements> empty;
|
|
403
|
|
-+ return empty;
|
|
404
|
|
-+ }
|
|
405
|
|
-+ };
|
|
|
210
|
++ class DelegateArgTraits {};
|
|
406
|
211
|
+
|
|
407
|
212
|
+ template<typename TDelegateInterface, bool isImplements = __is_base_of(ImplementsBase, TDelegateInterface)>
|
|
408
|
213
|
+ struct DelegateArgTraitsHelper;
|
| ... |
... |
@@ -415,11 +220,6 @@ index 000000000..2e883e241 |
|
415
|
220
|
+
|
|
416
|
221
|
+ template<typename TDelegateInterface>
|
|
417
|
222
|
+ struct DelegateArgTraitsHelper<TDelegateInterface, true> {};
|
|
418
|
|
-+
|
|
419
|
|
-+ template<typename TDelegateInterface>
|
|
420
|
|
-+ HRESULT CreateAgileHelper(TDelegateInterface* delegateInterface, TDelegateInterface** wrapper) {
|
|
421
|
|
-+ return 0;
|
|
422
|
|
-+ }
|
|
423
|
223
|
+ }
|
|
424
|
224
|
+
|
|
425
|
225
|
+ template<typename TDelegateInterface, typename TLambda>
|
| ... |
... |
@@ -436,143 +236,6 @@ index 000000000..2e883e241 |
|
436
|
236
|
+ ComPtr<typename Details::DelegateArgTraitsHelper<TDelegateInterface>::Interface> Callback(TCallbackObject *object, HRESULT(TCallbackObject::* method)(TArgs...)) noexcept {
|
|
437
|
237
|
+ return 0;
|
|
438
|
238
|
+ }
|
|
439
|
|
-+
|
|
440
|
|
-+ template<typename TDelegateInterface>
|
|
441
|
|
-+ HRESULT WeakReferenceCallback(IWeakReferenceSource* innerCallback, TDelegateInterface** callback) {
|
|
442
|
|
-+ return 0;
|
|
443
|
|
-+ }
|
|
444
|
|
-+
|
|
445
|
|
-+ template<typename TDelegateInterface>
|
|
446
|
|
-+ HRESULT WeakReferenceCallback(TDelegateInterface* innerCallback, TDelegateInterface** callback) {
|
|
447
|
|
-+ return 0;
|
|
448
|
|
-+ }
|
|
449
|
|
-+
|
|
450
|
|
-+ template<typename T, typename TDelegateInterface, typename ...TArgs>
|
|
451
|
|
-+ HRESULT WeakReferenceCallback(T* targetObject, HRESULT (T::*targetMethod)(TArgs... args), TDelegateInterface** callback) {
|
|
452
|
|
-+ return 0;
|
|
453
|
|
-+ }
|
|
454
|
|
-+
|
|
455
|
|
-+ template<typename T, typename TDelegateInterface, typename ...TArgs>
|
|
456
|
|
-+ HRESULT WeakReferenceCallback(T* targetObject, HRESULT(T::*targetMethod)(TArgs... args), ::Microsoft::WRL::Details::ComPtrRef< ::Microsoft::WRL::ComPtr<TDelegateInterface>> callback) {
|
|
457
|
|
-+ return 0;
|
|
458
|
|
-+ }
|
|
459
|
|
-+
|
|
460
|
|
-+ namespace Details {
|
|
461
|
|
-+
|
|
462
|
|
-+ class EventTargetArray WrlSealed : public ::Microsoft::WRL::RuntimeClass< ::Microsoft::WRL::RuntimeClassFlags<ClassicCom>, IUnknown > {
|
|
463
|
|
-+ public:
|
|
464
|
|
-+ EventTargetArray() noexcept {}
|
|
465
|
|
-+
|
|
466
|
|
-+ HRESULT RuntimeClassInitialize(size_t items) noexcept {
|
|
467
|
|
-+ return 0;
|
|
468
|
|
-+ }
|
|
469
|
|
-+
|
|
470
|
|
-+ ~EventTargetArray() noexcept
|
|
471
|
|
-+ {
|
|
472
|
|
-+ delete[] begin_;
|
|
473
|
|
-+ delete[] bucketAssists_;
|
|
474
|
|
-+ }
|
|
475
|
|
-+
|
|
476
|
|
-+ ComPtr<IUnknown>* Begin() noexcept {
|
|
477
|
|
-+ return nullptr;
|
|
478
|
|
-+ }
|
|
479
|
|
-+
|
|
480
|
|
-+ ComPtr<IUnknown>* End() noexcept {
|
|
481
|
|
-+ return nullptr;
|
|
482
|
|
-+ }
|
|
483
|
|
-+
|
|
484
|
|
-+ void AddTail(IUnknown* element) noexcept {
|
|
485
|
|
-+ }
|
|
486
|
|
-+
|
|
487
|
|
-+ void AddTail(IUnknown* element, void *bucketAssist) noexcept {
|
|
488
|
|
-+ }
|
|
489
|
|
-+
|
|
490
|
|
-+ size_t Length() noexcept {
|
|
491
|
|
-+ return 0;
|
|
492
|
|
-+ }
|
|
493
|
|
-+
|
|
494
|
|
-+ void **Begin_BucketAssists() {
|
|
495
|
|
-+ return nullptr;
|
|
496
|
|
-+ }
|
|
497
|
|
-+
|
|
498
|
|
-+ void **End_BucketAssists() {
|
|
499
|
|
-+ return nullptr;
|
|
500
|
|
-+ }
|
|
501
|
|
-+
|
|
502
|
|
-+ private:
|
|
503
|
|
-+ ComPtr<IUnknown>* begin_;
|
|
504
|
|
-+
|
|
505
|
|
-+ ComPtr<IUnknown>* end_;
|
|
506
|
|
-+
|
|
507
|
|
-+ void **bucketAssists_;
|
|
508
|
|
-+ };
|
|
509
|
|
-+ }
|
|
510
|
|
-+
|
|
511
|
|
-+ template<>
|
|
512
|
|
-+ struct InvokeTraits<FireAll>
|
|
513
|
|
-+ {
|
|
514
|
|
-+ template<typename TInvokeMethod, typename TDelegateInterface>
|
|
515
|
|
-+ static HRESULT InvokeDelegates(TInvokeMethod invokeOne, Details::EventTargetArray *targetArray, EventSource<TDelegateInterface, InvokeModeOptions<FireAll>>* pEvent) {
|
|
516
|
|
-+ return 0;
|
|
517
|
|
-+ }
|
|
518
|
|
-+ };
|
|
519
|
|
-+
|
|
520
|
|
-+ template<>
|
|
521
|
|
-+ struct InvokeTraits<StopOnFirstError>
|
|
522
|
|
-+ {
|
|
523
|
|
-+ template<typename TInvokeMethod, typename TDelegateInterface>
|
|
524
|
|
-+ static HRESULT InvokeDelegates(TInvokeMethod invokeOne, Details::EventTargetArray *targetArray, EventSource<TDelegateInterface, InvokeModeOptions<StopOnFirstError>>* pEvent) {
|
|
525
|
|
-+ return 0;
|
|
526
|
|
-+ }
|
|
527
|
|
-+ };
|
|
528
|
|
-+
|
|
529
|
|
-+ template<typename TDelegateInterface, typename TEventSourceOptions>
|
|
530
|
|
-+ class EventSource {
|
|
531
|
|
-+ public:
|
|
532
|
|
-+ EventSource() noexcept {}
|
|
533
|
|
-+
|
|
534
|
|
-+ HRESULT Add(TDelegateInterface* delegateInterface, EventRegistrationToken* token) noexcept {
|
|
535
|
|
-+ return 0;
|
|
536
|
|
-+ }
|
|
537
|
|
-+
|
|
538
|
|
-+ HRESULT Remove(EventRegistrationToken token) noexcept {
|
|
539
|
|
-+ return 0;
|
|
540
|
|
-+ }
|
|
541
|
|
-+
|
|
542
|
|
-+ protected:
|
|
543
|
|
-+
|
|
544
|
|
-+ HRESULT Add(TDelegateInterface* delegateInterface, void *bucketAssist, EventRegistrationToken* token) noexcept {
|
|
545
|
|
-+ return 0;
|
|
546
|
|
-+ }
|
|
547
|
|
-+
|
|
548
|
|
-+ private:
|
|
549
|
|
-+
|
|
550
|
|
-+ HRESULT AddInternal(TDelegateInterface* delegateInterface, void *bucketAssist, EventRegistrationToken* token) noexcept {
|
|
551
|
|
-+ return 0;
|
|
552
|
|
-+ }
|
|
553
|
|
-+
|
|
554
|
|
-+ template <typename TInvokeMethod>
|
|
555
|
|
-+ HRESULT DoInvoke(TInvokeMethod invokeOne) noexcept {
|
|
556
|
|
-+ return 0;
|
|
557
|
|
-+ }
|
|
558
|
|
-+
|
|
559
|
|
-+ public:
|
|
560
|
|
-+ template<typename ...TArgs>
|
|
561
|
|
-+ HRESULT InvokeAll(TArgs... args) noexcept {
|
|
562
|
|
-+ return 0;
|
|
563
|
|
-+ }
|
|
564
|
|
-+
|
|
565
|
|
-+ size_t GetSize() const noexcept {
|
|
566
|
|
-+ return 0;
|
|
567
|
|
-+ }
|
|
568
|
|
-+
|
|
569
|
|
-+ protected:
|
|
570
|
|
-+ ComPtr<Details::EventTargetArray> targets_;
|
|
571
|
|
-+
|
|
572
|
|
-+ mutable Wrappers::SRWLock targetsPointerLock_;
|
|
573
|
|
-+
|
|
574
|
|
-+ Wrappers::SRWLock addRemoveLock_;
|
|
575
|
|
-+ };
|
|
576
|
239
|
+ }
|
|
577
|
240
|
+}
|
|
578
|
241
|
+
|
| ... |
... |
@@ -581,10 +244,10 @@ index 000000000..2e883e241 |
|
581
|
244
|
+#endif
|
|
582
|
245
|
diff --git a/mingw-w64-headers/include/wrl/implements.h b/mingw-w64-headers/include/wrl/implements.h
|
|
583
|
246
|
new file mode 100644
|
|
584
|
|
-index 000000000..c8261e55a
|
|
|
247
|
+index 000000000..b6ef5cdd1
|
|
585
|
248
|
--- /dev/null
|
|
586
|
249
|
+++ b/mingw-w64-headers/include/wrl/implements.h
|
|
587
|
|
-@@ -0,0 +1,627 @@
|
|
|
250
|
+@@ -0,0 +1,394 @@
|
|
588
|
251
|
+#ifndef _WRL_IMPLEMENTS_H_
|
|
589
|
252
|
+#define _WRL_IMPLEMENTS_H_
|
|
590
|
253
|
+
|
| ... |
... |
@@ -625,10 +288,7 @@ index 000000000..c8261e55a |
|
625
|
288
|
+ template <typename FactoryInterface>
|
|
626
|
289
|
+ class ComposableBase {};
|
|
627
|
290
|
+
|
|
628
|
|
-+ typedef RuntimeClassFlags<WinRt | InhibitWeakReference> InhibitWeakReferencePolicy;
|
|
629
|
|
-+
|
|
630
|
291
|
+ namespace Details {
|
|
631
|
|
-+
|
|
632
|
292
|
+ class Nil {};
|
|
633
|
293
|
+
|
|
634
|
294
|
+ template <typename T, typename ...TArgs>
|
| ... |
... |
@@ -648,10 +308,8 @@ index 000000000..c8261e55a |
|
648
|
308
|
+ }
|
|
649
|
309
|
+ };
|
|
650
|
310
|
+
|
|
651
|
|
-+ class RuntimeClassBase {};
|
|
652
|
|
-+
|
|
653
|
311
|
+ template <unsigned int RuntimeClassTypeT>
|
|
654
|
|
-+ class RuntimeClassBaseT : private RuntimeClassBase {
|
|
|
312
|
++ class RuntimeClassBaseT {
|
|
655
|
313
|
+ protected:
|
|
656
|
314
|
+ template<typename T>
|
|
657
|
315
|
+ static HRESULT AsIID(T* implements, REFIID riid, void **ppvObject) throw() {
|
| ... |
... |
@@ -668,18 +326,6 @@ index 000000000..c8261e55a |
|
668
|
326
|
+ return 0;
|
|
669
|
327
|
+ }
|
|
670
|
328
|
+ };
|
|
671
|
|
-+
|
|
672
|
|
-+ class FtmBaseMarker {};
|
|
673
|
|
-+
|
|
674
|
|
-+ template <typename I, typename Base>
|
|
675
|
|
-+ struct VerifyInheritanceHelper {
|
|
676
|
|
-+ static void Verify() throw() {}
|
|
677
|
|
-+ };
|
|
678
|
|
-+
|
|
679
|
|
-+ template <typename I>
|
|
680
|
|
-+ struct VerifyInheritanceHelper<I, Nil> {
|
|
681
|
|
-+ static void Verify() throw() {}
|
|
682
|
|
-+ };
|
|
683
|
329
|
+ }
|
|
684
|
330
|
+
|
|
685
|
331
|
+ template <typename I0, typename I1, typename I2 = Details::Nil, typename I3 = Details::Nil,
|
| ... |
... |
@@ -882,21 +528,6 @@ index 000000000..c8261e55a |
|
882
|
528
|
+ void FillArrayWithIid(unsigned long *index, IID* iids) throw() {}
|
|
883
|
529
|
+ };
|
|
884
|
530
|
+
|
|
885
|
|
-+ template <typename I0, typename ...>
|
|
886
|
|
-+ struct AreAllNil {
|
|
887
|
|
-+ static const bool value = false;
|
|
888
|
|
-+ };
|
|
889
|
|
-+
|
|
890
|
|
-+ template <typename ...TInterfaces>
|
|
891
|
|
-+ struct AreAllNil<Microsoft::WRL::Details::Nil, TInterfaces...> {
|
|
892
|
|
-+ static const bool value = AreAllNil<TInterfaces...>::value;
|
|
893
|
|
-+ };
|
|
894
|
|
-+
|
|
895
|
|
-+ template <>
|
|
896
|
|
-+ struct AreAllNil<Microsoft::WRL::Details::Nil> {
|
|
897
|
|
-+ static const bool value = true;
|
|
898
|
|
-+ };
|
|
899
|
|
-+
|
|
900
|
531
|
+ template <typename RuntimeClassFlagsT, typename FactoryInterface, bool doStrictCheck, typename ...TInterfaces>
|
|
901
|
532
|
+ struct __declspec(novtable) ImplementsHelper<RuntimeClassFlagsT, doStrictCheck, ComposableBase<FactoryInterface>, TInterfaces...> : ImplementsHelper<RuntimeClassFlagsT, true, ComposableBase<FactoryInterface>> {
|
|
902
|
533
|
+ protected:
|
| ... |
... |
@@ -918,206 +549,12 @@ index 000000000..c8261e55a |
|
918
|
549
|
+
|
|
919
|
550
|
+ void FillArrayWithIid(unsigned long *index, IID* iids) throw() {}
|
|
920
|
551
|
+ };
|
|
921
|
|
-+
|
|
922
|
|
-+ template <typename RuntimeClassFlagsT, typename FactoryInterface, bool doStrictCheck>
|
|
923
|
|
-+ struct __declspec(novtable) ImplementsHelper<RuntimeClassFlagsT, doStrictCheck, ComposableBase<FactoryInterface>> {
|
|
924
|
|
-+ protected:
|
|
925
|
|
-+ template <unsigned int RuntimeClassTypeT> friend class Details::RuntimeClassBaseT;
|
|
926
|
|
-+
|
|
927
|
|
-+ HRESULT CanCastTo(REFIID riid, void **ppv, bool *pRefDelegated) throw() {
|
|
928
|
|
-+ return 0;
|
|
929
|
|
-+ }
|
|
930
|
|
-+
|
|
931
|
|
-+ IUnknown* CastToUnknown() throw() {
|
|
932
|
|
-+ return nullptr;
|
|
933
|
|
-+ }
|
|
934
|
|
-+
|
|
935
|
|
-+ unsigned long GetIidCount() throw() {
|
|
936
|
|
-+ return 0;
|
|
937
|
|
-+ }
|
|
938
|
|
-+
|
|
939
|
|
-+ void FillArrayWithIid(unsigned long *index, IID* iids) throw() {}
|
|
940
|
|
-+
|
|
941
|
|
-+ ImplementsHelper() throw() {}
|
|
942
|
|
-+
|
|
943
|
|
-+ ~ImplementsHelper() throw() {}
|
|
944
|
|
-+
|
|
945
|
|
-+ public:
|
|
946
|
|
-+ HRESULT SetComposableBasePointers(IInspectable* base, FactoryInterface* baseFactory) throw() {
|
|
947
|
|
-+ return 0;
|
|
948
|
|
-+ }
|
|
949
|
|
-+
|
|
950
|
|
-+ ComPtr<IInspectable> GetComposableBase() throw() {
|
|
951
|
|
-+ return composableBase_;
|
|
952
|
|
-+ }
|
|
953
|
|
-+
|
|
954
|
|
-+ ComPtr<FactoryInterface> GetComposableBaseFactory() throw() {
|
|
955
|
|
-+ return composableBaseFactory_;
|
|
956
|
|
-+ }
|
|
957
|
|
-+
|
|
958
|
|
-+ private:
|
|
959
|
|
-+ ComPtr<IInspectable> composableBase_;
|
|
960
|
|
-+
|
|
961
|
|
-+ ComPtr<FactoryInterface> composableBaseFactory_;
|
|
962
|
|
-+
|
|
963
|
|
-+ IID *iidsCached_;
|
|
964
|
|
-+
|
|
965
|
|
-+ unsigned long iidCount_;
|
|
966
|
|
-+ };
|
|
967
|
|
-+
|
|
968
|
552
|
+ }
|
|
969
|
553
|
+
|
|
970
|
|
-+ template <typename I0, typename ...TInterfaces>
|
|
971
|
|
-+ struct __declspec(novtable) Implements : Details::ImplementsHelper<RuntimeClassFlags<WinRt>, true, I0, TInterfaces...>, Details::ImplementsBase {
|
|
972
|
|
-+ public:
|
|
973
|
|
-+ typedef RuntimeClassFlags<WinRt> ClassFlags;
|
|
974
|
|
-+
|
|
975
|
|
-+ typedef I0 FirstInterface;
|
|
976
|
|
-+
|
|
977
|
|
-+ protected:
|
|
978
|
|
-+ HRESULT CanCastTo(REFIID riid, void **ppv) throw() {
|
|
979
|
|
-+ return 0;
|
|
980
|
|
-+ }
|
|
981
|
|
-+
|
|
982
|
|
-+ IUnknown* CastToUnknown() throw() {
|
|
983
|
|
-+ return nullptr;
|
|
984
|
|
-+ }
|
|
985
|
|
-+
|
|
986
|
|
-+ unsigned long GetIidCount() throw() {
|
|
987
|
|
-+ return 0;
|
|
988
|
|
-+ }
|
|
989
|
|
-+
|
|
990
|
|
-+ void FillArrayWithIid(unsigned long *index, IID* iids) throw() {}
|
|
991
|
|
-+ };
|
|
992
|
|
-+
|
|
993
|
|
-+ template <int flags, typename I0, typename ...TInterfaces>
|
|
994
|
|
-+ struct __declspec(novtable) Implements<RuntimeClassFlags<flags>, I0, TInterfaces...> : Details::ImplementsHelper<RuntimeClassFlags<flags>, true, I0, TInterfaces...>, Details::ImplementsBase {
|
|
995
|
|
-+ public:
|
|
996
|
|
-+ typedef RuntimeClassFlags<flags> ClassFlags;
|
|
997
|
|
-+
|
|
998
|
|
-+ typedef I0 FirstInterface;
|
|
999
|
|
-+
|
|
1000
|
|
-+ protected:
|
|
1001
|
|
-+ HRESULT CanCastTo(REFIID riid, void **ppv) throw() {
|
|
1002
|
|
-+ return 0;
|
|
1003
|
|
-+ }
|
|
1004
|
|
-+
|
|
1005
|
|
-+ IUnknown* CastToUnknown() throw() {
|
|
1006
|
|
-+ return nullptr;
|
|
1007
|
|
-+ }
|
|
1008
|
|
-+
|
|
1009
|
|
-+ unsigned long GetIidCount() throw() {
|
|
1010
|
|
-+ return 0;
|
|
1011
|
|
-+ }
|
|
1012
|
|
-+
|
|
1013
|
|
-+ void FillArrayWithIid(unsigned long *index, IID* iids) throw() {}
|
|
1014
|
|
-+ };
|
|
1015
|
|
-+
|
|
1016
|
|
-+ class FtmBase : public Implements< ::Microsoft::WRL::RuntimeClassFlags<WinRtClassicComMix>, ::Microsoft::WRL::CloakedIid< ::IMarshal> >, private ::Microsoft::WRL::Details::FtmBaseMarker {
|
|
1017
|
|
-+ protected:
|
|
1018
|
|
-+ template <typename RuntimeClassFlagsT, bool doStrictCheck, typename ...TInterfaces> friend struct Details::ImplementsHelper;
|
|
1019
|
|
-+
|
|
1020
|
|
-+ HRESULT CanCastTo(REFIID riid, void **ppv) throw() {
|
|
1021
|
|
-+ return 0;
|
|
1022
|
|
-+ }
|
|
1023
|
|
-+
|
|
1024
|
|
-+ public:
|
|
1025
|
|
-+ FtmBase() throw() {}
|
|
1026
|
|
-+
|
|
1027
|
|
-+ STDMETHOD(GetUnmarshalClass)(REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *pCid) override {
|
|
1028
|
|
-+ return 0;
|
|
1029
|
|
-+ }
|
|
1030
|
|
-+
|
|
1031
|
|
-+ STDMETHOD(GetMarshalSizeMax)(REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, DWORD *pSize) override {
|
|
1032
|
|
-+ return 0;
|
|
1033
|
|
-+ }
|
|
1034
|
|
-+
|
|
1035
|
|
-+ STDMETHOD(MarshalInterface)(IStream *pStm, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags) override {
|
|
1036
|
|
-+ return 0;
|
|
1037
|
|
-+ }
|
|
1038
|
|
-+
|
|
1039
|
|
-+ STDMETHOD(UnmarshalInterface)(IStream *pStm, REFIID riid, void **ppv) override {
|
|
1040
|
|
-+ return 0;
|
|
1041
|
|
-+ }
|
|
1042
|
|
-+
|
|
1043
|
|
-+ STDMETHOD(ReleaseMarshalData)(IStream *pStm) override {
|
|
1044
|
|
-+ return 0;
|
|
1045
|
|
-+ }
|
|
1046
|
|
-+
|
|
1047
|
|
-+ STDMETHOD(DisconnectObject)(DWORD dwReserved) override {
|
|
1048
|
|
-+ return 0;
|
|
1049
|
|
-+ }
|
|
1050
|
|
-+
|
|
1051
|
|
-+ static HRESULT CreateGlobalInterfaceTable(IGlobalInterfaceTable **git) throw() {
|
|
1052
|
|
-+ return 0;
|
|
1053
|
|
-+ }
|
|
1054
|
|
-+
|
|
1055
|
|
-+ ::Microsoft::WRL::ComPtr<IMarshal> marshaller_;
|
|
1056
|
|
-+ };
|
|
1057
|
|
-+
|
|
1058
|
554
|
+ namespace Details {
|
|
1059
|
|
-+ #define DETAILS_RTCLASS_FLAGS_ARGUMENTS(RuntimeClassFlagsT) \
|
|
1060
|
|
-+ RuntimeClassFlagsT, \
|
|
1061
|
|
-+ (RuntimeClassFlagsT::value & InhibitWeakReference) == 0, \
|
|
1062
|
|
-+ (RuntimeClassFlagsT::value & WinRt) == WinRt, \
|
|
1063
|
|
-+ __WRL_IMPLEMENTS_FTM_BASE__(RuntimeClassFlagsT::value) \
|
|
1064
|
|
-+
|
|
1065
|
555
|
+ template <class RuntimeClassFlagsT, bool implementsWeakReferenceSource, bool implementsInspectable, bool implementsFtmBase, typename ...TInterfaces>
|
|
1066
|
556
|
+ class __declspec(novtable) RuntimeClassImpl;
|
|
1067
|
557
|
+
|
|
1068
|
|
-+ template <class RuntimeClassFlagsT, bool implementsWeakReferenceSource, bool implementsFtmBase, typename ...TInterfaces>
|
|
1069
|
|
-+ class __declspec(novtable) RuntimeClassImpl<RuntimeClassFlagsT, implementsWeakReferenceSource, false, implementsFtmBase, TInterfaces...> : public Details::ImplementsHelper<RuntimeClassFlagsT, false, TInterfaces...>, public RuntimeClassBaseT<RuntimeClassFlagsT::value>, protected RuntimeClassFlags<InhibitWeakReference>, public DontUseNewUseMake {
|
|
1070
|
|
-+ public:
|
|
1071
|
|
-+ typedef RuntimeClassFlagsT ClassFlags;
|
|
1072
|
|
-+
|
|
1073
|
|
-+ STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject) {
|
|
1074
|
|
-+ return 0;
|
|
1075
|
|
-+ }
|
|
1076
|
|
-+
|
|
1077
|
|
-+ STDMETHOD_(ULONG, AddRef)() {
|
|
1078
|
|
-+ return 0;
|
|
1079
|
|
-+ }
|
|
1080
|
|
-+
|
|
1081
|
|
-+ STDMETHOD_(ULONG, Release)() {
|
|
1082
|
|
-+ return 0;
|
|
1083
|
|
-+ }
|
|
1084
|
|
-+
|
|
1085
|
|
-+ protected:
|
|
1086
|
|
-+ RuntimeClassImpl() throw() {}
|
|
1087
|
|
-+
|
|
1088
|
|
-+ virtual ~RuntimeClassImpl() throw() {}
|
|
1089
|
|
-+
|
|
1090
|
|
-+ unsigned long InternalAddRef() throw() {
|
|
1091
|
|
-+ return 0;
|
|
1092
|
|
-+ }
|
|
1093
|
|
-+
|
|
1094
|
|
-+ unsigned long InternalRelease() throw() {
|
|
1095
|
|
-+ return 0;
|
|
1096
|
|
-+ }
|
|
1097
|
|
-+
|
|
1098
|
|
-+ unsigned long GetRefCount() const throw() {
|
|
1099
|
|
-+ return 0;
|
|
1100
|
|
-+ }
|
|
1101
|
|
-+
|
|
1102
|
|
-+ friend class WeakReferenceImpl;
|
|
1103
|
|
-+
|
|
1104
|
|
-+ private:
|
|
1105
|
|
-+ volatile long refcount_;
|
|
1106
|
|
-+ };
|
|
1107
|
|
-+
|
|
1108
|
|
-+ template<typename I, bool isImplementsBased = __is_base_of(ImplementsBase, I)>
|
|
1109
|
|
-+ struct HasIInspectable;
|
|
1110
|
|
-+
|
|
1111
|
|
-+ template<typename I>
|
|
1112
|
|
-+ struct HasIInspectable<I, false> {
|
|
1113
|
|
-+ static const bool isIInspectable;
|
|
1114
|
|
-+ };
|
|
1115
|
|
-+
|
|
1116
|
|
-+ template<typename I>
|
|
1117
|
|
-+ struct HasIInspectable<I, true> {
|
|
1118
|
|
-+ static const bool isIInspectable;
|
|
1119
|
|
-+ };
|
|
1120
|
|
-+
|
|
1121
|
558
|
+ template<typename I0, bool isIInspectable = true>
|
|
1122
|
559
|
+ struct IInspectableInjector;
|
|
1123
|
560
|
+
|
| ... |
... |
@@ -1172,16 +609,10 @@ index 000000000..c8261e55a |
|
1172
|
609
|
+ private:
|
|
1173
|
610
|
+ volatile long refcount_;
|
|
1174
|
611
|
+ };
|
|
1175
|
|
-+
|
|
1176
|
|
-+ template <class RuntimeClassFlagsT, typename I0, typename ...TInterfaces>
|
|
1177
|
|
-+ class __declspec(novtable) RuntimeClassImpl<RuntimeClassFlagsT, false, true, true, I0, TInterfaces...> : public RuntimeClassImpl<RuntimeClassFlagsT, false, true, false, I0, TInterfaces...> {};
|
|
1178
|
|
-+
|
|
1179
|
|
-+ template <class RuntimeClassFlagsT, typename I0, typename ...TInterfaces>
|
|
1180
|
|
-+ class __declspec(novtable) RuntimeClassImpl<RuntimeClassFlagsT, true, true, true, I0, TInterfaces...> : public RuntimeClassImpl<RuntimeClassFlagsT, true, true, false, I0, FtmBase, TInterfaces...> {};
|
|
1181
|
612
|
+ }
|
|
1182
|
613
|
+
|
|
1183
|
614
|
+ template <typename ...TInterfaces>
|
|
1184
|
|
-+ class RuntimeClass : public Details::RuntimeClassImpl<DETAILS_RTCLASS_FLAGS_ARGUMENTS(RuntimeClassFlags<WinRt>), TInterfaces...> {
|
|
|
615
|
++ class RuntimeClass : public Details::RuntimeClassImpl<RuntimeClassFlags<WinRt>, false, true, false, TInterfaces...> {
|
|
1185
|
616
|
+ RuntimeClass(const RuntimeClass&);
|
|
1186
|
617
|
+
|
|
1187
|
618
|
+ RuntimeClass& operator=(const RuntimeClass&);
|
| ... |
... |
@@ -1193,7 +624,7 @@ index 000000000..c8261e55a |
|
1193
|
624
|
+ };
|
|
1194
|
625
|
+
|
|
1195
|
626
|
+ template <unsigned int classFlags, typename ...TInterfaces>
|
|
1196
|
|
-+ class RuntimeClass<RuntimeClassFlags<classFlags>, TInterfaces...> : public Details::RuntimeClassImpl<DETAILS_RTCLASS_FLAGS_ARGUMENTS(RuntimeClassFlags<classFlags>), TInterfaces...> {
|
|
|
627
|
++ class RuntimeClass<RuntimeClassFlags<classFlags>, TInterfaces...> : public Details::RuntimeClassImpl<RuntimeClassFlags<classFlags>, false, true, false, TInterfaces...> {
|
|
1197
|
628
|
+ RuntimeClass(const RuntimeClass&);
|
|
1198
|
629
|
+
|
|
1199
|
630
|
+ RuntimeClass& operator=(const RuntimeClass&);
|
| ... |
... |
@@ -1205,184 +636,9 @@ index 000000000..c8261e55a |
|
1205
|
636
|
+ };
|
|
1206
|
637
|
+
|
|
1207
|
638
|
+ using Details::Make;
|
|
1208
|
|
-+
|
|
1209
|
639
|
+ }
|
|
1210
|
640
|
+}
|
|
1211
|
641
|
+
|
|
1212
|
642
|
+#include <poppack.h>
|
|
1213
|
643
|
+
|
|
1214
|
644
|
+#endif |
|
1215
|
|
-diff --git a/mingw-w64-headers/include/wrl/internal.h b/mingw-w64-headers/include/wrl/internal.h
|
|
1216
|
|
-index 715ef74e3..dffa7153d 100644
|
|
1217
|
|
---- a/mingw-w64-headers/include/wrl/internal.h
|
|
1218
|
|
-+++ b/mingw-w64-headers/include/wrl/internal.h
|
|
1219
|
|
-@@ -7,6 +7,8 @@
|
|
1220
|
|
- #ifndef _WRL_INTERNAL_H_
|
|
1221
|
|
- #define _WRL_INTERNAL_H_
|
|
1222
|
|
-
|
|
1223
|
|
-+#define __WRL_IMPLEMENTS_FTM_BASE__(flags) (false)
|
|
1224
|
|
-+
|
|
1225
|
|
- #include <windows.h>
|
|
1226
|
|
-
|
|
1227
|
|
- namespace Microsoft {
|
|
1228
|
|
-@@ -29,6 +31,26 @@ namespace Microsoft {
|
|
1229
|
|
- struct EnableIf<true, T> {
|
|
1230
|
|
- typedef T type;
|
|
1231
|
|
- };
|
|
1232
|
|
-+
|
|
1233
|
|
-+ template<class T>
|
|
1234
|
|
-+ struct RemoveReference {
|
|
1235
|
|
-+ typedef T Type;
|
|
1236
|
|
-+ };
|
|
1237
|
|
-+
|
|
1238
|
|
-+ template<class T>
|
|
1239
|
|
-+ struct RemoveReference<T&> {
|
|
1240
|
|
-+ typedef T Type;
|
|
1241
|
|
-+ };
|
|
1242
|
|
-+
|
|
1243
|
|
-+ template<class T>
|
|
1244
|
|
-+ struct RemoveReference<T&&> {
|
|
1245
|
|
-+ typedef T Type;
|
|
1246
|
|
-+ };
|
|
1247
|
|
-+
|
|
1248
|
|
-+ template<class T>
|
|
1249
|
|
-+ inline typename RemoveReference<T>::Type&& Move(T&& arg) throw() {
|
|
1250
|
|
-+ return nullptr;
|
|
1251
|
|
-+ }
|
|
1252
|
|
- }
|
|
1253
|
|
- }
|
|
1254
|
|
- }
|
|
1255
|
|
-diff --git a/mingw-w64-headers/include/wrl/wrappers/corewrappers.h b/mingw-w64-headers/include/wrl/wrappers/corewrappers.h
|
|
1256
|
|
-index 182d4b063..6d42fb341 100644
|
|
1257
|
|
---- a/mingw-w64-headers/include/wrl/wrappers/corewrappers.h
|
|
1258
|
|
-+++ b/mingw-w64-headers/include/wrl/wrappers/corewrappers.h
|
|
1259
|
|
-@@ -24,6 +24,129 @@ namespace Microsoft {
|
|
1260
|
|
- }
|
|
1261
|
|
-
|
|
1262
|
|
- namespace Wrappers {
|
|
1263
|
|
-+ namespace HandleTraits {
|
|
1264
|
|
-+ struct SRWLockSharedTraits {
|
|
1265
|
|
-+ typedef SRWLOCK* Type;
|
|
1266
|
|
-+
|
|
1267
|
|
-+ inline static Type GetInvalidValue() throw() {
|
|
1268
|
|
-+ return nullptr;
|
|
1269
|
|
-+ }
|
|
1270
|
|
-+
|
|
1271
|
|
-+ inline static void Unlock(Type srwlock) throw() {}
|
|
1272
|
|
-+ };
|
|
1273
|
|
-+
|
|
1274
|
|
-+ struct SRWLockExclusiveTraits {
|
|
1275
|
|
-+ typedef SRWLOCK* Type;
|
|
1276
|
|
-+
|
|
1277
|
|
-+ inline static Type GetInvalidValue() throw() {
|
|
1278
|
|
-+ return nullptr;
|
|
1279
|
|
-+ }
|
|
1280
|
|
-+
|
|
1281
|
|
-+ inline static void Unlock(Type srwlock) throw() {}
|
|
1282
|
|
-+ };
|
|
1283
|
|
-+ }
|
|
1284
|
|
-+
|
|
1285
|
|
-+ class SRWLock;
|
|
1286
|
|
-+
|
|
1287
|
|
-+ namespace Details {
|
|
1288
|
|
-+ class SyncLockExclusive {
|
|
1289
|
|
-+ public:
|
|
1290
|
|
-+ SyncLockExclusive(SyncLockExclusive&& other) throw() {}
|
|
1291
|
|
-+
|
|
1292
|
|
-+ SyncLockExclusive(const SyncLockExclusive&);
|
|
1293
|
|
-+ SyncLockExclusive& operator=(const SyncLockExclusive&);
|
|
1294
|
|
-+
|
|
1295
|
|
-+ ~SyncLockExclusive() throw() {}
|
|
1296
|
|
-+
|
|
1297
|
|
-+ void Unlock() throw() {}
|
|
1298
|
|
-+
|
|
1299
|
|
-+ bool IsLocked() const throw() {
|
|
1300
|
|
-+ return 0;
|
|
1301
|
|
-+ }
|
|
1302
|
|
-+
|
|
1303
|
|
-+ friend class Wrappers::SRWLock;
|
|
1304
|
|
-+
|
|
1305
|
|
-+ protected:
|
|
1306
|
|
-+ explicit SyncLockExclusive(SRWLOCK* sync) throw() {}
|
|
1307
|
|
-+
|
|
1308
|
|
-+ SRWLOCK* sync_;
|
|
1309
|
|
-+
|
|
1310
|
|
-+ private:
|
|
1311
|
|
-+ void InternalUnlock() throw() {}
|
|
1312
|
|
-+ };
|
|
1313
|
|
-+
|
|
1314
|
|
-+ class SyncLockShared {
|
|
1315
|
|
-+ public:
|
|
1316
|
|
-+ SyncLockShared(SyncLockShared&& other) throw() {}
|
|
1317
|
|
-+
|
|
1318
|
|
-+ SyncLockShared(const SyncLockShared&);
|
|
1319
|
|
-+ SyncLockShared& operator=(const SyncLockShared&);
|
|
1320
|
|
-+
|
|
1321
|
|
-+ ~SyncLockShared() throw() {}
|
|
1322
|
|
-+
|
|
1323
|
|
-+ void Unlock() throw() {}
|
|
1324
|
|
-+
|
|
1325
|
|
-+ bool IsLocked() const throw() {
|
|
1326
|
|
-+ return 0;
|
|
1327
|
|
-+ }
|
|
1328
|
|
-+
|
|
1329
|
|
-+ friend class Wrappers::SRWLock;
|
|
1330
|
|
-+
|
|
1331
|
|
-+ protected:
|
|
1332
|
|
-+ explicit SyncLockShared(SRWLOCK* sync) throw() {}
|
|
1333
|
|
-+
|
|
1334
|
|
-+ SRWLOCK* sync_;
|
|
1335
|
|
-+
|
|
1336
|
|
-+ private:
|
|
1337
|
|
-+ void InternalUnlock() throw() {}
|
|
1338
|
|
-+ };
|
|
1339
|
|
-+ }
|
|
1340
|
|
-+
|
|
1341
|
|
-+ class SRWLock {
|
|
1342
|
|
-+ public:
|
|
1343
|
|
-+ SRWLock() throw() {}
|
|
1344
|
|
-+
|
|
1345
|
|
-+ SRWLock(const SRWLock&) = delete;
|
|
1346
|
|
-+ SRWLock& operator=(const SRWLock&) = delete;
|
|
1347
|
|
-+
|
|
1348
|
|
-+ ~SRWLock() throw() {}
|
|
1349
|
|
-+
|
|
1350
|
|
-+ Details::SyncLockExclusive LockExclusive() throw() {
|
|
1351
|
|
-+ return Details::SyncLockExclusive(nullptr);
|
|
1352
|
|
-+ }
|
|
1353
|
|
-+
|
|
1354
|
|
-+ static Details::SyncLockExclusive LockExclusive(SRWLOCK* lock) throw() {
|
|
1355
|
|
-+ return Details::SyncLockExclusive(nullptr);
|
|
1356
|
|
-+ }
|
|
1357
|
|
-+
|
|
1358
|
|
-+ Details::SyncLockExclusive TryLockExclusive() throw() {
|
|
1359
|
|
-+ return Details::SyncLockExclusive(nullptr);
|
|
1360
|
|
-+ }
|
|
1361
|
|
-+
|
|
1362
|
|
-+ static Details::SyncLockExclusive TryLockExclusive(SRWLOCK* lock) throw() {
|
|
1363
|
|
-+ return Details::SyncLockExclusive(nullptr);
|
|
1364
|
|
-+ }
|
|
1365
|
|
-+
|
|
1366
|
|
-+ Details::SyncLockShared LockShared() throw() {
|
|
1367
|
|
-+ return Details::SyncLockShared(nullptr);
|
|
1368
|
|
-+ }
|
|
1369
|
|
-+
|
|
1370
|
|
-+ static Details::SyncLockShared LockShared(SRWLOCK* lock) throw() {
|
|
1371
|
|
-+ return Details::SyncLockShared(nullptr);
|
|
1372
|
|
-+ }
|
|
1373
|
|
-+
|
|
1374
|
|
-+ Details::SyncLockShared TryLockShared() throw() {
|
|
1375
|
|
-+ return Details::SyncLockShared(nullptr);
|
|
1376
|
|
-+ }
|
|
1377
|
|
-+
|
|
1378
|
|
-+ static Details::SyncLockShared TryLockShared(SRWLOCK* lock) throw() {
|
|
1379
|
|
-+ return Details::SyncLockShared(nullptr);
|
|
1380
|
|
-+ }
|
|
1381
|
|
-+
|
|
1382
|
|
-+ protected:
|
|
1383
|
|
-+ SRWLOCK SRWLock_;
|
|
1384
|
|
-+ };
|
|
1385
|
|
-+
|
|
1386
|
|
- class HStringReference;
|
|
1387
|
|
-
|
|
1388
|
|
- class HString { |