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:
Frank Morgner
2014-03-20 01:20:34 +01:00
parent 151f3fe3da
commit e15307d662
22 changed files with 3445 additions and 0 deletions

View File

@@ -0,0 +1,134 @@
#include "internal.h"
class CVirtualSmartCardDriverModule : public CAtlDllModuleT<CVirtualSmartCardDriverModule> {} _AtlModule;
/////////////////////////////////////////////////////////////////////////
//
// DllMain
//
// This is the main DLL Entry Point.
//
// Parameters:
// hInstance - Handle to the DLL module
// dwReason - Indicates why the DLL entry point is being called
// lpReserved - Additional information based on dwReason
//
// Return Values:
// TRUE = initialization succeeds
// FALSE = initialization fails
//
/////////////////////////////////////////////////////////////////////////
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance,
DWORD dwReason,
LPVOID lpReserved)
{
(lpReserved);
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInstance);
break;
case DLL_PROCESS_DETACH:
_AtlModule.Term();
break;
default:
break;
}
// Call the ATL module class so it can initialize
return _AtlModule.DllMain(dwReason, lpReserved);
}
/////////////////////////////////////////////////////////////////////////
//
// DllCanUnloadNow
//
// Used to determine whether the DLL can be unloaded by OLE
//
// Parameters:
// void - (unused argument)
//
// Return Values:
// S_OK: DLL can be unloaded
// S_FALSE: DLL cannot be unloaded now
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllCanUnloadNow(void)
{
return _AtlModule.DllCanUnloadNow();
}
/////////////////////////////////////////////////////////////////////////
//
// DllGetClassObject
//
// Returns a class factory to create an object of the requested type
//
// Parameters:
// rclsid - CLSID that will associate the correct data and code
// riid - Reference to the IID the caller will use
// ppv - pointer to an interface pointer requested in riid
//
// Return Values:
// S_OK: The object was retrieved successfully.
// CLASS_E_CLASSNOTAVAILABLE: The DLL does not support the class
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllGetClassObject(__in REFCLSID rclsid, __in REFIID riid, __deref_out LPVOID* ppv)
{
return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
}
/////////////////////////////////////////////////////////////////////////
//
// DllRegisterServer
//
// Adds entries to the system registry
//
// Parameters:
// void - (unused argument)
//
// Return Values:
// S_OK: The registry entries were created successfully
// SELFREG_E_TYPELIB: The server was unable to complete the
// registration of all the type libraries used by its classes
// SELFREG_E_CLASS: The server was unable to complete the
// registration of all the object classes
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllRegisterServer(void)
{
return S_OK;
}
/////////////////////////////////////////////////////////////////////////
//
// DllUnregisterServer
//
// Removes entries from the system registry
//
// Parameters:
// void - (unused argument)
//
// Return Values:
// S_OK: The registry entries were removed successfully
// S_FALSE: Unregistration of known entries was successful, but
// other entries still exist for this server's classes
// SELFREG_E_TYPELIB: The server was unable to remove the entries
// of all the type libraries used by its classes
// SELFREG_E_CLASS: The server was unable to to remove the entries
// of all the object classes
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllUnregisterServer(void)
{
return S_OK;
}

View File

@@ -0,0 +1,126 @@
#include "internal.h"
#include "Device.h"
#include "Queue.h"
/////////////////////////////////////////////////////////////////////////
//
// CMyQueue::CMyQueue
//
// Object constructor function
//
// Initialize member variables
//
/////////////////////////////////////////////////////////////////////////
CMyQueue::CMyQueue() :
m_pParentDevice(NULL)
{
state=0;
}
/////////////////////////////////////////////////////////////////////////
//
// CMyQueue::~CMyQueue
//
// Object destructor function
//
//
/////////////////////////////////////////////////////////////////////////
CMyQueue::~CMyQueue()
{
// Release the reference that was incremented in CreateInstance()
SAFE_RELEASE(m_pParentDevice);
}
/////////////////////////////////////////////////////////////////////////
//
// CMyQueue::CreateInstance
//
// This function supports the COM factory creation system
//
// Parameters:
// parentDevice - A pointer to the CWSSDevice object
// ppUkwn - pointer to a pointer to the queue to be returned
//
// Return Values:
// S_OK: The queue was created successfully
//
/////////////////////////////////////////////////////////////////////////
HRESULT CMyQueue::CreateInstance(__in IWDFDevice* pWdfDevice, CMyDevice* pMyDevice)
{
inFunc;
CComObject<CMyQueue>* pMyQueue = NULL;
if(NULL == pMyDevice)
{
return E_INVALIDARG;
}
HRESULT hr = CComObject<CMyQueue>::CreateInstance(&pMyQueue);
if(SUCCEEDED(hr))
{
// AddRef the object
pMyQueue->AddRef();
// Store the parent device object
pMyQueue->m_pParentDevice = pMyDevice;
// Increment the reference for the lifetime of the CMyQueue object.
pMyQueue->m_pParentDevice->AddRef();
CComPtr<IUnknown> spIUnknown;
hr = pMyQueue->QueryInterface(IID_IUnknown, (void**)&spIUnknown);
if(SUCCEEDED(hr))
{
// Create the framework queue
CComPtr<IWDFIoQueue> spDefaultQueue;
hr = pWdfDevice->CreateIoQueue( spIUnknown,
TRUE, // DefaultQueue
WdfIoQueueDispatchParallel, // Parallel queue handling
FALSE, // PowerManaged
TRUE, // AllowZeroLengthRequests
&spDefaultQueue
);
if (FAILED(hr))
{
OutputDebugString (L"IoQueue NOT Created\n");
}
else
OutputDebugString (L"IoQueue Created\n");
}
// Release the pMyQueue pointer when done. Note: UMDF holds a reference to it above
SAFE_RELEASE(pMyQueue);
}
return hr;
}
/////////////////////////////////////////////////////////////////////////
//
// CMyQueue::OnDeviceIoControl
//
// This method is called when an IOCTL is sent to the device
//
// Parameters:
// pQueue - pointer to an IO queue
// pRequest - pointer to an IO request
// ControlCode - The IOCTL to process
// InputBufferSizeInBytes - the size of the input buffer
// OutputBufferSizeInBytes - the size of the output buffer
//
/////////////////////////////////////////////////////////////////////////
STDMETHODIMP_ (void) CMyQueue::OnDeviceIoControl(
__in IWDFIoQueue* pQueue,
__in IWDFIoRequest* pRequest,
__in ULONG ControlCode,
SIZE_T InputBufferSizeInBytes,
SIZE_T OutputBufferSizeInBytes
)
{
m_pParentDevice->ProcessIoControl(pQueue,pRequest,ControlCode,InputBufferSizeInBytes,OutputBufferSizeInBytes);
}

View File

@@ -0,0 +1,37 @@
#pragma once
class ATL_NO_VTABLE CMyQueue :
public CComObjectRootEx<CComMultiThreadModel>,
public IQueueCallbackDeviceIoControl
{
public:
virtual ~CMyQueue();
DECLARE_NOT_AGGREGATABLE(CMyQueue)
BEGIN_COM_MAP(CMyQueue)
COM_INTERFACE_ENTRY(IQueueCallbackDeviceIoControl)
END_COM_MAP()
static HRESULT CreateInstance(__in IWDFDevice* pWdfDevice, CMyDevice* pMyDevice);
protected:
CMyQueue();
// COM Interface methods
public:
int state;
// IQueueCallbackDeviceIoControl
STDMETHOD_ (void, OnDeviceIoControl)(
__in IWDFIoQueue* pQueue,
__in IWDFIoRequest* pRequest,
__in ULONG ControlCode,
SIZE_T InputBufferSizeInBytes,
SIZE_T OutputBufferSizeInBytes
);
private:
CMyDevice* m_pParentDevice; // Parent device object
};

View File

@@ -0,0 +1,20 @@
import "wudfddi.idl";
[
uuid(8B9C88E9-7E63-46c7-832B-D48D0290E4BF),
version(1.0),
helpstring("VirtualSCReader Driver Type Library")
]
library VirtualSCReaderDriverLib
{
importlib("stdole2.tlb");
[
uuid(d4112073-d09b-458f-a5aa-35ef21eef5de),
//uuid(10654262-B9BD-4636-8890-F66362CCC207),
helpstring("VirtualSCReader Class")
]
coclass VirtualSCReaderDriver
{
[default] interface IDriverEntry;
};
};

View File

@@ -0,0 +1,432 @@
#include "vpcd.h"
#include "internal.h"
#include "VirtualSCReader.h"
#include "queue.h"
#include "device.h"
#include "driver.h"
#include <stdio.h>
#include <winscard.h>
#include "memory.h"
#include <Sddl.h>
HRESULT
CMyDevice::CreateInstance(
__in IWDFDriver *FxDriver,
__in IWDFDeviceInitialize * FxDeviceInit
)
/*++
Routine Description:
This method creates and initializs an instance of the virtual smart card reader driver's
device callback object.
Arguments:
FxDeviceInit - the settings for the device.
Device - a location to store the referenced pointer to the device object.
Return Value:
Status
--*/
{
inFunc;
CComObject<CMyDevice>* device = NULL;
HRESULT hr;
//
// Allocate a new instance of the device class.
//
hr = CComObject<CMyDevice>::CreateInstance(&device);
if (device==NULL)
{
return E_OUTOFMEMORY;
}
//
// Initialize the instance.
//
device->AddRef();
FxDeviceInit->SetLockingConstraint(WdfDeviceLevel);
CComPtr<IUnknown> spCallback;
hr = device->QueryInterface(IID_IUnknown, (void**)&spCallback);
CComPtr<IWDFDevice> spIWDFDevice;
if (SUCCEEDED(hr))
{
hr = FxDriver->CreateDevice(FxDeviceInit, spCallback, &spIWDFDevice);
}
if (spIWDFDevice->CreateDeviceInterface(&SmartCardReaderGuid,NULL)!=0)
OutputDebugString(L"CreateDeviceInterface Failed\n");
SAFE_RELEASE(device);
return hr;
}
void CMyDevice::IoSmartCardIsPresent(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
UNREFERENCED_PARAMETER(inBufSize);
UNREFERENCED_PARAMETER(outBufSize);
inFunc;
if (vicc_present(ctx) == 1)
// there's a smart card present, so complete the request
pRequest->CompleteWithInformation(STATUS_SUCCESS, 0);
else {
// there's no smart card present, so leave the request pending; it will be completed later
waitInsertIpr=pRequest;
IRequestCallbackCancel *callback;
QueryInterface(__uuidof(IRequestCallbackCancel),(void**)&callback);
pRequest->MarkCancelable(callback);
callback->Release();
}
}
void CMyDevice::IoSmartCardGetState(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
UNREFERENCED_PARAMETER(inBufSize);
UNREFERENCED_PARAMETER(outBufSize);
inFunc;
if (vicc_present(ctx) == 1) {
OutputDebugString(L"[GSTA]SCARD_SPECIFIC\n");
completeWithInteger(pRequest, SCARD_SPECIFIC);
} else {
OutputDebugString(L"SCARD_ABSENT\n");
completeWithInteger(pRequest, SCARD_ABSENT);
}
}
void CMyDevice::IoSmartCardIsAbsent(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
UNREFERENCED_PARAMETER(inBufSize);
UNREFERENCED_PARAMETER(outBufSize);
inFunc;
if (vicc_present(ctx) == 0)
// there's no smart card present, so complete the request
pRequest->CompleteWithInformation(STATUS_SUCCESS, 0);
else {
// there's a smart card present, so leave the request pending; it will be completed later
waitRemoveIpr=pRequest;
IRequestCallbackCancel *callback;
QueryInterface(__uuidof(IRequestCallbackCancel),(void**)&callback);
pRequest->MarkCancelable(callback);
callback->Release();
}
}
void CMyDevice::IoSmartCardPower(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
UNREFERENCED_PARAMETER(inBufSize);
UNREFERENCED_PARAMETER(outBufSize);
inFunc;
DWORD code;
if (!getInteger(pRequest, &code)) {
OutputDebugString(L"error getting code\n");
pRequest->CompleteWithInformation(STATUS_NO_MEDIA, 0);
return;
}
switch (code) {
case SCARD_COLD_RESET:
OutputDebugString(L"[POWR]SCARD_COLD_RESET\n");
vicc_poweroff(ctx);
vicc_poweron(ctx);
break;
case SCARD_WARM_RESET:
OutputDebugString(L"[POWR]SCARD_WARM_RESET\n");
vicc_reset(ctx);
break;
case SCARD_POWER_DOWN:
OutputDebugString(L"[POWR]SCARD_POWER_DOWN\n");
vicc_poweroff(ctx);
}
if (code==SCARD_COLD_RESET || code==SCARD_WARM_RESET) {
int ATRsize = vicc_getatr(ctx, &outdata);
if (ATRsize <= 0) {
pRequest->CompleteWithInformation(STATUS_NO_MEDIA, 0);
return;
}
outlength = ATRsize;
completeWithBuffer(pRequest,outdata,outlength);
} else {
pRequest->CompleteWithInformation(STATUS_SUCCESS, 0);
}
}
void CMyDevice::IoSmartCardSetAttribute(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
UNREFERENCED_PARAMETER(inBufSize);
UNREFERENCED_PARAMETER(outBufSize);
inFunc;
IWDFMemory *inmem=NULL;
pRequest->GetInputMemory(&inmem);
SIZE_T size;
BYTE *data=(BYTE *)inmem->GetDataBuffer(&size);
DWORD minCode=*(DWORD*)(data);
bool handled=false;
if (minCode==SCARD_ATTR_DEVICE_IN_USE) {
OutputDebugString(L"[SATT]SCARD_ATTR_DEVICE_IN_USE\n");
pRequest->CompleteWithInformation(STATUS_SUCCESS, 0);
handled=true;
}
inmem->Release();
if (!handled) {
OutputDebugString(L"[SATT]ERROR_NOT_SUPPORTED\n");
pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
}
}
void CMyDevice::IoSmartCardTransmit(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
UNREFERENCED_PARAMETER(inBufSize);
UNREFERENCED_PARAMETER(outBufSize);
inFunc;
if (!getBuffer(pRequest,&indata,&inlength)) {
pRequest->CompleteWithInformation(STATUS_INVALID_DEVICE_STATE, 0);
return;
}
if (((SCARD_IO_REQUEST*)indata)->dwProtocol!=SCARD_PROTOCOL_T1) {
pRequest->CompleteWithInformation(STATUS_INVALID_DEVICE_STATE, 0);
return;
}
int RespSize = vicc_transmit(ctx, inlength - sizeof(SCARD_IO_REQUEST), indata + sizeof(SCARD_IO_REQUEST), &outdata);
if (RespSize < 0)
{
pRequest->CompleteWithInformation(STATUS_NO_MEDIA, 0);
return;
}
outlength = RespSize;
BYTE *Resp = (BYTE *) malloc(outlength+sizeof(SCARD_IO_REQUEST));
if (!Resp) {
pRequest->CompleteWithInformation(STATUS_NO_MEDIA, 0);
return;
}
((SCARD_IO_REQUEST*)Resp)->cbPciLength=sizeof(SCARD_IO_REQUEST);
((SCARD_IO_REQUEST*)Resp)->dwProtocol=SCARD_PROTOCOL_T1;
memcpy(Resp + sizeof(SCARD_IO_REQUEST), outdata, outlength);
completeWithBuffer(pRequest,Resp,RespSize+sizeof(SCARD_IO_REQUEST));
}
void CMyDevice::IoSmartCardGetAttribute(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
UNREFERENCED_PARAMETER(inBufSize);
DWORD code;
int ATRsize;
if (!getInteger(pRequest, &code)) {
OutputDebugString(L"error getting code\n");
pRequest->CompleteWithInformation(STATUS_NO_MEDIA, 0);
return;
}
switch(code) {
case SCARD_ATTR_CHARACTERISTICS:
// 0x00000000 No special characteristics
OutputDebugString(L"[GATT]SCARD_ATTR_CHARACTERISTICS\n");
completeWithInteger(pRequest,0);
return;
case SCARD_ATTR_VENDOR_NAME:
OutputDebugString(L"[GATT]SCARD_ATTR_VENDOR_NAME\n");
completeWithString(pRequest,"Virtual Smart Card Architecture",(int)outBufSize);
return;
case SCARD_ATTR_VENDOR_IFD_TYPE:
OutputDebugString(L"[GATT]SCARD_ATTR_VENDOR_IFD_TYPE\n");
completeWithString(pRequest,"Virtual PCD",(int)outBufSize);
return;
case SCARD_ATTR_DEVICE_UNIT:
OutputDebugString(L"[GATT]SCARD_ATTR_DEVICE_UNIT\n");
completeWithInteger(pRequest,0);
return;
case SCARD_ATTR_ATR_STRING:
OutputDebugString(L"[GATT]SCARD_ATTR_ATR_STRING\n");
ATRsize = vicc_getatr(ctx, &outdata);
if (ATRsize <= 0)
{
pRequest->CompleteWithInformation(STATUS_NO_MEDIA, 0);
return;
}
outlength = ATRsize;
completeWithBuffer(pRequest,outdata,outlength);
return;
case SCARD_ATTR_CURRENT_PROTOCOL_TYPE:
OutputDebugString(L"[GATT]SCARD_ATTR_CURRENT_PROTOCOL_TYPE\n");
completeWithInteger(pRequest,SCARD_PROTOCOL_T1); // T=1
return;
default:
OutputDebugString(L"[GATT]ERROR_NOT_SUPPORTED\n");
pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
}
}
void CMyDevice::ProcessIoControl(__in IWDFIoQueue* pQueue,
__in IWDFIoRequest* pRequest,
__in ULONG ControlCode,
SIZE_T inBufSize,
SIZE_T outBufSize)
{
inFunc;
UNREFERENCED_PARAMETER(pQueue);
if (ControlCode==IOCTL_SMARTCARD_GET_ATTRIBUTE) {
IoSmartCardGetAttribute(pRequest,inBufSize,outBufSize);
return;
}
else if (ControlCode==IOCTL_SMARTCARD_IS_PRESENT) {
IoSmartCardIsPresent(pRequest,inBufSize,outBufSize);
return;
}
else if (ControlCode==IOCTL_SMARTCARD_GET_STATE) {
IoSmartCardGetState(pRequest,inBufSize,outBufSize);
return;
}
else if (ControlCode==IOCTL_SMARTCARD_IS_ABSENT) {
IoSmartCardIsAbsent(pRequest,inBufSize,outBufSize);
return;
}
else if (ControlCode==IOCTL_SMARTCARD_POWER) {
IoSmartCardPower(pRequest,inBufSize,outBufSize);
return;
}
else if (ControlCode==IOCTL_SMARTCARD_SET_ATTRIBUTE) {
IoSmartCardSetAttribute(pRequest,inBufSize,outBufSize);
return;
}
else if (ControlCode==IOCTL_SMARTCARD_TRANSMIT) {
IoSmartCardTransmit(pRequest,inBufSize,outBufSize);
return;
}
OutputDebugString(L"[IOCT]ERROR_NOT_SUPPORTED\n");
pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
return;
}
/////////////////////////////////////////////////////////////////////////
//
// CMyDevice::OnPrepareHardware
//
// Called by UMDF to prepare the hardware for use.
//
// Parameters:
// pWdfDevice - pointer to an IWDFDevice object representing the
// device
//
// Return Values:
// S_OK: success
//
/////////////////////////////////////////////////////////////////////////
HRESULT CMyDevice::OnPrepareHardware(
__in IWDFDevice* pWdfDevice
)
{
inFunc;
// Store the IWDFDevice pointer
m_pWdfDevice = pWdfDevice;
// Configure the default IO Queue
HRESULT hr = CMyQueue::CreateInstance(m_pWdfDevice, this);
ctx = vicc_init(NULL, VPCDPORT);
return hr;
}
/////////////////////////////////////////////////////////////////////////
//
// CMyDevice::OnReleaseHardware
//
// Called by WUDF to uninitialize the hardware.
//
// Parameters:
// pWdfDevice - pointer to an IWDFDevice object for the device
//
// Return Values:
// S_OK:
//
/////////////////////////////////////////////////////////////////////////
HRESULT CMyDevice::OnReleaseHardware(
__in IWDFDevice* pWdfDevice
)
{
inFunc;
UNREFERENCED_PARAMETER(pWdfDevice);
// Release the IWDFDevice handle, if it matches
if (pWdfDevice == m_pWdfDevice.p)
{
vicc_eject(ctx);
vicc_exit(ctx);
ctx = NULL;
m_pWdfDevice.Release();
}
return S_OK;
}
HRESULT CMyDevice::OnD0Entry(IN IWDFDevice* pWdfDevice,IN WDF_POWER_DEVICE_STATE previousState) {
UNREFERENCED_PARAMETER(pWdfDevice);
UNREFERENCED_PARAMETER(previousState);
inFunc;
vicc_poweroff(ctx);
return S_OK;
}
HRESULT CMyDevice::OnD0Exit(IN IWDFDevice* pWdfDevice,IN WDF_POWER_DEVICE_STATE newState) {
UNREFERENCED_PARAMETER(pWdfDevice);
UNREFERENCED_PARAMETER(newState);
inFunc;
vicc_poweron(ctx);
return S_OK;
}
void CMyDevice::shutDown(){
if (waitRemoveIpr!=NULL) {
if (waitRemoveIpr->UnmarkCancelable()==S_OK)
waitRemoveIpr->Complete(HRESULT_FROM_WIN32(ERROR_CANCELLED));
waitRemoveIpr=NULL;
}
if (waitInsertIpr!=NULL) {
if (waitInsertIpr->UnmarkCancelable()==S_OK)
waitInsertIpr->Complete(HRESULT_FROM_WIN32(ERROR_CANCELLED));
waitInsertIpr=NULL;
}
free(outdata);
outdata = NULL;
outlength = 0;
free(indata);
indata = NULL;
inlength = 0;
}
HRESULT CMyDevice::OnQueryRemove(IN IWDFDevice* pWdfDevice) {
UNREFERENCED_PARAMETER(pWdfDevice);
inFunc;
shutDown();
return S_OK;
}
HRESULT CMyDevice::OnQueryStop(IN IWDFDevice* pWdfDevice) {
UNREFERENCED_PARAMETER(pWdfDevice);
inFunc;
shutDown();
return S_OK;
}
void CMyDevice::OnSurpriseRemoval(IN IWDFDevice* pWdfDevice) {
UNREFERENCED_PARAMETER(pWdfDevice);
inFunc;
shutDown();
}
STDMETHODIMP_ (void) CMyDevice::OnCancel(IN IWDFIoRequest* pWdfRequest) {
inFunc;
if (pWdfRequest==waitRemoveIpr) {
OutputDebugString(L"Cancel Remove\n");
waitRemoveIpr=NULL;
} else if (pWdfRequest==waitInsertIpr) {
OutputDebugString(L"Cancel Insert\n");
waitInsertIpr=NULL;
}
pWdfRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_CANCELLED), 0);
}

View File

@@ -0,0 +1,112 @@
#pragma once
//
// Class for the iotrace driver.
//
class ATL_NO_VTABLE CMyDevice :
public CComObjectRootEx<CComMultiThreadModel>,
public IPnpCallbackHardware,
public IPnpCallback,
public IRequestCallbackCancel
{
public:
~CMyDevice() {}
DECLARE_NOT_AGGREGATABLE(CMyDevice)
BEGIN_COM_MAP(CMyDevice)
COM_INTERFACE_ENTRY(IPnpCallbackHardware)
COM_INTERFACE_ENTRY(IPnpCallback)
COM_INTERFACE_ENTRY(IRequestCallbackCancel)
END_COM_MAP()
CMyDevice(VOID)
{
m_pWdfDevice = NULL;
waitRemoveIpr=NULL;
waitInsertIpr=NULL;
ctx = NULL;
pipe=NULL;
eventpipe=NULL;
outdata = NULL;
outlength = 0;
indata = NULL;
inlength = 0;
}
//
// Private data members.
//
private:
CComPtr<IWDFDevice> m_pWdfDevice;
CComPtr<IWDFIoRequest> waitRemoveIpr,waitInsertIpr;
struct vicc_ctx *ctx;
BYTE *outdata;
SIZE_T outlength;
BYTE *indata;
SIZE_T inlength;
HANDLE pipe;
HANDLE eventpipe;
//
// Private methods.
//
private:
HRESULT ConfigureQueue();
//
// Public methods
//
public:
//
// The factory method used to create an instance of this driver.
//
static
HRESULT CreateInstance(
__in IWDFDriver *FxDriver,
__in IWDFDeviceInitialize *FxDeviceInit
);
//
// COM methods
//
public:
//
// IUnknown methods.
//
void ProcessIoControl(__in IWDFIoQueue* pQueue,
__in IWDFIoRequest* pRequest,
__in ULONG ControlCode,
SIZE_T InputBufferSizeInBytes,
SIZE_T OutputBufferSizeInBytes);
STDMETHOD_ (HRESULT, OnPrepareHardware)(__in IWDFDevice* pWdfDevice);
STDMETHOD_ (HRESULT, OnReleaseHardware)(__in IWDFDevice* pWdfDevice);
STDMETHOD_ (HRESULT, OnD0Entry)(IN IWDFDevice* pWdfDevice,IN WDF_POWER_DEVICE_STATE previousState);
STDMETHOD_ (HRESULT, OnD0Exit )(IN IWDFDevice* pWdfDevice,IN WDF_POWER_DEVICE_STATE newState);
STDMETHOD_ (HRESULT, OnQueryRemove )(IN IWDFDevice* pWdfDevice);
STDMETHOD_ (HRESULT, OnQueryStop)(IN IWDFDevice* pWdfDevice);
STDMETHOD_ (void, OnSurpriseRemoval)(IN IWDFDevice* pWdfDevice);
STDMETHOD_ (void, OnCancel)(IN IWDFIoRequest* pWdfRequest);
void IoSmartCardGetAttribute(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize);
void IoSmartCardIsPresent(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize);
void IoSmartCardGetState(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize);
void IoSmartCardIsAbsent(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize);
void IoSmartCardPower(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize);
void IoSmartCardSetAttribute(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize);
void IoSmartCardTransmit(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize);
void shutDown();
};

View 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;
}

View File

@@ -0,0 +1,37 @@
#pragma once
//
// This class handles driver events for the skeleton sample. In particular
// it supports the OnDeviceAdd event, which occurs when the driver is called
// to setup per-device handlers for a new device stack.
//
class ATL_NO_VTABLE CMyDriver :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CMyDriver, &CLSID_VirtualSCReaderDriver>,
public IDriverEntry
{
public:
CMyDriver();
DECLARE_NO_REGISTRY()
DECLARE_CLASSFACTORY()
DECLARE_NOT_AGGREGATABLE(CMyDriver)
BEGIN_COM_MAP(CMyDriver)
COM_INTERFACE_ENTRY(IDriverEntry)
END_COM_MAP()
public:
//
// IDriverEntry
//
STDMETHOD (OnInitialize)(__in IWDFDriver* pDriver);
STDMETHOD (OnDeviceAdd)(__in IWDFDriver* pDriver, __in IWDFDeviceInitialize* pDeviceInit);
STDMETHOD_ (void, OnDeinitialize)(__in IWDFDriver* pDriver);
};
OBJECT_ENTRY_AUTO(__uuidof(VirtualSCReaderDriver), CMyDriver)

View File

@@ -0,0 +1,15 @@
; Skeleton.def : Declares the module parameters.
;
; TODO: Change the library name here to match your binary name.
;
LIBRARY "UMDFSkeleton.DLL"
EXPORTS
DllCanUnloadNow PRIVATE
DllGetClassObject PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE

View File

@@ -0,0 +1,74 @@
#pragma once
#include <windows.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlstr.h>
__user_driver; // Macro letting the compiler know this is not a kernel driver (this will help surpress needless warnings)
// Common WPD and WUDF headers
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
#ifndef SAFE_RELEASE
#define SAFE_RELEASE(p) {if ((p)) { (p)->Release(); (p) = NULL; }}
#endif
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth
#define STATUS_NO_MEDIA ((NTSTATUS)0xC0000178L)
#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184L)
//
// Include the WUDF DDI
//
#include <devioctl.h>
#include <initguid.h>
#include <propkeydef.h>
#include <propvarutil.h>
#include "PortableDeviceTypes.h"
#include "PortableDeviceClassExtension.h"
#include "PortableDevice.h"
#include "wudfddi.h"
//
// Use specstrings for in/out annotation of function parameters.
//
#include "specstrings.h"
//
// Forward definitions of classes in the other header files.
//
typedef class CMyDriver *PCMyDriver;
typedef class CMyDevice *PCMyDevice;
//
DEFINE_GUID(SmartCardReaderGuid, 0x50DD5230, 0xBA8A, 0x11D1, 0xBF,0x5D,0x00,0x00,0xF8,0x05,0xF5,0x30);
//
// Include the type specific headers.
//
class funcTrace {
public:
wchar_t funcN[500];
funcTrace (char *func) {
wchar_t funcName[500];
wsprintf(funcN,L"%S",func);
wsprintf(funcName,L"IN -> %s\n",funcN);
OutputDebugString(funcName);
}
~funcTrace () {
wchar_t funcName[500];
wsprintf(funcName,L"OUT -> %s\n",funcN);
OutputDebugString(funcName);
}
};
#define inFunc funcTrace _ftrace(__FUNCTION__);

View File

@@ -0,0 +1,8 @@
.SUFFIXES: .inx
STAMP=stampinf
.inx{$(OBJ_PATH)\$(O)}.inf:
copy $(@B).inx $@
$(STAMP) -f $@ -a $(_BUILDARCH) -k $(KMDF_VERSION_MAJOR).$(KMDF_VERSION_MINOR) -u $(UMDF_VERSION_MAJOR).$(UMDF_VERSION_MINOR).0

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<STAMP Condition="'$(OVERRIDE_STAMP)'!='true'">stampinf</STAMP>
</PropertyGroup>
<ItemGroup>
<NmakeTarget Include="vpcd.inx">
<TargetKillSwitch>ConvertedTarget0_Disabled</TargetKillSwitch>
<TargetName>Converted Target 0</TargetName>
<Outputs>$(OBJ_PATH)\$(O)\vpcd.inf</Outputs>
<Condition>
</Condition>
<Cmd0>copy %24%28%40B%29.inx %24%40</Cmd0>
<Cmd1>$(STAMP) -f %24%40 -a $(_BUILDARCH) -k $(KMDF_VERSION_MAJOR).$(KMDF_VERSION_MINOR) -u $(UMDF_VERSION_MAJOR).$(UMDF_VERSION_MINOR).0</Cmd1>
</NmakeTarget>
</ItemGroup>
<Target Name="Converted Target 0" BeforeTargets="$(BuildLinkTargets)" AfterTargets="$(AfterBuildCompileTargets)" Condition="'$(ConvertedTarget0_Disabled)'!='true'">
<ItemGroup>
<AllEvaluatedTargetInputs Remove="@(AllEvaluatedTargetInputs)" />
<t_TargetInput_0 Remove="@(t_TargetInput_0)" />
<t_TargetInput_0 Include="vpcd.inx" Condition="Exists('vpcd.inx') And ('@(t_TargetInput_0)'=='')" />
<t_TargetInput_0 Include="vpcd.inx" Condition="'@(t_TargetInput_0)'==''" />
<AllEvaluatedTargetInputs Include="@(t_TargetInput_0);" />
</ItemGroup>
<ReplaceNmakeCommandTokens Command="copy %24%28%40B%29.inx %24%40" TaskInputFiles="@(AllEvaluatedTargetInputs)" TaskOutputFile="$(OBJ_PATH)\$(O)\vpcd.inf">
<Output TaskParameter="ShouldExecute" PropertyName="TargetOutDated" />
<Output TaskParameter="ProcessedCommand" PropertyName="ResolvedCommand_1" />
</ReplaceNmakeCommandTokens>
<Exec Condition="'$(TargetOutDated)'=='true'" Command="$(ResolvedCommand_1)" WorkingDirectory="$(MSBuildProjectDirectory)" />
<ReplaceNmakeCommandTokens Command="$(STAMP) -f %24%40 -a $(_BUILDARCH) -k $(KMDF_VERSION_MAJOR).$(KMDF_VERSION_MINOR) -u $(UMDF_VERSION_MAJOR).$(UMDF_VERSION_MINOR).0" TaskInputFiles="@(AllEvaluatedTargetInputs)" TaskOutputFile="$(OBJ_PATH)\$(O)\vpcd.inf">
<Output TaskParameter="ShouldExecute" PropertyName="Junk_Property" />
<Output TaskParameter="ProcessedCommand" PropertyName="ResolvedCommand_2" />
</ReplaceNmakeCommandTokens>
<Exec Condition="'$(TargetOutDated)'=='true'" Command="$(ResolvedCommand_2)" WorkingDirectory="$(MSBuildProjectDirectory)" />
<Message Condition="'$(TargetOutDated)'!='true'" Text="File $(OBJ_PATH)\$(O)\vpcd.inf is up-to-date" />
</Target>
</Project>

View File

@@ -0,0 +1,103 @@
#include "memory.h"
bool getBuffer(IWDFIoRequest *pRequest, BYTE **buffer, SIZE_T *bufferLen)
{
IWDFMemory *inmem=NULL;
if (!pRequest || !buffer || !bufferLen) {
OutputDebugString(L"wrong arguments");
return false;
}
pRequest->GetInputMemory(&inmem);
if (inmem==NULL) {
OutputDebugString(L"GetInputMemory failed");
return false;
} else {
SIZE_T size;
void *data=inmem->GetDataBuffer(&size);
if (*bufferLen < size) {
BYTE *p = (BYTE *) realloc(*buffer, size);
if (!p) {
OutputDebugString(L"realloc failed");
inmem->Release();
return false;
}
*buffer = p;
}
memcpy(*buffer, data, size);
(*bufferLen) = size;
inmem->Release();
return true;
}
}
void completeWithBuffer(IWDFIoRequest* pRequest,BYTE *result,int inSize) {
IWDFMemory *outmem=NULL;
pRequest->GetOutputMemory (&outmem);
if (outmem==NULL) {
OutputDebugString(L"GetOutputMemory failed");
pRequest->Complete(HRESULT_FROM_WIN32(ERROR_GEN_FAILURE));
}
else {
outmem->CopyFromBuffer(0,result,inSize);
outmem->Release();
pRequest->CompleteWithInformation(0,(SIZE_T)inSize);
}
}
void completeWithString(IWDFIoRequest* pRequest,char *result,int outSize) {
IWDFMemory *outmem=NULL;
pRequest->GetOutputMemory (&outmem);
if (outmem==NULL) {
OutputDebugString(L"GetOutputMemory failed");
pRequest->Complete(HRESULT_FROM_WIN32(ERROR_GEN_FAILURE));
}
else {
int size=min(outSize,(int)strlen(result)+1);
outmem->CopyFromBuffer(0,result,size);
outmem->Release();
pRequest->CompleteWithInformation(0,(SIZE_T)size);
}
}
void completeWithInteger(IWDFIoRequest* pRequest,DWORD result) {
IWDFMemory *outmem=NULL;
pRequest->GetOutputMemory (&outmem);
if (outmem==NULL) {
OutputDebugString(L"GetOutputMemory failed");
pRequest->Complete(HRESULT_FROM_WIN32(ERROR_GEN_FAILURE));
}
else {
outmem->CopyFromBuffer(0,&result,sizeof(result));
outmem->Release();
pRequest->CompleteWithInformation(0,sizeof(result));
}
}
bool getInteger(IWDFIoRequest *pRequest, DWORD *integer)
{
IWDFMemory *inmem=NULL;
if (!pRequest || !integer) {
OutputDebugString(L"wrong arguments");
return false;
}
pRequest->GetInputMemory(&inmem);
if (inmem==NULL) {
OutputDebugString(L"GetInputMemory failed");
return false;
} else {
SIZE_T size;
void *data=inmem->GetDataBuffer(&size);
if (size != sizeof(*integer)) {
OutputDebugString(L"not enough memory failed");
return false;
}
*integer=*(DWORD *)data;
inmem->Release();
return true;
}
}

View File

@@ -0,0 +1,9 @@
#pragma once
#include "internal.h"
bool getBuffer(IWDFIoRequest *pRequest, BYTE **buffer, SIZE_T *bufferLen);
void completeWithString(IWDFIoRequest* pRequest,char *result,int outSize);
void completeWithBuffer(IWDFIoRequest* pRequest,BYTE *result,int inSize);
void completeWithInteger(IWDFIoRequest* pRequest,DWORD result);
bool getInteger(IWDFIoRequest *pRequest, DWORD *integer);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
#
# UMDF_VERSION_MAJOR controls the headers that the driver uses.
# UMDF_VERSION_MAJOR + UMDF_VERSION_MINOR control which version
# of UMDF the driver is bound to in the INF and which
# update coinstaller it requires (through stampinf).
#
UMDF_VERSION_MAJOR=1
UMDF_VERSION_MINOR=9
KMDF_VERSION_MAJOR=1
KMDF_VERSION_MINOR=9
TARGETNAME=vpcd
TARGETTYPE=DYNLINK
USE_ATL = 1
ATL_VER = 71
USE_MSVCRT = 1
C_DEFINES = $(C_DEFINES) /D_UNICODE /DUNICODE
WIN32_WINNT_VERSION=$(LATEST_WIN32_WINNT_VERSION)
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WIN7)
NTDDI_VERSION=$(LATEST_NTDDI_VERSION)
DLLENTRY=_DllMainCRTStartup
DLLDEF=exports.def
SOURCES=\
vpcd.rc \
driver.cpp \
device.cpp \
queue.cpp \
memory.cpp \
DllMain.cpp \
VirtualSCReader.idl
INCLUDES= $(INCLUDES); \
$(SDK_INC_PATH); \
$(DDK_INC_PATH); \
$(UMDF_INC_PATH)\10;
MSC_WARNING_LEVEL=/W4 /WX
TARGETLIBS=\
$(SDK_LIB_PATH)\strsafe.lib \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\ole32.lib \
$(SDK_LIB_PATH)\oleaut32.lib \
$(SDK_LIB_PATH)\uuid.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\advapi32.lib \
$(SDK_LIB_PATH)\shlwapi.lib \
$(SDK_LIB_PATH)\ws2_32.lib
NTTARGETFILE1=$(OBJ_PATH)\$(O)\vpcd.inf
#
# This sets up the WPP preprocessor and tells it to scan internal.h to find
# the trace function definition that's in there.
#
#RUN_WPP= $(SOURCES) -dll -scan:internal.h
TARGET_DESTINATION=wudf

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UMDF_VERSION_MAJOR Condition="'$(OVERRIDE_UMDF_VERSION_MAJOR)'!='true'">1</UMDF_VERSION_MAJOR>
<UMDF_VERSION_MINOR Condition="'$(OVERRIDE_UMDF_VERSION_MINOR)'!='true'">9</UMDF_VERSION_MINOR>
<KMDF_VERSION_MAJOR Condition="'$(OVERRIDE_KMDF_VERSION_MAJOR)'!='true'">1</KMDF_VERSION_MAJOR>
<KMDF_VERSION_MINOR Condition="'$(OVERRIDE_KMDF_VERSION_MINOR)'!='true'">9</KMDF_VERSION_MINOR>
<TARGETNAME Condition="'$(OVERRIDE_TARGETNAME)'!='true'">vpcd</TARGETNAME>
<TARGETTYPE Condition="'$(OVERRIDE_TARGETTYPE)'!='true'">DYNLINK</TARGETTYPE>
<USE_ATL Condition="'$(OVERRIDE_USE_ATL)'!='true'">1</USE_ATL>
<ATL_VER Condition="'$(OVERRIDE_ATL_VER)'!='true'">71</ATL_VER>
<USE_MSVCRT Condition="'$(OVERRIDE_USE_MSVCRT)'!='true'">1</USE_MSVCRT>
<C_DEFINES Condition="'$(OVERRIDE_C_DEFINES)'!='true'">$(C_DEFINES) /D_UNICODE /DUNICODE</C_DEFINES>
<WIN32_WINNT_VERSION Condition="'$(OVERRIDE_WIN32_WINNT_VERSION)'!='true'">$(LATEST_WIN32_WINNT_VERSION)</WIN32_WINNT_VERSION>
<_NT_TARGET_VERSION Condition="'$(OVERRIDE__NT_TARGET_VERSION)'!='true'">$(_NT_TARGET_VERSION_WIN7)</_NT_TARGET_VERSION>
<NTDDI_VERSION Condition="'$(OVERRIDE_NTDDI_VERSION)'!='true'">$(LATEST_NTDDI_VERSION)</NTDDI_VERSION>
<DLLENTRY Condition="'$(OVERRIDE_DLLENTRY)'!='true'">_DllMainCRTStartup</DLLENTRY>
<DLLDEF Condition="'$(OVERRIDE_DLLDEF)'!='true'">exports.def</DLLDEF>
<SOURCES Condition="'$(OVERRIDE_SOURCES)'!='true'">vpcd.rc driver.cpp device.cpp queue.cpp memory.cpp DllMain.cpp VirtualSCReader.idl</SOURCES>
<INCLUDES Condition="'$(OVERRIDE_INCLUDES)'!='true'">$(INCLUDES); $(SDK_INC_PATH); $(DDK_INC_PATH); $(UMDF_INC_PATH)\10;</INCLUDES>
<MSC_WARNING_LEVEL Condition="'$(OVERRIDE_MSC_WARNING_LEVEL)'!='true'">/W4 /WX</MSC_WARNING_LEVEL>
<TARGETLIBS Condition="'$(OVERRIDE_TARGETLIBS)'!='true'">$(SDK_LIB_PATH)\strsafe.lib $(SDK_LIB_PATH)\kernel32.lib $(SDK_LIB_PATH)\ole32.lib $(SDK_LIB_PATH)\oleaut32.lib $(SDK_LIB_PATH)\uuid.lib $(SDK_LIB_PATH)\user32.lib $(SDK_LIB_PATH)\advapi32.lib $(SDK_LIB_PATH)\shlwapi.lib $(SDK_LIB_PATH)\ws2_32.lib</TARGETLIBS>
<NTTARGETFILE1 Condition="'$(OVERRIDE_NTTARGETFILE1)'!='true'">$(OBJ_PATH)\$(O)\vpcd.inf</NTTARGETFILE1>
<TARGET_DESTINATION Condition="'$(OVERRIDE_TARGET_DESTINATION)'!='true'">wudf</TARGET_DESTINATION>
</PropertyGroup>
<ItemGroup>
<InvokedTargetsList Include="$(OBJ_PATH)\$(O)\vpcd.inf">
<Pass>1</Pass>
<Condition>
</Condition>
</InvokedTargetsList>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Win8.1 Debug|Win32">
<Configuration>Win8.1 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8.1 Release|Win32">
<Configuration>Win8.1 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Debug|Win32">
<Configuration>Win8 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|Win32">
<Configuration>Win8 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|Win32">
<Configuration>Win7 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|Win32">
<Configuration>Win7 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8.1 Debug|x64">
<Configuration>Win8.1 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8.1 Release|x64">
<Configuration>Win8.1 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Debug|x64">
<Configuration>Win8 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|x64">
<Configuration>Win8 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|x64">
<Configuration>Win7 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|x64">
<Configuration>Win7 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="PropertySheets">
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
<ConfigurationType>Utility</ConfigurationType>
<DriverType>Package</DriverType>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
<Configuration>Win8.1 Debug</Configuration>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|Win32'" Label="Configuration">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'" Label="Configuration">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'" Label="Configuration">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'" Label="Configuration">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup>
<DebuggerFlavor>DbgengRemoteDebugger</DebuggerFlavor>
<EnableDeployment>False</EnableDeployment>
<ImportToStore>False</ImportToStore>
<InstallMode>None</InstallMode>
<HardwareIdString />
<CommandLine />
<ScriptPath />
<DeployFiles />
<ScriptName />
<ScriptDeviceQuery>%PathToInf%</ScriptDeviceQuery>
<EnableVerifier>False</EnableVerifier>
<AllDrivers>False</AllDrivers>
<VerifyProjectOutput>True</VerifyProjectOutput>
<VerifyDrivers />
<VerifyFlags>133563</VerifyFlags>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<!--Inf Include="DriverInf.inv" /-->
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\vpcd.vcxproj">
<Project>{B019D202-420C-484D-9303-45B552A05B95}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,80 @@
;
; VirtualCardReader.inf
;
[Version]
Signature="$Windows NT$"
Class=SmartCardReader
ClassGuid={50dd5230-ba8a-11d1-bf5d-0000f805f530}
Provider=%MSFTUMDF%
CatalogFile=WUDF.cat
DriverVer=11/22/2010,6.1.7600.16385
[Manufacturer]
%MSFTUMDF%=Microsoft,NT$ARCH$
[Microsoft.NT$ARCH$]
%ReaderDeviceName%=VReader_Install,root\vpcd
; =================== Virtual Reader Device ==================================
[VReader_Install.NT]
CopyFiles=UMDriverCopy
[VReader_Install.NT.hw]
[VReader_Install.NT.Services]
AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall
[VReader_Install.NT.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles
[VReader_Install.NT.Wdf]
UmdfService=vpcd,UMDFVReader_Install
UmdfServiceOrder=vpcd
UmdfKernelModeClientPolicy=AllowKernelModeClients
; =================== UMDF Service Install section ===================
[UMDFVReader_Install]
UmdfLibraryVersion=$UMDFVERSION$
ServiceBinary=%12%\UMDF\vpcd.dll
DriverCLSID={d4112073-d09b-458f-a5aa-35ef21eef5de}
[WUDFRD_ServiceInstall]
DisplayName = %WudfRdDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WUDFRd.sys
LoadOrderGroup = Base
[SourceDisksFiles]
vpcd.dll=1
WudfUpdate_01009.dll=1
[SourceDisksNames]
1 = %MediaDescription%
[CoInstallers_CopyFiles]
WudfUpdate_$UMDFCOINSTALLERVERSION$.dll
[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WUDFUpdate_$UMDFCOINSTALLERVERSION$.dll"
[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to driversMdf
CoInstallers_CopyFiles=11
[UMDriverCopy]
vpcd.dll
; =================== Generic ==================================
[Strings]
MSFTUMDF="Virtual Smart Card Architecture"
MediaDescription="Virtual PCD Media"
WudfRdDisplayName="UMDF Virtual Smart Card Reader for ScardVisual"
ReaderDeviceName="Virtual PCD"

View File

@@ -0,0 +1,100 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Italian (Italy) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
#ifdef _WIN32
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 6,0,6000,16384
PRODUCTVERSION 6,0,6000,16384
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x9L
#else
FILEFLAGS 0x8L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "001004b0"
BEGIN
VALUE "CompanyName", "Windows (R) Codename Longhorn DDK provider"
VALUE "FileDescription", "Virtual Smart Card Driver"
VALUE "FileVersion", "6.0.6000.16384"
VALUE "InternalName", "vpcd"
VALUE "LegalCopyright", "<22> Microsoft Corporation. All rights reserved."
VALUE "OriginalFilename", "vpcd.dll"
VALUE "ProductName", "Windows (R) Codename Longhorn DDK driver"
VALUE "ProductVersion", "6.0.6000.16384"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x10, 1200
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // Italian (Italy) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
P
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,83 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vpcd-Package", "Vpcd-Package", "{B4A2C5E7-24D0-4EBB-A564-5F52DD858932}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vpcd-Package", "vpcd-Package\vpcd-Package.vcxproj", "{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vpcd", "vpcd.vcxproj", "{B019D202-420C-484D-9303-45B552A05B95}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Win8.1 Debug|Win32 = Win8.1 Debug|Win32
Win8.1 Debug|x64 = Win8.1 Debug|x64
Win8.1 Release|Win32 = Win8.1 Release|Win32
Win8.1 Release|x64 = Win8.1 Release|x64
Win8 Debug|Win32 = Win8 Debug|Win32
Win8 Debug|x64 = Win8 Debug|x64
Win8 Release|Win32 = Win8 Release|Win32
Win8 Release|x64 = Win8 Release|x64
Win7 Debug|Win32 = Win7 Debug|Win32
Win7 Debug|x64 = Win7 Debug|x64
Win7 Release|Win32 = Win7 Release|Win32
Win7 Release|x64 = Win7 Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Debug|x64.Build.0 = Win8 Debug|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Release|Win32.Build.0 = Win8 Release|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Release|x64.ActiveCfg = Win8 Release|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win8 Release|x64.Build.0 = Win8 Release|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Debug|x64.Build.0 = Win7 Debug|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Release|Win32.Build.0 = Win7 Release|Win32
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Release|x64.ActiveCfg = Win7 Release|x64
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5}.Win7 Release|x64.Build.0 = Win7 Release|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Debug|x64.Build.0 = Win8 Debug|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Release|Win32.Build.0 = Win8 Release|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Release|x64.ActiveCfg = Win8 Release|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win8 Release|x64.Build.0 = Win8 Release|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Debug|x64.Build.0 = Win7 Debug|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Release|Win32.Build.0 = Win7 Release|Win32
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Release|x64.ActiveCfg = Win7 Release|x64
{B019D202-420C-484D-9303-45B552A05B95}.Win7 Release|x64.Build.0 = Win7 Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7D06C4DD-96FC-4421-96F1-C90A6093A6F5} = {B4A2C5E7-24D0-4EBB-A564-5F52DD858932}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,217 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Win8.1 Debug|Win32">
<Configuration>Win8.1 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Debug|Win32">
<Configuration>Win8 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|Win32">
<Configuration>Win7 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8.1 Release|Win32">
<Configuration>Win8.1 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|Win32">
<Configuration>Win8 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|Win32">
<Configuration>Win7 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8.1 Debug|x64">
<Configuration>Win8.1 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Debug|x64">
<Configuration>Win8 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|x64">
<Configuration>Win7 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8.1 Release|x64">
<Configuration>Win8.1 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|x64">
<Configuration>Win8 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|x64">
<Configuration>Win7 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="PropertySheets">
<PlatformToolset>WindowsUserModeDriver8.1</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<DriverType>UMDF</DriverType>
<TARGETNAME>vpcd</TARGETNAME>
<Configuration Condition="'$(Configuration)' == ''">Win8.1 Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<ConvertedTarget0_Disabled>True</ConvertedTarget0_Disabled>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="PropertySheets">
<ConversionToolVersion>1.0</ConversionToolVersion>
<BUILD_ALT_DIR>$(Configuration.Replace(' ',''))</BUILD_ALT_DIR>
<IntDir Condition="'$(Platform)'!='Win32'">$(BUILD_ALT_DIR)\$(Platform)\</IntDir>
<IntDir Condition="'$(Platform)'=='Win32'">$(BUILD_ALT_DIR)\x86\</IntDir>
<OutDir>$(IntDir)</OutDir>
</PropertyGroup>
<ImportGroup Label="PreConfiguration">
<Import Project="$(VCTargetsPath)\WDKConversion\PreConfiguration.props" />
</ImportGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B019D202-420C-484D-9303-45B552A05B95}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|Win32'">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
<TargetVersion>Win8</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">
<TargetVersion>Win7</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>False</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
<TargetVersion>Win8</TargetVersion>
<UseDebugLibraries>False</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">
<TargetVersion>Win7</TargetVersion>
<UseDebugLibraries>False</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">
<TargetVersion>Win8</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'">
<TargetVersion>Win7</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
<TargetVersion>WindowsV6.3</TargetVersion>
<UseDebugLibraries>False</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
<TargetVersion>Win8</TargetVersion>
<UseDebugLibraries>False</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'">
<TargetVersion>Win7</TargetVersion>
<UseDebugLibraries>False</UseDebugLibraries>
</PropertyGroup>
<!-- Needed by any VcxProj -->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<!-- The WrappedTaskItems label is used by the conversion tool to identify the location where items
associated with wrapped tasks will reside.-->
<ItemGroup Label="WrappedTaskItems">
<Inf Include="vpcd.inx">
<Architecture>$(_BUILDARCH)</Architecture>
<SpecifyArchitecture>true</SpecifyArchitecture>
<KmdfVersionNumber>1.9</KmdfVersionNumber>
<UmdfVersionNumber>1.9.0</UmdfVersionNumber>
<CopyOutput>$(OBJ_PATH)\$(O)\vpcd.inf</CopyOutput>
</Inf>
</ItemGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\src\vpcd;%(AdditionalIncludeDirectories);$(Includes);$(User_Includes)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<!-- We only add items (e.g. form ClSourceFiles) that do not already exist (e.g in the ClCompile list), this avoids duplication -->
<ClCompile Include="..\..\src\vpcd\vpcd.c" />
<ClCompile Include="@(ClSourceFiles)" Exclude="@(ClCompile)" />
<ResourceCompile Include="@(RcSourceFiles)" Exclude="@(ResourceCompile)" />
<Midl Include="@(IdlSourceFiles)" Exclude="@(Midl)" />
<MessageCompile Include="@(McSourceFiles)" Exclude="@(MessageCompile)" />
<MASM Include="@(AsmSourceFiles)" Exclude="@(MASM)" />
<GenerateBmf Include="@(MofSourceFiles)" Exclude="@(GenerateBmf)" />
</ItemGroup>
<!-- Set default environment variables, e.g. for stampinf -->
<ItemGroup>
<BuildMacro Include="SDK_INC_PATH">
<Value>$(KIT_SHARED_INC_PATH)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
<ItemGroup>
<Inf Exclude="@(Inf)" Include="$(DDK_INF_FILES)" />
<Inf Exclude="@(Inf)" Include="*.inf" />
<FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" />
<FilesToPackage Include="$(DDK_PACKAGE_FILES)" />
</ItemGroup>
<!-- Necessary to pick up propper files from local directory when in the IDE-->
<ItemGroup>
<None Exclude="@(None)" Include="*.txt;*.htm;*.html" />
<None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" />
<None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" />
</ItemGroup>
<ItemGroup>
<ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" />
<ClInclude Include="..\..\src\vpcd\vpcd.h" />
</ItemGroup>
<!-- /Necessary to pick up propper files from local directory when in the IDE-->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>