summaryrefslogtreecommitdiff
path: root/pos/drivers/MagneticStripeReader/Driver.cpp
blob: 5bcf2f33622f86047fc5f584adce1c9d042e6c6f (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
#include <pch.h>

#include "Device.h"

// Forward declaration
VOID EvtDriverCleanup(_In_ WDFOBJECT DriverObject);

/*
** Driver TODO:
**
** This is the main entry point of the driver.  POS APIs require that the driver sets up additional data in device add.
**
** Note that your driver may have additional configuration to do in this function, and it should not be assumed that this sample is complete.
*/
NTSTATUS DriverEntry(
    PDRIVER_OBJECT  DriverObject,
    PUNICODE_STRING RegistryPath
    )
{
    WDF_DRIVER_CONFIG config;
    NTSTATUS status = STATUS_SUCCESS;
    WDF_OBJECT_ATTRIBUTES attributes;

    WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
    attributes.EvtCleanupCallback = EvtDriverCleanup;

    WDF_DRIVER_CONFIG_INIT(
        &config,
        EvtDriverDeviceAdd
        );

    status = WdfDriverCreate(
        DriverObject,
        RegistryPath,
        &attributes,
        &config,
        WDF_NO_HANDLE
        );

    return status;
}

/*
** Driver TODO:
**
** This is the cleanup callback for the driver (as set above in DriverEntry).
** PosCx requires no cleanup at this point.
*/
_Use_decl_annotations_
VOID EvtDriverCleanup(WDFOBJECT /* UnusedDriverObject */)
{
    // Do any cleanup needed here
    return;
}