diff options
Diffstat (limited to 'src/debug/di/nativepipeline.cpp')
-rw-r--r-- | src/debug/di/nativepipeline.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/debug/di/nativepipeline.cpp b/src/debug/di/nativepipeline.cpp new file mode 100644 index 0000000000..f64a2b8246 --- /dev/null +++ b/src/debug/di/nativepipeline.cpp @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// +//***************************************************************************** +// File: NativePipeline.cpp +// + +// +//***************************************************************************** + +#include "stdafx.h" +#include "nativepipeline.h" + +#if defined(ENABLE_EVENT_REDIRECTION_PIPELINE) +#include "eventredirection.h" +#include "eventredirectionpipeline.h" +#endif + +#include "sstring.h" + +//----------------------------------------------------------------------------- +// Returns null if redirection is not enabled, else returns a new redirection pipeline. +INativeEventPipeline * CreateEventRedirectionPipelineIfEnabled() +{ +#if !defined(ENABLE_EVENT_REDIRECTION_PIPELINE) + return NULL; +#else + + BOOL fEnabled = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgRedirect) != 0; + if (!fEnabled) + { + return NULL; + } + + return new (nothrow) EventRedirectionPipeline(); +#endif +} + + +//----------------------------------------------------------------------------- +// Allocate and return a pipeline object for this platform +// Has debug checks (such as for event redirection) +// +// Returns: +// newly allocated pipeline object. Caller must call delete on it. +INativeEventPipeline * NewPipelineWithDebugChecks() +{ + CONTRACTL + { + NOTHROW; + } + CONTRACTL_END; + INativeEventPipeline * pRedirection = CreateEventRedirectionPipelineIfEnabled(); + if (pRedirection != NULL) + { + return pRedirection; + } + + return NewPipelineForThisPlatform(); +} + + + + |