@@ -53,6 +53,10 @@ struct CxPlatEvent {
53
53
CxPlatEvent (bool ManualReset) noexcept { CxPlatEventInitialize (&Handle, ManualReset, FALSE ); }
54
54
CxPlatEvent (CXPLAT_EVENT event) noexcept : Handle(event) { }
55
55
~CxPlatEvent () noexcept { CxPlatEventUninitialize (Handle); }
56
+ CxPlatEvent (const CxPlatEvent&) = delete ;
57
+ CxPlatEvent& operator =(const CxPlatEvent&) = delete ;
58
+ CxPlatEvent (CxPlatEvent&&) = delete ;
59
+ CxPlatEvent& operator =(CxPlatEvent&&) = delete ;
56
60
CXPLAT_EVENT* operator &() noexcept { return &Handle; }
57
61
operator CXPLAT_EVENT () const noexcept { return Handle; }
58
62
void Set () { CxPlatEventSet (Handle); }
@@ -65,6 +69,10 @@ struct CxPlatRundown {
65
69
CXPLAT_RUNDOWN_REF Ref;
66
70
CxPlatRundown () noexcept { CxPlatRundownInitialize (&Ref); }
67
71
~CxPlatRundown () noexcept { CxPlatRundownUninitialize (&Ref); }
72
+ CxPlatRundown (const CxPlatRundown&) = delete ;
73
+ CxPlatRundown& operator =(const CxPlatRundown&) = delete ;
74
+ CxPlatRundown (CxPlatRundown&&) = delete ;
75
+ CxPlatRundown& operator =(CxPlatRundown&&) = delete ;
68
76
bool Acquire () noexcept { return CxPlatRundownAcquire (&Ref); }
69
77
void Release () noexcept { CxPlatRundownRelease (&Ref); }
70
78
void ReleaseAndWait () { CxPlatRundownReleaseAndWait (&Ref); }
@@ -74,6 +82,10 @@ struct CxPlatLock {
74
82
CXPLAT_LOCK Handle;
75
83
CxPlatLock () noexcept { CxPlatLockInitialize (&Handle); }
76
84
~CxPlatLock () noexcept { CxPlatLockUninitialize (&Handle); }
85
+ CxPlatLock (const CxPlatLock&) = delete ;
86
+ CxPlatLock& operator =(const CxPlatLock&) = delete ;
87
+ CxPlatLock (CxPlatLock&&) = delete ;
88
+ CxPlatLock& operator =(CxPlatLock&&) = delete ;
77
89
void Acquire () noexcept { CxPlatLockAcquire (&Handle); }
78
90
void Release () noexcept { CxPlatLockRelease (&Handle); }
79
91
};
@@ -84,6 +96,10 @@ struct CxPlatLockDispatch {
84
96
CXPLAT_DISPATCH_LOCK Handle;
85
97
CxPlatLockDispatch () noexcept { CxPlatDispatchLockInitialize (&Handle); }
86
98
~CxPlatLockDispatch () noexcept { CxPlatDispatchLockUninitialize (&Handle); }
99
+ CxPlatLockDispatch (const CxPlatLockDispatch&) = delete ;
100
+ CxPlatLockDispatch& operator =(const CxPlatLockDispatch&) = delete ;
101
+ CxPlatLockDispatch (CxPlatLockDispatch&&) = delete ;
102
+ CxPlatLockDispatch& operator =(CxPlatLockDispatch&&) = delete ;
87
103
void Acquire () noexcept { CxPlatDispatchLockAcquire (&Handle); }
88
104
void Release () noexcept { CxPlatDispatchLockRelease (&Handle); }
89
105
};
@@ -93,6 +109,10 @@ struct CxPlatPool {
93
109
CXPLAT_POOL Handle;
94
110
CxPlatPool (uint32_t Size, uint32_t Tag = 0 , bool IsPaged = false ) noexcept { CxPlatPoolInitialize (IsPaged, Size, Tag, &Handle); }
95
111
~CxPlatPool () noexcept { CxPlatPoolUninitialize (&Handle); }
112
+ CxPlatPool (const CxPlatPool&) = delete ;
113
+ CxPlatPool& operator =(const CxPlatPool&) = delete ;
114
+ CxPlatPool (CxPlatPool&&) = delete ;
115
+ CxPlatPool& operator =(CxPlatPool&&) = delete ;
96
116
void * Alloc () noexcept { return CxPlatPoolAlloc (&Handle); }
97
117
void Free (void * Ptr) noexcept { CxPlatPoolFree (Ptr); }
98
118
};
@@ -126,6 +146,10 @@ class CxPlatPoolT {
126
146
public:
127
147
CxPlatPoolT () noexcept { CxPlatPoolInitialize (Paged, sizeof (T), Tag, &Pool); }
128
148
~CxPlatPoolT () noexcept { CxPlatPoolUninitialize (&Pool); }
149
+ CxPlatPoolT (const CxPlatPoolT&) = delete ;
150
+ CxPlatPoolT& operator =(const CxPlatPoolT&) = delete ;
151
+ CxPlatPoolT (CxPlatPoolT&&) = delete ;
152
+ CxPlatPoolT& operator =(CxPlatPoolT&&) = delete ;
129
153
template <class ... Args>
130
154
T* Alloc (Args&&... args) noexcept {
131
155
void * Raw = CxPlatPoolAlloc (&Pool);
@@ -146,6 +170,10 @@ struct CxPlatHashTable {
146
170
CXPLAT_HASHTABLE Table;
147
171
CxPlatHashTable () noexcept { Initialized = CxPlatHashtableInitializeEx (&Table, CXPLAT_HASH_MIN_SIZE); }
148
172
~CxPlatHashTable () noexcept { if (Initialized) { CxPlatHashtableUninitialize (&Table); } }
173
+ CxPlatHashTable (const CxPlatHashTable&) = delete ;
174
+ CxPlatHashTable& operator =(const CxPlatHashTable&) = delete ;
175
+ CxPlatHashTable (CxPlatHashTable&&) = delete ;
176
+ CxPlatHashTable& operator =(CxPlatHashTable&&) = delete ;
149
177
void Insert (CXPLAT_HASHTABLE_ENTRY* Entry) noexcept { CxPlatHashtableInsert (&Table, Entry, Entry->Signature , nullptr ); }
150
178
void Remove (CXPLAT_HASHTABLE_ENTRY* Entry) noexcept { CxPlatHashtableRemove (&Table, Entry, nullptr ); }
151
179
CXPLAT_HASHTABLE_ENTRY* Lookup (uint64_t Signature) noexcept {
@@ -188,6 +216,10 @@ class CxPlatThread {
188
216
CxPlatThreadDelete (&Thread);
189
217
}
190
218
}
219
+ CxPlatThread (const CxPlatThread&) = delete ;
220
+ CxPlatThread& operator =(const CxPlatThread&) = delete ;
221
+ CxPlatThread (CxPlatThread&&) = delete ;
222
+ CxPlatThread& operator =(CxPlatThread&&) = delete ;
191
223
QUIC_STATUS Create (CXPLAT_THREAD_CONFIG* Config) noexcept {
192
224
auto Status = CxPlatThreadCreate (Config, &Thread);
193
225
if (QUIC_SUCCEEDED (Status)) {
@@ -240,6 +272,10 @@ class CxPlatWatchdog {
240
272
~CxPlatWatchdog () noexcept {
241
273
ShutdownEvent.Set ();
242
274
}
275
+ CxPlatWatchdog (const CxPlatWatchdog&) = delete ;
276
+ CxPlatWatchdog& operator =(const CxPlatWatchdog&) = delete ;
277
+ CxPlatWatchdog (CxPlatWatchdog&&) = delete ;
278
+ CxPlatWatchdog& operator =(CxPlatWatchdog&&) = delete ;
243
279
};
244
280
245
281
#endif // CXPLAT_FRE_ASSERT
@@ -446,6 +482,10 @@ class MsQuicApi : public QUIC_API_TABLE {
446
482
memset (thisTable, 0 , sizeof (*thisTable));
447
483
}
448
484
}
485
+ MsQuicApi (const MsQuicApi&) = delete ;
486
+ MsQuicApi& operator =(const MsQuicApi&) = delete ;
487
+ MsQuicApi (MsQuicApi&&) = delete ;
488
+ MsQuicApi& operator =(MsQuicApi&&) = delete ;
449
489
QUIC_STATUS GetInitStatus () const noexcept { return InitStatus; }
450
490
bool IsValid () const noexcept { return QUIC_SUCCEEDED (InitStatus); }
451
491
};
@@ -473,6 +513,10 @@ struct MsQuicExecution {
473
513
delete [] Configs;
474
514
}
475
515
}
516
+ MsQuicExecution (const MsQuicExecution&) = delete ;
517
+ MsQuicExecution& operator =(const MsQuicExecution&) = delete ;
518
+ MsQuicExecution (MsQuicExecution&&) = delete ;
519
+ MsQuicExecution& operator =(MsQuicExecution&&) = delete ;
476
520
void Initialize (
477
521
_In_ QUIC_GLOBAL_EXECUTION_CONFIG_FLAGS Flags, // Used for datapath type
478
522
_In_ uint32_t PollingIdleTimeoutUs,
@@ -537,6 +581,8 @@ struct MsQuicRegistration {
537
581
bool IsValid () const noexcept { return QUIC_SUCCEEDED (InitStatus); }
538
582
MsQuicRegistration (const MsQuicRegistration& Other) = delete ;
539
583
MsQuicRegistration& operator =(const MsQuicRegistration& Other) = delete ;
584
+ MsQuicRegistration (MsQuicRegistration&& Other) = delete ;
585
+ MsQuicRegistration& operator =(MsQuicRegistration&& Other) = delete ;
540
586
void Shutdown (
541
587
_In_ QUIC_CONNECTION_SHUTDOWN_FLAGS Flags,
542
588
_In_ QUIC_UINT62 ErrorCode
@@ -816,6 +862,8 @@ struct MsQuicConfiguration {
816
862
bool IsValid () const noexcept { return QUIC_SUCCEEDED (InitStatus); }
817
863
MsQuicConfiguration (const MsQuicConfiguration& Other) = delete ;
818
864
MsQuicConfiguration& operator =(const MsQuicConfiguration& Other) = delete ;
865
+ MsQuicConfiguration (MsQuicConfiguration&& Other) = delete ;
866
+ MsQuicConfiguration& operator =(MsQuicConfiguration&& Other) = delete ;
819
867
QUIC_STATUS
820
868
LoadCredential (_In_ const QUIC_CREDENTIAL_CONFIG* CredConfig) noexcept {
821
869
return MsQuic->ConfigurationLoadCredential (Handle, CredConfig);
@@ -1016,6 +1064,8 @@ struct MsQuicListener {
1016
1064
bool IsValid () const { return QUIC_SUCCEEDED (InitStatus); }
1017
1065
MsQuicListener (const MsQuicListener& Other) = delete;
1018
1066
MsQuicListener& operator =(const MsQuicListener& Other) = delete;
1067
+ MsQuicListener (MsQuicListener&& Other) = delete;
1068
+ MsQuicListener& operator =(MsQuicListener&& Other) = delete ;
1019
1069
operator HQUIC () const noexcept { return Handle; }
1020
1070
1021
1071
private:
@@ -1337,6 +1387,8 @@ struct MsQuicConnection {
1337
1387
bool IsValid () const { return QUIC_SUCCEEDED (InitStatus); }
1338
1388
MsQuicConnection (const MsQuicConnection& Other) = delete;
1339
1389
MsQuicConnection& operator =(const MsQuicConnection& Other) = delete;
1390
+ MsQuicConnection (MsQuicConnection&& Other) = delete;
1391
+ MsQuicConnection& operator =(MsQuicConnection&& Other) = delete ;
1340
1392
operator HQUIC () const noexcept { return Handle; }
1341
1393
1342
1394
static
@@ -1723,6 +1775,8 @@ struct MsQuicStream {
1723
1775
bool IsValid () const { return QUIC_SUCCEEDED (InitStatus); }
1724
1776
MsQuicStream (const MsQuicStream& Other) = delete;
1725
1777
MsQuicStream& operator =(const MsQuicStream& Other) = delete;
1778
+ MsQuicStream (MsQuicStream&& Other) = delete;
1779
+ MsQuicStream& operator =(MsQuicStream&& Other) = delete ;
1726
1780
operator HQUIC () const noexcept { return Handle; }
1727
1781
1728
1782
static
@@ -1765,6 +1819,10 @@ struct ConnectionScope {
1765
1819
ConnectionScope () noexcept : Handle(nullptr ) { }
1766
1820
ConnectionScope (HQUIC handle) noexcept : Handle(handle) { }
1767
1821
~ConnectionScope () noexcept { if (Handle) { MsQuic->ConnectionClose (Handle); } }
1822
+ ConnectionScope (const ConnectionScope&) = delete ;
1823
+ ConnectionScope& operator =(const ConnectionScope&) = delete ;
1824
+ ConnectionScope (ConnectionScope&&) = delete ;
1825
+ ConnectionScope& operator =(ConnectionScope&&) = delete ;
1768
1826
operator HQUIC () const noexcept { return Handle; }
1769
1827
};
1770
1828
@@ -1775,6 +1833,10 @@ struct StreamScope {
1775
1833
StreamScope () noexcept : Handle(nullptr ) { }
1776
1834
StreamScope (HQUIC handle) noexcept : Handle(handle) { }
1777
1835
~StreamScope () noexcept { if (Handle) { MsQuic->StreamClose (Handle); } }
1836
+ StreamScope (const StreamScope&) = delete ;
1837
+ StreamScope& operator =(const StreamScope&) = delete ;
1838
+ StreamScope (StreamScope&&) = delete ;
1839
+ StreamScope& operator =(StreamScope&&) = delete ;
1778
1840
operator HQUIC () const noexcept { return Handle; }
1779
1841
};
1780
1842
@@ -1785,6 +1847,10 @@ struct ConfigurationScope {
1785
1847
ConfigurationScope () noexcept : Handle(nullptr ) { }
1786
1848
ConfigurationScope (HQUIC handle) noexcept : Handle(handle) { }
1787
1849
~ConfigurationScope () noexcept { if (Handle) { MsQuic->ConfigurationClose (Handle); } }
1850
+ ConfigurationScope (const ConfigurationScope&) = delete ;
1851
+ ConfigurationScope& operator =(const ConfigurationScope&) = delete ;
1852
+ ConfigurationScope (ConfigurationScope&&) = delete ;
1853
+ ConfigurationScope& operator =(ConfigurationScope&&) = delete ;
1788
1854
operator HQUIC () const noexcept { return Handle; }
1789
1855
};
1790
1856
@@ -1799,8 +1865,12 @@ struct QuicBufferScope {
1799
1865
Buffer->Length = Size;
1800
1866
Buffer->Buffer = (uint8_t *)(Buffer + 1 );
1801
1867
}
1802
- operator QUIC_BUFFER* () noexcept { return Buffer; }
1803
1868
~QuicBufferScope () noexcept { if (Buffer) { delete[] (uint8_t *) Buffer; } }
1869
+ QuicBufferScope (const QuicBufferScope&) = delete ;
1870
+ QuicBufferScope& operator =(const QuicBufferScope&) = delete ;
1871
+ QuicBufferScope (QuicBufferScope&&) = delete ;
1872
+ QuicBufferScope& operator =(QuicBufferScope&&) = delete ;
1873
+ operator QUIC_BUFFER* () noexcept { return Buffer; }
1804
1874
};
1805
1875
1806
1876
static_assert (sizeof (QuicBufferScope) == sizeof(QUIC_BUFFER*), "Scope guards should be the same size as the guarded type");
0 commit comments