summaryrefslogtreecommitdiff
path: root/nfc/Simulator/Src/SecureElement.cpp
blob: 9273c9484cc529a2d544d84722b73ba4556f2a27 (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
/*++

Copyright (c) Microsoft Corporation.  All rights reserved.

Module Name:

    secureelement.cpp

Abstract:

    Implements the secure element class

Environment:

    User-mode only.

--*/

#include "Internal.h"
#include "SecureElement.tmh"

CSecureElement::CSecureElement(
    const GUID& SecureElementId,
    SECURE_ELEMENT_TYPE SecureElementType
    )
    : m_SecureElementId(SecureElementId),
      m_SecureElementType(SecureElementType),
      m_EmulationMode(EmulationOff)
{
    InitializeListHead(&m_ListEntry);
}

CSecureElement::~CSecureElement()
{
}

NTSTATUS CSecureElement::SetEmulationMode(SECURE_ELEMENT_CARD_EMULATION_MODE EmulationMode)
{
    MethodEntry("...");

    NTSTATUS Status = STATUS_SUCCESS;

    if (m_EmulationMode == EmulationMode) {
        Status = STATUS_INVALID_DEVICE_STATE;
        goto Exit;
    }

    m_EmulationMode = EmulationMode;

Exit:
    MethodReturn(Status, "Status = %!STATUS!", Status);
}