836 references to NativeMethods
System (836)
compmod\microsoft\win32\NativeMethods.cs (1)
1164
internal static extern SafeFileMappingHandle CreateFileMapping(IntPtr hFile,
NativeMethods
.SECURITY_ATTRIBUTES lpFileMappingAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, string lpName);
compmod\microsoft\win32\safehandles\SafeUserTokenHandle.cs (1)
44
internal extern static bool DuplicateTokenEx(SafeHandle hToken, int access,
NativeMethods
.SECURITY_ATTRIBUTES tokenAttributes, int impersonationLevel, int tokenType, out SafeUserTokenHandle hNewToken);
compmod\microsoft\win32\SafeNativeMethods.cs (5)
54
public static extern bool GetTextMetrics(IntPtr hDC, [In, Out]
NativeMethods
.TEXTMETRIC tm);
185
NativeMethods
.PDH_RAW_COUNTER pRawValue1,
186
NativeMethods
.PDH_RAW_COUNTER pRawValue2,
187
NativeMethods
.PDH_FMT_COUNTERVALUE pFmtValue
223
internal static extern SafeWaitHandle CreateSemaphore(
NativeMethods
.SECURITY_ATTRIBUTES lpSecurityAttributes, int initialCount, int maximumCount, String name);
compmod\microsoft\win32\SessionSwitchReason.cs (9)
22
ConsoleConnect =
NativeMethods
.WTS_CONSOLE_CONNECT,
27
ConsoleDisconnect =
NativeMethods
.WTS_CONSOLE_DISCONNECT,
32
RemoteConnect =
NativeMethods
.WTS_REMOTE_CONNECT,
37
RemoteDisconnect =
NativeMethods
.WTS_REMOTE_DISCONNECT,
42
SessionLogon =
NativeMethods
.WTS_SESSION_LOGON,
47
SessionLogoff =
NativeMethods
.WTS_SESSION_LOGOFF,
52
SessionLock =
NativeMethods
.WTS_SESSION_LOCK,
57
SessionUnlock =
NativeMethods
.WTS_SESSION_UNLOCK,
62
SessionRemoteControl =
NativeMethods
.WTS_SESSION_REMOTE_CONTROL
compmod\microsoft\win32\SystemEvents.cs (164)
53
private static volatile
NativeMethods
.WNDCLASS staticwndclass;
72
private
NativeMethods
.WndProc windowProc;
73
private
NativeMethods
.ConHndlr consoleHandler;
124
NativeMethods
.USEROBJECTFLAGS flags = new
NativeMethods
.USEROBJECTFLAGS();
126
if (UnsafeNativeMethods.GetUserObjectInformation(new HandleRef(null, hwinsta),
NativeMethods
.UOI_FLAGS, flags, Marshal.SizeOf(flags), ref lengthNeeded)) {
127
if ((flags.dwFlags &
NativeMethods
.WSF_VISIBLE) == 0) {
366
case
NativeMethods
.CTRL_LOGOFF_EVENT:
367
OnSessionEnded((IntPtr) 1, (IntPtr)
NativeMethods
.ENDSESSION_LOGOFF);
370
case
NativeMethods
.CTRL_SHUTDOWN_EVENT:
378
private
NativeMethods
.WNDCLASS WndClass {
393
NativeMethods
.WNDCLASS tempwndclass = new
NativeMethods
.WNDCLASS();
394
tempwndclass.hbrBackground = (IntPtr)(
NativeMethods
.COLOR_WINDOW + 1);
397
windowProc = new
NativeMethods
.WndProc(this.WindowProc);
436
NativeMethods
.WNDCLASS_I wndclassi = new
NativeMethods
.WNDCLASS_I();
463
} while (atom == 0 && Marshal.GetLastWin32Error() ==
NativeMethods
.ERROR_CLASS_ALREADY_EXISTS);
474
NativeMethods
.WS_POPUP,
475
0, 0, 0, 0,
NativeMethods
.NullHandleRef,
NativeMethods
.NullHandleRef,
494
NativeMethods
.WM_CREATETIMER, (IntPtr)interval, IntPtr.Zero);
519
UnsafeNativeMethods.SetWindowLong(href,
NativeMethods
.GWL_WNDPROC, new HandleRef(this, DefWndProc));
523
UnsafeNativeMethods.SetClassLong(href,
NativeMethods
.GCL_WNDPROC, DefWndProc);
532
UnsafeNativeMethods.PostMessage(href,
NativeMethods
.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
608
UnsafeNativeMethods.WTSRegisterSessionNotification(new HandleRef(systemEvents, systemEvents.windowHandle),
NativeMethods
.NOTIFY_FOR_THIS_SESSION);
620
if (msg ==
NativeMethods
.WM_SETTINGCHANGE) {
630
case
NativeMethods
.SPI_SETACCESSTIMEOUT:
631
case
NativeMethods
.SPI_SETFILTERKEYS:
632
case
NativeMethods
.SPI_SETHIGHCONTRAST:
633
case
NativeMethods
.SPI_SETMOUSEKEYS:
634
case
NativeMethods
.SPI_SETSCREENREADER:
635
case
NativeMethods
.SPI_SETSERIALKEYS:
636
case
NativeMethods
.SPI_SETSHOWSOUNDS:
637
case
NativeMethods
.SPI_SETSOUNDSENTRY:
638
case
NativeMethods
.SPI_SETSTICKYKEYS:
639
case
NativeMethods
.SPI_SETTOGGLEKEYS:
643
case
NativeMethods
.SPI_SETDESKWALLPAPER:
644
case
NativeMethods
.SPI_SETFONTSMOOTHING:
645
case
NativeMethods
.SPI_SETCURSORS:
646
case
NativeMethods
.SPI_SETDESKPATTERN:
647
case
NativeMethods
.SPI_SETGRIDGRANULARITY:
648
case
NativeMethods
.SPI_SETWORKAREA:
652
case
NativeMethods
.SPI_ICONHORIZONTALSPACING:
653
case
NativeMethods
.SPI_ICONVERTICALSPACING:
654
case
NativeMethods
.SPI_SETICONMETRICS:
655
case
NativeMethods
.SPI_SETICONS:
656
case
NativeMethods
.SPI_SETICONTITLELOGFONT:
657
case
NativeMethods
.SPI_SETICONTITLEWRAP:
661
case
NativeMethods
.SPI_SETDOUBLECLICKTIME:
662
case
NativeMethods
.SPI_SETDOUBLECLKHEIGHT:
663
case
NativeMethods
.SPI_SETDOUBLECLKWIDTH:
664
case
NativeMethods
.SPI_SETMOUSE:
665
case
NativeMethods
.SPI_SETMOUSEBUTTONSWAP:
666
case
NativeMethods
.SPI_SETMOUSEHOVERHEIGHT:
667
case
NativeMethods
.SPI_SETMOUSEHOVERTIME:
668
case
NativeMethods
.SPI_SETMOUSESPEED:
669
case
NativeMethods
.SPI_SETMOUSETRAILS:
670
case
NativeMethods
.SPI_SETSNAPTODEFBUTTON:
671
case
NativeMethods
.SPI_SETWHEELSCROLLLINES:
672
case
NativeMethods
.SPI_SETCURSORSHADOW:
673
case
NativeMethods
.SPI_SETHOTTRACKING:
674
case
NativeMethods
.SPI_SETTOOLTIPANIMATION:
675
case
NativeMethods
.SPI_SETTOOLTIPFADE:
679
case
NativeMethods
.SPI_SETKEYBOARDDELAY:
680
case
NativeMethods
.SPI_SETKEYBOARDPREF:
681
case
NativeMethods
.SPI_SETKEYBOARDSPEED:
682
case
NativeMethods
.SPI_SETLANGTOGGLE:
686
case
NativeMethods
.SPI_SETMENUDROPALIGNMENT:
687
case
NativeMethods
.SPI_SETMENUFADE:
688
case
NativeMethods
.SPI_SETMENUSHOWDELAY:
689
case
NativeMethods
.SPI_SETMENUANIMATION:
690
case
NativeMethods
.SPI_SETSELECTIONFADE:
694
case
NativeMethods
.SPI_SETLOWPOWERACTIVE:
695
case
NativeMethods
.SPI_SETLOWPOWERTIMEOUT:
696
case
NativeMethods
.SPI_SETPOWEROFFACTIVE:
697
case
NativeMethods
.SPI_SETPOWEROFFTIMEOUT:
701
case
NativeMethods
.SPI_SETSCREENSAVEACTIVE:
702
case
NativeMethods
.SPI_SETSCREENSAVERRUNNING:
703
case
NativeMethods
.SPI_SETSCREENSAVETIMEOUT:
707
case
NativeMethods
.SPI_SETKEYBOARDCUES:
708
case
NativeMethods
.SPI_SETCOMBOBOXANIMATION:
709
case
NativeMethods
.SPI_SETLISTBOXSMOOTHSCROLLING:
710
case
NativeMethods
.SPI_SETGRADIENTCAPTIONS:
711
case
NativeMethods
.SPI_SETUIEFFECTS:
712
case
NativeMethods
.SPI_SETACTIVEWINDOWTRACKING:
713
case
NativeMethods
.SPI_SETACTIVEWNDTRKZORDER:
714
case
NativeMethods
.SPI_SETACTIVEWNDTRKTIMEOUT:
715
case
NativeMethods
.SPI_SETANIMATION:
716
case
NativeMethods
.SPI_SETBORDER:
717
case
NativeMethods
.SPI_SETCARETWIDTH:
718
case
NativeMethods
.SPI_SETDRAGFULLWINDOWS:
719
case
NativeMethods
.SPI_SETDRAGHEIGHT:
720
case
NativeMethods
.SPI_SETDRAGWIDTH:
721
case
NativeMethods
.SPI_SETFOREGROUNDFLASHCOUNT:
722
case
NativeMethods
.SPI_SETFOREGROUNDLOCKTIMEOUT:
723
case
NativeMethods
.SPI_SETMINIMIZEDMETRICS:
724
case
NativeMethods
.SPI_SETNONCLIENTMETRICS:
725
case
NativeMethods
.SPI_SETSHOWIMEUI:
731
else if (msg ==
NativeMethods
.WM_SYSCOLORCHANGE) {
744
consoleHandler = new
NativeMethods
.ConHndlr(this.ConsoleHandlerProc);
844
NativeMethods
.WM_KILLTIMER, timerId, IntPtr.Zero);
857
IntPtr res = UnsafeNativeMethods.SetTimer(new HandleRef(this, windowHandle), new HandleRef(this, timerId), (int) wParam,
NativeMethods
.NullHandleRef);
904
case
NativeMethods
.PBT_APMSUSPEND:
905
case
NativeMethods
.PBT_APMSTANDBY:
909
case
NativeMethods
.PBT_APMRESUMECRITICAL:
910
case
NativeMethods
.PBT_APMRESUMESUSPEND:
911
case
NativeMethods
.PBT_APMRESUMESTANDBY:
915
case
NativeMethods
.PBT_APMBATTERYLOW:
916
case
NativeMethods
.PBT_APMPOWERSTATUSCHANGE:
917
case
NativeMethods
.PBT_APMOEMEVENT:
941
if (((unchecked ((int)(long) lParam)) &
NativeMethods
.ENDSESSION_LOGOFF) != 0) {
960
if ((((long)lParam) &
NativeMethods
.ENDSESSION_LOGOFF) != 0) {
1254
StringBuilder sb = new StringBuilder(
NativeMethods
.MAX_PATH);
1255
UnsafeNativeMethods.GetModuleFileName(
NativeMethods
.NullHandleRef, sb, sb.Capacity);
1263
executablePath =
NativeMethods
.GetLocalPath(ecb);
1414
UnsafeNativeMethods.PostMessage(new HandleRef(systemEvents, systemEvents.windowHandle),
NativeMethods
.WM_QUIT, IntPtr.Zero, IntPtr.Zero);
1441
case
NativeMethods
.WM_SETTINGCHANGE:
1450
UnsafeNativeMethods.PostMessage(new HandleRef(this, windowHandle),
NativeMethods
.WM_REFLECT + msg, wParam, newStringPtr);
1452
case
NativeMethods
.WM_WTSSESSION_CHANGE:
1455
case
NativeMethods
.WM_SYSCOLORCHANGE:
1456
case
NativeMethods
.WM_COMPACTING:
1457
case
NativeMethods
.WM_DISPLAYCHANGE:
1458
case
NativeMethods
.WM_FONTCHANGE:
1459
case
NativeMethods
.WM_PALETTECHANGED:
1460
case
NativeMethods
.WM_TIMECHANGE:
1461
case
NativeMethods
.WM_TIMER:
1462
case
NativeMethods
.WM_THEMECHANGED:
1463
UnsafeNativeMethods.PostMessage(new HandleRef(this, windowHandle),
NativeMethods
.WM_REFLECT + msg, wParam, lParam);
1466
case
NativeMethods
.WM_CREATETIMER:
1469
case
NativeMethods
.WM_KILLTIMER:
1472
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_SETTINGCHANGE:
1474
OnUserPreferenceChanging(msg -
NativeMethods
.WM_REFLECT, wParam, lParam);
1475
OnUserPreferenceChanged(msg -
NativeMethods
.WM_REFLECT, wParam, lParam);
1489
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_SYSCOLORCHANGE:
1490
OnUserPreferenceChanging(msg -
NativeMethods
.WM_REFLECT, wParam, lParam);
1491
OnUserPreferenceChanged(msg -
NativeMethods
.WM_REFLECT, wParam, lParam);
1494
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_THEMECHANGED:
1498
case
NativeMethods
.WM_QUERYENDSESSION:
1501
case
NativeMethods
.WM_ENDSESSION:
1505
case
NativeMethods
.WM_POWERBROADCAST:
1510
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_COMPACTING:
1514
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_DISPLAYCHANGE:
1519
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_FONTCHANGE:
1523
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_PALETTECHANGED:
1527
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_TIMECHANGE:
1531
case
NativeMethods
.WM_REFLECT +
NativeMethods
.WM_TIMER:
1562
NativeMethods
.MSG msg = new
NativeMethods
.MSG();
1571
int ret = UnsafeNativeMethods.MsgWaitForMultipleObjectsEx(0, IntPtr.Zero, 100,
NativeMethods
.QS_ALLINPUT,
NativeMethods
.MWMO_INPUTAVAILABLE);
1573
if (ret ==
NativeMethods
.WAIT_TIMEOUT) {
1577
while (UnsafeNativeMethods.PeekMessage(ref msg,
NativeMethods
.NullHandleRef, 0, 0,
NativeMethods
.PM_REMOVE))
1579
if (msg.message ==
NativeMethods
.WM_QUIT) {
compmod\microsoft\win32\UnsafeNativeMethods.cs (7)
57
public static extern bool GetUserObjectInformation(HandleRef hObj, int nIndex, [MarshalAs(UnmanagedType.LPStruct)]
NativeMethods
.USEROBJECTFLAGS pvBuffer, int nLength, ref int lpnLengthNeeded);
74
public static extern bool GetClassInfo(HandleRef hInst, string lpszClass, [In, Out]
NativeMethods
.WNDCLASS_I wc);
135
public static extern short RegisterClass(
NativeMethods
.WNDCLASS wc);
148
public static extern bool SetConsoleCtrlHandler(
NativeMethods
.ConHndlr handler, int add);
163
public static extern int DispatchMessage([In] ref
NativeMethods
.MSG msg);
167
public static extern bool PeekMessage([In, Out] ref
NativeMethods
.MSG msg, HandleRef hwnd, int msgMin, int msgMax, int remove);
178
public static extern bool TranslateMessage([In, Out] ref
NativeMethods
.MSG msg);
compmod\system\codedom\compiler\Executor.cs (19)
174
NativeMethods
.STARTUPINFO si = new
NativeMethods
.STARTUPINFO();
180
si.dwFlags =
NativeMethods
.STARTF_USESTDHANDLES |
NativeMethods
.STARTF_USESHOWWINDOW;
181
si.wShowWindow =
NativeMethods
.SW_HIDE;
185
si.hStdInput = new SafeFileHandle(UnsafeNativeMethods.GetStdHandle(
NativeMethods
.STD_INPUT_HANDLE), false);
219
success =
NativeMethods
.CreateProcess(
230
if ( pi.hProcess!= (IntPtr)0 && pi.hProcess!= (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
232
if ( pi.hThread != (IntPtr)0 && pi.hThread != (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
242
NativeMethods
.TOKEN_ALL_ACCESS,
244
NativeMethods
.IMPERSONATION_LEVEL_SecurityImpersonation,
245
NativeMethods
.TOKEN_TYPE_TokenPrimary,
253
success =
NativeMethods
.CreateProcessAsUser(
265
if ( pi.hProcess!= (IntPtr)0 && pi.hProcess!= (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
267
if ( pi.hThread != (IntPtr)0 && pi.hThread != (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
301
throw new ExternalException(SR.GetString(SR.ExecTimeout, cmd),
NativeMethods
.WAIT_TIMEOUT);
305
int status =
NativeMethods
.STILL_ACTIVE;
306
if (!
NativeMethods
.GetExitCodeProcess(procSH, out status)) {
321
if (err ==
NativeMethods
.ERROR_NOT_ENOUGH_MEMORY)
compmod\system\codedom\compiler\TempFiles.cs (5)
227
uint HR_ERROR_FILE_EXISTS = unchecked(((uint)0x80070000) |
NativeMethods
.ERROR_FILE_EXISTS);
364
SafeLocalMemHandle.ConvertStringSecurityDescriptorToSecurityDescriptor(sddl,
NativeMethods
.SDDL_REVISION_1, out acl, IntPtr.Zero);
367
NativeMethods
.CreateDirectory(directory, acl);
375
SafeLocalMemHandle.ConvertStringSecurityDescriptorToSecurityDescriptor(sddl,
NativeMethods
.SDDL_REVISION_1, out acl, IntPtr.Zero);
377
NativeMethods
.SetNamedSecurityInfo(directory, acl);
compmod\system\componentmodel\design\CheckoutException.cs (1)
37
public readonly static CheckoutException Canceled = new CheckoutException(SR.GetString(SR.CHECKOUTCanceled),
NativeMethods
.E_ABORT);
compmod\system\diagnostics\assertwrapper.cs (5)
19
using NativeMethods = Microsoft.Win32.
NativeMethods
;
210
IntPtr hFont = SafeNativeMethods.GetStockObject(
NativeMethods
.DEFAULT_GUI_FONT);
212
NativeMethods
.TEXTMETRIC tm = new
NativeMethods
.TEXTMETRIC();
218
int cy = UnsafeNativeMethods.GetSystemMetrics(
NativeMethods
.SM_CYSCREEN);
compmod\System\Runtime\InteropServices\StandardOleMarshalObject.cs (5)
48
if (
NativeMethods
.S_OK == UnsafeNativeMethods.CoGetStandardMarshal(ref riid, pUnk, dwDestContext, IntPtr.Zero, mshlflags, out pStandardMarshal))
68
return
NativeMethods
.S_OK;
125
return
NativeMethods
.E_NOTIMPL;
135
return
NativeMethods
.E_NOTIMPL;
145
return
NativeMethods
.E_NOTIMPL;
net\System\Net\_WinHttpWebProxyDataBuilder.cs (1)
50
if (errorCode == Microsoft.Win32.
NativeMethods
.ERROR_NOT_ENOUGH_MEMORY)
net\System\Net\UnsafeNativeMethods.cs (1)
655
Microsoft.Win32.
NativeMethods
.SECURITY_ATTRIBUTES pSecurityAttributes, uint flags, out HttpRequestQueueV2Handle pReqQueueHandle);
net\System\Net\WinHttpWebProxyFinder.cs (1)
246
if (errorCode ==
NativeMethods
.ERROR_NOT_ENOUGH_MEMORY)
services\io\system\io\FileSystemWatcher.cs (2)
736
NativeMethods
.NullHandleRef);
979
directoryHandle =
NativeMethods
.CreateFile(directory, // Directory name
services\monitoring\system\diagnosticts\CounterSampleCalculator.cs (58)
68
if ((newCounterType !=
NativeMethods
.PERF_RAW_FRACTION) &&
69
(newCounterType !=
NativeMethods
.PERF_COUNTER_RAWCOUNT) &&
70
(newCounterType !=
NativeMethods
.PERF_COUNTER_RAWCOUNT_HEX) &&
71
(newCounterType !=
NativeMethods
.PERF_COUNTER_LARGE_RAWCOUNT) &&
72
(newCounterType !=
NativeMethods
.PERF_COUNTER_LARGE_RAWCOUNT_HEX) &&
73
(newCounterType !=
NativeMethods
.PERF_COUNTER_MULTI_BASE)) {
84
if (newCounterType ==
NativeMethods
.PERF_ELAPSED_TIME)
87
NativeMethods
.PDH_RAW_COUNTER newPdhValue = new
NativeMethods
.PDH_RAW_COUNTER();
88
NativeMethods
.PDH_RAW_COUNTER oldPdhValue = new
NativeMethods
.PDH_RAW_COUNTER();
94
NativeMethods
.PDH_FMT_COUNTERVALUE pdhFormattedValue= new
NativeMethods
.PDH_FMT_COUNTERVALUE();
96
int result = SafeNativeMethods.FormatFromRawValue((uint) newCounterType,
NativeMethods
.PDH_FMT_DOUBLE |
NativeMethods
.PDH_FMT_NOSCALE |
NativeMethods
.PDH_FMT_NOCAP100,
99
if (result !=
NativeMethods
.ERROR_SUCCESS) {
101
if (result ==
NativeMethods
.PDH_CALC_NEGATIVE_VALUE || result ==
NativeMethods
.PDH_CALC_NEGATIVE_DENOMINATOR || result ==
NativeMethods
.PDH_NO_DATA)
114
private static void FillInValues(CounterSample oldSample, CounterSample newSample,
NativeMethods
.PDH_RAW_COUNTER oldPdhValue,
NativeMethods
.PDH_RAW_COUNTER newPdhValue) {
118
case
NativeMethods
.PERF_COUNTER_COUNTER:
119
case
NativeMethods
.PERF_COUNTER_QUEUELEN_TYPE:
120
case
NativeMethods
.PERF_SAMPLE_COUNTER:
121
case
NativeMethods
.PERF_OBJ_TIME_TIMER:
122
case
NativeMethods
.PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE:
130
case
NativeMethods
.PERF_COUNTER_100NS_QUEUELEN_TYPE:
138
case
NativeMethods
.PERF_COUNTER_TIMER:
139
case
NativeMethods
.PERF_COUNTER_TIMER_INV:
140
case
NativeMethods
.PERF_COUNTER_BULK_COUNT:
141
case
NativeMethods
.PERF_COUNTER_LARGE_QUEUELEN_TYPE:
142
case
NativeMethods
.PERF_COUNTER_MULTI_TIMER:
143
case
NativeMethods
.PERF_COUNTER_MULTI_TIMER_INV:
149
if (newCounterType ==
NativeMethods
.PERF_COUNTER_MULTI_TIMER || newCounterType ==
NativeMethods
.PERF_COUNTER_MULTI_TIMER_INV) {
158
if ((newCounterType &
NativeMethods
.PERF_MULTI_COUNTER) ==
NativeMethods
.PERF_MULTI_COUNTER) {
168
case
NativeMethods
.PERF_COUNTER_RAWCOUNT:
169
case
NativeMethods
.PERF_COUNTER_RAWCOUNT_HEX:
170
case
NativeMethods
.PERF_COUNTER_DELTA:
171
case
NativeMethods
.PERF_COUNTER_LARGE_RAWCOUNT:
172
case
NativeMethods
.PERF_COUNTER_LARGE_RAWCOUNT_HEX:
173
case
NativeMethods
.PERF_COUNTER_LARGE_DELTA:
183
case
NativeMethods
.PERF_100NSEC_TIMER:
184
case
NativeMethods
.PERF_100NSEC_TIMER_INV:
185
case
NativeMethods
.PERF_100NSEC_MULTI_TIMER:
186
case
NativeMethods
.PERF_100NSEC_MULTI_TIMER_INV:
192
if ((newCounterType &
NativeMethods
.PERF_MULTI_COUNTER) ==
NativeMethods
.PERF_MULTI_COUNTER) {
200
case
NativeMethods
.PERF_SAMPLE_FRACTION:
201
case
NativeMethods
.PERF_RAW_FRACTION:
202
case
NativeMethods
.PERF_LARGE_RAW_FRACTION:
203
case
NativeMethods
.PERF_PRECISION_SYSTEM_TIMER:
204
case
NativeMethods
.PERF_PRECISION_100NS_TIMER:
205
case
NativeMethods
.PERF_PRECISION_OBJECT_TIMER:
206
case
NativeMethods
.PERF_AVERAGE_TIMER:
207
case
NativeMethods
.PERF_AVERAGE_BULK:
services\monitoring\system\diagnosticts\EventLog.cs (9)
1042
NativeMethods
.RTL_OSVERSIONINFOEX osv = new
NativeMethods
.RTL_OSVERSIONINFOEX();
1044
int ret =
NativeMethods
.RtlGetVersion(out osv);
1286
int flags =
NativeMethods
.FORMAT_MESSAGE_FROM_HMODULE |
NativeMethods
.FORMAT_MESSAGE_ARGUMENT_ARRAY;
1296
flags |=
NativeMethods
.FORMAT_MESSAGE_IGNORE_INSERTS;
1304
int lastError =
NativeMethods
.ERROR_INSUFFICIENT_BUFFER;
1305
while (msgLen == 0 && lastError ==
NativeMethods
.ERROR_INSUFFICIENT_BUFFER) {
1317
if (lastError ==
NativeMethods
.ERROR_INSUFFICIENT_BUFFER)
services\monitoring\system\diagnosticts\EventLogInternal.cs (20)
632
bool success = UnsafeNativeMethods.ClearEventLog(readHandle,
NativeMethods
.NullHandleRef);
637
if (error !=
NativeMethods
.ERROR_FILE_NOT_FOUND)
845
hModule = SafeLibraryHandle.LoadLibraryEx(dllName, IntPtr.Zero,
NativeMethods
.LOAD_LIBRARY_AS_DATAFILE);
850
hModule = SafeLibraryHandle.LoadLibraryEx(dllName, IntPtr.Zero,
NativeMethods
.LOAD_LIBRARY_AS_DATAFILE);
896
bool success = UnsafeNativeMethods.ReadEventLog(readHandle,
NativeMethods
.FORWARDS_READ |
NativeMethods
.SEEK_READ,
907
if (error ==
NativeMethods
.ERROR_INSUFFICIENT_BUFFER || error ==
NativeMethods
.ERROR_EVENTLOG_FILE_CHANGED) {
909
if (error ==
NativeMethods
.ERROR_EVENTLOG_FILE_CHANGED) {
920
success = UnsafeNativeMethods.ReadEventLog(readHandle,
NativeMethods
.FORWARDS_READ |
NativeMethods
.SEEK_READ,
1078
flags =
NativeMethods
.FORWARDS_READ |
NativeMethods
.SEEK_READ;
1082
flags =
NativeMethods
.BACKWARDS_READ |
NativeMethods
.SEEK_READ;
1099
if (error ==
NativeMethods
.ERROR_INSUFFICIENT_BUFFER || error ==
NativeMethods
.ERROR_EVENTLOG_FILE_CHANGED) {
1100
if (error ==
NativeMethods
.ERROR_EVENTLOG_FILE_CHANGED) {
1113
success = UnsafeNativeMethods.ReadEventLog(readHandle,
NativeMethods
.FORWARDS_READ |
NativeMethods
.SEEK_READ, index,
services\monitoring\system\diagnosticts\FileVersionInfo.cs (12)
156
return (fileFlags &
NativeMethods
.VS_FF_DEBUG) != 0;
166
return (fileFlags &
NativeMethods
.VS_FF_PATCHED) != 0;
175
return (fileFlags &
NativeMethods
.VS_FF_PRIVATEBUILD) != 0;
185
return (fileFlags &
NativeMethods
.VS_FF_PRERELEASE) != 0;
194
return (fileFlags &
NativeMethods
.VS_FF_SPECIALBUILD) != 0;
326
private static
NativeMethods
.VS_FIXEDFILEINFO GetFixedFileInfo(IntPtr memPtr) {
331
NativeMethods
.VS_FIXEDFILEINFO fixedFileInfo = new
NativeMethods
.VS_FIXEDFILEINFO();
336
return new
NativeMethods
.VS_FIXEDFILEINFO();
399
NativeMethods
.VS_FIXEDFILEINFO ffi = GetFixedFileInfo(memIntPtr);
495
return
NativeMethods
.Util.HIWORD(dword);
499
return
NativeMethods
.Util.LOWORD(dword);
services\monitoring\system\diagnosticts\PerformanceCounterCategory.cs (16)
324
if ( (currentSampleType ==
NativeMethods
.PERF_AVERAGE_BULK) ||
325
(currentSampleType ==
NativeMethods
.PERF_100NSEC_MULTI_TIMER) ||
326
(currentSampleType ==
NativeMethods
.PERF_100NSEC_MULTI_TIMER_INV) ||
327
(currentSampleType ==
NativeMethods
.PERF_COUNTER_MULTI_TIMER) ||
328
(currentSampleType ==
NativeMethods
.PERF_COUNTER_MULTI_TIMER_INV) ||
329
(currentSampleType ==
NativeMethods
.PERF_RAW_FRACTION) ||
330
(currentSampleType ==
NativeMethods
.PERF_SAMPLE_FRACTION) ||
331
(currentSampleType ==
NativeMethods
.PERF_AVERAGE_TIMER)) {
350
(currentSampleType !=
NativeMethods
.PERF_AVERAGE_BULK) &&
351
(currentSampleType !=
NativeMethods
.PERF_100NSEC_MULTI_TIMER) &&
352
(currentSampleType !=
NativeMethods
.PERF_100NSEC_MULTI_TIMER_INV) &&
353
(currentSampleType !=
NativeMethods
.PERF_COUNTER_MULTI_TIMER) &&
354
(currentSampleType !=
NativeMethods
.PERF_COUNTER_MULTI_TIMER_INV) &&
355
(currentSampleType !=
NativeMethods
.PERF_RAW_FRACTION) &&
356
(currentSampleType !=
NativeMethods
.PERF_SAMPLE_FRACTION) &&
357
(currentSampleType !=
NativeMethods
.PERF_AVERAGE_TIMER))
services\monitoring\system\diagnosticts\PerformanceCounterLib.cs (40)
103
NativeMethods
.PERF_DATA_BLOCK dataBlock = new
NativeMethods
.PERF_DATA_BLOCK();
115
NativeMethods
.PERF_OBJECT_TYPE perfObject = new
NativeMethods
.PERF_OBJECT_TYPE();
128
NativeMethods
.PERF_COUNTER_DEFINITION perfCounter = new
NativeMethods
.PERF_COUNTER_DEFINITION();
1065
return (type ==
NativeMethods
.PERF_AVERAGE_BASE ||
1066
type ==
NativeMethods
.PERF_COUNTER_MULTI_BASE ||
1067
type ==
NativeMethods
.PERF_RAW_BASE ||
1068
type ==
NativeMethods
.PERF_LARGE_RAW_BASE ||
1069
type ==
NativeMethods
.PERF_SAMPLE_BASE);
1158
if (res ==
NativeMethods
.ERROR_ACCESS_DENIED) {
1200
throw new Win32Exception(
NativeMethods
.ERROR_ACCESS_DENIED);
1240
case
NativeMethods
.RPC_S_CALL_FAILED:
1241
case
NativeMethods
.ERROR_INVALID_HANDLE:
1242
case
NativeMethods
.RPC_S_SERVER_UNAVAILABLE:
1244
goto case
NativeMethods
.WAIT_TIMEOUT;
1246
case
NativeMethods
.WAIT_TIMEOUT:
1247
case
NativeMethods
.ERROR_NOT_READY:
1248
case
NativeMethods
.ERROR_LOCK_FAILED:
1249
case
NativeMethods
.ERROR_BUSY:
1280
internal CategoryEntry(
NativeMethods
.PERF_OBJECT_TYPE perfObject) {
1304
NativeMethods
.PERF_DATA_BLOCK dataBlock = new
NativeMethods
.PERF_DATA_BLOCK();
1322
NativeMethods
.PERF_OBJECT_TYPE perfObject = null;
1325
perfObject = new
NativeMethods
.PERF_OBJECT_TYPE();
1355
NativeMethods
.PERF_COUNTER_DEFINITION perfCounter = new
NativeMethods
.PERF_COUNTER_DEFINITION();
1363
if (currentSampleType !=
NativeMethods
.PERF_COUNTER_NODATA)
1387
NativeMethods
.PERF_INSTANCE_DEFINITION perfInstance = new
NativeMethods
.PERF_INSTANCE_DEFINITION();
1429
NativeMethods
.PERF_DATA_BLOCK dataBlock = new
NativeMethods
.PERF_DATA_BLOCK();
1434
NativeMethods
.PERF_OBJECT_TYPE perfObject = null;
1437
perfObject = new
NativeMethods
.PERF_OBJECT_TYPE();
1460
NativeMethods
.PERF_COUNTER_DEFINITION perfCounter = new
NativeMethods
.PERF_COUNTER_DEFINITION();
1467
NativeMethods
.PERF_INSTANCE_DEFINITION perfInstance = new
NativeMethods
.PERF_INSTANCE_DEFINITION();
1535
internal CounterDefinitionSample(
NativeMethods
.PERF_COUNTER_DEFINITION perfCounter, CategorySample categorySample, int instanceNumber) {
services\monitoring\system\diagnosticts\PerformanceCounterType.cs (28)
18
NumberOfItems32 =
NativeMethods
.PERF_COUNTER_RAWCOUNT,
19
NumberOfItems64 =
NativeMethods
.PERF_COUNTER_LARGE_RAWCOUNT,
20
NumberOfItemsHEX32 =
NativeMethods
.PERF_COUNTER_RAWCOUNT_HEX,
21
NumberOfItemsHEX64 =
NativeMethods
.PERF_COUNTER_LARGE_RAWCOUNT_HEX,
22
RateOfCountsPerSecond32 =
NativeMethods
.PERF_COUNTER_COUNTER,
23
RateOfCountsPerSecond64 =
NativeMethods
.PERF_COUNTER_BULK_COUNT,
24
CountPerTimeInterval32 =
NativeMethods
.PERF_COUNTER_QUEUELEN_TYPE,
25
CountPerTimeInterval64 =
NativeMethods
.PERF_COUNTER_LARGE_QUEUELEN_TYPE,
26
RawFraction =
NativeMethods
.PERF_RAW_FRACTION,
27
RawBase =
NativeMethods
.PERF_RAW_BASE,
29
AverageTimer32 =
NativeMethods
.PERF_AVERAGE_TIMER,
30
AverageBase =
NativeMethods
.PERF_AVERAGE_BASE,
31
AverageCount64 =
NativeMethods
.PERF_AVERAGE_BULK,
33
SampleFraction =
NativeMethods
.PERF_SAMPLE_FRACTION,
34
SampleCounter =
NativeMethods
.PERF_SAMPLE_COUNTER,
35
SampleBase =
NativeMethods
.PERF_SAMPLE_BASE,
37
CounterTimer =
NativeMethods
.PERF_COUNTER_TIMER,
38
CounterTimerInverse =
NativeMethods
.PERF_COUNTER_TIMER_INV,
39
Timer100Ns =
NativeMethods
.PERF_100NSEC_TIMER,
40
Timer100NsInverse =
NativeMethods
.PERF_100NSEC_TIMER_INV,
41
ElapsedTime =
NativeMethods
.PERF_ELAPSED_TIME,
42
CounterMultiTimer =
NativeMethods
.PERF_COUNTER_MULTI_TIMER,
43
CounterMultiTimerInverse=
NativeMethods
.PERF_COUNTER_MULTI_TIMER_INV,
44
CounterMultiTimer100Ns =
NativeMethods
.PERF_100NSEC_MULTI_TIMER,
45
CounterMultiTimer100NsInverse =
NativeMethods
.PERF_100NSEC_MULTI_TIMER_INV,
46
CounterMultiBase =
NativeMethods
.PERF_COUNTER_MULTI_BASE,
48
CounterDelta32 =
NativeMethods
.PERF_COUNTER_DELTA,
49
CounterDelta64 =
NativeMethods
.PERF_COUNTER_LARGE_DELTA
services\monitoring\system\diagnosticts\Process.cs (128)
154
this.m_processAccess =
NativeMethods
.PROCESS_ALL_ACCESS;
167
this.m_processAccess =
NativeMethods
.PROCESS_ALL_ACCESS;
229
handle = GetProcessHandle(
NativeMethods
.PROCESS_QUERY_INFORMATION |
NativeMethods
.SYNCHRONIZE, false);
243
if (
NativeMethods
.GetExitCodeProcess(handle, out exitCode) && exitCode !=
NativeMethods
.STILL_ACTIVE) {
270
if (!
NativeMethods
.GetExitCodeProcess(handle, out exitCode))
296
int access =
NativeMethods
.PROCESS_QUERY_INFORMATION;
299
access =
NativeMethods
.PROCESS_QUERY_LIMITED_INFORMATION;
309
if (!
NativeMethods
.GetProcessTimes(handle,
457
int length =
NativeMethods
.GetWindowTextLength(new HandleRef(this, handle)) * 2;
459
NativeMethods
.GetWindowText(new HandleRef(this, handle), builder, builder.Capacity);
730
handle = GetProcessHandle(
NativeMethods
.PROCESS_QUERY_INFORMATION);
732
if (!
NativeMethods
.GetProcessPriorityBoost(handle, out disabled)) {
748
handle = GetProcessHandle(
NativeMethods
.PROCESS_SET_INFORMATION);
749
if (!
NativeMethods
.SetProcessPriorityBoost(handle, !value))
772
handle = GetProcessHandle(
NativeMethods
.PROCESS_QUERY_INFORMATION);
773
int value =
NativeMethods
.GetPriorityClass(handle);
802
handle = GetProcessHandle(
NativeMethods
.PROCESS_SET_INFORMATION);
803
if (!
NativeMethods
.SetPriorityClass(handle, (int)value)) {
903
handle = GetProcessHandle(
NativeMethods
.PROCESS_QUERY_INFORMATION);
906
if (!
NativeMethods
.GetProcessAffinityMask(handle, out processAffinity, out systemAffinity))
922
handle = GetProcessHandle(
NativeMethods
.PROCESS_SET_INFORMATION);
923
if (!
NativeMethods
.SetProcessAffinityMask(handle, value))
953
responding =
NativeMethods
.SendMessageTimeout(new HandleRef(this, mainWindow),
NativeMethods
.WM_NULL, IntPtr.Zero, IntPtr.Zero,
NativeMethods
.SMTO_ABORTIFHUNG, 5000, out result) != (IntPtr)0;
1242
int style =
NativeMethods
.GetWindowLong(new HandleRef(this, mainWindowHandle),
NativeMethods
.GWL_STYLE);
1243
if ((style &
NativeMethods
.WS_DISABLED) != 0) return false;
1244
NativeMethods
.PostMessage(new HandleRef(this, mainWindowHandle),
NativeMethods
.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
1435
handle = GetProcessHandle(
NativeMethods
.PROCESS_QUERY_INFORMATION);
1438
if (!
NativeMethods
.GetProcessWorkingSetSize(handle, out min, out max)) {
1453
SetPrivilege("SeDebugPrivilege",
NativeMethods
.SE_PRIVILEGE_ENABLED);
1461
NativeMethods
.LUID debugValue = new
NativeMethods
.LUID();
1464
IntPtr processHandle =
NativeMethods
.GetCurrentProcess();
1468
if (!
NativeMethods
.OpenProcessToken(new HandleRef(null, processHandle),
NativeMethods
.TOKEN_ADJUST_PRIVILEGES, out hToken)) {
1473
if (!
NativeMethods
.LookupPrivilegeValue(null, privilegeName, out debugValue)) {
1477
NativeMethods
.TokenPrivileges tkp = new
NativeMethods
.TokenPrivileges();
1481
NativeMethods
.AdjustTokenPrivileges(new HandleRef(null, hToken), false, tkp, 0, IntPtr.Zero, IntPtr.Zero);
1485
if (Marshal.GetLastWin32Error() !=
NativeMethods
.ERROR_SUCCESS) {
1625
return new Process(".", false,
NativeMethods
.GetCurrentProcessId(), null);
1701
if (throwIfExited && (access &
NativeMethods
.PROCESS_QUERY_INFORMATION) != 0) {
1702
if (
NativeMethods
.GetExitCodeProcess(handle, out exitCode) && exitCode !=
NativeMethods
.STILL_ACTIVE) {
1726
return OpenProcessHandle(
NativeMethods
.PROCESS_ALL_ACCESS);
1817
handle = GetProcessHandle(
NativeMethods
.PROCESS_QUERY_INFORMATION |
NativeMethods
.PROCESS_SET_QUOTA);
1820
if (!
NativeMethods
.GetProcessWorkingSetSize(handle, out min, out max)) {
1841
if (!
NativeMethods
.SetProcessWorkingSetSize(handle, min, max)) {
1846
if (!
NativeMethods
.GetProcessWorkingSetSize(handle, out min, out max)) {
1891
private static void CreatePipeWithSecurityAttributes(out SafeFileHandle hReadPipe, out SafeFileHandle hWritePipe,
NativeMethods
.SECURITY_ATTRIBUTES lpPipeAttributes, int nSize) {
1892
bool ret =
NativeMethods
.CreatePipe(out hReadPipe, out hWritePipe, lpPipeAttributes, nSize);
1908
NativeMethods
.SECURITY_ATTRIBUTES securityAttributesParent = new
NativeMethods
.SECURITY_ATTRIBUTES();
1927
if (!
NativeMethods
.DuplicateHandle(new HandleRef(this,
NativeMethods
.GetCurrentProcess()),
1929
new HandleRef(this,
NativeMethods
.GetCurrentProcess()),
1933
NativeMethods
.DUPLICATE_SAME_ACCESS)) {
1995
NativeMethods
.STARTUPINFO startupInfo = new
NativeMethods
.STARTUPINFO();
2013
startupInfo.hStdInput = new SafeFileHandle(
NativeMethods
.GetStdHandle(
NativeMethods
.STD_INPUT_HANDLE), false);
2019
startupInfo.hStdOutput = new SafeFileHandle(
NativeMethods
.GetStdHandle(
NativeMethods
.STD_OUTPUT_HANDLE), false);
2025
startupInfo.hStdError = new SafeFileHandle(
NativeMethods
.GetStdHandle(
NativeMethods
.STD_ERROR_HANDLE), false);
2028
startupInfo.dwFlags =
NativeMethods
.STARTF_USESTDHANDLES;
2034
if (startInfo.CreateNoWindow) creationFlags |=
NativeMethods
.CREATE_NO_WINDOW;
2043
creationFlags |=
NativeMethods
.CREATE_UNICODE_ENVIRONMENT;
2062
NativeMethods
.LogonFlags logonFlags = (
NativeMethods
.LogonFlags)0;
2064
logonFlags =
NativeMethods
.LogonFlags.LOGON_WITH_PROFILE;
2079
retVal =
NativeMethods
.CreateProcessWithLogonW(
2094
if ( processInfo.hProcess!= (IntPtr)0 && processInfo.hProcess!= (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
2096
if ( processInfo.hThread != (IntPtr)0 && processInfo.hThread != (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
2100
if (errorCode ==
NativeMethods
.ERROR_BAD_EXE_FORMAT || errorCode ==
NativeMethods
.ERROR_EXE_MACHINE_TYPE_MISMATCH) {
2115
retVal =
NativeMethods
.CreateProcess (
2129
if ( processInfo.hProcess!= (IntPtr)0 && processInfo.hProcess!= (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
2131
if ( processInfo.hThread != (IntPtr)0 && processInfo.hThread != (IntPtr)
NativeMethods
.INVALID_HANDLE_VALUE)
2135
if (errorCode ==
NativeMethods
.ERROR_BAD_EXE_FORMAT || errorCode ==
NativeMethods
.ERROR_EXE_MACHINE_TYPE_MISMATCH) {
2208
NativeMethods
.ShellExecuteInfo shellExecuteInfo = new
NativeMethods
.ShellExecuteInfo();
2209
shellExecuteInfo.fMask =
NativeMethods
.SEE_MASK_NOCLOSEPROCESS;
2214
shellExecuteInfo.fMask |=
NativeMethods
.SEE_MASK_FLAG_NO_UI;
2219
shellExecuteInfo.nShow =
NativeMethods
.SW_HIDE;
2222
shellExecuteInfo.nShow =
NativeMethods
.SW_SHOWMINIMIZED;
2225
shellExecuteInfo.nShow =
NativeMethods
.SW_SHOWMAXIMIZED;
2228
shellExecuteInfo.nShow =
NativeMethods
.SW_SHOWNORMAL;
2243
shellExecuteInfo.fMask |=
NativeMethods
.SEE_MASK_FLAG_DDEWAIT;
2250
case
NativeMethods
.SE_ERR_FNF: error =
NativeMethods
.ERROR_FILE_NOT_FOUND; break;
2251
case
NativeMethods
.SE_ERR_PNF: error =
NativeMethods
.ERROR_PATH_NOT_FOUND; break;
2252
case
NativeMethods
.SE_ERR_ACCESSDENIED: error =
NativeMethods
.ERROR_ACCESS_DENIED; break;
2253
case
NativeMethods
.SE_ERR_OOM: error =
NativeMethods
.ERROR_NOT_ENOUGH_MEMORY; break;
2254
case
NativeMethods
.SE_ERR_DDEFAIL:
2255
case
NativeMethods
.SE_ERR_DDEBUSY:
2256
case
NativeMethods
.SE_ERR_DDETIMEOUT: error =
NativeMethods
.ERROR_DDE_FAIL; break;
2257
case
NativeMethods
.SE_ERR_SHARE: error =
NativeMethods
.ERROR_SHARING_VIOLATION; break;
2258
case
NativeMethods
.SE_ERR_NOASSOC: error =
NativeMethods
.ERROR_NO_ASSOCIATION; break;
2259
case
NativeMethods
.SE_ERR_DLLNOTFOUND: error =
NativeMethods
.ERROR_DLL_NOT_FOUND; break;
2263
if( error ==
NativeMethods
.ERROR_BAD_EXE_FORMAT || error ==
NativeMethods
.ERROR_EXE_MACHINE_TYPE_MISMATCH) {
2369
handle = GetProcessHandle(
NativeMethods
.PROCESS_TERMINATE);
2370
if (!
NativeMethods
.TerminateProcess(handle, -1))
2431
handle = GetProcessHandle(
NativeMethods
.SYNCHRONIZE, false);
2497
handle = GetProcessHandle(
NativeMethods
.SYNCHRONIZE |
NativeMethods
.PROCESS_QUERY_INFORMATION);
2498
int ret =
NativeMethods
.WaitForInputIdle(handle, milliseconds);
2500
case
NativeMethods
.WAIT_OBJECT_0:
2503
case
NativeMethods
.WAIT_TIMEOUT:
2506
case
NativeMethods
.WAIT_FAILED:
2834
private
NativeMethods
.ShellExecuteInfo _executeInfo;
2838
public ShellExecuteHelper(
NativeMethods
.ShellExecuteInfo executeInfo) {
2845
if (!(_succeeded =
NativeMethods
.ShellExecuteEx(_executeInfo))) {
services\monitoring\system\diagnosticts\ProcessManager.cs (84)
38
NativeMethods
.EnumThreadWindowsCallback callback = new
NativeMethods
.EnumThreadWindowsCallback(this.EnumWindowsCallback);
39
NativeMethods
.EnumWindows(callback, IntPtr.Zero);
49
if (
NativeMethods
.GetWindow(new HandleRef(this, handle),
NativeMethods
.GW_OWNER) != (IntPtr)0 || !
NativeMethods
.IsWindowVisible(new HandleRef(this, handle)))
70
NativeMethods
.GetWindowThreadProcessId(new HandleRef(this, handle), out processId);
100
NativeMethods
.LUID luid = new
NativeMethods
.LUID();
101
if (!
NativeMethods
.LookupPrivilegeValue(null, "SeDebugPrivilege", out luid)) {
107
if( !
NativeMethods
.OpenProcessToken(
108
new HandleRef(null,
NativeMethods
.GetCurrentProcess()),
114
NativeMethods
.TokenPrivileges tp = new
NativeMethods
.TokenPrivileges();
117
tp.Attributes =
NativeMethods
.SE_PRIVILEGE_ENABLED;
120
NativeMethods
.AdjustTokenPrivileges(new HandleRef(null,tokenHandle), false, tp, 0, IntPtr.Zero, IntPtr.Zero);
264
SafeProcessHandle processHandle =
NativeMethods
.OpenProcess(access, false, processId);
290
SafeThreadHandle threadHandle =
NativeMethods
.OpenThread(access, false, threadId);
293
if (result ==
NativeMethods
.ERROR_INVALID_PARAMETER)
356
handle =
NativeMethods
.CreateToolhelp32Snapshot(
NativeMethods
.TH32CS_SNAPPROCESS |
NativeMethods
.TH32CS_SNAPTHREAD, 0);
358
int entrySize = (int)Marshal.SizeOf(typeof(
NativeMethods
.WinProcessEntry));
359
int bufferSize = entrySize +
NativeMethods
.WinProcessEntry.sizeofFileName;
367
if (
NativeMethods
.Process32First(handleRef, bufferPtr)) {
369
NativeMethods
.WinProcessEntry process = new
NativeMethods
.WinProcessEntry();
381
while (
NativeMethods
.Process32Next(handleRef, bufferPtr));
384
NativeMethods
.WinThreadEntry thread = new
NativeMethods
.WinThreadEntry();
386
if (
NativeMethods
.Thread32First(handleRef, thread)) {
395
while (
NativeMethods
.Thread32Next(handleRef, thread));
426
handle =
NativeMethods
.CreateToolhelp32Snapshot(
NativeMethods
.TH32CS_SNAPMODULE, processId);
428
int entrySize = Marshal.SizeOf(typeof(
NativeMethods
.WinModuleEntry));
429
int bufferSize = entrySize +
NativeMethods
.WinModuleEntry.sizeofFileName +
NativeMethods
.WinModuleEntry.sizeofModuleName;
437
if (
NativeMethods
.Module32First(handleRef, bufferPtr)) {
439
NativeMethods
.WinModuleEntry module = new
NativeMethods
.WinModuleEntry();
443
moduleInfo.fileName = Marshal.PtrToStringAnsi((IntPtr)((long)bufferPtr + entrySize +
NativeMethods
.WinModuleEntry.sizeofModuleName));
450
while (
NativeMethods
.Module32Next(handleRef, bufferPtr));
535
if (!
NativeMethods
.EnumProcesses(processIds, processIds.Length * 4, out size))
579
processHandle = ProcessManager.OpenProcess(processId,
NativeMethods
.PROCESS_QUERY_INFORMATION |
NativeMethods
.PROCESS_VM_READ, true);
588
enumResult =
NativeMethods
.EnumProcessModules(processHandle, moduleHandlesArrayHandle.AddrOfPinnedObject(), moduleHandles.Length * IntPtr.Size, ref moduleCount);
613
hCurProcess = ProcessManager.OpenProcess(
NativeMethods
.GetCurrentProcessId(),
NativeMethods
.PROCESS_QUERY_INFORMATION, true);
628
throw new Win32Exception(
NativeMethods
.ERROR_PARTIAL_COPY, SR.GetString(SR.EnumProcessModuleFailedDueToWow));
640
enumResult =
NativeMethods
.EnumProcessModules(processHandle, moduleHandlesArrayHandle.AddrOfPinnedObject(), moduleHandles.Length * IntPtr.Size, ref moduleCount);
668
NativeMethods
.NtModuleInfo ntModuleInfo = new
NativeMethods
.NtModuleInfo();
669
if (!
NativeMethods
.GetModuleInformation(processHandle, new HandleRef(null, moduleHandle), ntModuleInfo, Marshal.SizeOf(ntModuleInfo)))
676
ret =
NativeMethods
.GetModuleBaseName(processHandle, new HandleRef(null, moduleHandle), baseName, baseName.Capacity * 2);
681
ret =
NativeMethods
.GetModuleFileNameEx(processHandle, new HandleRef(null, moduleHandle), fileName, fileName.Capacity * 2);
702
if (e.NativeErrorCode ==
NativeMethods
.ERROR_INVALID_HANDLE || e.NativeErrorCode ==
NativeMethods
.ERROR_PARTIAL_COPY)
736
NativeMethods
.NtProcessBasicInfo info = new
NativeMethods
.NtProcessBasicInfo();
737
int status =
NativeMethods
.NtQueryInformationProcess(processHandle,
NativeMethods
.NtQueryProcessBasicInfo, info, (int)Marshal.SizeOf(info), null);
799
NativeMethods
.PERF_DATA_BLOCK dataBlock = new
NativeMethods
.PERF_DATA_BLOCK();
802
NativeMethods
.PERF_INSTANCE_DEFINITION instance = new
NativeMethods
.PERF_INSTANCE_DEFINITION();
803
NativeMethods
.PERF_COUNTER_BLOCK counterBlock = new
NativeMethods
.PERF_COUNTER_BLOCK();
805
NativeMethods
.PERF_OBJECT_TYPE type = new
NativeMethods
.PERF_OBJECT_TYPE();
812
NativeMethods
.PERF_COUNTER_DEFINITION counter = new
NativeMethods
.PERF_COUNTER_DEFINITION();
823
NativeMethods
.PERF_COUNTER_DEFINITION[] counters = new
NativeMethods
.PERF_COUNTER_DEFINITION[counterList.Count];
889
static ThreadInfo GetThreadInfo(
NativeMethods
.PERF_OBJECT_TYPE type, IntPtr instancePtr,
NativeMethods
.PERF_COUNTER_DEFINITION[] counters) {
892
NativeMethods
.PERF_COUNTER_DEFINITION counter = counters[i];
948
static ProcessInfo GetProcessInfo(
NativeMethods
.PERF_OBJECT_TYPE type, IntPtr instancePtr,
NativeMethods
.PERF_COUNTER_DEFINITION[] counters) {
951
NativeMethods
.PERF_COUNTER_DEFINITION counter = counters[i];
1005
if ((counterType &
NativeMethods
.NtPerfCounterSizeLarge) != 0)
1092
status =
NativeMethods
.NtQuerySystemInformation(
1093
NativeMethods
.NtQuerySystemProcessInformation,
1098
if ((uint)status ==
NativeMethods
.STATUS_INFO_LENGTH_MISMATCH)
1104
} while ((uint)status ==
NativeMethods
.STATUS_INFO_LENGTH_MISMATCH);
services\monitoring\system\diagnosticts\ProcessThread.cs (15)
118
threadHandle = OpenThreadHandle(
NativeMethods
.THREAD_SET_INFORMATION);
119
if (
NativeMethods
.SetThreadIdealProcessor(threadHandle, value) < 0) {
139
threadHandle = OpenThreadHandle(
NativeMethods
.THREAD_QUERY_INFORMATION);
141
if (!
NativeMethods
.GetThreadPriorityBoost(threadHandle, out disabled)) {
156
threadHandle = OpenThreadHandle(
NativeMethods
.THREAD_SET_INFORMATION);
157
if (!
NativeMethods
.SetThreadPriorityBoost(threadHandle, !value))
179
threadHandle = OpenThreadHandle(
NativeMethods
.THREAD_QUERY_INFORMATION);
180
int value =
NativeMethods
.GetThreadPriority(threadHandle);
198
threadHandle = OpenThreadHandle(
NativeMethods
.THREAD_SET_INFORMATION);
199
if (!
NativeMethods
.SetThreadPriority(threadHandle, (int)value)) {
359
threadHandle = OpenThreadHandle(
NativeMethods
.THREAD_SET_INFORMATION |
NativeMethods
.THREAD_QUERY_INFORMATION);
360
if (
NativeMethods
.SetThreadAffinityMask(threadHandle, new HandleRef(this, value)) == IntPtr.Zero) {
375
threadHandle = OpenThreadHandle(
NativeMethods
.THREAD_QUERY_INFORMATION);
377
if (!
NativeMethods
.GetThreadTimes(threadHandle,
services\monitoring\system\diagnosticts\processwaithandle.cs (4)
15
bool succeeded =
NativeMethods
.DuplicateHandle(
16
new HandleRef(this,
NativeMethods
.GetCurrentProcess()),
18
new HandleRef(this,
NativeMethods
.GetCurrentProcess()),
22
NativeMethods
.DUPLICATE_SAME_ACCESS);
services\monitoring\system\diagnosticts\SharedPerformanceCounter.cs (21)
51
int pid =
NativeMethods
.GetCurrentProcessId();
60
using (SafeProcessHandle procHandle = SafeProcessHandle.OpenProcess(
NativeMethods
.PROCESS_QUERY_INFORMATION, false, pid)) {
63
NativeMethods
.GetProcessTimes(procHandle, out startTime, out temp, out temp, out temp);
1212
using (SafeProcessHandle procHandle = SafeProcessHandle.OpenProcess(
NativeMethods
.PROCESS_QUERY_INFORMATION, false, pid)) {
1214
if ((error ==
NativeMethods
.ERROR_INVALID_PARAMETER) && procHandle.IsInvalid) {
1227
if (
NativeMethods
.GetProcessTimes(procHandle, out processStartTime, out temp, out temp, out temp)) {
1239
using (SafeProcessHandle procHandle = SafeProcessHandle.OpenProcess(
NativeMethods
.SYNCHRONIZE, false, pid)) {
1563
if (!SafeLocalMemHandle.ConvertStringSecurityDescriptorToSecurityDescriptor(sddlString,
NativeMethods
.SDDL_REVISION_1,
1567
NativeMethods
.SECURITY_ATTRIBUTES securityAttributes = new
NativeMethods
.SECURITY_ATTRIBUTES();
1587
fileMappingHandle =
NativeMethods
.CreateFileMapping((IntPtr)(-1), securityAttributes,
1588
NativeMethods
.PAGE_READWRITE, 0, fileMappingSize, mappingName);
1590
if ((Marshal.GetLastWin32Error() !=
NativeMethods
.ERROR_ACCESS_DENIED) || !fileMappingHandle.IsInvalid) {
1596
fileMappingHandle =
NativeMethods
.OpenFileMapping(
NativeMethods
.FILE_MAP_WRITE, false, mappingName);
1598
if ((Marshal.GetLastWin32Error() !=
NativeMethods
.ERROR_FILE_NOT_FOUND) || !fileMappingHandle.IsInvalid) {
1617
fileViewAddress = SafeFileMapViewHandle.MapViewOfFile(fileMappingHandle,
NativeMethods
.FILE_MAP_WRITE, 0,0, UIntPtr.Zero);
1622
NativeMethods
.MEMORY_BASIC_INFORMATION meminfo = new
NativeMethods
.MEMORY_BASIC_INFORMATION();
1623
if (
NativeMethods
.VirtualQuery(fileViewAddress, ref meminfo, (IntPtr) sizeof(
NativeMethods
.MEMORY_BASIC_INFORMATION)) == IntPtr.Zero)
services\monitoring\system\diagnosticts\SharedUtils.cs (3)
179
case
NativeMethods
.WAIT_OBJECT_0:
180
case
NativeMethods
.WAIT_ABANDONED:
186
case
NativeMethods
.WAIT_TIMEOUT:
sys\system\io\ports\InternalResources.cs (8)
38
int result = SafeNativeMethods.FormatMessage(
NativeMethods
.FORMAT_MESSAGE_IGNORE_INSERTS |
39
NativeMethods
.FORMAT_MESSAGE_FROM_SYSTEM |
NativeMethods
.FORMAT_MESSAGE_ARGUMENT_ARRAY,
106
case
NativeMethods
.ERROR_FILE_NOT_FOUND:
107
case
NativeMethods
.ERROR_PATH_NOT_FOUND:
113
case
NativeMethods
.ERROR_ACCESS_DENIED:
119
case
NativeMethods
.ERROR_FILENAME_EXCED_RANGE:
122
case
NativeMethods
.ERROR_SHARING_VIOLATION:
sys\system\io\ports\Parity.cs (5)
22
None =
NativeMethods
.NOPARITY,
23
Odd =
NativeMethods
.ODDPARITY,
24
Even =
NativeMethods
.EVENPARITY,
25
Mark =
NativeMethods
.MARKPARITY,
26
Space =
NativeMethods
.SPACEPARITY
sys\system\io\ports\SerialErrors.cs (5)
22
TXFull =
NativeMethods
.CE_TXFULL,
23
RXOver =
NativeMethods
.CE_RXOVER,
24
Overrun =
NativeMethods
.CE_OVERRUN,
25
RXParity =
NativeMethods
.CE_PARITY,
26
Frame =
NativeMethods
.CE_FRAME,
sys\system\io\ports\SerialPinChanges.cs (5)
23
CtsChanged =
NativeMethods
.EV_CTS,
24
DsrChanged =
NativeMethods
.EV_DSR,
25
CDChanged =
NativeMethods
.EV_RLSD,
26
Ring =
NativeMethods
.EV_RING,
27
Break =
NativeMethods
.EV_BREAK,
sys\system\io\ports\SerialReceived.cs (2)
23
Chars =
NativeMethods
.EV_RXCHAR,
24
Eof =
NativeMethods
.EV_RXFLAG,
sys\system\io\ports\SerialStream.cs (133)
216
int fNullFlag = GetDcbFlag(
NativeMethods
.FNULL);
220
SetDcbFlag(
NativeMethods
.FNULL, value ? 1 : 0);
224
SetDcbFlag(
NativeMethods
.FNULL, fNullOld);
234
int fDtrControl = GetDcbFlag(
NativeMethods
.FDTRCONTROL);
236
return (fDtrControl ==
NativeMethods
.DTR_CONTROL_ENABLE);
241
int fDtrControlOld = GetDcbFlag(
NativeMethods
.FDTRCONTROL);
243
SetDcbFlag(
NativeMethods
.FDTRCONTROL, value ?
NativeMethods
.DTR_CONTROL_ENABLE :
NativeMethods
.DTR_CONTROL_DISABLE);
246
SetDcbFlag(
NativeMethods
.FDTRCONTROL, fDtrControlOld);
251
if (!UnsafeNativeMethods.EscapeCommFunction(_handle, value ?
NativeMethods
.SETDTR :
NativeMethods
.CLRDTR))
271
int fInOutXOld = GetDcbFlag(
NativeMethods
.FINX);
272
int fOutxCtsFlowOld = GetDcbFlag(
NativeMethods
.FOUTXCTSFLOW);
273
int fRtsControlOld = GetDcbFlag(
NativeMethods
.FRTSCONTROL);
277
SetDcbFlag(
NativeMethods
.FINX, fInXOutXFlag);
278
SetDcbFlag(
NativeMethods
.FOUTX, fInXOutXFlag);
280
SetDcbFlag(
NativeMethods
.FOUTXCTSFLOW, (handshake == Handshake.RequestToSend ||
286
SetDcbFlag(
NativeMethods
.FRTSCONTROL,
NativeMethods
.RTS_CONTROL_HANDSHAKE);
290
SetDcbFlag(
NativeMethods
.FRTSCONTROL,
NativeMethods
.RTS_CONTROL_ENABLE);
293
SetDcbFlag(
NativeMethods
.FRTSCONTROL,
NativeMethods
.RTS_CONTROL_DISABLE);
299
SetDcbFlag(
NativeMethods
.FINX, fInOutXOld);
300
SetDcbFlag(
NativeMethods
.FOUTX, fInOutXOld);
301
SetDcbFlag(
NativeMethods
.FOUTXCTSFLOW, fOutxCtsFlowOld);
302
SetDcbFlag(
NativeMethods
.FRTSCONTROL, fRtsControlOld);
330
int fParityOld = GetDcbFlag(
NativeMethods
.FPARITY);
332
int fErrorCharOld = GetDcbFlag(
NativeMethods
.FERRORCHAR);
336
SetDcbFlag(
NativeMethods
.FPARITY, parityFlag);
339
SetDcbFlag(
NativeMethods
.FERRORCHAR, (parityReplace != '\0') ? 1 : 0);
344
SetDcbFlag(
NativeMethods
.FERRORCHAR, 0);
350
SetDcbFlag(
NativeMethods
.FPARITY, fParityOld);
353
SetDcbFlag(
NativeMethods
.FERRORCHAR, fErrorCharOld);
373
int fErrorCharOld = GetDcbFlag(
NativeMethods
.FERRORCHAR);
376
if (GetDcbFlag(
NativeMethods
.FPARITY) == 1)
378
SetDcbFlag(
NativeMethods
.FERRORCHAR, (parityReplace != '\0')? 1 : 0);
383
SetDcbFlag(
NativeMethods
.FERRORCHAR, 0);
391
SetDcbFlag(
NativeMethods
.FERRORCHAR, fErrorCharOld);
435
commTimeouts.ReadIntervalTimeout =
NativeMethods
.MAXDWORD;
440
commTimeouts.ReadTotalTimeoutMultiplier =
NativeMethods
.MAXDWORD;
441
commTimeouts.ReadIntervalTimeout =
NativeMethods
.MAXDWORD;
444
commTimeouts.ReadTotalTimeoutMultiplier =
NativeMethods
.MAXDWORD;
445
commTimeouts.ReadIntervalTimeout =
NativeMethods
.MAXDWORD;
461
int fRtsControl = GetDcbFlag(
NativeMethods
.FRTSCONTROL);
462
if (fRtsControl ==
NativeMethods
.RTS_CONTROL_HANDSHAKE)
465
return (fRtsControl ==
NativeMethods
.RTS_CONTROL_ENABLE);
473
int fRtsControlOld = GetDcbFlag(
NativeMethods
.FRTSCONTROL);
477
SetDcbFlag(
NativeMethods
.FRTSCONTROL,
NativeMethods
.RTS_CONTROL_ENABLE);
479
SetDcbFlag(
NativeMethods
.FRTSCONTROL,
NativeMethods
.RTS_CONTROL_DISABLE);
483
SetDcbFlag(
NativeMethods
.FRTSCONTROL, fRtsControlOld);
489
if (!UnsafeNativeMethods.EscapeCommFunction(_handle, value ?
NativeMethods
.SETRTS :
NativeMethods
.CLRRTS))
520
if (value == StopBits.One) nativeValue = (byte)
NativeMethods
.ONESTOPBIT;
521
else if (value == StopBits.OnePointFive) nativeValue = (byte)
NativeMethods
.ONE5STOPBITS;
522
else nativeValue = (byte)
NativeMethods
.TWOSTOPBITS;
576
return (
NativeMethods
.MS_RLSD_ON & pinStatus) != 0;
588
return (
NativeMethods
.MS_CTS_ON & pinStatus) != 0;
601
return (
NativeMethods
.MS_DSR_ON & pinStatus) != 0;
655
NativeMethods
.GENERIC_READ |
NativeMethods
.GENERIC_WRITE,
701
if ((errorCode ==
NativeMethods
.ERROR_INVALID_PARAMETER) || (errorCode ==
NativeMethods
.ERROR_INVALID_HANDLE))
722
this.rtsEnable = (GetDcbFlag(
NativeMethods
.FRTSCONTROL) ==
NativeMethods
.RTS_CONTROL_ENABLE);
734
commTimeouts.ReadIntervalTimeout =
NativeMethods
.MAXDWORD;
739
commTimeouts.ReadTotalTimeoutMultiplier =
NativeMethods
.MAXDWORD;
740
commTimeouts.ReadIntervalTimeout =
NativeMethods
.MAXDWORD;
743
commTimeouts.ReadTotalTimeoutMultiplier =
NativeMethods
.MAXDWORD;
744
commTimeouts.ReadIntervalTimeout =
NativeMethods
.MAXDWORD;
764
UnsafeNativeMethods.SetCommMask(_handle,
NativeMethods
.ALL_EVENTS);
805
if (!UnsafeNativeMethods.EscapeCommFunction(_handle,
NativeMethods
.CLRDTR))
816
if ((hr ==
NativeMethods
.ERROR_ACCESS_DENIED || hr ==
NativeMethods
.ERROR_BAD_COMMAND || hr == ERROR_DEVICE_REMOVED) && !disposing) {
934
if (UnsafeNativeMethods.PurgeComm(_handle,
NativeMethods
.PURGE_RXCLEAR |
NativeMethods
.PURGE_RXABORT) == false)
941
if (UnsafeNativeMethods.PurgeComm(_handle,
NativeMethods
.PURGE_TXCLEAR |
NativeMethods
.PURGE_TXABORT) == false)
1201
if (hr ==
NativeMethods
.ERROR_COUNTER_TIMEOUT)
1242
if (Marshal.GetLastWin32Error() ==
NativeMethods
.ERROR_COUNTER_TIMEOUT)
1281
dcb.StopBits =
NativeMethods
.ONESTOPBIT;
1284
dcb.StopBits =
NativeMethods
.ONE5STOPBITS;
1287
dcb.StopBits =
NativeMethods
.TWOSTOPBITS;
1298
SetDcbFlag(
NativeMethods
.FPARITY, ((parity == Parity.None) ? 0 : 1));
1300
SetDcbFlag(
NativeMethods
.FBINARY, 1); // always true for communications resources
1305
SetDcbFlag(
NativeMethods
.FOUTXCTSFLOW, ((handshake == Handshake.RequestToSend ||
1308
SetDcbFlag(
NativeMethods
.FOUTXDSRFLOW, 0); // dsrTimeout is always set to 0.
1309
SetDcbFlag(
NativeMethods
.FDTRCONTROL,
NativeMethods
.DTR_CONTROL_DISABLE);
1310
SetDcbFlag(
NativeMethods
.FDSRSENSITIVITY, 0); // this should remain off
1311
SetDcbFlag(
NativeMethods
.FINX, (handshake == Handshake.XOnXOff || handshake == Handshake.RequestToSendXOnXOff) ? 1 : 0);
1312
SetDcbFlag(
NativeMethods
.FOUTX,(handshake == Handshake.XOnXOff || handshake == Handshake.RequestToSendXOnXOff) ? 1 : 0);
1317
SetDcbFlag(
NativeMethods
.FERRORCHAR, (parityReplace != '\0') ? 1 : 0);
1322
SetDcbFlag(
NativeMethods
.FERRORCHAR, 0);
1328
SetDcbFlag(
NativeMethods
.FNULL, discardNull ? 1 : 0);
1337
SetDcbFlag(
NativeMethods
.FRTSCONTROL,
NativeMethods
.RTS_CONTROL_HANDSHAKE);
1339
else if (GetDcbFlag(
NativeMethods
.FRTSCONTROL) ==
NativeMethods
.RTS_CONTROL_HANDSHAKE)
1341
SetDcbFlag(
NativeMethods
.FRTSCONTROL,
NativeMethods
.RTS_CONTROL_DISABLE);
1344
dcb.XonChar =
NativeMethods
.DEFAULTXONCHAR; // may be exposed later but for now, constant
1345
dcb.XoffChar =
NativeMethods
.DEFAULTXOFFCHAR;
1351
dcb.EofChar =
NativeMethods
.EOFCHAR;
1355
dcb.EvtChar =
NativeMethods
.EOFCHAR;
1371
Debug.Assert(whichFlag >=
NativeMethods
.FBINARY && whichFlag <=
NativeMethods
.FDUMMY2, "GetDcbFlag needs to fit into enum!");
1373
if (whichFlag ==
NativeMethods
.FDTRCONTROL || whichFlag ==
NativeMethods
.FRTSCONTROL)
1377
else if (whichFlag ==
NativeMethods
.FDUMMY2)
1398
Debug.Assert(whichFlag >=
NativeMethods
.FBINARY && whichFlag <=
NativeMethods
.FDUMMY2, "SetDcbFlag needs to fit into enum!");
1400
if (whichFlag ==
NativeMethods
.FDTRCONTROL || whichFlag ==
NativeMethods
.FRTSCONTROL)
1404
else if (whichFlag ==
NativeMethods
.FDUMMY2)
1466
if (hr !=
NativeMethods
.ERROR_IO_PENDING)
1468
if (hr ==
NativeMethods
.ERROR_HANDLE_EOF)
1519
if (hr !=
NativeMethods
.ERROR_IO_PENDING)
1522
if (hr ==
NativeMethods
.ERROR_HANDLE_EOF)
1571
if (hr ==
NativeMethods
.ERROR_INVALID_HANDLE)
1620
if (hr ==
NativeMethods
.ERROR_INVALID_HANDLE)
1745
if (hr ==
NativeMethods
.ERROR_ACCESS_DENIED || hr ==
NativeMethods
.ERROR_BAD_COMMAND || hr == ERROR_DEVICE_REMOVED) {
1749
if (hr ==
NativeMethods
.ERROR_IO_PENDING)
1764
while (error ==
NativeMethods
.ERROR_IO_INCOMPLETE && !ShutdownLoop && !success);
1769
if (! ( (error ==
NativeMethods
.ERROR_IO_INCOMPLETE || error ==
NativeMethods
.ERROR_INVALID_PARAMETER) && ShutdownLoop))
1773
else if (hr !=
NativeMethods
.ERROR_INVALID_PARAMETER) {
1815
if ((nativeEvents & (
NativeMethods
.EV_ERR |
NativeMethods
.EV_RXCHAR)) != 0) {
sys\system\security\accesscontrol\semaphoresecurity.cs (3)
136
case
NativeMethods
.ERROR_INVALID_NAME:
137
case
NativeMethods
.ERROR_INVALID_HANDLE:
138
case
NativeMethods
.ERROR_FILE_NOT_FOUND:
sys\system\threading\semaphore.cs (10)
75
if(null != name && 0 != name.Length &&
NativeMethods
.ERROR_INVALID_HANDLE == errorCode)
125
NativeMethods
.SECURITY_ATTRIBUTES secAttrs = null;
126
secAttrs = new
NativeMethods
.SECURITY_ATTRIBUTES();
143
if(null != name && 0 != name.Length &&
NativeMethods
.ERROR_INVALID_HANDLE == errorCode)
147
createdNew = errorCode !=
NativeMethods
.ERROR_ALREADY_EXISTS;
192
InternalResources.WinIOError(
NativeMethods
.ERROR_PATH_NOT_FOUND, string.Empty);
277
if (
NativeMethods
.ERROR_FILE_NOT_FOUND == errorCode ||
NativeMethods
.ERROR_INVALID_NAME == errorCode)
279
if (
NativeMethods
.ERROR_PATH_NOT_FOUND == errorCode)
281
if (null != name && 0 != name.Length &&
NativeMethods
.ERROR_INVALID_HANDLE == errorCode)