summaryrefslogtreecommitdiff
path: root/gnss/gnssUmdf/Device.cpp
diff options
context:
space:
mode:
authorAdonais Romero González <[email protected]>2018-11-28 11:43:42 -0800
committerGitHub <[email protected]>2018-11-28 11:43:42 -0800
commit7695b30331c53cfd119c8ffae81b2e049341d301 (patch)
treee0e5d38b88c84b72caad4e8a849421dd803f451c /gnss/gnssUmdf/Device.cpp
parent70876614eb9138f66399deb6a6f06e42645d9cd3 (diff)
Revert "Initial version of GNSS UMDF Sample Driver"
Diffstat (limited to 'gnss/gnssUmdf/Device.cpp')
-rw-r--r--gnss/gnssUmdf/Device.cpp153
1 files changed, 0 insertions, 153 deletions
diff --git a/gnss/gnssUmdf/Device.cpp b/gnss/gnssUmdf/Device.cpp
deleted file mode 100644
index ed642981..00000000
--- a/gnss/gnssUmdf/Device.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-Module Name:
-
- device.c
-
-Abstract:
-
- This file contains the device entry points and callbacks.
-
-Environment:
-
- Windows User-Mode Driver Framework
-
---*/
-
-#include "precomp.h"
-#include "Trace.h"
-#include "Defaults.h"
-#include "Device.h"
-#include "NmeaProcessor.h"
-#include "FixSession.h"
-#include "FixHandler.h"
-#include "Queue.h"
-
-#include "Device.tmh"
-
-
-CDevice::CDevice(
- _In_ WDFDEVICE Device
-) :
- _Device(Device),
- _Queue(nullptr)
-{
-}
-
-CDevice::~CDevice()
-{
- if (_Queue != nullptr)
- {
- _Queue = nullptr;
- }
-}
-
-CQueue*
-CDevice::GetQueue()
-{
- return _Queue;
-}
-
-NTSTATUS
-CDevice::OnDeviceAdd(
- _In_ WDFDRIVER /*Driver*/,
- _Inout_ PWDFDEVICE_INIT DeviceInit
-)
-{
- NTSTATUS status = STATUS_SUCCESS;
-
- WDF_PNPPOWER_EVENT_CALLBACKS powerCallbacks;
- WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&powerCallbacks);
-
- powerCallbacks.EvtDeviceD0Entry = CDevice::OnD0Entry;
- powerCallbacks.EvtDeviceD0Exit = CDevice::OnD0Exit;
-
- WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &powerCallbacks);
-
- WDF_OBJECT_ATTRIBUTES deviceAttributes;
- WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes,
- CDevice);
-
- deviceAttributes.EvtCleanupCallback = CDevice::OnCleanup;
- deviceAttributes.SynchronizationScope = WdfSynchronizationScopeNone;
- deviceAttributes.ExecutionLevel = WdfExecutionLevelPassive;
-
- WDFDEVICE device;
- status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device);
-
- if (!NT_SUCCESS(status))
- {
- TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DEVICE, "WdfDeviceCreate failed with Status %!STATUS!", status);
- goto Exit;
- }
-
- // Construct device object on the preallocated buffer using placement 'new'
- CDevice* pDevice = new (GetDeviceObject(device)) CDevice(device);
-
- status = pDevice->Initialize();
-
-Exit:
- return status;
-}
-
-NTSTATUS
-CDevice::Initialize()
-{
- NTSTATUS status = STATUS_SUCCESS;
-
- status = CQueue::AddQueueToDevice(_Device, &_Queue);
-
- // Register FakeGnss Device interface
- // Note: we are not publishing a symbolic link.
- status = WdfDeviceCreateDeviceInterface(_Device,
- (LPGUID)&GUID_DEVINTERFACE_GNSS,
- nullptr);
-
- if (!NT_SUCCESS(status))
- {
- TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DEVICE, "WdfDeviceCreateDeviceInterface failed with %!STATUS!", status);
- goto Exit;
- }
-
-Exit:
- return status;
-}
-
-void
-CDevice::OnCleanup(
- _In_ WDFOBJECT Object
-)
-{
- CDevice *pDevice = GetDeviceObject(Object);
-
- // Device object constructed using placement 'new' so explicitly invoke destructor
- pDevice->~CDevice();
-}
-
-NTSTATUS
-CDevice::OnD0Entry(
- _In_ WDFDEVICE /*Device*/,
- _In_ WDF_POWER_DEVICE_STATE /*PreviousState*/
-)
-{
- NTSTATUS status;
-
- status = STATUS_SUCCESS;
-
- return status;
-}
-
-NTSTATUS
-CDevice::OnD0Exit(
- _In_ WDFDEVICE /*Device*/,
- _In_ WDF_POWER_DEVICE_STATE /*TargetState*/
-)
-{
- NTSTATUS status;
-
- status = STATUS_SUCCESS;
-
- return status;
-}