257 references to Interop
System.Diagnostics.PerformanceCounter (257)
_generated\0\LibraryImports.g.cs (28)
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); 808internal static partial uint PerfStartProvider(ref global::System.Guid ProviderGuid, global::Interop.PerfCounter.PERFLIBREQUEST ControlCallback, out global::Microsoft.Win32.SafeHandles.SafePerfProviderHandle phProvider) 857internal static unsafe partial global::Interop.PerfCounter.PerfCounterSetInstanceStruct* PerfCreateInstance(global::Microsoft.Win32.SafeHandles.SafePerfProviderHandle hProvider, ref global::System.Guid CounterSetGuid, string szInstanceName, uint dwInstance) 861global::Interop.PerfCounter.PerfCounterSetInstanceStruct* __retVal = default; 889static extern unsafe global::Interop.PerfCounter.PerfCounterSetInstanceStruct* __PInvoke(nint __hProvider_native, global::System.Guid* __CounterSetGuid_native, ushort* __szInstanceName_native, uint __dwInstance_native); 899internal static unsafe partial uint PerfSetCounterSetInfo(global::Microsoft.Win32.SafeHandles.SafePerfProviderHandle hProvider, global::Interop.PerfCounter.PerfCounterSetInfoStruct* pTemplate, uint dwTemplateSize) 924static extern unsafe uint __PInvoke(nint __hProvider_native, global::Interop.PerfCounter.PerfCounterSetInfoStruct* __pTemplate_native, uint __dwTemplateSize_native); 934internal static unsafe partial uint PerfDeleteInstance(global::Microsoft.Win32.SafeHandles.SafePerfProviderHandle hProvider, global::Interop.PerfCounter.PerfCounterSetInstanceStruct* InstanceBlock) 959static extern unsafe uint __PInvoke(nint __hProvider_native, global::Interop.PerfCounter.PerfCounterSetInstanceStruct* __InstanceBlock_native); 969internal static unsafe partial uint PerfSetCounterRefValue(global::Microsoft.Win32.SafeHandles.SafePerfProviderHandle hProvider, global::Interop.PerfCounter.PerfCounterSetInstanceStruct* pInstance, uint CounterId, void* lpAddr) 994static extern unsafe uint __PInvoke(nint __hProvider_native, global::Interop.PerfCounter.PerfCounterSetInstanceStruct* __pInstance_native, uint __CounterId_native, void* __lpAddr_native);
misc\EnvironmentHelpers.cs (2)
45if (!Interop.Advapi32.GetTokenInformation(wi.Token, (uint)Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenIsAppContainer, new IntPtr(dwIsAppContainerPtr), sizeof(int), out dwLength))
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetTokenInformation.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
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\Microsoft\Win32\SafeHandles\SafePerfProviderHandle.cs (2)
16uint Status = Interop.PerfCounter.PerfStopProvider(handle); 17Debug.Assert(Status == (uint)Interop.Errors.ERROR_SUCCESS, "PerfStopProvider() fails");
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:
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs (2)
37Interop.Advapi32.RegCloseKey(handle) == Interop.Errors.ERROR_SUCCESS;
System\Diagnostics\CounterSampleCalculator.cs (56)
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, 95if (result != Interop.Errors.ERROR_SUCCESS) 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 (18)
14using static Interop.Advapi32; 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); 1222if (res == Interop.Errors.ERROR_ACCESS_DENIED) 1269throw new Win32Exception(Interop.Errors.ERROR_ACCESS_DENIED); 1312case Interop.Advapi32.RPCStatus.RPC_S_CALL_FAILED: 1313case Interop.Errors.ERROR_INVALID_HANDLE: 1314case Interop.Advapi32.RPCStatus.RPC_S_SERVER_UNAVAILABLE: 1316goto case Interop.Kernel32.WAIT_TIMEOUT; 1318case Interop.Kernel32.WAIT_TIMEOUT: 1319case Interop.Errors.ERROR_NOT_READY: 1320case Interop.Errors.ERROR_LOCK_FAILED: 1321case Interop.Errors.ERROR_BUSY: 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\CounterSet.cs (14)
204uint Status = (uint)Interop.Errors.ERROR_SUCCESS; 208uint CounterSetInfoSize = checked((uint)sizeof(Interop.PerfCounter.PerfCounterSetInfoStruct) 209+ (uint)_idToCounter.Count * (uint)sizeof(Interop.PerfCounter.PerfCounterInfoStruct)); 214Debug.Assert(sizeof(Interop.PerfCounter.PerfCounterSetInfoStruct) == 40); 215Debug.Assert(sizeof(Interop.PerfCounter.PerfCounterInfoStruct) == 32); 217Interop.PerfCounter.PerfCounterSetInfoStruct* CounterSetInfo; 218Interop.PerfCounter.PerfCounterInfoStruct* CounterInfo; 223CounterSetInfo = (Interop.PerfCounter.PerfCounterSetInfoStruct*)pCounterSetBuffer; 231CounterSetInfoUsed = (uint)sizeof(Interop.PerfCounter.PerfCounterSetInfoStruct) 232+ (uint)CurrentCounter * (uint)sizeof(Interop.PerfCounter.PerfCounterInfoStruct); 235CounterInfo = (Interop.PerfCounter.PerfCounterInfoStruct*)(pCounterSetBuffer + CounterSetInfoUsed); 248Status = Interop.PerfCounter.PerfSetCounterSetInfo(_provider._hProvider, CounterSetInfo, CounterSetInfoSize); 251if (Status != (uint)Interop.Errors.ERROR_SUCCESS) 255(uint)Interop.Errors.ERROR_ALREADY_EXISTS => new InvalidOperationException(SR.Format(SR.Perflib_Argument_CounterSetAlreadyRegister, _counterSet)),
System\Diagnostics\PerformanceData\CounterSetInstance.cs (8)
18internal unsafe Interop.PerfCounter.PerfCounterSetInstanceStruct* _nativeInst; 33Debug.Assert(sizeof(Interop.PerfCounter.PerfCounterSetInstanceStruct) == 32); 35_nativeInst = Interop.PerfCounter.PerfCreateInstance( 37int Status = (int)((_nativeInst != null) ? Interop.Errors.ERROR_SUCCESS : Marshal.GetLastWin32Error()); 51case (int)Interop.Errors.ERROR_ALREADY_EXISTS: 54case (int)Interop.Errors.ERROR_NOT_FOUND: 57case (int)Interop.Errors.ERROR_INVALID_PARAMETER: 104Interop.PerfCounter.PerfDeleteInstance(_counterSet._provider._hProvider, _nativeInst);
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (3)
141uint Status = Interop.PerfCounter.PerfSetCounterRefValue( 146if (Status != (uint)Interop.Errors.ERROR_SUCCESS) 153(uint)Interop.Errors.ERROR_NOT_FOUND => new InvalidOperationException(SR.Format(SR.Perflib_InvalidOperation_CounterRefValue, _instance._counterSet._counterSet, CounterDef.Key, _instance._instName)),
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\PerformanceData\PerfProviderCollection.cs (2)
20uint Status = Interop.PerfCounter.PerfStartProvider(ref _providerGuid, null, out _hProvider); 22if (Status != (uint)Interop.Errors.ERROR_SUCCESS)
System\Diagnostics\PerformanceDataRegistryKey.cs (6)
27int ret = Interop.Advapi32.RegConnectRegistry(machineName, new IntPtr(PerformanceData), out SafeRegistryHandle foreignHKey); 35if (ret == Interop.Errors.ERROR_DLL_INIT_FAILED) 64while (Interop.Errors.ERROR_MORE_DATA == (ret = Interop.Advapi32.RegQueryValueEx(_hkey, name, lpReserved: null, ref type, data, ref sizeInput))) 124if (errorCode == Interop.Errors.ERROR_ACCESS_DENIED) 129throw new IOException(Interop.Kernel32.GetMessage(errorCode), errorCode);
System\Diagnostics\SharedPerformanceCounter.cs (27)
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)) 1306if ((error == Interop.Errors.ERROR_INVALID_PARAMETER) && procHandle.IsInvalid) 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)) 1684if (!Interop.Advapi32.ConvertStringSecurityDescriptorToSecurityDescriptor( 1686Interop.Kernel32.PerformanceCounterOptions.SDDL_REVISION_1, 1693Interop.Kernel32.SECURITY_ATTRIBUTES securityAttributes = default; 1695securityAttributes.bInheritHandle = Interop.BOOL.FALSE; 1714_fileMappingHandle = Interop.Kernel32.CreateFileMapping((IntPtr)(-1), ref securityAttributes, 1715Interop.Kernel32.PageOptions.PAGE_READWRITE, 0, fileMappingSize, mappingName); 1717if ((Marshal.GetLastWin32Error() != Interop.Errors.ERROR_ACCESS_DENIED) || !_fileMappingHandle.IsInvalid) 1725_fileMappingHandle = Interop.Kernel32.OpenFileMapping(Interop.Kernel32.FileMapOptions.FILE_MAP_WRITE, false, mappingName); 1727if ((Marshal.GetLastWin32Error() != Interop.Errors.ERROR_FILE_NOT_FOUND) || !_fileMappingHandle.IsInvalid) 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)