blob: f64a2b824627a68e103d757dddbc64ab1698ae57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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();
}
|