84 writes to handle
ComSvcConfig (1)
SafeNativeMethods.cs (1)
173
handle
= hKey;
mscorlib (5)
microsoft\win32\safehandles\safeviewoffilehandle.cs (1)
46
handle
= IntPtr.Zero;
system\runtime\interopservices\safehandle.cs (2)
166
handle
= invalidHandleValue;
209
this.
handle
= handle;
system\threading\compressedstack.cs (1)
128
handle
= IntPtr.Zero;
system\typenameparser.cs (1)
36
handle
= IntPtr.Zero;
PresentationCore (3)
Core\CSharp\System\Windows\Media\SafeMediaHandle.cs (1)
55
UnsafeNativeMethods.MILUnknown.ReleaseInterface(ref
handle
);
Core\CSharp\System\Windows\Media\SafeMILHandle.cs (1)
92
UnsafeNativeMethods.MILUnknown.ReleaseInterface(ref
handle
);
Core\CSharp\System\Windows\Media\SafeReversePInvokeHandle.cs (1)
75
UnsafeNativeMethods.MILUnknown.ReleaseInterface(ref
handle
);
PresentationFramework (5)
src\Framework\System\Windows\Standard\NativeMethods.cs (5)
1572
handle
= hdc,
1640
safeHandle.
handle
= unsafeHandle;
1670
handle
= IntPtr.Zero;
1682
handle
= new IntPtr(dwCookie);
1715
handle
= IntPtr.Zero;
System (9)
compmod\microsoft\win32\safehandles\SafeProcessHandle.cs (1)
52
base.
handle
= h;
net\System\Net\_SafeNetHandles.cs (4)
476
this.
handle
= value;
1024
this.
handle
= value;
2380
IntPtr oldHandle = Interlocked.Exchange(ref
handle
, IntPtr.Zero);
2860
this.
handle
= value;
net\System\Net\NetworkInformation\SafeCancelMibChangeNotify.cs (1)
19
base.
handle
= IntPtr.Zero;
net\System\Net\NetworkInformation\SafeFreeMibTable.cs (1)
15
base.
handle
= IntPtr.Zero;
parent\parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (2)
350
handle
= IntPtr.Zero;
534
this.
handle
= IntPtr.Zero;
System.Configuration (1)
Microsoft\Win32\SafeNativeMemoryHandle.cs (1)
44
handle
= IntPtr.Zero;
System.Core (5)
Microsoft\Win32\SafeHandles\SafeMemoryMappedViewHandle.cs (1)
49
handle
= IntPtr.Zero;
Microsoft\Win32\SafeHandles\SafePerfProviderHandle.cs (1)
23
if (Interlocked.Exchange(ref
handle
, IntPtr.Zero) != IntPtr.Zero) {
System\Diagnostics\Eventing\Reader\CoTaskMemSafeHandle.cs (1)
51
handle
= IntPtr.Zero;
System\Diagnostics\Eventing\Reader\CoTaskMemUnicodeSafeHandle.cs (1)
56
handle
= IntPtr.Zero;
System\Diagnostics\Eventing\Reader\EventLogHandle.cs (1)
49
handle
= IntPtr.Zero;
System.Data (32)
fx\src\data\System\Data\Odbc\OdbcHandle.cs (4)
45
retcode = UnsafeNativeMethods.SQLAllocHandle(handleType, IntPtr.Zero, out base.
handle
);
53
retcode = UnsafeNativeMethods.SQLAllocHandle(handleType, parentHandle, out base.
handle
);
99
retcode = parentHandle.GetStatementAttribute(attribute, out base.
handle
, out cbActual);
136
base.
handle
= IntPtr.Zero;
fx\src\data\System\Data\OleDb\DBPropSet.cs (5)
39
base.
handle
= SafeNativeMethods.CoTaskMemAlloc(countOfBytes);
57
hr = properties.GetProperties(propidsetcount, propidset, out this.propertySetCount, out base.
handle
);
74
hr = properties.GetProperties(propidsetcount, propidset, out this.propertySetCount, out base.
handle
);
91
hr = properties.GetProperties(propidsetcount, propidset, out this.propertySetCount, out base.
handle
);
122
base.
handle
= IntPtr.Zero;
fx\src\data\System\Data\OleDb\OleDbWrapper.cs (2)
35
base.
handle
= Marshal.GetComInterfaceForObject(unknown, typeof(UnsafeNativeMethods.IDataInitialize)); //
261
base.
handle
= idbCreateCommand;
fx\src\data\System\Data\OleDb\PropertyInfoSet.cs (2)
49
hr = idbProperties.GetPropertyInfo(propIDSetCount, propIDSet, out this.setCount, out base.
handle
, out this.descBuffer);
114
base.
handle
= IntPtr.Zero;
fx\src\data\System\Data\OleDb\SafeHandles.cs (5)
36
hr = dbInfo.GetLiteralInfo(count, literals, out literalCount, out base.
handle
, out this.handle2);
44
hr = columnsInfo.GetColumnInfo(out columnCount, out base.
handle
, out this.handle2);
52
hr = dbSchemaRowset.GetSchemas(out schemaCount, out base.
handle
, out this.handle2);
60
hr = icolumnsRowset.GetAvailableColumns(out cOptColumns, out base.
handle
);
75
base.
handle
= IntPtr.Zero;
fx\src\data\System\Data\ProviderBase\DbBuffer.cs (2)
37
base.
handle
= SafeNativeMethods.LocalAlloc(flags, (IntPtr)initialSize);
335
base.
handle
= IntPtr.Zero;
fx\src\data\System\Data\ProviderBase\WrappedIUnknown.cs (2)
35
base.
handle
= Marshal.GetIUnknownForObject(unknown); //
69
base.
handle
= IntPtr.Zero;
fx\src\data\System\Data\SqlClient\TdsParserSafeHandles.cs (7)
50
base.
handle
= (IntPtr) 1; // Initialize to non-zero dummy variable.
66
base.
handle
= IntPtr.Zero;
152
_status = SNINativeMethodWrapper.SNIOpenSyncEx(myInfo, serverName, ref base.
handle
,
162
_status = SNINativeMethodWrapper.SNIOpenMarsSession(myInfo, parent, ref base.
handle
, parent._fSync);
175
base.
handle
= IntPtr.Zero;
194
SNINativeMethodWrapper.SNIPacketAllocate(sniHandle, SNINativeMethodWrapper.IOType.WRITE, ref base.
handle
);
209
base.
handle
= IntPtr.Zero;
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (3)
873
base.
handle
= IntPtr.Zero;
952
base.
handle
= IntPtr.Zero;
1022
base.
handle
= IntPtr.Zero;
System.Drawing (2)
commonui\System\Drawing\Advanced\SafeCustomLineCapHandle.cs (1)
45
handle
= IntPtr.Zero;
commonui\System\Drawing\Printing\PrintController.cs (1)
62
handle
= IntPtr.Zero;
System.IdentityModel (2)
System\IdentityModel\SspiSafeHandles.cs (2)
1209
this.
handle
= value;
1239
this.
handle
= value;
System.IO.Log (2)
System\IO\Log\SmuggledIUnknown.cs (2)
25
base.
handle
= Marshal.GetIUnknownForObject(unknown);
57
base.
handle
= IntPtr.Zero;
System.Net (1)
net\PeerToPeer\Collaboration\UnsafeCollabNativeMethods.cs (1)
134
handle
= Marshal.AllocHGlobal(cb);
System.ServiceModel (3)
System\ServiceModel\Channels\UnsafeNativeMethods.cs (2)
1265
handle
= IntPtr.Zero;
1285
handle
= IntPtr.Zero;
System\ServiceModel\ComIntegration\SafeNativeMethods.cs (1)
751
handle
= hKey;
System.Transactions (2)
System\Transactions\SafeIUnknown.cs (2)
34
base.
handle
= unknown;
50
base.
handle
= IntPtr.Zero;
System.Web (2)
PerfCounters.cs (1)
30
handle
= IntPtr.Zero;
Util\TlsTokenBindingHandle.cs (1)
25
ref
handle
,
System.Windows.Forms (2)
winforms\Managed\System\WinForms\Control.cs (2)
17821
this.
handle
= unknown;
17854
base.
handle
= IntPtr.Zero;
WindowsBase (3)
parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (2)
350
handle
= IntPtr.Zero;
534
this.
handle
= IntPtr.Zero;
Shared\MS\Win32\NativeMethodsOther.cs (1)
328
handle
= hbitmap,
WsatConfig (2)
Configuration\SafeIUnknown.cs (2)
34
base.
handle
= unknown;
50
base.
handle
= IntPtr.Zero;
WsatUI (2)
Configuration\SafeIUnknown.cs (2)
34
base.
handle
= unknown;
50
base.
handle
= IntPtr.Zero;
405 references to handle
ComSvcConfig (1)
SafeNativeMethods.cs (1)
228
if (SafeNativeMethods.RegCloseKey(
handle
) == SafeNativeMethods.ERROR_SUCCESS)
mscorlib (48)
microsoft\win32\safehandles\safefilehandle.cs (1)
43
return Win32Native.CloseHandle(
handle
);
microsoft\win32\safehandles\safefilemappinghandle.cs (1)
43
return Win32Native.CloseHandle(
handle
);
microsoft\win32\safehandles\safefindhandle.cs (1)
34
return Win32Native.FindClose(
handle
);
microsoft\win32\safehandles\safelibraryhandle.cs (1)
32
return UnsafeNativeMethods.FreeLibrary(
handle
);
microsoft\win32\safehandles\safelocalallochandle.cs (1)
25
return Win32Native.LocalFree(
handle
) == IntPtr.Zero;
microsoft\win32\safehandles\safepefilehandle.cs (1)
34
ReleaseSafePEFileHandle(
handle
);
microsoft\win32\safehandles\saferegistryhandle.cs (1)
36
return (RegCloseKey(
handle
) == Win32Native.ERROR_SUCCESS);
microsoft\win32\safehandles\safeviewoffilehandle.cs (1)
44
if (Win32Native.UnmapViewOfFile(
handle
))
microsoft\win32\safehandles\safewaithandle.cs (1)
48
return Win32Native.CloseHandle(
handle
);
microsoft\win32\safehandles\win32safehandles.cs (3)
47
get { return
handle
.IsNull() ||
handle
== new IntPtr(-1); }
73
get { return
handle
== new IntPtr(-1); }
system\io\isolatedstorage\isolatedstoragefile.cs (1)
2802
Close(
handle
);
system\runtime\interopservices\safebuffer.cs (6)
194
pointer = (byte*)
handle
;
222
byte* ptr = (byte*)
handle
+ byteOffset;
263
byte* ptr = (byte*)
handle
+ byteOffset;
297
byte* ptr = (byte*)
handle
+ byteOffset;
335
byte* ptr = (byte*)
handle
+ byteOffset;
377
if ((ulong)(ptr - (byte*)
handle
) > ((ulong)_numBytes) - sizeInBytes)
system\runtime\interopservices\safehandle.cs (1)
230
return
handle
;
system\security\cryptography\capinative.cs (3)
533
return CryptReleaseContext(
handle
, 0);
555
return CryptDestroyHash(
handle
);
595
return CryptDestroyKey(
handle
);
system\security\cryptography\safecryptohandles.cs (3)
52
FreeCsp(
handle
);
92
FreeKey(
handle
);
128
FreeHash(
handle
);
system\security\cryptography\x509certificates\safex509handles.cs (4)
44
if (
handle
== IntPtr.Zero)
47
return Marshal.ReadIntPtr(
handle
);
60
_FreePCertContext(
handle
);
94
_FreeCertStoreContext(
handle
);
system\security\safesecurityhandles.cs (9)
35
get { return
handle
== IntPtr.Zero ||
handle
== new IntPtr(-1); }
41
return Win32Native.CloseHandle(
handle
);
63
return Win32Native.LsaDeregisterLogonProcess(
handle
) >= 0;
83
return Win32Native.LsaFreeMemory(
handle
) == 0;
103
return Win32Native.LsaClose(
handle
) == 0;
124
return Win32Native.LsaFreeReturnBuffer(
handle
) >= 0;
146
return Win32Native.CloseHandle(
handle
);
164
return Win32Native.CloseHandle(
handle
);
system\security\securestring.cs (3)
699
Win32Native.ZeroMemory(
handle
, (UIntPtr) (Win32Native.SysStringLen(
handle
) * 2));
700
Win32Native.SysFreeString(
handle
);
system\threading\compressedstack.cs (2)
121
get { return
handle
== IntPtr.Zero; }
127
CompressedStack.DestroyDelayedCompressedStack(
handle
);
system\threading\hostexecutioncontextmanager.cs (2)
109
get { return
handle
== IntPtr.Zero; }
115
HostExecutionContextManager.ReleaseHostSecurityContext(this.
handle
);
system\threading\timer.cs (1)
117
return DeleteAppDomainTimer(
handle
);
system\typenameparser.cs (1)
35
_ReleaseTypeNameParser(
handle
);
PresentationCore (12)
Core\CSharp\MS\Win32\UnsafeNativeMethodsTablet.cs (6)
167
return IsClosed ||
handle
== IntPtr.Zero;
179
Debug.Assert(
handle
!= IntPtr.Zero);
180
return (MS.Internal.HRESULT.Succeeded(MS.Win32.Recognizer.UnsafeNativeMethods.DestroyRecognizer(
handle
)));
226
return IsClosed ||
handle
== IntPtr.Zero;
244
Debug.Assert(
handle
!= IntPtr.Zero);
245
int hr = MS.Win32.Recognizer.UnsafeNativeMethods.DestroyContext(
handle
);
Core\CSharp\System\Windows\Media\ColorContextHelper.cs (1)
67
return UnsafeNativeMethodsMilCoreApi.Mscms.CloseColorProfile(
handle
);
Core\CSharp\System\Windows\Media\ColorTransformHelper.cs (1)
66
return UnsafeNativeMethods.Mscms.DeleteColorTransform(
handle
);
Core\CSharp\System\Windows\Media\Imaging\BitmapSourceSafeMILHandle.cs (1)
90
UpdateEstimatedSize(ComputeEstimatedSize(
handle
));
Core\CSharp\System\Windows\Media\SafeMediaHandle.cs (1)
54
HRESULT.Check(MILMedia.Shutdown(
handle
));
Core\CSharp\System\Windows\Media\SafeReversePInvokeHandle.cs (2)
71
if (
handle
!= IntPtr.Zero)
73
UnsafeNativeMethods.MilCoreApi.MilReleasePInvokePtrBlocking(
handle
);
PresentationFramework (7)
src\Framework\System\Windows\Standard\NativeMethods.cs (7)
1355
return NativeMethods.FindClose(
handle
);
1445
return NativeMethods.DeleteDC(
handle
);
1453
return NativeMethods.ReleaseDC(_hwnd.Value,
handle
) == 1;
1499
hPtr = hdc.
handle
;
1598
return NativeMethods.DeleteObject(
handle
);
1621
Status s = NativeMethods.GdiplusShutdown(this.
handle
);
1714
int dwCookie =
handle
.ToInt32();
SMDiagnostics (1)
System\ServiceModel\Diagnostics\SafeEventLogWriteHandle.cs (1)
48
return DeregisterEventSource(this.
handle
);
SMSvcHost (1)
System\ServiceModel\Activation\WebHostUnsafeNativeMethods.cs (1)
110
return FreeLibrary(
handle
);
System (55)
compmod\microsoft\win32\safehandles\SafeEventLogReadHandle.cs (1)
49
return CloseEventLog(
handle
);
compmod\microsoft\win32\safehandles\SafeEventLogWriteHandle.cs (1)
48
return DeregisterEventSource(
handle
);
compmod\microsoft\win32\safehandles\SafeFileMappingHandle.cs (1)
48
return CloseHandle(
handle
);
compmod\microsoft\win32\safehandles\SafeFileMapViewHandle.cs (1)
49
return UnmapViewOfFile(
handle
);
compmod\microsoft\win32\safehandles\SafeLibraryHandle.cs (1)
50
return FreeLibrary(
handle
);
compmod\microsoft\win32\safehandles\SafeLocalMemHandle.cs (1)
52
return LocalFree(
handle
) == IntPtr.Zero;
compmod\microsoft\win32\safehandles\SafeProcessHandle.cs (1)
57
return SafeNativeMethods.CloseHandle(
handle
);
compmod\microsoft\win32\safehandles\SafeThreadHandle.cs (1)
39
return SafeNativeMethods.CloseHandle(
handle
);
compmod\microsoft\win32\safehandles\SafeTimerHandle.cs (1)
50
return CloseHandle(
handle
);
compmod\microsoft\win32\safehandles\SafeUserTokenHandle.cs (1)
55
return CloseHandle(
handle
);
net\System\Net\_SafeNetHandles.cs (34)
269
UnsafeNclNativeMethods.SafeNetHandlesXPOrLater.freeaddrinfo(
handle
);
411
return UnsafeNetInfoNativeMethods.IcmpCloseHandle(
handle
);
429
return UnsafeNclNativeMethods.WinHttp.WinHttpCloseHandle(
handle
);
447
return UnsafeNclNativeMethods.SspiHelper.SspiFreeAuthIdentity(
handle
) == SecurityStatus.OK;
634
return UnsafeNclNativeMethods.SafeNetHandles_SECURITY.FreeContextBuffer(
handle
) == 0;
675
return UnsafeNclNativeMethods.SafeNetHandles.LocalFree(
handle
) == IntPtr.Zero;
696
return UnsafeNclNativeMethods.SafeNetHandles.GlobalFree(
handle
) == IntPtr.Zero;
754
return UnsafeNclNativeMethods.SafeNetHandles.LocalFree(
handle
) == IntPtr.Zero;
814
return UnsafeNclNativeMethods.SafeNetHandles.FreeLibrary(
handle
);
845
UnsafeNclNativeMethods.SafeNetHandles.CertFreeCertificateChain(
handle
);
880
UnsafeNclNativeMethods.SafeNetHandles.CertFreeCertificateChainList(
handle
);
1030
UnsafeNclNativeMethods.SafeNetHandles.CertFreeCertificateContext(
handle
);
2360
get { return
handle
== IntPtr.Zero; }
2365
IntPtr handleSnapshot =
handle
;
2575
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ")");
2584
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") Following 'blockable' branch.");
2586
errorCode = UnsafeNclNativeMethods.SafeNetHandles.closesocket(
handle
);
2592
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") closesocket()#1:" + errorCode.ToString());
2604
handle
,
2608
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") ioctlsocket()#1:" + errorCode.ToString());
2614
handle
,
2617
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") WSAEventSelect():" + (errorCode == SocketError.SocketError ? (SocketError)Marshal.GetLastWin32Error() : errorCode).ToString());
2621
handle
,
2624
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") ioctlsocket#2():" + (errorCode == SocketError.SocketError ? (SocketError)Marshal.GetLastWin32Error() : errorCode).ToString());
2630
errorCode = UnsafeNclNativeMethods.SafeNetHandles.closesocket(
handle
);
2636
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") closesocket#2():" + errorCode.ToString());
2654
handle
,
2663
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") setsockopt():" + errorCode.ToString());
2671
errorCode = UnsafeNclNativeMethods.SafeNetHandles.closesocket(
handle
);
2676
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" +
handle
.ToString("x") + ") closesocket#3():" + (errorCode == SocketError.SocketError ? (SocketError)Marshal.GetLastWin32Error() : errorCode).ToString());
2842
return UnsafeNclNativeMethods.SafeNetHandles.LocalFree(
handle
) == IntPtr.Zero;
2938
return UnsafeNclNativeMethods.SafeNetHandles_SECURITY.FreeContextBuffer(
handle
) == 0;
3102
resClose = UnsafeNclNativeMethods.RegistryHelper.RegCloseKey(
handle
);
3127
WebSocketProtocolComponent.WebSocketDeleteHandle(this.
handle
);
net\System\Net\NetworkInformation\SafeCancelMibChangeNotify.cs (1)
18
uint err = UnsafeNetInfoNativeMethods.CancelMibChangeNotify2(base.
handle
);
net\System\Net\NetworkInformation\SafeFreeMibTable.cs (1)
14
UnsafeNetInfoNativeMethods.FreeMibTable(base.
handle
);
net\System\Net\UnsafeNativeMethods.cs (1)
2237
return HeapFree(ProcessHeap, 0,
handle
);
parent\parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (1)
349
bool res = ZLibNative.NativeMethods.FreeLibrary(
handle
);
security\system\security\cryptography\cryptoapi.cs (7)
3937
return FreeLibrary(
handle
);
3975
return LocalFree(
handle
) == IntPtr.Zero;
4006
return CryptReleaseContext(
handle
, 0);
4043
return CertFreeCertificateContext(
handle
);
4080
return CertCloseStore(
handle
, 0);
4113
return CryptMsgClose(
handle
);
4155
CertFreeCertificateChain(
handle
);
System.Configuration (4)
Microsoft\Win32\SafeCryptContextHandle.cs (1)
28
if (
handle
!= IntPtr.Zero) {
Microsoft\Win32\SafeNativeMemoryHandle.cs (3)
39
if (
handle
!= IntPtr.Zero) {
41
UnsafeNativeMethods.LocalFree(
handle
);
43
Marshal.FreeHGlobal(
handle
);
System.Core (27)
Microsoft\Win32\SafeHandles\BCryptSafeHandles.cs (3)
31
return BCryptCloseAlgorithmProvider(
handle
, 0) == BCryptNative.ErrorCode.Success;
66
bool success = BCryptDestroyHash(
handle
) == BCryptNative.ErrorCode.Success;
91
return BCryptDestroyKey(
handle
) == BCryptNative.ErrorCode.Success;
Microsoft\Win32\SafeHandles\CapiSafeHandles.cs (4)
49
HeapFree(GetProcessHeap(), 0,
handle
);
231
return CryptDestroyHash(
handle
);
316
return CryptDestroyKey(
handle
);
423
return CryptReleaseContext(
handle
, 0);
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (4)
394
return NCryptFreeObject(
handle
) == 0;
421
Contract.Assert(
handle
== IntPtr.Zero);
427
return NCryptFreeObject(
handle
) == 0;
446
return NCryptFreeObject(
handle
) == 0;
Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs (1)
32
return UnsafeNativeMethods.FreeLibrary(
handle
);
Microsoft\Win32\SafeHandles\SafeMemoryMappedFileHandle.cs (1)
46
return UnsafeNativeMethods.CloseHandle(
handle
);
Microsoft\Win32\SafeHandles\SafeMemoryMappedViewHandle.cs (1)
48
if (UnsafeNativeMethods.UnmapViewOfFile(
handle
)) {
Microsoft\Win32\SafeHandles\SafePerfProviderHandle.cs (1)
21
IntPtr tempProviderHandle =
handle
;
Microsoft\Win32\SafeHandles\SafePipeHandle.cs (1)
36
return UnsafeNativeMethods.CloseHandle(
handle
);
System\Diagnostics\Eventing\Reader\CoTaskMemSafeHandle.cs (3)
39
return
handle
;
45
return IsClosed ||
handle
== IntPtr.Zero;
50
Marshal.FreeCoTaskMem(
handle
);
System\Diagnostics\Eventing\Reader\CoTaskMemUnicodeSafeHandle.cs (3)
44
return
handle
;
50
return IsClosed ||
handle
== IntPtr.Zero;
55
Marshal.ZeroFreeCoTaskMemUnicode(
handle
);
System\Diagnostics\Eventing\Reader\EventLogHandle.cs (2)
43
return IsClosed ||
handle
== IntPtr.Zero;
48
NativeWrapper.EvtClose(
handle
);
System\Security\Cryptography\CapiNative.cs (2)
990
IntPtr pBase = new IntPtr((byte*)
handle
.ToPointer() + offset);
1003
return LocalFree(
handle
) == IntPtr.Zero;
System\Security\Cryptography\X509Certificates\X509Native.cs (1)
518
return CertFreeCertificateContext(
handle
);
System.Data (70)
fx\src\data\System\Data\Odbc\OdbcConnectionHandle.cs (3)
147
ODBC32.RetCode retcode = CompleteTransaction(transactionOperation, base.
handle
);
212
retcode = CompleteTransaction(ODBC32.SQL_ROLLBACK,
handle
);
215
retcode = UnsafeNativeMethods.SQLDisconnect(
handle
);
fx\src\data\System\Data\Odbc\OdbcHandle.cs (6)
66
if (IntPtr.Zero != base.
handle
) {
81
if((ADP.PtrZero == base.
handle
) || (ODBC32.RetCode.SUCCESS != retcode)) {
103
if (IntPtr.Zero != base.
handle
) {
114
if (ADP.PtrZero == base.
handle
) {
129
return (IntPtr.Zero == base.
handle
);
135
IntPtr handle = base.
handle
;
fx\src\data\System\Data\OleDb\DBPropSet.cs (5)
40
if (ADP.PtrZero != base.
handle
) {
41
SafeNativeMethods.ZeroMemory(base.
handle
, countOfBytes);
44
if (ADP.PtrZero == base.
handle
) {
115
return (IntPtr.Zero == base.
handle
);
121
IntPtr ptr = base.
handle
;
fx\src\data\System\Data\OleDb\OleDbTransaction.cs (5)
62
Bid.Trace("<oledb.ITransactionLocal.Abort|API|OLEDB> handle=%p\n", base.
handle
);
86
Bid.Trace("<oledb.ITransactionLocal.Commit|API|OLEDB> handle=%p\n", base.
handle
);
105
if (_mustComplete && (IntPtr.Zero != base.
handle
)) {
106
Bid.Trace("<oledb.ITransactionLocal.Abort|API|OLEDB|INFO> handle=%p\n", base.
handle
);
107
OleDbHResult hr = (OleDbHResult)NativeOledbWrapper.ITransactionAbort(base.
handle
);
fx\src\data\System\Data\OleDb\OleDbWrapper.cs (11)
40
IntPtr vtable = Marshal.ReadIntPtr(base.
handle
, 0);
60
hr = GetDataSource(base.
handle
, IntPtr.Zero, ODB.CLSCTX_ALL, connectionString, ref ODB.IID_IDBInitialize, ref datasrcWrapper);
104
IntPtr vtable = Marshal.ReadIntPtr(base.
handle
, 0);
120
vtable = Marshal.ReadIntPtr(base.
handle
, 0);
134
hr = Initialize(base.
handle
);
140
hr = (OleDbHResult)QueryInterface(base.
handle
, ref ODB.IID_IDBCreateSession, ref idbCreateSession);
242
IntPtr vtable = Marshal.ReadIntPtr(base.
handle
, 0);
246
int hresult = QueryInterface(base.
handle
, ref ODB.IID_IDBCreateCommand, ref idbCreateCommand); //
260
IntPtr ptr = base.
handle
;
279
IntPtr vtable = Marshal.ReadIntPtr(base.
handle
, 0);
307
hr = CreateCommand(base.
handle
, IntPtr.Zero, ref ODB.IID_ICommandText, ref icommandText);
fx\src\data\System\Data\OleDb\PropertyIDSet.cs (6)
35
IntPtr ptr = ADP.IntPtrOffset(base.
handle
, PropertyIDSetSize);
36
Marshal.WriteIntPtr(base.
handle
, 0, ptr);
38
Marshal.WriteInt32(base.
handle
, ADP.PtrSize, /*propertyid count*/1);
40
ptr = ADP.IntPtrOffset(base.
handle
, ODB.OffsetOf_tagDBPROPIDSET_PropertySet);
44
Marshal.WriteInt32(base.
handle
, PropertyIDSetSize, propertyID);
51
IntPtr ptr = ADP.IntPtrOffset(base.
handle
, (i * PropertyIDSetSize) + ODB.OffsetOf_tagDBPROPIDSET_PropertySet);
fx\src\data\System\Data\OleDb\PropertyInfoSet.cs (5)
52
if ((0 <= hr) && (ADP.PtrZero !=
handle
)) {
59
return ((IntPtr.Zero == base.
handle
) && (IntPtr.Zero == this.descBuffer));
70
if (ADP.PtrZero != this.
handle
) {
73
IntPtr setPtr = this.
handle
;
113
IntPtr ptr = base.
handle
;
fx\src\data\System\Data\OleDb\RowBinding.cs (6)
241
Marshal.WriteIntPtr(base.
handle
, offset, ptr);
242
Marshal.WriteIntPtr(base.
handle
, offset + ADP.PtrSize, ptr);
262
pinnedValue = ADP.IntPtrOffset(base.
handle
, _emptyStringOffset);
271
Marshal.WriteIntPtr(base.
handle
, offset, pinnedValue); // parameter input value
272
Marshal.WriteIntPtr(base.
handle
, offset + ADP.PtrSize, pinnedValue); // original parameter value
564
IntPtr buffer = base.
handle
;
fx\src\data\System\Data\OleDb\SafeHandles.cs (7)
37
literalInfo = base.
handle
;
45
columnInfos = base.
handle
;
53
schemaGuids = base.
handle
;
67
return (((IntPtr.Zero == base.
handle
)) && (IntPtr.Zero == this.handle2));
74
IntPtr ptr = base.
handle
;
154
if ((IntPtr.Zero != base.
handle
) && (IntPtr.Zero != chapter)) {
156
OleDbHResult hr = (OleDbHResult)NativeOledbWrapper.IChapteredRowsetReleaseChapter(base.
handle
, chapter);
fx\src\data\System\Data\ProviderBase\DbBuffer.cs (3)
39
if (IntPtr.Zero == base.
handle
) {
55
return (IntPtr.Zero == base.
handle
);
334
IntPtr ptr = base.
handle
;
fx\src\data\System\Data\ProviderBase\WrappedIUnknown.cs (2)
42
return (IntPtr.Zero == base.
handle
);
68
IntPtr ptr = base.
handle
;
fx\src\data\System\Data\SqlClient\TdsParserSafeHandles.cs (7)
56
return (IntPtr.Zero == base.
handle
);
61
if (base.
handle
!= IntPtr.Zero) {
168
return (IntPtr.Zero == base.
handle
);
174
IntPtr ptr = base.
handle
;
195
if (IntPtr.Zero == base.
handle
) {
202
return (IntPtr.Zero == base.
handle
);
208
IntPtr ptr = base.
handle
;
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (4)
869
if (base.
handle
== IntPtr.Zero)
872
Marshal.FreeHGlobal(base.
handle
);
1018
if (base.
handle
== IntPtr.Zero)
1021
Marshal.FreeHGlobal(base.
handle
);
System.Drawing (6)
commonui\System\Drawing\Advanced\SafeCustomLineCapHandle.cs (3)
35
status = SafeNativeMethods.Gdip.GdipDeleteCustomLineCap(new HandleRef(this,
handle
));
53
get { return
handle
== IntPtr.Zero; }
57
return (handle == null) ? IntPtr.Zero : handle.
handle
;
commonui\System\Drawing\Printing\PrintController.cs (3)
49
get { return
handle
== IntPtr.Zero; }
60
SafeNativeMethods.GlobalFree(new HandleRef(this,
handle
));
69
return (handle == null) ? IntPtr.Zero : handle.
handle
;
System.IdentityModel (11)
System\IdentityModel\CryptoApi.cs (3)
368
return CAPI.CertCloseStore(
handle
, 0);
395
return CAPI.CertFreeCertificateContext(
handle
);
421
CAPI.CertFreeCertificateChain(
handle
);
System\IdentityModel\SafeCryptHandles.cs (2)
36
return NativeMethods.CryptReleaseContext(
handle
, 0);
63
bool ret = NativeMethods.CryptDestroyKey(
handle
);
System\IdentityModel\SspiSafeHandles.cs (6)
1225
return CertFreeCertificateContext(
handle
);
1335
return FreeContextBuffer(
handle
) == 0;
1376
return CloseHandle(
handle
);
1403
Marshal.FreeHGlobal(
handle
);
1473
return NativeMethods.LsaDeregisterLogonProcess(
handle
) >= 0;
1496
return NativeMethods.LsaFreeReturnBuffer(
handle
) >= 0;
System.IdentityModel.Selectors (13)
infocard\client\System\IdentityModel\Selectors\CryptoHandle.cs (2)
267
return (IntPtr.Zero == base.
handle
);
275
return CloseCryptoHandle(base.
handle
);
infocard\client\System\IdentityModel\Selectors\SafeLibraryHandle.cs (1)
43
return FreeLibrary(
handle
);
infocard\client\System\IdentityModel\Selectors\SafeTokenHandle.cs (2)
46
return (IntPtr.Zero == base.
handle
);
54
return (0 == FreeToken(base.
handle
)) ? false : true;
infocard\common\managed\GlobalAllocSafeHandle.cs (3)
54
return (IntPtr.Zero == base.
handle
);
69
ZeroMemory(base.
handle
, m_bytes);
70
GlobalFree(base.
handle
);
infocard\common\managed\HGlobalSafeHandle.cs (3)
67
return (IntPtr.Zero == base.
handle
);
81
ZeroMemory(base.
handle
, m_bytes);
83
Marshal.FreeHGlobal(base.
handle
);
infocard\Diagnostics\Managed\Microsoft\InfoCards\Diagnostics\InfocardTrace.cs (2)
155
return (IntPtr.Zero == base.
handle
);
166
return DeregisterEventSource(base.
handle
);
System.IO.Log (12)
System\IO\Log\CoTaskMemHandle.cs (2)
22
return IsClosed || this.
handle
== IntPtr.Zero;
33
CoTaskMemFree(this.
handle
);
System\IO\Log\SafeArchiveContext.cs (2)
22
return IsClosed || this.
handle
== IntPtr.Zero;
34
return TerminateLogArchive(this.
handle
);
System\IO\Log\SafeMarshalContext.cs (2)
22
return IsClosed || this.
handle
== IntPtr.Zero;
34
return DeleteLogMarshallingArea(this.
handle
);
System\IO\Log\SafeReadContext.cs (2)
23
return IsClosed || this.
handle
== IntPtr.Zero;
35
return TerminateReadLog(this.
handle
);
System\IO\Log\SmuggledIUnknown.cs (4)
33
return (IsClosed || (IntPtr.Zero == base.
handle
));
46
comObject = EnterpriseServicesHelper.WrapIUnknownWithComObject(base.
handle
);
54
if (base.
handle
!= IntPtr.Zero)
56
Marshal.Release(base.
handle
);
System.Messaging (4)
System\Messaging\Interop\SafeHandles.cs (4)
23
SafeNativeMethods.MQCloseQueue(this.
handle
);
58
SafeNativeMethods.MQCloseCursor(this.
handle
);
93
SafeNativeMethods.MQLocateEnd(this.
handle
);
132
SafeNativeMethods.MQFreeSecurityContext(this.
handle
);
System.Net (12)
net\PeerToPeer\Collaboration\UnsafeCollabNativeMethods.cs (7)
37
UnsafeCollabNativeMethods.PeerFreeData(
handle
);
61
UnsafeCollabNativeMethods.PeerEndEnumeration(
handle
);
85
UnsafeCollabNativeMethods.PeerCollabCloseHandle(
handle
);
109
UnsafeCollabNativeMethods.CertCloseStore(
handle
, 0);
135
if (IntPtr.Equals(
handle
, IntPtr.Zero)){
145
Marshal.FreeHGlobal(
handle
);
167
UnsafeCollabNativeMethods.PeerCollabUnregisterEvent(
handle
);
net\PeerToPeer\UnsafePeerToPeerMethods.cs (4)
189
return Marshal.PtrToStringUni(
handle
);
194
UnsafeP2PNativeMethods.PeerFreeData(
handle
);
215
UnsafeP2PNativeMethods.PeerPnrpUnregister(
handle
);
235
UnsafeP2PNativeMethods.PeerPnrpEndResolve(
handle
);
net\UnsafeMethods.cs (1)
126
return UnsafeSystemNativeMethods.FreeLibrary(
handle
);
System.Runtime.Caching (1)
System\Caching\SafeRegistryHandle.cs (1)
24
int r = UnsafeNativeMethods.RegCloseKey(
handle
);
System.Security (7)
system\security\cryptography\cryptoapi.cs (7)
2942
return FreeLibrary(
handle
);
2973
return LocalFree(
handle
) == IntPtr.Zero;
3039
IntPtr h =
handle
;
3089
return CertFreeCertificateContext(
handle
);
3120
return CertCloseStore(
handle
, 0);
3150
return CryptMsgClose(
handle
);
3180
CertFreeCertificateChain(
handle
);
System.ServiceModel (19)
System\ServiceModel\Activation\ListenerUnsafeNativeMethods.cs (2)
262
return CloseHandle(
handle
);
283
return ListenerUnsafeNativeMethods.CloseServiceHandle(
handle
);
System\ServiceModel\Channels\ChannelBindingUtility.cs (2)
244
byte* destinationBuffer = (byte*)this.
handle
.ToPointer();
271
Marshal.FreeHGlobal(this.
handle
);
System\ServiceModel\Channels\PeerUnsafeNativeCryptMethods.cs (9)
63
get { return
handle
== IntPtr.Zero; }
69
return CertDeleteCertificateFromStore(
handle
);
71
return CertFreeCertificateContext(
handle
);
97
get { return
handle
== IntPtr.Zero; }
102
return CertCloseStore(
handle
, 0);
122
get { return
handle
== IntPtr.Zero; }
127
return CryptReleaseContext(
handle
, 0);
146
get { return
handle
== IntPtr.Zero; }
151
return CryptDestroyKey(
handle
);
System\ServiceModel\Channels\UnsafeNativeMethods.cs (5)
1223
return UnsafeNativeMethods.CloseHandle(
handle
) != 0;
1237
return UnsafeNativeMethods.CloseHandle(
handle
) != 0;
1269
return FreeLibrary(
handle
);
1283
if (UnsafeNativeMethods.UnmapViewOfFile(
handle
) != 0)
1299
return UnsafeNativeMethods.MQCloseQueue(
handle
) >= 0;
System\ServiceModel\ComIntegration\SafeNativeMethods.cs (1)
882
if (SafeNativeMethods.RegCloseKey(
handle
) == SafeNativeMethods.ERROR_SUCCESS)
System.ServiceModel.Activation (2)
System\ServiceModel\Activation\Interop\SafeCloseHandleCritical.cs (1)
28
return CloseHandle(
handle
);
System\ServiceModel\Activation\Interop\SafeHGlobalHandleCritical.cs (1)
35
Marshal.FreeHGlobal(
handle
);
System.ServiceModel.Internals (1)
System\Runtime\Interop\SafeEventLogWriteHandle.cs (1)
47
return DeregisterEventSource(this.
handle
);
System.Transactions (4)
System\Transactions\Oletx\CoTaskMemHandle.cs (2)
24
return IsClosed || this.
handle
== IntPtr.Zero;
40
CoTaskMemFree(this.
handle
);
System\Transactions\SafeIUnknown.cs (2)
42
return (IsClosed || (IntPtr.Zero == base.
handle
));
49
IntPtr ptr = base.
handle
;
System.Web (4)
PerfCounters.cs (3)
21
get { return
handle
; }
25
get { return
handle
== IntPtr.Zero; }
29
UnsafeNativeMethods.PerfCloseAppCounters(
handle
);
Util\HeapAllocHandle.cs (1)
23
return UnsafeNativeMethods.HeapFree(ProcessHeap, 0,
handle
);
System.Windows.Forms (5)
winforms\Managed\System\WinForms\Control.cs (5)
17843
return (IntPtr.Zero == base.
handle
);
17853
IntPtr ptr1 = base.
handle
;
17865
IntPtr vtblptr = Marshal.ReadIntPtr(this.
handle
, 0);
17902
int hresult = findConnectionPoint.Invoke(this.
handle
, ref iid, out result);
17946
if (advise.Invoke(this.
handle
, punkEventSink, out cookie) == 0) {
UIAutomationClient (14)
MS\Internal\Automation\SafeHandles.cs (6)
34
get { return
handle
== IntPtr.Zero; }
39
return UiaCoreApi.UiaNodeRelease(
handle
);
57
get { return
handle
== IntPtr.Zero; }
62
return UiaCoreApi.UiaPatternRelease(
handle
);
77
get { return
handle
== IntPtr.Zero; }
82
UiaCoreApi.UiaRemoveEvent(
handle
);
MS\Internal\Automation\SafeProcessHandle.cs (1)
56
return Misc.CloseHandle(
handle
);
System\Windows\Automation\Condition.cs (5)
40
get { return
handle
== IntPtr.Zero; }
45
Marshal.FreeCoTaskMem(
handle
);
63
Marshal.StructureToPtr(uiaCondition, sh.
handle
, false);
88
IntPtr* pdata = (IntPtr*)sh.
handle
;
91
*pdata++ = conditions[i]._safeHandle.
handle
;
System\Windows\Automation\Text\TextRange.cs (2)
44
get { return
handle
== IntPtr.Zero; }
49
return UiaCoreApi.UiaTextRangeRelease(
handle
);
UIAutomationClientsideProviders (10)
MS\Internal\AutomationProxies\CommonRemoteMemoryBlock.cs (5)
70
return Misc.VirtualFreeEx(_processHandle,
handle
, UIntPtr.Zero, UnsafeNativeMethods.MEM_RELEASE);
87
return
handle
;
94
Misc.WriteProcessMemory(_processHandle,
handle
, sourceAddress, cbSize, out count);
106
Misc.ReadProcessMemory(_processHandle,
handle
, destAddress, cbSize, out count);
111
Misc.ReadProcessMemory(_processHandle,
handle
, destAddress, cbSize, out count);
MS\Internal\AutomationProxies\SafeCoTaskMem.cs (3)
37
return Marshal.PtrToStringAuto(
handle
);
43
return Marshal.PtrToStringUni(
handle
, length);
52
Marshal.FreeCoTaskMem(
handle
);
MS\Internal\AutomationProxies\SafeProcessHandle.cs (1)
62
return Misc.CloseHandle(
handle
);
MS\Internal\AutomationProxies\SafeThemeHandle.cs (1)
46
return !IsInvalid ? CloseThemeData(
handle
) == (IntPtr)NativeMethods.S_OK : true;
WindowsBase (22)
Base\MS\Internal\Security\RightsManagement\SafeRightsManagementEnvironmentHandle.cs (2)
55
z = SafeNativeMethods.DRMCloseEnvironmentHandle((uint)this.
handle
);
77
return this.
handle
.Equals(IntPtr.Zero);
Base\MS\Internal\Security\RightsManagement\SafeRightsManagementHandle.cs (2)
55
z = SafeNativeMethods.DRMCloseHandle((uint)this.
handle
);
77
return this.
handle
.Equals(IntPtr.Zero);
Base\MS\Internal\Security\RightsManagement\SafeRightsManagementPubHandle.cs (2)
55
z = SafeNativeMethods.DRMClosePubHandle((uint)this.
handle
);
77
return this.
handle
.Equals(IntPtr.Zero);
Base\MS\Internal\Security\RightsManagement\SafeRightsManagementQueryHandle.cs (2)
55
z = SafeNativeMethods.DRMCloseQueryHandle((uint)this.
handle
);
77
return this.
handle
.Equals(IntPtr.Zero);
Base\MS\Internal\Security\RightsManagement\SafeRightsManagementSessionHandle.cs (2)
55
z = SafeNativeMethods.DRMCloseSession((uint)this.
handle
);
77
return this.
handle
.Equals(IntPtr.Zero);
parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (1)
349
bool res = ZLibNative.NativeMethods.FreeLibrary(
handle
);
Shared\MS\Win32\NativeMethodsOther.cs (6)
308
return UnsafeNativeMethods.DeleteObject(
handle
);
317
return new HandleRef(obj,
handle
);
350
return UnsafeNativeMethods.DestroyIcon(
handle
);
372
return
handle
;
393
return UnsafeNativeMethods.DestroyCursor(
handle
);
711
return (LocalFree(base.
handle
) == IntPtr.Zero);
Shared\MS\Win32\UnsafeNativeMethodsOther.cs (5)
568
return
handle
== IntPtr.Zero;
582
return CloseHandleNoThrow(new HandleRef(null,
handle
));
607
Debug.Assert(
handle
!= IntPtr.Zero);
608
return (void*)
handle
;
622
return UnsafeNativeMethods.UnmapViewOfFileNoThrow(new HandleRef(null,
handle
));
WsatConfig (15)
Configuration\ClusterSafeNativeMethods.cs (5)
29
get { return IsClosed ||
handle
== IntPtr.Zero; }
42
return CloseCluster(
handle
);
54
return CloseClusterResource(
handle
);
66
return ClusterCloseEnum(
handle
) == SafeNativeMethods.ERROR_SUCCESS;
78
return ClusterRegCloseKey(
handle
) == SafeNativeMethods.ERROR_SUCCESS;
Configuration\SafeCertificateContext.cs (3)
25
return
handle
== IntPtr.Zero;
32
int r = SafeNativeMethods.CertFreeCertificateContext(
handle
);
38
return new X509Certificate2(
handle
);
Configuration\SafeCertificateStore.cs (2)
28
return
handle
== IntPtr.Zero;
35
return SafeNativeMethods.CertCloseStore(
handle
, 0);
Configuration\SafeIUnknown.cs (2)
42
return (IsClosed || (IntPtr.Zero == base.
handle
));
49
IntPtr ptr = base.
handle
;
Configuration\SafeLocalAllocation.cs (2)
48
handle
,
55
IntPtr r = SafeNativeMethods.LocalFree(
handle
);
Configuration\SafeRegistryKey.cs (1)
30
int r = SafeNativeMethods.RegCloseKey(
handle
);
WsatUI (17)
Configuration\ClusterSafeNativeMethods.cs (5)
29
get { return IsClosed ||
handle
== IntPtr.Zero; }
42
return CloseCluster(
handle
);
54
return CloseClusterResource(
handle
);
66
return ClusterCloseEnum(
handle
) == SafeNativeMethods.ERROR_SUCCESS;
78
return ClusterRegCloseKey(
handle
) == SafeNativeMethods.ERROR_SUCCESS;
Configuration\SafeCertificateContext.cs (3)
25
return
handle
== IntPtr.Zero;
32
int r = SafeNativeMethods.CertFreeCertificateContext(
handle
);
38
return new X509Certificate2(
handle
);
Configuration\SafeCertificateStore.cs (2)
28
return
handle
== IntPtr.Zero;
35
return SafeNativeMethods.CertCloseStore(
handle
, 0);
Configuration\SafeIUnknown.cs (2)
42
return (IsClosed || (IntPtr.Zero == base.
handle
));
49
IntPtr ptr = base.
handle
;
Configuration\SafeLocalAllocation.cs (3)
38
handle
,
48
handle
,
55
IntPtr r = SafeNativeMethods.LocalFree(
handle
);
Configuration\SafeRegistryKey.cs (1)
30
int r = SafeNativeMethods.RegCloseKey(
handle
);
MMCUI\SafePropertyPage.cs (1)
26
return SafeNativeMethods.DestroyPropertySheetPage(
handle
);