summaryrefslogtreecommitdiff
path: root/pos/drivers/MagneticStripeReader/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pos/drivers/MagneticStripeReader/Driver.cpp')
-rw-r--r--pos/drivers/MagneticStripeReader/Driver.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/pos/drivers/MagneticStripeReader/Driver.cpp b/pos/drivers/MagneticStripeReader/Driver.cpp
new file mode 100644
index 00000000..5bcf2f33
--- /dev/null
+++ b/pos/drivers/MagneticStripeReader/Driver.cpp
@@ -0,0 +1,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;
+}