Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes308downloads
EventActivityIdControl.cs55 linesDownload Raw Back to Windows
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4#nullable enable5 6#if !UNIX7using System;8using System.Runtime.InteropServices;9 10internal static partial class Interop11{12    internal static partial class Windows13    {14        internal enum ActivityControl : uint15        {16            /// <summary>17            /// Gets the ActivityId from thread local storage.18            /// </summary>19            Get = 1,20 21            /// <summary>22            /// Sets the ActivityId in the thread local storage.23            /// </summary>24            Set = 2,25 26            /// <summary>27            /// Creates a new activity id.28            /// </summary>29            Create = 3,30 31            /// <summary>32            /// Sets the activity id in thread local storage and returns the previous value.33            /// </summary>34            GetSet = 4,35 36            /// <summary>37            /// Creates a new activity id, sets thread local storage, and returns the previous value.38            /// </summary>39            CreateSet = 540        }41 42        [LibraryImport("api-ms-win-eventing-provider-l1-1-0.dll")]43        internal static unsafe partial int EventActivityIdControl(ActivityControl controlCode, Guid* activityId);44 45        internal static unsafe int GetEventActivityIdControl(ref Guid activityId)46        {47            fixed (Guid* guidPtr = &activityId)48            {49                return EventActivityIdControl(ActivityControl.Get, guidPtr);50            }51        }52    }53}54#endif55