summaryrefslogtreecommitdiff
path: root/src/utilcode/appxutil.cpp
blob: 5d095a48739b529fcd71c06da060ec6a1460ceb2 (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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//


#include "stdafx.h"

#include <strsafe.h>

#include "utilcode.h"
#include "holder.h"
#include "volatile.h"
#include "clr/fs.h"
#include "clr/str.h"

#include "appxutil.h"
#include "ex.h"

#include "shlwapi.h"    // Path manipulation APIs


GVAL_IMPL(bool, g_fAppX);
INDEBUG(bool g_fIsAppXAsked;)

namespace AppX
{
#ifdef DACCESS_COMPILE
    bool DacIsAppXProcess()
    {
        return g_fAppX;
    }
#else

    // Returns true if host has deemed the process to be appx
    bool IsAppXProcess()
    {
        INDEBUG(g_fIsAppXAsked = true;)
        return g_fAppX;
    }


    void SetIsAppXProcess(bool value)
    {
        _ASSERTE(!g_fIsAppXAsked);
        g_fAppX = value;    
    }
#endif
};