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