added windows version of vpcd driver
based on Fabio Ottavi's UMDF Driver for a Virtual Smart Card Reader, see http://www.codeproject.com/Articles/134010/An-UMDF-Driver-for-a-Virtual-Smart-Card-Reader
This commit is contained in:
69
virtualsmartcard/win32/vpcd/driver.cpp
Normal file
69
virtualsmartcard/win32/vpcd/driver.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
#include "internal.h"
|
||||
#include "VirtualSCReader.h"
|
||||
#include "driver.h"
|
||||
#include "device.h"
|
||||
#include <stdio.h>
|
||||
|
||||
CMyDriver::CMyDriver()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CMyDriver::OnDeviceAdd
|
||||
//
|
||||
// The framework call this function when device is detected. This driver
|
||||
// creates a device callback object
|
||||
//
|
||||
// Parameters:
|
||||
// pDriver - pointer to an IWDFDriver object
|
||||
// pDeviceInit - pointer to a device initialization object
|
||||
//
|
||||
// Return Values:
|
||||
// S_OK: device initialized successfully
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CMyDriver::OnDeviceAdd(
|
||||
__in IWDFDriver* pDriver,
|
||||
__in IWDFDeviceInitialize* pDeviceInit
|
||||
)
|
||||
{
|
||||
inFunc;
|
||||
HRESULT hr = CMyDevice::CreateInstance(pDriver, pDeviceInit);
|
||||
|
||||
return hr;
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CMyDriver::OnInitialize
|
||||
//
|
||||
// The framework calls this function just after loading the driver. The driver
|
||||
// can perform any global, device independent intialization in this routine.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CMyDriver::OnInitialize(
|
||||
__in IWDFDriver* pDriver
|
||||
)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(pDriver);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CMyDriver::OnDeinitialize
|
||||
//
|
||||
// The framework calls this function just before de-initializing itself. All
|
||||
// WDF framework resources should be released by driver before returning
|
||||
// from this call.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
void CMyDriver::OnDeinitialize(
|
||||
__in IWDFDriver* pDriver
|
||||
)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(pDriver);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user