Base:
property
IsInvalid
System.Runtime.InteropServices.SafeHandle.IsInvalid
9 overrides of IsInvalid
System.Messaging (4)
System\Messaging\Interop\SafeHandles.cs (4)
28public override bool IsInvalid 63public override bool IsInvalid 98public override bool IsInvalid 137public override bool IsInvalid
WindowsBase (1)
Shared\MS\Win32\UnsafeNativeMethodsOther.cs (1)
563public override bool IsInvalid
WsatConfig (2)
Configuration\SafeCertificateContext.cs (1)
21public override bool IsInvalid
Configuration\SafeCertificateStore.cs (1)
24public override bool IsInvalid
WsatUI (2)
Configuration\SafeCertificateContext.cs (1)
21public override bool IsInvalid
Configuration\SafeCertificateStore.cs (1)
24public override bool IsInvalid
522 references to IsInvalid
ComSvcConfig (7)
SafeNativeMethods.cs (7)
42if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid) 54if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid) 65if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid) 129if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid) 146if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid) 162if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid) 198if (status != SafeNativeMethods.ERROR_SUCCESS || regHandle == null || regHandle.IsInvalid)
mscorlib (68)
microsoft\win32\registrykey.cs (6)
394if (ret == 0 && !result.IsInvalid) { 703if (foreignHKey.IsInvalid) 742if (ret == 0 && !result.IsInvalid) { 801if (ret == 0 && !result.IsInvalid) { 835if (ret == 0 && !result.IsInvalid) { 927if (ret == 0 && !result.IsInvalid) {
microsoft\win32\win32native.cs (1)
978if (!handle.IsInvalid)
system\console.cs (1)
489if (sh.IsInvalid) {
system\io\__consolestream.cs (1)
52Contract.Assert(handle != null && !handle.IsInvalid, "__ConsoleStream expects a valid handle!");
system\io\directory.cs (2)
1373if (hnd.IsInvalid) { 1518if (handle.IsInvalid) {
system\io\file.cs (3)
179if (handle.IsInvalid) 1376if (handle.IsInvalid) { 1460if (handle.IsInvalid) {
system\io\filestream.cs (3)
378if (_handle.IsInvalid) 847if (_handle.IsInvalid) { 1011if (handle.IsInvalid)
system\io\filesystemenumerable.cs (3)
275if (_hnd.IsInvalid) 430if (_hnd.IsInvalid) 535if (hnd.IsInvalid)
system\io\isolatedstorage\isolatedstoragefile.cs (2)
2086get { return m_handle == null || m_handle.IsClosed || m_handle.IsInvalid; } 2464if (hnd.IsInvalid) {
system\io\longpath.cs (2)
227if (handle.IsInvalid) 753if (hnd.IsInvalid)
system\security\cryptography\capinative.cs (8)
305Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 321Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 335Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 364Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 401Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 430Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "hashHandle != null && !hashHandle.IsInvalid"); 448Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 449Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid");
system\security\cryptography\x509certificates\x509certificate.cs (7)
386if (m_safeCertContext.IsInvalid) 387return other.m_safeCertContext.IsInvalid; 400if (m_safeCertContext.IsInvalid) 417if (fVerbose == false || m_safeCertContext.IsInvalid) 611if (!m_safeCertContext.IsInvalid) { 636if (m_safeCertContext.IsInvalid) 674if (m_safeCertContext.IsInvalid)
system\security\cryptography\x509certificates\x509utils.cs (4)
447if (!safeCertContext.IsInvalid) { 456if (!pCertCtx.IsInvalid) { 465if (!pCertCtx.IsInvalid) { 474if (!safeCertStoreHandle.IsInvalid) {
system\security\policy\pefileevidencefactory.cs (1)
67!peFile.IsInvalid);
system\security\principal\windowsidentity.cs (7)
323if (!pLogonSessionData.IsInvalid) 955if (safeLocalAllocHandle == null || safeLocalAllocHandle.IsInvalid) 988if (pSourceName == null || pSourceName.IsInvalid) 1039if (pPackageName == null || pPackageName.IsInvalid) 1075if (logonInfoBuffer == null || logonInfoBuffer.IsInvalid) { 1142if (!logonHandle.IsInvalid) 1144if (!profile.IsInvalid)
system\security\securestring.cs (5)
180if(m_buffer != null && !m_buffer.IsInvalid) { 327if (m_buffer.IsInvalid) { 352if (newBuffer.IsInvalid) { 450Contract.Assert(!m_buffer.IsInvalid && m_buffer.Length != 0, "Invalid buffer!"); 651Contract.Assert(!m_buffer.IsInvalid && m_buffer.Length != 0, "Invalid buffer!");
system\threading\eventwaithandle.cs (3)
79if (_handle.IsInvalid) 142if (_handle.IsInvalid) 248if (myHandle.IsInvalid)
system\threading\mutex.cs (5)
190if (mutexHandle.IsInvalid) 214if (cleanupInfo.mutexHandle != null && !cleanupInfo.mutexHandle.IsInvalid) { 387if (myHandle.IsInvalid) 441if( !mutexHandle.IsInvalid) { 464if(!mutexHandle.IsInvalid)
system\threading\timer.cs (3)
162if (m_appDomainTimer == null || m_appDomainTimer.IsInvalid) 167if (!m_appDomainTimer.IsInvalid) 249if(m_appDomainTimer != null && !m_appDomainTimer.IsInvalid)
system\timezoneinfo.cs (1)
2650if (!handle.IsInvalid) {
PresentationCore (31)
Core\CSharp\MS\Internal\FontCache\FontCacheUtil.cs (1)
1051if (fileHandle.IsInvalid)
Core\CSharp\MS\Internal\IO\Packaging\ByteRangeDownloader.cs (2)
474if (eventHandle.IsInvalid || eventHandle.IsClosed) 562if (_eventHandle != null && !_eventHandle.IsInvalid && !_eventHandle.IsClosed)
Core\CSharp\System\Windows\Media\ColorContextHelper.cs (1)
149return _profileHandle == null || _profileHandle.IsInvalid;
Core\CSharp\System\Windows\Media\ColorTransform.cs (2)
97if (srcContext.ProfileHandle != null && !srcContext.ProfileHandle.IsInvalid) 100if (dstContext.ProfileHandle != null && !dstContext.ProfileHandle.IsInvalid)
Core\CSharp\System\Windows\Media\ColorTransformHelper.cs (4)
92if (sourceProfile == null || sourceProfile.IsInvalid) 97if (destinationProfile == null || destinationProfile.IsInvalid) 133if (_transformHandle == null || _transformHandle.IsInvalid) 147if (_transformHandle == null || _transformHandle.IsInvalid)
Core\CSharp\System\Windows\Media\Imaging\BitmapDownload.cs (1)
172if (fileHandle.IsInvalid)
Core\CSharp\System\Windows\Media\Imaging\BitmapMetadataEnumerator.cs (1)
200Debug.Assert(metadataHandle != null && !metadataHandle.IsInvalid);
Core\CSharp\System\Windows\Media\Imaging\BitmapPalette.cs (5)
193Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid); 260if (_palette == null || _palette.IsInvalid) 304Debug.Assert(palette != null && !palette.IsInvalid); 319Debug.Assert(_palette != null && !_palette.IsInvalid); 353Debug.Assert(_palette != null && !_palette.IsInvalid);
Core\CSharp\System\Windows\Media\Imaging\BitmapSource.cs (3)
632if (_wicSource == null || _wicSource.IsInvalid) 882if (_convertedDUCEPtr != null && !_convertedDUCEPtr.IsInvalid) 1922if ((palette == null) || (palette.InternalPalette == null) || palette.InternalPalette.IsInvalid)
Core\CSharp\System\Windows\Media\Imaging\InteropBitmapSource.cs (3)
78Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 115Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 175Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid);
Core\CSharp\System\Windows\Media\Imaging\PropVariant.cs (1)
458if (metadataHandle == null || metadataHandle.IsInvalid)
Core\CSharp\System\Windows\Media\Imaging\RenderTargetBitmap.cs (2)
306Debug.Assert(renderTargetBitmap != null && !renderTargetBitmap.IsInvalid); 312Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid);
Core\CSharp\System\Windows\Media\MediaPlayerState.cs (3)
927if (_nativeMedia != null && !_nativeMedia.IsInvalid) 1238Debug.Assert(_nativeMedia != null && !_nativeMedia.IsInvalid); 1245if (_nativeMedia == null || _nativeMedia.IsInvalid)
Graphics\include\exports.cs (2)
911Invariant.Assert(pBitmapSource != null && !pBitmapSource.IsInvalid); 933Invariant.Assert(pMedia != null && !pMedia.IsInvalid);
PresentationFramework (6)
src\Framework\System\Windows\Interop\DocobjHost.cs (1)
843if (eventHandle.IsInvalid || eventHandle.IsClosed)
src\Framework\System\Windows\Standard\NativeMethods.cs (5)
1477if (dc.IsInvalid) 1515if (dc.IsInvalid) 1543if (dc.IsInvalid) 1712if (!this.IsInvalid) 2584if (hBitmap.IsInvalid)
SMDiagnostics (1)
System\ServiceModel\Diagnostics\SafeEventLogWriteHandle.cs (1)
31if (retval.IsInvalid)
SMSvcHost (1)
System\ServiceModel\Activation\ListenerAdapterBase.cs (1)
42if (webHostIpm.IsInvalid)
System (136)
compmod\microsoft\win32\NativeMethods.cs (3)
134if(hStdInput != null && !hStdInput.IsInvalid) { 139if(hStdOutput != null && !hStdOutput.IsInvalid) { 144if(hStdError != null && !hStdError.IsInvalid) {
compmod\microsoft\win32\safehandles\SafeProcessHandle.cs (1)
51Debug.Assert(base.IsInvalid, "Safe handle should only be set once");
compmod\microsoft\win32\safehandles\SafeThreadHandle.cs (1)
34Debug.Assert(base.IsInvalid, "Safe handle should only be set once");
compmod\system\codedom\compiler\Executor.cs (3)
216if (userToken == null || userToken.IsInvalid) { 277if (!success && (primaryToken != null && !primaryToken.IsInvalid)) { 315if (primaryToken != null && !primaryToken.IsInvalid)
net\System\Net\_AutoWebProxyScriptEngine.cs (5)
334if (regKeyPolicy != null && !regKeyPolicy.IsInvalid) 338if (regKeyLM != null && !regKeyLM.IsInvalid) 342if (regKey != null && !regKey.IsInvalid) 423if (key == null || key.IsInvalid) 457if (key != null && !key.IsInvalid)
net\System\Net\_SafeNetHandles.cs (8)
666if (result.IsInvalid) { 717if (result.IsInvalid) { 801if (result.IsInvalid) { 1746if (handleTemplate.IsInvalid) 2059if (handleTemplate.IsInvalid) 2830if (result.IsInvalid) 3101if(!IsInvalid) 3122if (this.IsInvalid)
net\System\Net\_SecureChannel.cs (2)
162if (certContext.IsInvalid) 198if (remoteContext != null && !remoteContext.IsInvalid) {
net\System\Net\HttpListener.cs (1)
2478if (token.IsInvalid)
net\System\Net\HttpListenerRequest.cs (1)
1124Debug.Assert(!handle.IsInvalid);
net\System\Net\NetworkInformation\ping.cs (2)
634if (handlePingV4.IsInvalid) { 641if (handlePingV6.IsInvalid) {
net\System\Net\NetworkInformation\TeredoHelper.cs (3)
96GlobalLog.Assert(!helper.cancelHandle.IsInvalid, 129GlobalLog.Assert(helper.cancelHandle != null && !helper.cancelHandle.IsInvalid, 158GlobalLog.Assert(cancelHandle != null && !cancelHandle.IsInvalid,
net\System\Net\Sockets\_BaseOverlappedAsyncResult.cs (2)
570return (m_UnmanagedBlob == null || m_UnmanagedBlob.IsInvalid)? SafeOverlappedFree.Zero : m_UnmanagedBlob; 612if (m_UnmanagedBlob != null && !m_UnmanagedBlob.IsInvalid) {
net\System\Net\UnsafeNativeMethods.cs (3)
1723Debug.Assert(chainCount == 0 || !chainList.IsInvalid); 1732Debug.Assert(!chainRef.IsInvalid); 3511if (!s_TokenBindingLibrary.IsInvalid)
net\System\Net\WebSockets\WebSocketProtocolComponent.cs (9)
152if (!s_WebSocketDllHandle.IsInvalid) 201if (s_WebSocketDllHandle.IsInvalid) 214return !s_WebSocketDllHandle.IsInvalid; 360if (s_WebSocketDllHandle.IsInvalid) 372webSocketHandle.IsInvalid) 423if (s_WebSocketDllHandle.IsInvalid) 432webSocketHandle.IsInvalid) 524if (s_WebSocketDllHandle.IsInvalid) 533webSocketHandle.IsInvalid)
net\System\Net\WinHttpWebProxyFinder.cs (3)
26if (session == null || session.IsInvalid) 53if (session == null || session.IsInvalid) 145if (session != null && !session.IsInvalid)
parent\parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (3)
440if (libHndl.IsInvalid) { 471Contract.Assert(!ZLibStreamHandle.zlibLibraryHandle.IsInvalid); 556if (zlibLibraryHandle == null || zlibLibraryHandle.IsInvalid)
security\system\security\cryptography\cryptoapi.cs (18)
2949if (safeCertContext.IsInvalid) 2989if (safeLocalAllocHandle == null || safeLocalAllocHandle.IsInvalid) 3103if (pvKey.IsInvalid) 3366if (pCertContext.IsInvalid) 3400if (pCertContext == null || pCertContext.IsInvalid) 3416if (hCertStore.IsInvalid) 3447if (hCertStore.IsInvalid) 3451if (pPrevCertContext.IsInvalid) { 3458if (safeCertContextHandle == null || safeCertContextHandle.IsInvalid) { 3657if (!safeCertStoreHandle.IsInvalid) { 3697if (hCertStore.IsInvalid) 3702if (pCertContext.IsInvalid) 3732if (hCertStore.IsInvalid) 3737if (pCertContext.IsInvalid) 3764if (pCertContext.IsInvalid) 3842if (hCertStore.IsInvalid) 3868if (hCertStore.IsInvalid) 3902if (hCertStore.IsInvalid)
security\system\security\cryptography\x509\x509certificate2.cs (17)
431if (verbose == false || m_safeCertContext.IsInvalid) 602if (m_safeCertContext.IsInvalid) 633if (m_safeCertContext.IsInvalid) 648if (m_safeCertContext.IsInvalid) 674if (m_safeCertContext.IsInvalid) 689if (m_safeCertContext.IsInvalid) 709if (m_safeCertContext.IsInvalid) 730if (m_safeCertContext.IsInvalid) 751if (m_safeCertContext.IsInvalid) 815if (m_safeCertContext.IsInvalid) 866if (m_safeCertContext.IsInvalid) 898if (m_safeCertContext.IsInvalid) 918if (m_safeCertContext.IsInvalid) 939if (m_safeCertContext.IsInvalid) 1123if (!m_safeCertContext.IsInvalid) { 1133if (m_safeCertContext.IsInvalid) 1412if (!ptr.IsInvalid) {
security\system\security\cryptography\x509\x509certificate2collection.cs (7)
307if (safeCertContextHandle != null && !safeCertContextHandle.IsInvalid) { 317if (safeCertContextHandle != null && !safeCertContextHandle.IsInvalid) { 597if (safeTargetStoreHandle == null || safeTargetStoreHandle.IsInvalid) 638while (pEnumContext != null && !pEnumContext.IsInvalid) { 697if (pEnumContext != null && !pEnumContext.IsInvalid) 1097if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid) 1135if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid)
security\system\security\cryptography\x509\x509chain.cs (3)
182if (certificate == null || certificate.CertContext.IsInvalid) 251if (!m_safeCertChainHandle.IsInvalid) { 352if (pCertContext == null || pCertContext.IsInvalid)
security\system\security\cryptography\x509\x509store.cs (9)
117if (m_safeCertStoreHandle == null || m_safeCertStoreHandle.IsInvalid) 125if (m_safeCertStoreHandle == null || m_safeCertStoreHandle.IsInvalid || m_safeCertStoreHandle.IsClosed) 152if (!m_safeCertStoreHandle.IsInvalid) 162if (m_safeCertStoreHandle == null || m_safeCertStoreHandle.IsInvalid) 195if (m_safeCertStoreHandle == null || m_safeCertStoreHandle.IsInvalid || m_safeCertStoreHandle.IsClosed) 256if (m_safeCertStoreHandle.IsInvalid || m_safeCertStoreHandle.IsClosed) 270if (safeCertContext == null || safeCertContext.IsInvalid) 273if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid || safeCertStoreHandle.IsClosed) 285if (safeCertContext2 == null || safeCertContext2.IsInvalid)
security\system\security\cryptography\x509\x509utils.cs (2)
360if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid) 553if (pCertContext == null || pCertContext.IsInvalid)
services\io\system\io\FileSystemWatcher.cs (1)
279return (directoryHandle == null || directoryHandle.IsInvalid);
services\monitoring\system\diagnosticts\EventLog.cs (1)
1024if (!handle.IsInvalid) {
services\monitoring\system\diagnosticts\EventLogInternal.cs (4)
844if (hModule == null || hModule.IsInvalid) { 853if (hModule.IsInvalid) 1303if (handle.IsInvalid) { 1333if (handle.IsInvalid) {
services\monitoring\system\diagnosticts\Process.cs (7)
230if (handle.IsInvalid) { 302if( handle.IsInvalid) { 1893if (!ret || hReadPipe.IsInvalid || hWritePipe.IsInvalid) { 1938if( hTmp != null && !hTmp.IsInvalid) { 2167if (!procSH.IsInvalid) { 2432if (handle.IsInvalid) {
services\monitoring\system\diagnosticts\ProcessManager.cs (3)
266if (!processHandle.IsInvalid) { 292if (threadHandle.IsInvalid) { 727if (!processHandle.IsInvalid ) {
services\monitoring\system\diagnosticts\SharedPerformanceCounter.cs (9)
61if (!procHandle.IsInvalid) { 1214if ((error == NativeMethods.ERROR_INVALID_PARAMETER) && procHandle.IsInvalid) { 1225if (!procHandle.IsInvalid && startTime != -1) { 1240if (!procHandle.IsInvalid) { 1538if (fileViewAddress.IsInvalid) 1590if ((Marshal.GetLastWin32Error() != NativeMethods.ERROR_ACCESS_DENIED) || !fileMappingHandle.IsInvalid) { 1598if ((Marshal.GetLastWin32Error() != NativeMethods.ERROR_FILE_NOT_FOUND) || !fileMappingHandle.IsInvalid) { 1613if (fileMappingHandle.IsInvalid) { 1618if (fileViewAddress.IsInvalid)
sys\system\io\ports\SerialStream.cs (2)
663if (tempHandle.IsInvalid) 794if (_handle != null && !_handle.IsInvalid) {
sys\system\threading\semaphore.cs (3)
71if (myHandle.IsInvalid) 141if (myHandle.IsInvalid) 273if (myHandle.IsInvalid)
System.Configuration (7)
System\Configuration\DPAPIProtectedConfigurationProvider.cs (6)
116if (!(safeOutputDataHandle == null || safeOutputDataHandle.IsInvalid)) { 120if (!(safeEntDataHandle == null || safeEntDataHandle.IsInvalid)) { 124if (!(safeInputDataHandle == null || safeInputDataHandle.IsInvalid)) { 183if (!(safeOutputDataHandle == null || safeOutputDataHandle.IsInvalid)) { 187if (!(safeEntDataHandle == null || safeEntDataHandle.IsInvalid)) { 191if (!(safeInputDataHandle == null || safeInputDataHandle.IsInvalid)) {
System\Configuration\RSAProtectedConfigurationProvider.cs (1)
216if (!(hProv == null || hProv.IsInvalid))
System.Core (94)
Microsoft\Win32\SafeHandles\CapiSafeHandles.cs (5)
292Contract.Requires(!IsInvalid && !IsClosed); 293Contract.Ensures(Contract.Result<SafeCapiKeyHandle>() != null && !Contract.Result<SafeCapiKeyHandle>().IsInvalid && !Contract.Result<SafeCapiKeyHandle>().IsClosed); 304if (duplicate != null && !duplicate.IsInvalid && ParentCsp != IntPtr.Zero) { 371Contract.Requires(!IsInvalid && !IsClosed); 407Debug.Assert(!duplicate.IsInvalid, "Failed to duplicate handle successfully");
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (2)
104if (IsInvalid) 420Contract.Ensures(!IsInvalid);
Microsoft\Win32\UnsafeNativeMethods.cs (1)
195if (!handle.IsInvalid) {
System\Diagnostics\PerformanceData\CounterSet.cs (1)
187if (m_provider.m_hProvider.IsInvalid) {
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (1)
121if (m_instance.m_counterSet.m_provider.m_hProvider.IsInvalid) {
System\IO\LogStream.cs (1)
131if (_handle.IsInvalid) {
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (9)
40Debug.Assert(handle != null && !handle.IsClosed && !handle.IsInvalid, "handle is null, closed, or invalid"); 48Debug.Assert(handle != null && !handle.IsClosed && !handle.IsInvalid, "handle is null, closed, or invalid"); 180Debug.Assert(handle != null && !handle.IsInvalid); 399if (!handle.IsInvalid && errorCode == UnsafeNativeMethods.ERROR_ALREADY_EXISTS) { 403else if (handle.IsInvalid) { 427if (handle.IsInvalid) { 483if (!handle.IsInvalid) { 503if (!handle.IsInvalid) { 526if (handle == null || handle.IsInvalid) {
System\IO\MemoryMappedFiles\MemoryMappedView.cs (1)
118if (viewHandle.IsInvalid) {
System\IO\Pipes\Pipe.cs (10)
123if (serverSafePipeHandle.IsInvalid) { 126if (clientSafePipeHandle.IsInvalid) { 293if (safePipeHandle.IsInvalid) { 311if (safePipeHandle.IsInvalid) { 322Debug.Assert(safePipeHandle != null && !safePipeHandle.IsInvalid, "safePipeHandle must be valid"); 538if (safePipeHandle.IsInvalid) { 584if (handle.IsInvalid) { 1135if (safePipeHandle.IsInvalid) { 1214if (handle.IsInvalid) { 1339if (handle.IsInvalid) {
System\Security\Cryptography\AesCryptoServiceProvider.cs (8)
38Contract.Ensures(m_cspHandle != null && !m_cspHandle.IsInvalid && !m_cspHandle.IsClosed); 76Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); 80if (m_key == null || m_key.IsInvalid || m_key.IsClosed) { 93Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); 147if (m_key == null || m_key.IsInvalid || m_key.IsClosed) { 208if (m_key == null || m_key.IsInvalid || m_key.IsClosed) { 369Contract.Ensures(m_key != null && !m_key.IsInvalid & !m_key.IsClosed); 384if (key != null && !key.IsInvalid) {
System\Security\Cryptography\BCryptHashAlgorithm.cs (3)
70Contract.Ensures(m_algorithmHandle != null && !m_algorithmHandle.IsInvalid && !m_algorithmHandle.IsClosed); 71Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed); 114Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed);
System\Security\Cryptography\BCryptNative.cs (2)
467s_bcryptSupported = !bcrypt.IsInvalid; 582!Contract.Result<SafeBCryptAlgorithmHandle>().IsInvalid &&
System\Security\Cryptography\CapiHashAlgorithm.cs (4)
34Contract.Ensures(m_cspHandle != null && !m_cspHandle.IsInvalid && !m_cspHandle.IsClosed); 35Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed); 66Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed); 91if (newHashAlgorithm != null && !newHashAlgorithm.IsInvalid) {
System\Security\Cryptography\CapiNative.cs (6)
512!Contract.Result<SafeCspHandle>().IsInvalid && 722!Contract.Result<SafeCapiKeyHandle>().IsInvalid && 765if (importedKey != null && !importedKey.IsInvalid) { 789Contract.Requires(key != null && !key.IsInvalid && !key.IsClosed); 808if (safeLocalAllocHandle == null || safeLocalAllocHandle.IsInvalid) { 955if (pvKey.IsInvalid) {
System\Security\Cryptography\CapiSymmetricAlgorithm.cs (4)
52Contract.Requires(provider != null && !provider.IsInvalid && !provider.IsClosed); 53Contract.Requires(key != null && !key.IsInvalid && !key.IsClosed); 54Contract.Ensures(m_provider != null && !m_provider.IsInvalid && !m_provider.IsClosed); 585!Contract.Result<SafeCapiKeyHandle>().IsInvalid &&
System\Security\Cryptography\CngKey.cs (6)
39Contract.Requires(keyHandle != null && !keyHandle.IsInvalid && !keyHandle.IsClosed); 40Contract.Requires(kspHandle != null && !kspHandle.IsInvalid && !kspHandle.IsClosed); 41Contract.Ensures(m_keyHandle != null && !m_keyHandle.IsInvalid && !m_keyHandle.IsClosed); 42Contract.Ensures(kspHandle != null && !kspHandle.IsInvalid && !kspHandle.IsClosed); 728if (keyHandle.IsClosed || keyHandle.IsInvalid) { 797Contract.Requires(keyHandle != null && !keyHandle.IsInvalid && !keyHandle.IsClosed);
System\Security\Cryptography\NCryptNative.cs (17)
545Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); 658Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); 756Debug.Assert(!key.IsInvalid && !key.IsClosed, "!key.IsInvalid && !key.IsClosed"); 798Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); 821Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); 848Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); 872Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); 898Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); 926s_ncryptSupported = !ncrypt.IsInvalid; 979Contract.Requires(provider != null && !provider.IsInvalid && !provider.IsClosed); 982!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 1242!Contract.Result<SafeNCryptSecretHandle>().IsInvalid); 1331Contract.Requires(key != null && !key.IsInvalid && !key.IsClosed); 1536!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 1565!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 1593Contract.Requires(provider != null && !provider.IsInvalid && !provider.IsClosed); 1613!Contract.Result<SafeNCryptProviderHandle>().IsInvalid &&
System\Security\Cryptography\X509Certificates\ECDsaCertificateExtensions.cs (5)
75if (bcryptKeyHandle.IsInvalid) 129if (bcryptKeyHandle.IsInvalid) 260Debug.Assert(!cryptHandle.IsInvalid); 312Debug.Assert(!cryptHandle.IsInvalid); 333Debug.Assert(!cryptHandle.IsInvalid);
System\Security\Cryptography\X509Certificates\X509Native.cs (8)
28Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, 51Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, 100if (!freeKey && privateKey != null && !privateKey.IsInvalid) 119Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, 152Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, 171Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, 187Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, 191Debug.Assert(!keyHandle.IsClosed && !keyHandle.IsInvalid,
System.Data (2)
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (2)
743if ( hFile.IsInvalid ) 799if ( hFile != null && !hFile.IsInvalid )
System.IdentityModel (7)
System\IdentityModel\Selectors\X509CertificateChain.cs (1)
231if (certStoreHandle == null || certStoreHandle.IsInvalid)
System\IdentityModel\Selectors\X509CertificateStore.cs (4)
86DiagnosticUtility.DebugAssert(this.certStoreHandle.IsInvalid, ""); 95if (certStoreHandle == null || certStoreHandle.IsInvalid) 109DiagnosticUtility.DebugAssert(!this.certStoreHandle.IsInvalid, ""); 234while (pCertContext != null && !pCertContext.IsInvalid)
System\IdentityModel\SspiSafeHandles.cs (2)
433if (handleTemplate.IsInvalid) 701if (handleTemplate.IsInvalid)
System.IdentityModel.Selectors (1)
infocard\client\System\IdentityModel\Selectors\CardSpaceShim.cs (1)
97if (m_implementationDll.IsInvalid)
System.IO.Log (2)
System\IO\Log\LogStore.cs (1)
423if (!this.logFile.IsInvalid)
System\IO\Log\UnsafeNativeMethods.cs (1)
486if (ret.IsInvalid)
System.Messaging (4)
System\Messaging\Interop\SafeHandles.cs (4)
30get { return base.IsInvalid || IsClosed; } 65get { return base.IsInvalid || IsClosed; } 100get { return base.IsInvalid || IsClosed; } 139get { return base.IsInvalid || IsClosed; }
System.Net (37)
net\PeerToPeer\Collaboration\CollaborationHelperFunctions.cs (3)
156if (certHandle == null || certHandle.IsInvalid){ 205if (certHandle == null || certHandle.IsInvalid){ 405if ((safeEvent != null) && (!safeEvent.IsInvalid)){
net\PeerToPeer\Collaboration\ContactManager.cs (5)
325if (m_safeSubLstChangedEvent.IsInvalid) return; 526if (m_safeNameChangedEvent.IsInvalid) return; 733if (m_safePresenceChangedEvent.IsInvalid) return; 951if (m_safeAppChangedEvent.IsInvalid) return; 1164if (m_safeObjChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\MyContact.cs (3)
169if (m_safePresenceChangedEvent.IsInvalid) return; 335if (m_safeAppChangedEvent.IsInvalid) return; 503if (m_safeObjChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\Peer.cs (3)
748if (!safeResponse.IsInvalid){ 1119if (!m_SafeCollabInvite.IsInvalid && !m_SafeCollabInvite.IsClosed){ 1437if (!m_SafeCollabInvite.IsInvalid){
net\PeerToPeer\Collaboration\PeerApplication.cs (1)
367if (m_safeAppChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\PeerCollaboration.cs (5)
760if (!safeAppRegInfo.IsInvalid){ 1121if (s_safeNameChangedEvent.IsInvalid) return; 1280if (s_safePresenceChangedEvent.IsInvalid) return; 1451if (s_safeObjChangedEvent.IsInvalid) return; 1613if (s_safeAppChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\PeerContact.cs (3)
1342if (m_safeAppChangedEvent.IsInvalid) return; 1593if (m_safeObjChangedEvent.IsInvalid) return; 1845if (m_safePresenceChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\PeerEndPoint.cs (1)
303if (m_safeNameChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\PeerNearMe.cs (1)
639if (s_safePeerNearMeChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\PeerObject.cs (1)
312if (m_safeObjChangedEvent.IsInvalid) return;
net\PeerToPeer\Collaboration\UnsafeCollabNativeMethods.cs (5)
36if(!IsInvalid) 60if (!IsInvalid) 84if (!IsInvalid) 108if (!IsInvalid) 144if (allocated && !IsInvalid)
net\PeerToPeer\PeerNameRegistration.cs (1)
631 if(m_RegistrationHandle.IsInvalid || m_RegistrationHandle.IsClosed)
net\PeerToPeer\PeerNameResolver.cs (2)
224if (!m_SafePeerNameEndResolve.IsInvalid && !m_SafePeerNameEndResolve.IsClosed) 470if (!m_SafePeerNameEndResolve.IsInvalid)
net\PeerToPeer\UnsafePeerToPeerMethods.cs (2)
270if (!s_P2PLibrary.IsInvalid) { 344if (!s_P2PLibrary.IsClosed && !s_P2PLibrary.IsInvalid)
net\UnsafeMethods.cs (1)
109if (result.IsInvalid) {
System.Security (49)
system\security\cryptography\cryptoapi.cs (8)
2472if (safeLocalAllocHandle == null || safeLocalAllocHandle.IsInvalid) 2572if (pvKey.IsInvalid) 2687if (hCertStore.IsInvalid) 2719if (hCertStore.IsInvalid) 2724if (pCertContext.IsInvalid) 2748if (hCertStore.IsInvalid) 2753if (pCertContext.IsInvalid) 2912if (hCertStore.IsInvalid)
system\security\cryptography\pkcs\envelopedpkcs7.cs (13)
153if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) { 162if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) 173if (m_safeCryptMsgHandle != null && !m_safeCryptMsgHandle.IsInvalid) { 258if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) 320if (pOriginatorCert == null || pOriginatorCert.IsInvalid) { 416if (encryptParam.pvEncryptionAuxInfo != null && !encryptParam.pvEncryptionAuxInfo.IsInvalid) { 426if (encryptParam.rgCertEncoded != null && !encryptParam.rgCertEncoded.IsInvalid) { 430if (encryptParam.rgUnprotectedAttr != null && !encryptParam.rgUnprotectedAttr.IsInvalid) { 449if (safeCryptMsgHandle == null || safeCryptMsgHandle.IsInvalid) 452if (m_safeCryptMsgHandle != null && !m_safeCryptMsgHandle.IsInvalid) { 503if (safeCryptMsgHandle == null || safeCryptMsgHandle.IsInvalid) 568if (safeCertContextHandle != null && !safeCertContextHandle.IsInvalid) { 574if (safeCryptProvHandle != null && !safeCryptProvHandle.IsInvalid) {
system\security\cryptography\pkcs\pkcsmisc.cs (1)
544if (safeCryptMsgHandle == null || safeCryptMsgHandle.IsInvalid)
system\security\cryptography\pkcs\pkcsutils.cs (4)
43if (!hModule.IsInvalid) { 234if (safeCertContextHandle == null || safeCertContextHandle.IsInvalid) 882if ((safeCryptProvHandle == null) || (safeCryptProvHandle.IsInvalid)) 1106if (handle == null || handle.IsInvalid)
system\security\cryptography\pkcs\signedpkcs7.cs (14)
86if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) 108if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) { 118if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) { 128if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) 139if (m_safeCryptMsgHandle != null && !m_safeCryptMsgHandle.IsInvalid) { 173if (m_safeCryptMsgHandle != null && !m_safeCryptMsgHandle.IsInvalid) 205if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) { 217if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) 256if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) 268if (m_safeCryptMsgHandle == null || m_safeCryptMsgHandle.IsInvalid) 287if (m_safeCryptMsgHandle != null && !m_safeCryptMsgHandle.IsInvalid) { 335if (safeCryptMsgHandle == null || safeCryptMsgHandle.IsInvalid) 363if (m_safeCryptMsgHandle != null && !m_safeCryptMsgHandle.IsInvalid) { 419if (safeCryptMsgHandle == null || safeCryptMsgHandle.IsInvalid)
system\security\cryptography\pkcs\signerinfo.cs (3)
47Debug.Assert(signedCms != null && pbCmsgSignerInfo != null && !pbCmsgSignerInfo.IsInvalid); 669if (pbCmsgCmsSignerInfo != null && !pbCmsgCmsSignerInfo.IsInvalid) { 672if (pbCmsgSignerInfo != null && !pbCmsgSignerInfo.IsInvalid) {
system\security\cryptography\x509\x509ui.cs (3)
52if (safeCertContext.IsInvalid) 121if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid) 147if (safeCertContextHandle != null && !safeCertContextHandle.IsInvalid) {
system\security\cryptography\x509\x509utils.cs (3)
203if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid) 302if (pCertContext == null || pCertContext.IsInvalid) 374if (pCertContext == null || pCertContext.IsInvalid)
System.ServiceModel (24)
System\ServiceModel\Activation\SharedMemory.cs (3)
43if (fileMapping.IsInvalid) 83if (!handle.IsInvalid) 122if (fileMapping.IsInvalid)
System\ServiceModel\Activation\Utility.cs (4)
38if (process.IsInvalid) 51if (process.IsInvalid) 104if (scManager.IsInvalid) 117if (service.IsInvalid)
System\ServiceModel\Channels\ChannelBindingUtility.cs (1)
215if (source.IsInvalid || source.IsClosed)
System\ServiceModel\Channels\PipeConnection.cs (5)
641if (targetProcessHandle.IsInvalid) 2562if (fileMapping.IsInvalid) 2611if (fileMapping.IsInvalid) 2619if (fileMapping.IsInvalid) 2729if (handle.IsInvalid)
System\ServiceModel\ComIntegration\OuterProxyWrapper.cs (1)
60if (monikerSupportLibrary.IsInvalid)
System\ServiceModel\ComIntegration\SafeNativeMethods.cs (8)
586if (null == regHandle || regHandle.IsInvalid) 607if (null == regHandle || regHandle.IsInvalid) 627if (null == regHandle || regHandle.IsInvalid) 680if (null == regHandle || regHandle.IsInvalid) 700if (null == regHandle || regHandle.IsInvalid) 719if (null == regHandle || regHandle.IsInvalid) 740if (status != SafeNativeMethods.ERROR_SUCCESS || regHandle == null || regHandle.IsInvalid) 780if (status != SafeNativeMethods.ERROR_SUCCESS || regHandle == null || regHandle.IsInvalid)
System\ServiceModel\Security\TlsSspiNegotiation.cs (2)
657if (remoteContext != null && !remoteContext.IsInvalid) 733if (certContext.IsInvalid)
System.ServiceModel.Internals (2)
System\Runtime\Interop\SafeEventLogWriteHandle.cs (1)
30if (retval.IsInvalid)
System\Runtime\IOThreadTimer.cs (1)
633if (handle.IsInvalid)
System.Web (3)
Hosting\IIS7WorkerRequest.cs (2)
262if (_channelBindingToken != null && !_channelBindingToken.IsInvalid) 2516if (handle.IsInvalid) {
Hosting\ISAPIWorkerRequest.cs (1)
2011if (_channelBindingToken != null && !_channelBindingToken.IsInvalid)
UIAutomationClient (1)
MS\Internal\Automation\ProxyManager.cs (1)
323if (processHandle.IsInvalid)
UIAutomationClientsideProviders (29)
MS\Internal\AutomationProxies\CommonGetThemePartSize.cs (1)
55if (!_hTheme.IsInvalid)
MS\Internal\AutomationProxies\CommonRemoteMemoryBlock.cs (1)
130if (ptr.IsInvalid)
MS\Internal\AutomationProxies\CommonXSendMessage.cs (24)
80if (hProcess.IsInvalid) 90if (rmem.IsInvalid) 190if (hProcess.IsInvalid) 198if (rmem.IsInvalid) 227if (hProcess.IsInvalid) 236if (rmem.IsInvalid) 274if (hProcess.IsInvalid) 283if (rmem.IsInvalid) 321if (hProcess.IsInvalid) 330if (rmem1.IsInvalid) 338if (rmem2.IsInvalid) 372if (hProcess.IsInvalid) 380if (rmem.IsInvalid) 1173if (hProcess.IsInvalid) 1185if (remoteMem.IsInvalid) 1251if (hProcess.IsInvalid) 1260if (rmem.IsInvalid) 1368if (!copyTo.IsInvalid) 1372if (!hProcess.IsInvalid) 1416if (!copyTo.IsInvalid) 1420if (!hProcess.IsInvalid) 1464if (!copyTo.IsInvalid) 1468if (!hProcess.IsInvalid) 1489if (hProcess.IsInvalid)
MS\Internal\AutomationProxies\SafeThemeHandle.cs (1)
46return !IsInvalid ? CloseThemeData(handle) == (IntPtr)NativeMethods.S_OK : true;
MS\Internal\AutomationProxies\WindowsMenu.cs (1)
2607if (hProcess.IsInvalid)
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
1602if (hProcess.IsInvalid)
WindowsBase (7)
parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (3)
440if (libHndl.IsInvalid) { 471Contract.Assert(!ZLibStreamHandle.zlibLibraryHandle.IsInvalid); 556if (zlibLibraryHandle == null || zlibLibraryHandle.IsInvalid)
Shared\MS\Win32\SafeNativeMethodsCLR.cs (1)
155if(cursorHandle == null || cursorHandle.IsInvalid)
Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (3)
1856if ( hBitmap.IsInvalid ) 1880if ( hBitmap.IsInvalid ) 1928if ( hIcon.IsInvalid )
WsatConfig (1)
Configuration\QfeChecker.cs (1)
74if (ret == 0 && regKey != null && !regKey.IsInvalid)
WsatUI (2)
Configuration\QfeChecker.cs (1)
74if (ret == 0 && regKey != null && !regKey.IsInvalid)
MMCUI\WSATPropertySheet.cs (1)
183if (!dlgTemplate.IsInvalid)