188 references to Kernel32
System.Diagnostics.PerformanceCounter (188)
_generated\0\LibraryImports.g.cs (18)
223internal static partial global::Microsoft.Win32.SafeHandles.SafeMemoryMappedFileHandle CreateFileMapping(global::Microsoft.Win32.SafeHandles.SafeFileHandle hFile, ref global::Interop.Kernel32.SECURITY_ATTRIBUTES lpFileMappingAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, string lpName) 239fixed (global::Interop.Kernel32.SECURITY_ATTRIBUTES* __lpFileMappingAttributes_native = &lpFileMappingAttributes) 270static extern unsafe nint __PInvoke(nint __hFile_native, global::Interop.Kernel32.SECURITY_ATTRIBUTES* __lpFileMappingAttributes_native, int __flProtect_native, int __dwMaximumSizeHigh_native, int __dwMaximumSizeLow_native, ushort* __lpName_native); 280internal static partial global::Microsoft.Win32.SafeHandles.SafeMemoryMappedFileHandle CreateFileMapping(nint hFile, ref global::Interop.Kernel32.SECURITY_ATTRIBUTES lpFileMappingAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, string lpName) 292fixed (global::Interop.Kernel32.SECURITY_ATTRIBUTES* __lpFileMappingAttributes_native = &lpFileMappingAttributes) 318static extern unsafe nint __PInvoke(nint __hFile_native, global::Interop.Kernel32.SECURITY_ATTRIBUTES* __lpFileMappingAttributes_native, int __flProtect_native, int __dwMaximumSizeHigh_native, int __dwMaximumSizeLow_native, ushort* __lpName_native); 695internal static partial nuint VirtualQuery(global::System.Runtime.InteropServices.SafeHandle lpAddress, ref global::Interop.Kernel32.MEMORY_BASIC_INFORMATION lpBuffer, nuint dwLength) 707fixed (global::Interop.Kernel32.MEMORY_BASIC_INFORMATION* __lpBuffer_native = &lpBuffer) 726static extern unsafe nuint __PInvoke(nint __lpAddress_native, global::Interop.Kernel32.MEMORY_BASIC_INFORMATION* __lpBuffer_native, nuint __dwLength_native); 775public static partial int PdhFormatFromRawValue(uint dwCounterType, uint dwFormat, ref long pTimeBase, ref global::Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER pRawValue1, ref global::Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER pRawValue2, ref global::Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_COUNTERVALUE pFmtValue) 779fixed (global::Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_COUNTERVALUE* __pFmtValue_native = &pFmtValue) 780fixed (global::Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER* __pRawValue2_native = &pRawValue2) 781fixed (global::Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER* __pRawValue1_native = &pRawValue1) 790static extern unsafe int __PInvoke(uint __dwCounterType_native, uint __dwFormat_native, long* __pTimeBase_native, global::Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER* __pRawValue1_native, global::Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER* __pRawValue2_native, global::Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_COUNTERVALUE* __pFmtValue_native);
src\runtime\src\libraries\Common\src\Interop\Windows\Pdh\Interop.PdhFormatFromRawValue.cs (3)
15ref Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER pRawValue1, 16ref Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER pRawValue2, 17ref Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_COUNTERVALUE pFmtValue
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (4)
87int result = Interop.Kernel32.WaitForSingleObject(mutexIn.SafeWaitHandle, 500); 90case Interop.Kernel32.WAIT_OBJECT_0: 91case Interop.Kernel32.WAIT_ABANDONED: 97case Interop.Kernel32.WAIT_TIMEOUT:
System\Diagnostics\CounterSampleCalculator.cs (54)
64if ((newCounterType != Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_FRACTION) && 65(newCounterType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT) && 66(newCounterType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT_HEX) && 67(newCounterType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT) && 68(newCounterType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT_HEX) && 69(newCounterType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_BASE)) 82if (newCounterType == Interop.Kernel32.PerformanceCounterOptions.PERF_ELAPSED_TIME) 85Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER newPdhValue = default; 86Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER oldPdhValue = default; 90Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_COUNTERVALUE pdhFormattedValue = default; 92int result = Interop.Pdh.PdhFormatFromRawValue((uint)newCounterType, Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_DOUBLE | Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_NOSCALE | Interop.Kernel32.PerformanceCounterOptions.PDH_FMT_NOCAP100, 98if (result == Interop.Kernel32.PerformanceCounterOptions.PDH_CALC_NEGATIVE_VALUE || result == Interop.Kernel32.PerformanceCounterOptions.PDH_CALC_NEGATIVE_DENOMINATOR || result == Interop.Kernel32.PerformanceCounterOptions.PDH_NO_DATA) 110private static void FillInValues(CounterSample oldSample, CounterSample newSample, ref Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER oldPdhValue, ref Interop.Kernel32.PerformanceCounterOptions.PDH_RAW_COUNTER newPdhValue) 116case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_COUNTER: 117case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_QUEUELEN_TYPE: 118case Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_COUNTER: 119case Interop.Kernel32.PerformanceCounterOptions.PERF_OBJ_TIME_TIMER: 120case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE: 128case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_100NS_QUEUELEN_TYPE: 136case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_TIMER: 137case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_TIMER_INV: 138case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_BULK_COUNT: 139case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_QUEUELEN_TYPE: 140case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER: 141case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER_INV: 147if (newCounterType == Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER || newCounterType == Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER_INV) 158if ((newCounterType & Interop.Kernel32.PerformanceCounterOptions.PERF_MULTI_COUNTER) == Interop.Kernel32.PerformanceCounterOptions.PERF_MULTI_COUNTER) 168case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT: 169case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT_HEX: 170case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_DELTA: 171case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT: 172case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT_HEX: 173case Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_DELTA: 183case Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_TIMER: 184case Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_TIMER_INV: 185case Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER: 186case Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER_INV: 192if ((newCounterType & Interop.Kernel32.PerformanceCounterOptions.PERF_MULTI_COUNTER) == Interop.Kernel32.PerformanceCounterOptions.PERF_MULTI_COUNTER) 201case Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_FRACTION: 202case Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_FRACTION: 203case Interop.Kernel32.PerformanceCounterOptions.PERF_LARGE_RAW_FRACTION: 204case Interop.Kernel32.PerformanceCounterOptions.PERF_PRECISION_SYSTEM_TIMER: 205case Interop.Kernel32.PerformanceCounterOptions.PERF_PRECISION_100NS_TIMER: 206case Interop.Kernel32.PerformanceCounterOptions.PERF_PRECISION_OBJECT_TIMER: 207case Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_TIMER: 208case Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BULK:
System\Diagnostics\PerformanceCounterCategory.cs (16)
305if ((currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BULK) || 306(currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER) || 307(currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER_INV) || 308(currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER) || 309(currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER_INV) || 310(currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_FRACTION) || 311(currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_FRACTION) || 312(currentSampleType == Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_TIMER)) 334(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BULK) && 335(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER) && 336(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER_INV) && 337(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER) && 338(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER_INV) && 339(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_FRACTION) && 340(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_FRACTION) && 341(currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_TIMER))
System\Diagnostics\PerformanceCounterLib.cs (9)
115s_computerName ??= Interop.Kernel32.GetComputerName() ?? string.Empty; 1139return (type == Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BASE || 1140type == Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_BASE || 1141type == Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_BASE || 1142type == Interop.Kernel32.PerformanceCounterOptions.PERF_LARGE_RAW_BASE || 1143type == Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_BASE); 1316goto case Interop.Kernel32.WAIT_TIMEOUT; 1318case Interop.Kernel32.WAIT_TIMEOUT: 1462if (currentSampleType != Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_NODATA)
System\Diagnostics\PerformanceCounterType.cs (28)
11NumberOfItems32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT, 12NumberOfItems64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT, 13NumberOfItemsHEX32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT_HEX, 14NumberOfItemsHEX64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT_HEX, 15RateOfCountsPerSecond32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_COUNTER, 16RateOfCountsPerSecond64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_BULK_COUNT, 17CountPerTimeInterval32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_QUEUELEN_TYPE, 18CountPerTimeInterval64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_QUEUELEN_TYPE, 19RawFraction = Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_FRACTION, 20RawBase = Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_BASE, 22AverageTimer32 = Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_TIMER, 23AverageBase = Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BASE, 24AverageCount64 = Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BULK, 26SampleFraction = Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_FRACTION, 27SampleCounter = Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_COUNTER, 28SampleBase = Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_BASE, 30CounterTimer = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_TIMER, 31CounterTimerInverse = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_TIMER_INV, 32Timer100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_TIMER, 33Timer100NsInverse = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_TIMER_INV, 34ElapsedTime = Interop.Kernel32.PerformanceCounterOptions.PERF_ELAPSED_TIME, 35CounterMultiTimer = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER, 36CounterMultiTimerInverse = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER_INV, 37CounterMultiTimer100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER, 38CounterMultiTimer100NsInverse = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER_INV, 39CounterMultiBase = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_BASE, 41CounterDelta32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_DELTA, 42CounterDelta64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_DELTA
System\Diagnostics\PerformanceData\CounterType.cs (36)
11QueueLength = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_QUEUELEN_TYPE, 12LargeQueueLength = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_QUEUELEN_TYPE, 13QueueLength100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_100NS_QUEUELEN_TYPE, 14QueueLengthObjectTime = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE, 15RawData32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT, 16RawData64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT, 17RawDataHex32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_RAWCOUNT_HEX, 18RawDataHex64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_RAWCOUNT_HEX, 19RateOfCountPerSecond32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_COUNTER, 20RateOfCountPerSecond64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_BULK_COUNT, 21RawFraction32 = Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_FRACTION, 22RawFraction64 = Interop.Kernel32.PerformanceCounterOptions.PERF_LARGE_RAW_FRACTION, 23RawBase32 = Interop.Kernel32.PerformanceCounterOptions.PERF_RAW_BASE, 24RawBase64 = Interop.Kernel32.PerformanceCounterOptions.PERF_LARGE_RAW_BASE, 25SampleFraction = Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_FRACTION, 26SampleCounter = Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_COUNTER, 27SampleBase = Interop.Kernel32.PerformanceCounterOptions.PERF_SAMPLE_BASE, 28AverageTimer32 = Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_TIMER, 29AverageBase = Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BASE, 30AverageCount64 = Interop.Kernel32.PerformanceCounterOptions.PERF_AVERAGE_BULK, 31PercentageActive = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_TIMER, 32PercentageNotActive = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_TIMER_INV, 33PercentageActive100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_TIMER, 34PercentageNotActive100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_TIMER_INV, 35ElapsedTime = Interop.Kernel32.PerformanceCounterOptions.PERF_ELAPSED_TIME, 36MultiTimerPercentageActive = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER, 37MultiTimerPercentageNotActive = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_TIMER_INV, 38MultiTimerPercentageActive100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER, 39MultiTimerPercentageNotActive100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_100NSEC_MULTI_TIMER_INV, 40MultiTimerBase = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_MULTI_BASE, 41Delta32 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_DELTA, 42Delta64 = Interop.Kernel32.PerformanceCounterOptions.PERF_COUNTER_LARGE_DELTA, 43ObjectSpecificTimer = Interop.Kernel32.PerformanceCounterOptions.PERF_OBJ_TIME_TIMER, 44PrecisionSystemTimer = Interop.Kernel32.PerformanceCounterOptions.PERF_PRECISION_SYSTEM_TIMER, 45PrecisionTimer100Ns = Interop.Kernel32.PerformanceCounterOptions.PERF_PRECISION_100NS_TIMER, 46PrecisionObjectSpecificTimer = Interop.Kernel32.PerformanceCounterOptions.PERF_PRECISION_OBJECT_TIMER
System\Diagnostics\PerformanceDataRegistryKey.cs (1)
129throw new IOException(Interop.Kernel32.GetMessage(errorCode), errorCode);
System\Diagnostics\SharedPerformanceCounter.cs (19)
40int pid = (int)Interop.Kernel32.GetCurrentProcessId(); 49using (SafeProcessHandle procHandle = Interop.Kernel32.OpenProcess(Interop.Advapi32.ProcessOptions.PROCESS_QUERY_INFORMATION, false, pid)) 54Interop.Kernel32.GetProcessTimes(procHandle, out startTime, out temp, out temp, out temp); 1303using (SafeProcessHandle procHandle = Interop.Kernel32.OpenProcess(Interop.Advapi32.ProcessOptions.PROCESS_QUERY_INFORMATION, false, pid)) 1321if (Interop.Kernel32.GetProcessTimes(procHandle, out processStartTime, out temp, out temp, out temp)) 1335using (SafeProcessHandle procHandle = Interop.Kernel32.OpenProcess(Interop.Advapi32.ProcessOptions.SYNCHRONIZE, false, pid)) 1339using (Interop.Kernel32.ProcessWaitHandle wh = new Interop.Kernel32.ProcessWaitHandle(procHandle)) 1686Interop.Kernel32.PerformanceCounterOptions.SDDL_REVISION_1, 1693Interop.Kernel32.SECURITY_ATTRIBUTES securityAttributes = default; 1714_fileMappingHandle = Interop.Kernel32.CreateFileMapping((IntPtr)(-1), ref securityAttributes, 1715Interop.Kernel32.PageOptions.PAGE_READWRITE, 0, fileMappingSize, mappingName); 1725_fileMappingHandle = Interop.Kernel32.OpenFileMapping(Interop.Kernel32.FileMapOptions.FILE_MAP_WRITE, false, mappingName); 1751_fileViewAddress = Interop.Kernel32.MapViewOfFile(_fileMappingHandle, Interop.Kernel32.FileMapOptions.FILE_MAP_WRITE, 0, 0, UIntPtr.Zero); 1756Interop.Kernel32.MEMORY_BASIC_INFORMATION meminfo = default; 1757if (Interop.Kernel32.VirtualQuery(_fileViewAddress, ref meminfo, (UIntPtr)sizeof(Interop.Kernel32.MEMORY_BASIC_INFORMATION)) == UIntPtr.Zero)