system\io\__consolestream.cs (4)
205readSuccess = (0 != Win32Native.ReadFile(hFile, p + offset, count, out bytesRead, IntPtr.Zero));
213readSuccess = Win32Native.ReadConsoleW(hFile, p + offset, count / BytesPerWChar, out charsRead, IntPtr.Zero);
255writeSuccess = (0 != Win32Native.WriteFile(hFile, p + offset, count, out numBytesWritten, IntPtr.Zero));
268writeSuccess = Win32Native.WriteConsoleW(hFile, p + offset, count / BytesPerWChar, out charsWritten, IntPtr.Zero);
system\io\file.cs (3)
178using(SafeFileHandle handle = Win32Native.UnsafeCreateFile(fullSourceFileName, FileStream.GENERIC_READ, FileShare.Read, null, FileMode.Open, 0, IntPtr.Zero)) {
1345bool r = Win32Native.ReplaceFile(fullDestPath, fullSrcPath, fullBackupPath, flags, IntPtr.Zero, IntPtr.Zero);
system\io\filestream.cs (8)
149Overlapped overlapped = new Overlapped(0, 0, IntPtr.Zero, this);
210if (_overlapped != null && _overlapped->EventHandle != IntPtr.Zero) {
845_handle = Win32Native.SafeCreateFile(tempPath, fAccess, share, secAttrs, mode, flagsAndAttributes, IntPtr.Zero);
2086intOverlapped->InternalLow = IntPtr.Zero;
2511r = Win32Native.ReadFile(handle, p + offset, count, IntPtr.Zero, overlapped);
2513r = Win32Native.ReadFile(handle, p + offset, count, out numBytesRead, IntPtr.Zero);
2568r = Win32Native.WriteFile(handle, p + offset, count, IntPtr.Zero, overlapped);
2570r = Win32Native.WriteFile(handle, p + offset, count, out numBytesWritten, IntPtr.Zero);
system\io\pathhelper.cs (4)
158int result = Win32Native.GetFullPathName(m_arrayPtr, Path.MaxPath + 1, finalBuffer, IntPtr.Zero);
166result = Win32Native.GetFullPathName(m_arrayPtr, result, finalBuffer, IntPtr.Zero);
196int result = Win32Native.GetFullPathName(m_sb.ToString(), m_capacity + 1, finalBuffer, IntPtr.Zero);
203result = Win32Native.GetFullPathName(m_sb.ToString(), result, finalBuffer, IntPtr.Zero);
system\reflection\assembly.cs (11)
1210ppv = IntPtr.Zero;
1722return InternalLoad(assemblyString, assemblySecurity, ref stackMark, IntPtr.Zero, forIntrospection);
1790return InternalLoadAssemblyName(assemblyRef, assemblySecurity, reqAssembly, ref stackMark, IntPtr.Zero, true /*throwOnError*/, forIntrospection, suppressSecurityChecks);
1992IntPtr.Zero,
2028IntPtr.Zero,
2054IntPtr.Zero,
2985IntPtr.Zero,
3015IntPtr.Zero,
3026IntPtr.Zero,
3098IntPtr.Zero,
3131IntPtr.Zero,
Core\CSharp\MS\Internal\AppModel\CookieHandler.cs (2)
130if (UnsafeNativeMethods.InternetGetCookieEx(uriString, null, null, ref size, 0, IntPtr.Zero))
137if (UnsafeNativeMethods.InternetGetCookieEx(uriString, null, sb, ref size, 0, IntPtr.Zero))
Core\CSharp\System\Windows\DataObject.cs (36)
780pformatetcOut.ptd = IntPtr.Zero;
842hr = Win32CreateStreamOnHGlobal(IntPtr.Zero, true /*deleteOnRelease*/, ref istream);
871medium.unionmember = IntPtr.Zero;
1175if (win32Pointer == IntPtr.Zero)
1212if (win32Pointer != IntPtr.Zero)
1229if (win32Pointer == IntPtr.Zero)
1248if (win32Pointer == IntPtr.Zero)
1285if (win32Pointer == IntPtr.Zero)
1303if (handleOldObject == IntPtr.Zero)
1406int win32Return = UnsafeNativeMethods.WideCharToMultiByte(0 /*CP_ACP*/, 0 /*flags*/, wideString, wideChars, bytes, byteCount, IntPtr.Zero, IntPtr.Zero);
1608if (hBitmap == IntPtr.Zero)
1610return IntPtr.Zero;
1616hDC = Win32GetDC(new HandleRef(this, IntPtr.Zero));
1650Win32ReleaseDC(new HandleRef(this, IntPtr.Zero), new HandleRef(this, hDC));
1673hEnhancedMetafile = IntPtr.Zero;
1697if (hEnhancedMetafile == IntPtr.Zero)
1898istream.Write(buffer, NativeMethods.IntPtrToInt32(size), IntPtr.Zero);
1938if (hBitmap != IntPtr.Zero)
1975if (hMetafile != IntPtr.Zero)
2028if (handle == IntPtr.Zero)
2085IntPtr.Zero,
2138if (handle == IntPtr.Zero)
2149currentPtr = IntPtr.Zero;
2224if (handle == IntPtr.Zero)
2336if (handle == IntPtr.Zero)
2477handle = IntPtr.Zero;
2489if (handle == IntPtr.Zero)
2538IntPtr.Zero,
2638temp.ptd = IntPtr.Zero;
2883if (formatetc[formatetcIndex].ptd != IntPtr.Zero)
3088if (medium.unionmember != IntPtr.Zero && medium.tymed == TYMED.TYMED_ISTREAM)
3148if (hglobal != IntPtr.Zero)
3257if (medium.unionmember != IntPtr.Zero && medium.tymed == TYMED.TYMED_HGLOBAL)
3318if (medium.unionmember != IntPtr.Zero)
3724IntPtr.Zero,
Core\CSharp\System\Windows\Interop\HwndTarget.cs (31)
127private static readonly IntPtr Unhandled = IntPtr.Zero;
525Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero);
536IntPtr hwndParent = IntPtr.Zero;
552if (hwndParent != IntPtr.Zero)
557} while (hwndParent != IntPtr.Zero);
561Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero);
1056UnsafeNativeMethods.InvalidateRect(_hWnd.MakeHandleRef(this), IntPtr.Zero, true);
1103UnsafeNativeMethods.InvalidateRect(_hWnd.MakeHandleRef(this), IntPtr.Zero , true);
1202UnsafeNativeMethods.InvalidateRect(_hWnd.MakeHandleRef(this), IntPtr.Zero , true);
1219bool enableRenderTarget = (wparam != IntPtr.Zero);
1344UnsafeNativeMethods.InvalidateRect(_hWnd.MakeHandleRef(this), IntPtr.Zero , true);
1382UnsafeNativeMethods.InvalidateRect(_hWnd.MakeHandleRef(this), IntPtr.Zero , true);
1424UnsafeNativeMethods.InvalidateRect(_hWnd.MakeHandleRef(this), IntPtr.Zero, true);
1451UnsafeNativeMethods.InvalidateRect(_hWnd.MakeHandleRef(this), IntPtr.Zero, true);
1492&& !UnsafeNativeMethods.GetLayeredWindowAttributes(_hWnd.MakeHandleRef(this), IntPtr.Zero, IntPtr.Zero, IntPtr.Zero)
1578return IntPtr.Zero;
1584return IntPtr.Zero;
1931new HandleRef(null, IntPtr.Zero), // HWND_TOP
1958new HandleRef(null, IntPtr.Zero), // HWND_TOP
1963UnsafeNativeMethods.InvalidateRect(new HandleRef(this, _hWnd), IntPtr.Zero, true);
2090if(hwndParent != IntPtr.Zero)
2395UnsafeNativeMethods.UpdateLayeredWindow(_hWnd.h, IntPtr.Zero, null, null, IntPtr.Zero, null, 0, ref blend, NativeMethods.ULW_ALPHA);
2473UnsafeNativeMethods.PostMessage(new HandleRef(this, _hWnd), s_updateWindowSettings, IntPtr.Zero, IntPtr.Zero);
2769IntPtr.Zero,
2787if (_hPowerNotify != IntPtr.Zero)
2790_hPowerNotify = IntPtr.Zero;
2849IntPtr retInt = IntPtr.Zero;
src\Framework\MS\Internal\PtsHost\FigureParagraph.cs (11)
194CreateSubpageFiniteHelper(PtsContext, IntPtr.Zero, PTS.False, _mainTextSegment.Handle, IntPtr.Zero, PTS.False, PTS.True,
200if(brParaOut != IntPtr.Zero)
217if (pfsFigureContent != IntPtr.Zero)
221if (pmcsclientOut != IntPtr.Zero)
226pmcsclientOut = IntPtr.Zero;
237CreateSubpageFiniteHelper(PtsContext, IntPtr.Zero, PTS.False, _mainTextSegment.Handle, IntPtr.Zero, PTS.False, PTS.True,
243if(brParaOut != IntPtr.Zero)
261if (pmcsclientOut != IntPtr.Zero)
266pmcsclientOut = IntPtr.Zero;
src\Framework\System\Windows\Controls\Primitives\Popup.cs (22)
1230bool reestablishCapture = e.OriginalSource != root && Mouse.Captured == null && MS.Win32.SafeNativeMethods.GetCapture() == IntPtr.Zero;
1759if (wParam == IntPtr.Zero)
1792return IntPtr.Zero;
2677if (monitor != IntPtr.Zero)
2768if (hCursor != IntPtr.Zero)
3145UnsafeNativeMethods.SetWindowPos(new HandleRef(null, Handle), new HandleRef(null, IntPtr.Zero),
3159if (parent != IntPtr.Zero)
3257lastWebOCHwnd == IntPtr.Zero ? NativeMethods.HWND_TOP : new HandleRef(null, lastWebOCHwnd),
3306while (lastHwnd != IntPtr.Zero)
3434IntPtr parent = IntPtr.Zero;
3464if ( parent != IntPtr.Zero )
3476if ((parent != IntPtr.Zero) && ConnectedToForegroundWindow(parent))
3520while (window != IntPtr.Zero)
3543return (hwnd!=null ? hwnd.CriticalHandle : IntPtr.Zero);
3557if (child != IntPtr.Zero)
3563return IntPtr.Zero;
3612if (Handle != IntPtr.Zero && (UnsafeNativeMethods.IsWinEventHookInstalled(NativeMethods.EVENT_OBJECT_FOCUS) || UnsafeNativeMethods.IsWinEventHookInstalled(NativeMethods.EVENT_OBJECT_STATECHANGE)))
3617if (popupRootAutomationPeer.Hwnd == IntPtr.Zero)
3620IntPtr lResult = AutomationInteropProvider.ReturnRawElementProvider(Handle, IntPtr.Zero, new IntPtr(NativeMethods.OBJID_CLIENT), RootProviderForHwnd);
3621if (lResult != IntPtr.Zero)
3626hr = UnsafeNativeMethods.ObjectFromLresult(lResult, ref iid, IntPtr.Zero, ref acc);
3738return DpiUtil.GetProcessDpiAwareness(IntPtr.Zero) == NativeMethods.PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE;
src\Framework\System\Windows\Documents\ImmComposition.cs (22)
242IntPtr hwnd = IntPtr.Zero;
255if (himc != IntPtr.Zero)
423IntPtr lret = IntPtr.Zero;
506if (himc == IntPtr.Zero)
517size = UnsafeNativeMethods.ImmGetCompositionString(new HandleRef(this, himc), NativeMethods.GCS_RESULTSTR, IntPtr.Zero, 0);
534size = UnsafeNativeMethods.ImmGetCompositionString(new HandleRef(this, himc), NativeMethods.GCS_COMPSTR, IntPtr.Zero, 0);
548cursorPos = UnsafeNativeMethods.ImmGetCompositionString(new HandleRef(this, himc), NativeMethods.GCS_CURSORPOS, IntPtr.Zero, 0);
556deltaStart = UnsafeNativeMethods.ImmGetCompositionString(new HandleRef(this, himc), NativeMethods.GCS_DELTASTART, IntPtr.Zero, 0);
564size = UnsafeNativeMethods.ImmGetCompositionString(new HandleRef(this, himc), NativeMethods.GCS_COMPATTR, IntPtr.Zero, 0);
689if (himc != IntPtr.Zero)
887if (himc != IntPtr.Zero)
1434IntPtr lret = IntPtr.Zero;
1474return IntPtr.Zero;
1496if (lParam != IntPtr.Zero)
1666return IntPtr.Zero;
1671return IntPtr.Zero;
1680return IntPtr.Zero;
1922IntPtr hwnd = IntPtr.Zero;
1936IntPtr lret = IntPtr.Zero;
1937if (himc != IntPtr.Zero)
1939IntPtr hwndDefIme = IntPtr.Zero;
1953return (lret != IntPtr.Zero) ? true : false;
src\Framework\System\Windows\Interop\HwndHost.cs (33)
411if (_hwnd.Handle != IntPtr.Zero && (hwndFocus.Handle == _hwnd.Handle || UnsafeNativeMethods.IsChild(_hwnd, hwndFocus)))
457if (( CriticalHandle != IntPtr.Zero) && IsVisible)
697_hwnd = new HandleRef(null, IntPtr.Zero);
755return IntPtr.Zero ;
774IntPtr result = IntPtr.Zero;
809new HandleRef(null, IntPtr.Zero),
855if(CriticalHandle != IntPtr.Zero)
895if(_hwnd.Handle != IntPtr.Zero && UnsafeNativeMethods.IsWindow(_hwnd))
902HandleRef hdcScreen = new HandleRef(this, UnsafeNativeMethods.GetDC(new HandleRef(this, IntPtr.Zero)));
903if(hdcScreen.Handle != IntPtr.Zero)
905HandleRef hdcBitmap = new HandleRef(this, IntPtr.Zero);
906HandleRef hBitmap = new HandleRef(this, IntPtr.Zero);
911if(hdcBitmap.Handle != IntPtr.Zero)
915if(hBitmap.Handle != IntPtr.Zero)
947UnsafeNativeMethods.CriticalRedrawWindow(_hwnd, IntPtr.Zero, IntPtr.Zero, NativeMethods.RDW_INVALIDATE | NativeMethods.RDW_ALLCHILDREN);
952System.Windows.Media.Imaging.BitmapSource bitmapSource = Imaging.CriticalCreateBitmapSourceFromHBitmap(hBitmap.Handle, IntPtr.Zero, Int32Rect.Empty, null, WICBitmapAlphaChannelOption.WICBitmapIgnoreAlpha);
967UnsafeNativeMethods.ReleaseDC(new HandleRef(this, IntPtr.Zero), hdcScreen);
968hdcScreen = new HandleRef(null, IntPtr.Zero);
970if(hBitmap.Handle != IntPtr.Zero)
973hBitmap = new HandleRef(this, IntPtr.Zero);
976if(hdcBitmap.Handle != IntPtr.Zero)
979hdcBitmap = new HandleRef(this, IntPtr.Zero);
1155IntPtr hwndParent = IntPtr.Zero;
1181if(hwndParent != IntPtr.Zero)
1183if(_hwnd.Handle == IntPtr.Zero)
1199else if (!FrameworkAppContextSwitches.Enable2019_12_B || _hwnd.Handle != IntPtr.Zero) // When the "knob" is disabled, it would be as if this condition didn't exist - which is equivalent to the code prior to this change.
1240if(_hwnd.Handle == IntPtr.Zero || !UnsafeNativeMethods.IsWindow(_hwnd))
1311if( CriticalHandle == IntPtr.Zero)
1327_hwnd = new HandleRef(null, IntPtr.Zero);
1346if(_hwnd.Handle != IntPtr.Zero)
1350_hwnd = new HandleRef(null, IntPtr.Zero);
1364IntPtr result = IntPtr.Zero ;
src\Framework\System\Windows\MessageBox.cs (8)
113return ShowCore(IntPtr.Zero, messageBoxText, caption, button, icon, defaultResult, options);
133return ShowCore(IntPtr.Zero, messageBoxText, caption, button, icon, defaultResult, 0);
152return ShowCore(IntPtr.Zero, messageBoxText, caption, button, icon, 0, 0);
170return ShowCore(IntPtr.Zero, messageBoxText, caption, button, MessageBoxImage.None, 0, 0);
185return ShowCore(IntPtr.Zero, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, 0, 0);
200return ShowCore(IntPtr.Zero, messageBoxText, String.Empty, MessageBoxButton.OK, MessageBoxImage.None, 0, 0);
489if (owner != IntPtr.Zero)
496if (owner == IntPtr.Zero)
src\Framework\System\Windows\Shell\WindowChromeWorker.cs (27)
208if (IntPtr.Zero != _hwnd)
301if (_chromeInfo != null && _hwnd != IntPtr.Zero)
321if (_hwnd == IntPtr.Zero || _hwndSource.IsDisposed)
345NativeMethods.SetWindowPos(_hwnd, IntPtr.Zero, 0, 0, 0, 0, _SwpFlags);
628return IntPtr.Zero;
725IntPtr retVal = IntPtr.Zero;
805if (IntPtr.Zero != lRet)
834return IntPtr.Zero;
858return IntPtr.Zero;
891return IntPtr.Zero;
903return IntPtr.Zero;
919return IntPtr.Zero;
950return IntPtr.Zero;
970return IntPtr.Zero;
984return IntPtr.Zero;
1070if (IntPtr.Zero != hmenu)
1117if (IntPtr.Zero == _hwnd || _hwndSource.IsDisposed)
1139NativeMethods.SetWindowPos(_hwnd, IntPtr.Zero, 0, 0, 0, 0, _SwpFlags);
1149NativeMethods.SetWindowRgn(_hwnd, IntPtr.Zero, NativeMethods.IsWindowVisible(_hwnd));
1189IntPtr hrgn = IntPtr.Zero;
1194hrgn = IntPtr.Zero;
1221IntPtr hrgn = IntPtr.Zero;
1271hrgn = IntPtr.Zero;
1315IntPtr hrgn = IntPtr.Zero;
1367if (IntPtr.Zero == _hwnd)
1559if (!Utility.IsOSVistaOrNewer || _hwnd == IntPtr.Zero)
1581NativeMethods.SetWindowPos(_hwnd, IntPtr.Zero, 0, 0, 0, 0, _SwpFlags);
src\Framework\System\Windows\Standard\NativeMethods.cs (27)
1448if (!_hwnd.HasValue || _hwnd.Value == IntPtr.Zero)
1467dc = NativeMethods.CreateDC(deviceName, null, IntPtr.Zero, IntPtr.Zero);
1496IntPtr hPtr = IntPtr.Zero;
1558return GetDC(IntPtr.Zero);
1574_hwnd = IntPtr.Zero,
1670handle = IntPtr.Zero;
1715handle = IntPtr.Zero;
2521IntPtr argv = IntPtr.Zero;
2527if (argv == IntPtr.Zero)
2546Assert.AreEqual(IntPtr.Zero, p);
2577hBitmap = _CreateDIBSectionIntPtr(IntPtr.Zero, ref bitmapInfo, DIB_RGB_COLORS, out ppvBits, hSection, dwOffset);
2608if (IntPtr.Zero == ret)
2631if (IntPtr.Zero == ret)
2654if (IntPtr.Zero == ret)
2709if (IntPtr.Zero == ret)
3086if (retPtr == IntPtr.Zero)
3162IntPtr ret = IntPtr.Zero;
3171if (IntPtr.Zero == ret)
3422if (ret == IntPtr.Zero)
3675if (ret == IntPtr.Zero)
3698if (ret == IntPtr.Zero)
3833if (!_UpdateLayeredWindowIntPtr(hwnd, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, crKey, ref pblend, dwFlags))
src\Framework\System\Windows\SystemCommands.cs (5)
35if (hwnd == IntPtr.Zero || !NativeMethods.IsWindow(hwnd))
40NativeMethods.PostMessage(hwnd, WM.SYSCOMMAND, new IntPtr((int)command), IntPtr.Zero);
117if (hwnd == IntPtr.Zero || !NativeMethods.IsWindow(hwnd))
124uint cmd = NativeMethods.TrackPopupMenuEx(hmenu, TPM_LEFTBUTTON | TPM_RETURNCMD, (int)physicalScreenLocation.X, (int)physicalScreenLocation.Y, hwnd, IntPtr.Zero);
127NativeMethods.PostMessage(hwnd, WM.SYSCOMMAND, new IntPtr(cmd), IntPtr.Zero);
src\Framework\System\Windows\Window.cs (45)
310UnsafeNativeMethods.SendMessage( CriticalHandle, WindowMessage.WM_SYSCOMMAND, (IntPtr)NativeMethods.SC_MOUSEMOVE, IntPtr.Zero);
311UnsafeNativeMethods.SendMessage( CriticalHandle, WindowMessage.WM_LBUTTONUP, IntPtr.Zero, IntPtr.Zero);
361_dialogOwnerHandle = IntPtr.Zero;
371if (_dialogOwnerHandle == IntPtr.Zero)
378if ((_dialogOwnerHandle != IntPtr.Zero) &&
381_dialogOwnerHandle = IntPtr.Zero;
386if (_dialogOwnerHandle != IntPtr.Zero)
391while (_dialogOwnerHandle != IntPtr.Zero)
428if (hWndCapture != IntPtr.Zero)
496if ( (_dialogPreviousActiveHandle != IntPtr.Zero) &&
1355SetOwnerHandle(_ownerWindow != null ? _ownerWindow.CriticalHandle: IntPtr.Zero);
2912new HandleRef(null, IntPtr.Zero),
3005new HandleRef(null, IntPtr.Zero),
3118new HandleRef(null, IntPtr.Zero),
3266return IntPtr.Zero;
3889IntPtr hMonitor = IntPtr.Zero;
3890if ((_ownerHandle == IntPtr.Zero) ||
3902if (hMonitor != IntPtr.Zero)
3926if (Owner.CriticalHandle == IntPtr.Zero)
3944if ((_ownerHandle != IntPtr.Zero) && UnsafeNativeMethods.IsWindow(new HandleRef(null, _ownerHandle)))
3992Debug.Assert(hMonitor != IntPtr.Zero);
4005if (hMonitor == IntPtr.Zero)
4309if (_ownerHandle == ownerHandle && _ownerHandle == IntPtr.Zero)
4317_ownerHandle = (IntPtr.Zero == ownerHandle && !ShowInTaskbar)
4399IntPtr retInt = IntPtr.Zero ;
4647(_dialogPreviousActiveHandle != IntPtr.Zero) &&
6282if (hMonitor != IntPtr.Zero)
6529new HandleRef(null, IntPtr.Zero),
6653IntPtr.Zero,
6683if (_ownerHandle == IntPtr.Zero)
6705SetOwnerHandle(IntPtr.Zero);
6717UnsafeNativeMethods.PostMessage(new HandleRef(this, CriticalHandle), WM_APPLYTASKBARITEMINFO, IntPtr.Zero, IntPtr.Zero);
7080nativeTB.hIcon = IntPtr.Zero;
7205if (manager.Dirty && CriticalHandle != IntPtr.Zero)
7285SetOwnerHandle(IntPtr.Zero);
7618private IntPtr _ownerHandle = IntPtr.Zero; // no need to dispose this
7688private IntPtr _dialogOwnerHandle = IntPtr.Zero;
7844return IntPtr.Zero;
7866if ( monitor != IntPtr.Zero )
8390return DpiUtil.GetProcessDpiAwareness(IntPtr.Zero) == NativeMethods.PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE;
8410var nullHandle = new HandleRef(null, IntPtr.Zero);
8414IntPtr.Zero,
8416IntPtr.Zero);
compmod\microsoft\win32\NativeMethods.cs (22)
58public readonly static HandleRef NullHandleRef = new HandleRef(null, IntPtr.Zero);
110public IntPtr lpReserved = IntPtr.Zero;
111public IntPtr lpDesktop = IntPtr.Zero;
112public IntPtr lpTitle = IntPtr.Zero;
123public IntPtr lpReserved2 = IntPtr.Zero;
124public SafeFileHandle hStdInput = new SafeFileHandle(IntPtr.Zero, false);
125public SafeFileHandle hStdOutput = new SafeFileHandle(IntPtr.Zero, false);
126public SafeFileHandle hStdError = new SafeFileHandle(IntPtr.Zero, false);
161public SafeLocalMemHandle lpSecurityDescriptor = new SafeLocalMemHandle(IntPtr.Zero, false);
233return SetNamedSecurityInfo(directory, 1, 0x04 | 0x10, IntPtr.Zero, IntPtr.Zero, pDacl, IntPtr.Zero);
653public IntPtr hInstance = IntPtr.Zero;
654public IntPtr hIcon = IntPtr.Zero;
655public IntPtr hCursor = IntPtr.Zero;
656public IntPtr hbrBackground = IntPtr.Zero;
657public IntPtr lpszMenuName = IntPtr.Zero;
658public IntPtr lpszClassName = IntPtr.Zero;
667public IntPtr hInstance = IntPtr.Zero;
668public IntPtr hIcon = IntPtr.Zero;
669public IntPtr hCursor = IntPtr.Zero;
670public IntPtr hbrBackground = IntPtr.Zero;
compmod\microsoft\win32\SystemEvents.cs (31)
110private static volatile IntPtr processWinStation = IntPtr.Zero;
117IntPtr hwinsta = IntPtr.Zero;
120if (hwinsta != IntPtr.Zero && processWinStation != hwinsta) {
411if (defWindowProc == IntPtr.Zero) {
444return IntPtr.Zero;
494NativeMethods.WM_CREATETIMER, (IntPtr)interval, IntPtr.Zero);
496if (timerId == IntPtr.Zero) {
505if (windowHandle != IntPtr.Zero) {
512windowHandle = IntPtr.Zero;
518if (UnsafeNativeMethods.IsWindow(href) && DefWndProc != IntPtr.Zero) {
532UnsafeNativeMethods.PostMessage(href, NativeMethods.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
586if (requireHandle && systemEvents.windowHandle == IntPtr.Zero) {
607if (retval != IntPtr.Zero) {
622if (lParam != IntPtr.Zero && Marshal.PtrToStringAuto(lParam).Equals("Policy")) {
625else if (lParam != IntPtr.Zero && Marshal.PtrToStringAuto(lParam).Equals("intl")) {
751Debug.Assert(windowHandle != IntPtr.Zero, "CreateBroadcastWindow failed");
833UnsafeNativeMethods.PostMessage(new HandleRef(systemEvents, systemEvents.windowHandle), threadCallbackMessage, IntPtr.Zero, IntPtr.Zero);
842if (systemEvents.windowHandle != IntPtr.Zero) {
844NativeMethods.WM_KILLTIMER, timerId, IntPtr.Zero);
858return(res == IntPtr.Zero ? IntPtr.Zero: timerId);
1399if (systemEvents != null && systemEvents.windowHandle != IntPtr.Zero) {
1414UnsafeNativeMethods.PostMessage(new HandleRef(systemEvents, systemEvents.windowHandle), NativeMethods.WM_QUIT, IntPtr.Zero, IntPtr.Zero);
1444if (lParam != IntPtr.Zero) {
1479if (lParam != IntPtr.Zero) {
1540return IntPtr.Zero;
1561if (windowHandle != IntPtr.Zero) {
1571int ret = UnsafeNativeMethods.MsgWaitForMultipleObjectsEx(0, IntPtr.Zero, 100, NativeMethods.QS_ALLINPUT, NativeMethods.MWMO_INPUTAVAILABLE);
net\System\Net\_SafeNetHandles.cs (35)
675return UnsafeNclNativeMethods.SafeNetHandles.LocalFree(handle) == IntPtr.Zero;
696return UnsafeNclNativeMethods.SafeNetHandles.GlobalFree(handle) == IntPtr.Zero;
754return UnsafeNclNativeMethods.SafeNetHandles.LocalFree(handle) == IntPtr.Zero;
784if (hKernel32 != IntPtr.Zero &&
785UnsafeNclNativeMethods.GetProcAddress(hKernel32, AddDllDirectory) != IntPtr.Zero) {
810return (ret != IntPtr.Zero);
962certExtension.pszObjId = IntPtr.Zero;
1041get {return HandleHi == IntPtr.Zero && HandleLo == IntPtr.Zero;}
1047HandleHi = IntPtr.Zero;
1048HandleLo = IntPtr.Zero;
1071protected SafeFreeCredentials(): base(IntPtr.Zero, true) {
1177IntPtr.Zero,
1266if (copiedPtr != IntPtr.Zero) {
1412protected SafeDeleteContext(): base(IntPtr.Zero, true) {
1534inUnmanagedBuffer[index].token = IntPtr.Zero;
1556outUnmanagedBuffer[0].token = IntPtr.Zero;
1859inUnmanagedBuffer[index].token = IntPtr.Zero;
1882outUnmanagedBuffer[0].token = IntPtr.Zero;
2117inUnmanagedBuffer[index].token = IntPtr.Zero;
2232inUnmanagedBuffer[index].token = IntPtr.Zero;
2343: this(IntPtr.Zero)
2353: base(IntPtr.Zero, true)
2360get { return handle == IntPtr.Zero; }
2367if (handleSnapshot != IntPtr.Zero)
2371((NativeOverlapped*)handleSnapshot)->InternalHigh = IntPtr.Zero;
2372((NativeOverlapped*)handleSnapshot)->InternalLow = IntPtr.Zero;
2373((NativeOverlapped*)handleSnapshot)->EventHandle = IntPtr.Zero;
2380IntPtr oldHandle = Interlocked.Exchange(ref handle, IntPtr.Zero);
2383if (oldHandle != IntPtr.Zero && !NclUtilities.HasShutdownStarted)
2615IntPtr.Zero,
2727InnerSafeCloseSocket result = UnsafeNclNativeMethods.OSSOCK.WSASocket(addressFamily, socketType, protocolType, IntPtr.Zero, 0, SocketConstructorFlags.WSA_FLAG_OVERLAPPED);
2842return UnsafeNclNativeMethods.SafeNetHandles.LocalFree(handle) == IntPtr.Zero;
2974SetHandle(IntPtr.Zero);
3056errorCode = UnsafeNclNativeMethods.RegistryHelper.RegQueryValueEx(this, name, IntPtr.Zero, out type, blob, ref size);
net\System\Net\Internal.cs (7)
216uint result = UnsafeNetInfoNativeMethods.GetAdaptersAddresses(AddressFamily.Unspecified, (uint)gaaFlags, IntPtr.Zero, SafeLocalFree.Zero, ref size);
222result = UnsafeNetInfoNativeMethods.GetAdaptersAddresses(AddressFamily.Unspecified, (uint)gaaFlags, IntPtr.Zero, buffer, ref size);
228while (nextAdapter != IntPtr.Zero)
233if (adapterAddresses.firstUnicastAddress != IntPtr.Zero)
583SafeNativeOverlapped.Zero, IntPtr.Zero);
606SafeNativeOverlapped.Zero, IntPtr.Zero);
1392rootStore = phMappers = palgSupportedAlgs = certContextArray = IntPtr.Zero;
net\System\Net\NetworkInformation\ping.cs (10)
675error = (int)UnsafeNetInfoNativeMethods.IcmpSendEcho2 (handlePingV4, pingEvent.SafeWaitHandle, IntPtr.Zero, IntPtr.Zero, (uint)address.m_Address, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
678error = (int)UnsafeNetInfoNativeMethods.IcmpSendEcho2 (handlePingV4, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, (uint)address.m_Address, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
686error = (int)UnsafeNetInfoNativeMethods.Icmp6SendEcho2 (handlePingV6, pingEvent.SafeWaitHandle, IntPtr.Zero, IntPtr.Zero, sourceAddr, remoteAddr.m_Buffer, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
689error = (int)UnsafeNetInfoNativeMethods.Icmp6SendEcho2 (handlePingV6, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, sourceAddr, remoteAddr.m_Buffer, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
net\System\Net\Sockets\Socket.cs (48)
1350IntPtr.Zero);
1459!UnsafeNclNativeMethods.OSSOCK.TransmitFile_Blocking2(m_Handle.DangerousGetHandle(), IntPtr.Zero, 0, 0, SafeNativeOverlapped.Zero, asyncResult.TransmitFileBuffers, flags))
1886IntPtr.Zero );
2008IntPtr.Zero,
2009IntPtr.Zero) == SocketError.SocketError)
2206IntPtr.Zero);
2259IntPtr.Zero);
2573IntPtr.Zero);
2650IntPtr.Zero);
2888IntPtr.Zero,
2889IntPtr.Zero,
2890IntPtr.Zero,
2891IntPtr.Zero);
3284if (!DisconnectEx_Blocking(m_Handle.DangerousGetHandle(), IntPtr.Zero, (int) (reuseSocket ? TransmitFileOptions.ReuseSocket : 0), 0))
3530IntPtr.Zero);
3645result = UnsafeNclNativeMethods.OSSOCK.TransmitFile2(m_Handle,IntPtr.Zero,0,0,asyncResult.OverlappedHandle,asyncResult.TransmitFileBuffers,flags);
3764IntPtr.Zero);
4036IntPtr.Zero);
4276IntPtr.Zero);
4392IntPtr.Zero);
4595IntPtr.Zero);
4856IntPtr.Zero );
5998IntPtr.Zero,
6014IntPtr.Zero,
6188IntPtr.Zero,
6189IntPtr.Zero,
6190IntPtr.Zero,
6191IntPtr.Zero);
6926IntPtr.Zero,
7012IntPtr.Zero);
7242IntPtr.Zero);
7469errorCode = UnsafeNclNativeMethods.OSSOCK.WSAEventSelect(m_Handle, IntPtr.Zero, AsyncEventBits.FdNone);
7729(e.m_PtrSingleBuffer != IntPtr.Zero) ? e.m_PtrSingleBuffer : e.m_PtrAcceptBuffer,
7730(e.m_PtrSingleBuffer != IntPtr.Zero) ? e.Count - e.m_AcceptAddressBufferCount : 0,
8001IntPtr.Zero);
8011IntPtr.Zero);
8092IntPtr.Zero);
8103IntPtr.Zero);
8181IntPtr.Zero);
8243IntPtr.Zero);
8253IntPtr.Zero);
8396IntPtr.Zero);
8407IntPtr.Zero);
9524m_PtrAcceptBuffer = IntPtr.Zero;
9538m_PtrSingleBuffer = IntPtr.Zero;
9539m_PtrAcceptBuffer = IntPtr.Zero;
9553m_PtrSingleBuffer = IntPtr.Zero;
9816m_PtrSingleBuffer != IntPtr.Zero ? m_PtrSingleBuffer : m_PtrAcceptBuffer,
net\System\Net\WebSockets\WebSocketProtocolComponent.cs (20)
381IntPtr.Zero,
383IntPtr.Zero,
450IntPtr.Zero,
452IntPtr.Zero,
505IntPtr.Zero,
506IntPtr.Zero,
507IntPtr.Zero);
551IntPtr.Zero,
552IntPtr.Zero,
585Contract.Assert(webSocketPtr != IntPtr.Zero, "'webSocketPtr' MUST NOT be IntPtr.Zero.");
604errorCode = WebSocketSend_Raw(webSocket.SessionHandle, bufferType, ref buffer, IntPtr.Zero);
628errorCode = WebSocketSendWithoutBody_Raw(webSocket.SessionHandle, bufferType, IntPtr.Zero, IntPtr.Zero);
651errorCode = WebSocketReceive_Raw(webSocket.SessionHandle, IntPtr.Zero, IntPtr.Zero);
681actionContext = IntPtr.Zero;
720Contract.Assert(actionContext != IntPtr.Zero, "'actionContext' MUST NOT be IntPtr.Zero.");
792Contract.Assert(httpHeaderPtr != IntPtr.Zero, "'currentHttpHeaderPtr' MUST NOT be IntPtr.Zero.");
799if (httpHeaderNamePtr != IntPtr.Zero)
839Contract.Assert(nativeHeadersPtr != IntPtr.Zero || nativeHeaderCount == 0,
services\monitoring\system\diagnosticts\Process.cs (9)
134private static SafeFileHandle InvalidPipeHandle = new SafeFileHandle(IntPtr.Zero, false);
953responding = NativeMethods.SendMessageTimeout(new HandleRef(this, mainWindow), NativeMethods.WM_NULL, IntPtr.Zero, IntPtr.Zero, NativeMethods.SMTO_ABORTIFHUNG, 5000, out result) != (IntPtr)0;
1244NativeMethods.PostMessage(new HandleRef(this, mainWindowHandle), NativeMethods.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
1481NativeMethods.AdjustTokenPrivileges(new HandleRef(null, hToken), false, tkp, 0, IntPtr.Zero, IntPtr.Zero);
2067IntPtr password = IntPtr.Zero;
2107if( password != IntPtr.Zero) {
sys\system\io\ports\SerialStream.cs (9)
657IntPtr.Zero, // no security attributes
660IntPtr.Zero // hTemplate must be NULL for comm devices
1441Overlapped overlapped = new Overlapped(0, 0, IntPtr.Zero, asyncResult);
1496Overlapped overlapped = new Overlapped(0, 0, IntPtr.Zero, asyncResult);
1554r = UnsafeNativeMethods.ReadFile(_handle, p + offset, count, IntPtr.Zero, overlapped);
1556r = UnsafeNativeMethods.ReadFile(_handle, p + offset, count, out numBytesRead, IntPtr.Zero);
1604r = UnsafeNativeMethods.WriteFile(_handle, p + offset, count, IntPtr.Zero, overlapped);
1606r = UnsafeNativeMethods.WriteFile(_handle, p + offset, count, out numBytesWritten, IntPtr.Zero);
1817if (UnsafeNativeMethods.ClearCommError(handle, ref errors, IntPtr.Zero) == false) {
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\DialogWindow.cs (1)
71return IntPtr.Zero;
fx\src\bid\inc\cs\bidPrivateBase.cs (11)
652NativeMethods.AddMetaText(modID, DefaultCmdSpace, CtlCmd.AddMetaText, IntPtr.Zero, metaStr, IntPtr.Zero);
839ModulePathA = IntPtr.Zero;
900ref extInfo, IntPtr.Zero, IntPtr.Zero );
924NativeMethods.DllBidEntryPoint( ref modID, 0, IntPtr.Zero,
926IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero );
952internal AutoInit() : base(IntPtr.Zero, true) {
fx\src\data\System\Data\OleDb\OleDbCommand.cs (2)
932hr = iopenRowset.Value.OpenRowset(ADP.PtrZero, tableID, ADP.PtrZero, ref ODB.IID_IRowset, 0, IntPtr.Zero, out executeResult);
938hr = iopenRowset.Value.OpenRowset(ADP.PtrZero, tableID, ADP.PtrZero, ref ODB.IID_IRowset, 0, IntPtr.Zero, out executeResult);
fx\src\data\System\Data\OleDb\OleDbWrapper.cs (10)
60hr = GetDataSource(base.handle, IntPtr.Zero, ODB.CLSCTX_ALL, connectionString, ref ODB.IID_IDBInitialize, ref datasrcWrapper);
96IntPtr idbCreateSession = IntPtr.Zero;
141if ((0 <= hr) && (IntPtr.Zero != idbCreateSession)) {
161hr = CreateSession(idbCreateSession, IntPtr.Zero, ref ODB.IID_IDBCreateCommand, ref sessionWrapper);
169hr = CreateSession(idbCreateSession, IntPtr.Zero, ref ODB.IID_IUnknown, ref sessionWrapper);
179if (IntPtr.Zero != idbCreateSession) {
236IntPtr idbCreateCommand = IntPtr.Zero;
247if ((0 <= hresult) && (IntPtr.Zero != idbCreateCommand)) {
259if (IntPtr.Zero != idbCreateCommand) {
307hr = CreateCommand(base.handle, IntPtr.Zero, ref ODB.IID_ICommandText, ref icommandText);
fx\src\data\System\Data\SqlClient\TdsParserSafeHandles.cs (20)
31private SNILoadHandle() : base(IntPtr.Zero, true) {
56return (IntPtr.Zero == base.handle);
61if (base.handle != IntPtr.Zero) {
66base.handle = IntPtr.Zero;
88Debug.Assert(IntPtr.Zero != key, "no key passed to read callback dispatcher?");
89if (IntPtr.Zero != key) {
97stateObj.ReadAsyncCallback(IntPtr.Zero, packet, error);
106Debug.Assert(IntPtr.Zero != key, "no key passed to write callback dispatcher?");
107if (IntPtr.Zero != key) {
115stateObj.WriteAsyncCallback(IntPtr.Zero, packet, error);
138: base(IntPtr.Zero, true) {
159internal SNIHandle(SNINativeMethodWrapper.ConsumerInfo myInfo, SNIHandle parent) : base(IntPtr.Zero, true) {
168return (IntPtr.Zero == base.handle);
175base.handle = IntPtr.Zero;
176if (IntPtr.Zero != ptr) {
193internal SNIPacket(SafeHandle sniHandle) : base(IntPtr.Zero, true) {
195if (IntPtr.Zero == base.handle) {
202return (IntPtr.Zero == base.handle);
209base.handle = IntPtr.Zero;
210if (IntPtr.Zero != ptr) {
System\ServiceModel\Channels\MsmqQueue.cs (11)
504return UnsafeNativeMethods.MQReceiveMessageByLookupId(handle, lookupId, action, nativePropertiesPointer, null, IntPtr.Zero, dtcTransaction);
513return UnsafeNativeMethods.MQReceiveMessageByLookupId(handle, lookupId, action, nativePropertiesPointer, null, IntPtr.Zero, (IntPtr)GetTransactionConstant(transactionMode));
535return UnsafeNativeMethods.MQReceiveMessageByLookupId(handle, lookupId, action, nativePropertiesPointer, null, IntPtr.Zero, (IntPtr)GetTransactionConstant(transactionMode));
558action, nativePropertiesPointer, null, IntPtr.Zero, IntPtr.Zero, dtcTransaction);
568action, nativePropertiesPointer, null, IntPtr.Zero, IntPtr.Zero, (IntPtr)GetTransactionConstant(transactionMode));
591action, nativePropertiesPointer, null, IntPtr.Zero, IntPtr.Zero, (IntPtr)GetTransactionConstant(transactionMode));
724IntPtr.Zero, (IntPtr)UnsafeNativeMethods.MQ_NO_TRANSACTION);
805nativeOverlapped = new Overlapped(0, 0, IntPtr.Zero, this).UnsafePack(onPortedCompletion, this.message.GetBuffersForAsync());
System\ServiceModel\Channels\PipeConnection.cs (11)
279if (UnsafeNativeMethods.ReadFile(this.pipe.DangerousGetHandle(), this.readOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.readOverlapped.NativeOverlapped) == 0)
373if (UnsafeNativeMethods.WriteFile(this.pipe.DangerousGetHandle(), this.writeOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.writeOverlapped.NativeOverlapped) == 0)
651if (sourceProcessHandle == IntPtr.Zero)
1376if (UnsafeNativeMethods.ReadFile(this.pipe.DangerousGetHandle(), this.readOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.readOverlapped.NativeOverlapped) == 0)
1474if (UnsafeNativeMethods.WriteFile(this.pipe.DangerousGetHandle(), this.writeOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.writeOverlapped.NativeOverlapped) == 0)
1810PipeHandle pipeHandle = UnsafeNativeMethods.CreateFile(resolvedAddress, access, 0, IntPtr.Zero,
1811UnsafeNativeMethods.OPEN_EXISTING, flags, IntPtr.Zero);
1820if (UnsafeNativeMethods.SetNamedPipeHandleState(pipeHandle, ref mode, IntPtr.Zero, IntPtr.Zero) == 0)
2890IntPtr.Zero, error, CultureInfo.CurrentCulture.LCID, stringBuilder, stringBuilder.Capacity, IntPtr.Zero) != 0)