public unsafe LogicalProcessorInformationIterator(LogicalProcessorRelationship relationship, Span <byte> buffer) { uint length = (uint)buffer.Length; bool success; fixed(byte *p = buffer) { success = GetLogicalProcessorInformationEx(relationship, (IntPtr)p, ref length); } if (success) { _buffer = buffer.Slice(0, (int)length); } else { int error = Marshal.GetLastWin32Error(); if (error != 122 /* ERROR_INSUFFICIENT_BUFFER */) { throw new Win32Exception(error); } _buffer = new Span <byte>(); } _start = 0; _next = 0; }
private void VerifyRelationship(LogicalProcessorRelationship relationship) { if (Relationship == relationship) { return; } throw new InvalidOperationException("Property not valid for this relationship."); }
private extern static bool GetLogicalProcessorInformationEx( LogicalProcessorRelationship relationshipType, IntPtr buffer, ref uint returnedLength);
internal LogicalProcessorInformation(Int64 processorMask, LogicalProcessorRelationship relationship, Byte processorCore) : this(processorMask, relationship) { m_processorCore = processorCore; }
internal LogicalProcessorInformation(Int64 processorMask, LogicalProcessorRelationship relationship, Int32 numaNode) : this(processorMask, relationship) { m_numaNode = numaNode; }
internal LogicalProcessorInformation(Int64 processorMask, LogicalProcessorRelationship relationship, CacheDescriptor cacheDescriptor) : this(processorMask, relationship) { m_cacheDescriptor = cacheDescriptor; }
internal LogicalProcessorInformation(Int64 processorMask, LogicalProcessorRelationship relationship) { m_processorMask = processorMask; m_relationship = relationship; }