Merge pull request #62 from pharring/MaybeAnEventSource

Use unsafe in MaybeAnEventSource
This commit is contained in:
Vance Morrison
2016-04-17 08:17:26 -07:00
+2 -2
View File
@@ -2277,9 +2277,9 @@ namespace Microsoft.Diagnostics.Tracing.Session
/// Returns true if 'providerGuid' can be an eventSource. If it says true, there is a 1/16 chance it is not.
/// However if it returns false, it is definitely not following EventSource Guid generation conventions.
/// </summary>
public static bool MaybeAnEventSource(Guid providerGuid)
public unsafe static bool MaybeAnEventSource(Guid providerGuid)
{
byte octet7 = providerGuid.ToByteArray()[7];
byte octet7 = ((byte*)(&providerGuid))[7];
if ((octet7 & 0xF0) == 0x50)
return true;
// FrameworkEventSource predated the Guid selection convention that most eventSources use.