diff options
| author | karlf <[email protected]> | 2016-08-11 13:28:13 -0700 |
|---|---|---|
| committer | karlf <[email protected]> | 2016-08-11 13:28:13 -0700 |
| commit | 96eb96dfb613e4c745db6bd1f53a92fe7e2290fc (patch) | |
| tree | ad5f3ede5cbcd6b598677ce41bcf8318471bdd92 /wia/microdrv | |
| parent | 687b274aa38fd05c8c26e3068932121876d7f745 (diff) | |
Updated for "Windows 10 Anniversary Update" (Version 1607)
Diffstat (limited to 'wia/microdrv')
| -rw-r--r-- | wia/microdrv/resource.h | 20 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.cpp | 1192 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.def | 6 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.h | 31 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.inf | 82 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.rc | 14 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.rcv | 18 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.vcxproj | 199 | ||||
| -rw-r--r-- | wia/microdrv/testmcro.vcxproj.Filters | 30 |
9 files changed, 1592 insertions, 0 deletions
diff --git a/wia/microdrv/resource.h b/wia/microdrv/resource.h new file mode 100644 index 00000000..55300a1a --- /dev/null +++ b/wia/microdrv/resource.h @@ -0,0 +1,20 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by testmcro.rc +// + +#define IDS_SCAN_BUTTON_NAME 700 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 701 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 701 +#endif +#endif + + diff --git a/wia/microdrv/testmcro.cpp b/wia/microdrv/testmcro.cpp new file mode 100644 index 00000000..6514a585 --- /dev/null +++ b/wia/microdrv/testmcro.cpp @@ -0,0 +1,1192 @@ +#include <DriverSpecs.h> +_Analysis_mode_(_Analysis_code_type_user_driver_) + +#include "testmcro.h" +#include "wiamicro.h" +#include "resource.h" + +#include <STI.H> +#include <math.h> +#include <winioctl.h> +#include <usbscan.h> + +#ifdef DEBUG +#include <stdio.h> +#endif + +#include <strsafe.h> + +// #define BUTTON_SUPPORT // (uncomment this to allow BUTTON SUPPORT) + // button support is not functional in the test device + +#define MAX_BUTTONS 1 +#define MAX_BUTTON_NAME 255 + +HINSTANCE g_hInst; // instance of this MicroDriver (used for loading from a resource) + + +// note: MEMORYBMP, and BMP file will be added by wiafbdrv host driver. +// do not include them in your extended list. +// + +// #define _USE_EXTENDED_FORMAT_LIST (uncomment this to allow Extented file and memory formats) + +#define NUM_SUPPORTED_FILEFORMATS 1 +GUID g_SupportedFileFormats[NUM_SUPPORTED_FILEFORMATS]; + +#define NUM_SUPPORTED_MEMORYFORMATS 2 +GUID g_SupportedMemoryFormats[NUM_SUPPORTED_MEMORYFORMATS]; + +// +// Button GUID array used in Capability negotiation. +// Set your BUTTON guids here. These must match the GUIDS specified in +// your INF. The Scan Button GUID is public to all scanners with a +// scan button. +// + +GUID g_Buttons[MAX_BUTTONS] ={{0xa6c5a715, 0x8c6e, 0x11d2,{ 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f}}}; +BOOL g_bButtonNamesCreated = FALSE; +WCHAR* g_ButtonNames[MAX_BUTTONS] = {0}; + +INT g_PalIndex = 0; // simple palette index counter (test driver specific) +BOOL g_bDown = FALSE; // simple band direction bool (test drvier specific) + +BOOL InitializeScanner(PSCANINFO pScanInfo); +VOID InitScannerDefaults(PSCANINFO pScanInfo); +BOOL SetScannerSettings(PSCANINFO pScanInfo); +VOID CheckButtonStatus(PVAL pValue); +VOID GetButtonPress(LONG *pButtonValue); +HRESULT GetInterruptEvent(PVAL pValue); +LONG GetButtonCount(); +HRESULT GetOLESTRResourceString(LONG lResourceID,_Outptr_ LPOLESTR *ppsz,BOOL bLocal); +VOID ReadRegistryInformation(PVAL pValue); + +BOOL APIENTRY DllMain( HANDLE hModule,DWORD dwreason, LPVOID lpReserved) +{ + UNREFERENCED_PARAMETER(lpReserved); + + g_hInst = (HINSTANCE)hModule; + switch(dwreason) { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +/**************************************************************************\ +* MicroEntry (MicroDriver Entry point) +* +* Called by the WIA driver to communicate with the MicroDriver. +* +* Arguments: +* +* lCommand - MicroDriver Command, sent from the WIA driver +* pValue - VAL structure used for settings +* +* +* Return Value: +* +* Status +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +WIAMICRO_API HRESULT MicroEntry(LONG lCommand, _Inout_ PVAL pValue) +{ + HRESULT hr = E_NOTIMPL; + INT index = 0; + +//#define _DEBUG_COMMANDS + +#ifdef _DEBUG_COMMANDS + if(lCommand != CMD_STI_GETSTATUS) + Trace(TEXT("Command Value (%d)"),lCommand); +#endif + + if( !pValue || !(pValue->pScanInfo)) + { + return E_INVALIDARG; + } + + switch(lCommand) + { + case CMD_INITIALIZE: + hr = S_OK; + + // + // create any DeviceIO handles needed, use index (1 - MAX_IO_HANDLES) to store these handles. + // Index '0' is reserved by the WIA flatbed driver. The CreateFile Name is stored in the szVal + // member of the VAL structure. + // + + // pValue->pScanInfo->DeviceIOHandles[1] = CreateFileA( pValue->szVal, + // GENERIC_READ | GENERIC_WRITE, // Access mask + // 0, // Share mode + // NULL, // SA + // OPEN_EXISTING, // Create disposition + // FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, // Attributes + // NULL ); + + // + // if your device supports buttons, create the BUTTON name information here.. + // + + if (!g_bButtonNamesCreated) + { + for(index = 0; index < MAX_BUTTONS; index++) + { + g_ButtonNames[index] = (WCHAR*)CoTaskMemAlloc(MAX_BUTTON_NAME); + if (!g_ButtonNames[index]) + { + hr = E_OUTOFMEMORY; + break; + } + } + + if(SUCCEEDED(hr)) + { + hr = GetOLESTRResourceString(IDS_SCAN_BUTTON_NAME,&g_ButtonNames[0],TRUE); + } + + if(SUCCEEDED(hr)) + { + g_bButtonNamesCreated = TRUE; + } + else + { + for(index = 0; index < MAX_BUTTONS; index++) + { + if (g_ButtonNames[index]) + { + CoTaskMemFree(g_ButtonNames[index]); + g_ButtonNames[index] = NULL; + } + } + } + } + + // + // Initialize the scanner's default settings + // + + InitScannerDefaults(pValue->pScanInfo); + + break; + case CMD_UNINITIALIZE: + + // + // close any open handles created by the Micro driver + // + + if(pValue->pScanInfo->DeviceIOHandles[1] != NULL) + { + CloseHandle(pValue->pScanInfo->DeviceIOHandles[1]); + } + + + // + // if your device supports buttons, free/destroy the BUTTON name information here.. + // + + if(g_bButtonNamesCreated) + { + g_bButtonNamesCreated = FALSE; + + for(index = 0; index < MAX_BUTTONS; index++) + { + if (g_ButtonNames[index]) + { + CoTaskMemFree(g_ButtonNames[index]); + g_ButtonNames[index] = NULL; + } + } + } + + // + // close/unload libraries + // + + hr = S_OK; + break; + case CMD_RESETSCANNER: + + // + // reset scanner + // + + hr = S_OK; + break; + case CMD_STI_DIAGNOSTIC: + case CMD_STI_DEVICERESET: + + // + // reset device + // + + hr = S_OK; + break; + case CMD_STI_GETSTATUS: + + // + // set status flag to ON-LINE + // + + pValue->lVal = MCRO_STATUS_OK; + pValue->pGuid = (GUID*) &GUID_NULL; + + // + // button polling support + // + +#ifdef BUTTON_SUPPORT + CheckButtonStatus(pValue); +#endif + + hr = S_OK; + break; + case CMD_SETXRESOLUTION: + pValue->pScanInfo->Xresolution = pValue->lVal; + hr = S_OK; + break; + case CMD_SETYRESOLUTION: + pValue->pScanInfo->Yresolution = pValue->lVal; + hr = S_OK; + break; + case CMD_SETCONTRAST: + pValue->pScanInfo->Contrast = pValue->lVal; + hr = S_OK; + break; + case CMD_SETINTENSITY: + pValue->pScanInfo->Intensity = pValue->lVal; + hr = S_OK; + break; + case CMD_SETDATATYPE: + pValue->pScanInfo->DataType = pValue->lVal; + hr = S_OK; + break; + case CMD_SETNEGATIVE: + pValue->pScanInfo->Negative = pValue->lVal; + hr = S_OK; + break; + case CMD_GETADFSTATUS: + case CMD_GETADFHASPAPER: + // pValue->lVal = MCRO_ERROR_PAPER_EMPTY; + // hr = S_OK; + break; + case CMD_GET_INTERRUPT_EVENT: + hr = GetInterruptEvent(pValue); + break; + case CMD_GETCAPABILITIES: + pValue->lVal = 0; + pValue->pGuid = NULL; + pValue->ppButtonNames = NULL; + hr = S_OK; + break; + + case CMD_SETSCANMODE: + hr = S_OK; + switch(pValue->lVal) + { + case SCANMODE_FINALSCAN: + Trace(TEXT("Final Scan")); + break; + case SCANMODE_PREVIEWSCAN: + Trace(TEXT("Preview Scan")); + break; + default: + Trace(TEXT("Unknown Scan Mode (%d)"),pValue->lVal); + hr = E_FAIL; + break; + } + break; + case CMD_SETSTIDEVICEHKEY: + ReadRegistryInformation(pValue); + break; + +#ifdef _USE_EXTENDED_FORMAT_LIST + + // note: MEMORYBMP, and BMP file will be added by wiafbdrv host driver. + // do not include them in your extended list. + // + + case CMD_GETSUPPORTEDFILEFORMATS: + g_SupportedFileFormats[0] = WiaImgFmt_JPEG; + pValue->lVal = NUM_SUPPORTED_FILEFORMATS; + pValue->pGuid = g_SupportedFileFormats; + hr = S_OK; + break; + + case CMD_GETSUPPORTEDMEMORYFORMATS: + g_SupportedMemoryFormats[0] = WiaImgFmt_TIFF; + g_SupportedMemoryFormats[1] = WiaImgFmt_MYNEWFORMAT; + pValue->lVal = NUM_SUPPORTED_MEMORYFORMATS; + pValue->pGuid = g_SupportedMemoryFormats; + hr = S_OK; + break; +#endif + + default: + Trace(TEXT("Unknown Command (%d)"),lCommand); + break; + } + + return hr; +} + +/**************************************************************************\ +* Scan (MicroDriver Entry point) +* +* Called by the WIA driver to acquire data from the MicroDriver. +* +* Arguments: +* +* pScanInfo - SCANINFO structure used for settings +* lPhase - Current Scan phase, SCAN_FIRST, SCAN_NEXT, SCAN_FINISH... +* pBuffer - data buffer to be filled with scanned data +* lLength - Maximum length of pBuffer +* plReceived - Number of actual bytes written to pBuffer. +* +* +* Return Value: +* +* Status +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +WIAMICRO_API HRESULT Scan(_Inout_ PSCANINFO pScanInfo, LONG lPhase, _Out_writes_bytes_(lLength) PBYTE pBuffer, LONG lLength, _Out_ LONG *plReceived) +{ + if(pScanInfo == NULL) { + return E_INVALIDARG; + } + + INT i = 0; + *plReceived = 0; // Initialize *plReceived as 0. It has a return value in case of SCAN_FIRST and SCAN_NEXT. + + Trace(TEXT("------ Scan Requesting %d ------"),lLength); + switch (lPhase) { + case SCAN_FIRST: + if (!SetScannerSettings(pScanInfo)) { + return E_FAIL; + } + + Trace(TEXT("SCAN_FIRST")); + + g_PalIndex = 0; + g_bDown = FALSE; + + // + // first phase + // + + Trace(TEXT("Start Scan..")); + + case SCAN_NEXT: // SCAN_FIRST will fall through to SCAN_NEXT (because it is expecting data) + + // + // next phase + // + + if(lPhase == SCAN_NEXT) + Trace(TEXT("SCAN_NEXT")); + + // + // get data from the scanner and set plReceived value + // + + // + // read data + // + + switch(pScanInfo->DataType) { + case WIA_DATA_THRESHOLD: + + // + // make buffer alternate black/White, for sample 1-bit data + // + + memset(pBuffer,0,lLength); + memset(pBuffer,255,lLength/2); + break; + case WIA_DATA_GRAYSCALE: + + // + // make buffer grayscale data, for sample 8-bit data + // + + if(!g_bDown){ + g_PalIndex+=10; + if(g_PalIndex > 255){ + g_PalIndex = 255; + g_bDown = TRUE; + } + } + else { + g_PalIndex-=10; + if(g_PalIndex < 0){ + g_PalIndex = 0; + g_bDown = FALSE; + } + } + memset(pBuffer,g_PalIndex,lLength); + break; + case WIA_DATA_COLOR: + + // + // make buffer red, for sample color data + // + + for (i = 0;i+2<lLength;i+=3) { + memset(pBuffer+i,255,1); + memset(pBuffer+(i+1),0,1); + memset(pBuffer+(i+2),0,1); + } + break; + default: + break; + } + + // + // test device always returns the exact amount of scanned data + // + + *plReceived = lLength; + break; + case SCAN_FINISHED: + default: + Trace(TEXT("SCAN_FINISHED")); + + // + // stop scanner, do not set lRecieved, or write any data to pBuffer. Those values + // will be NULL. This lPhase is only to allow you to stop scanning, and return the + // scan head to the HOME position. SCAN_FINISHED will be called always for regular scans, and + // for cancelled scans. + // + + break; + } + + return S_OK; +} + +/**************************************************************************\ +* SetPixelWindow (MicroDriver Entry point) +* +* Called by the WIA driver to set the scan selection area to the MicroDriver. +* +* Arguments: +* +* pScanInfo - SCANINFO structure used for settings +* pValue - VAL structure used for settings +* x - X Position of scan rect (upper left x coordinate) +* y - Y Position of scan rect (upper left y coordinate) +* xExtent - Width of scan rect (in pixels) +* yExtent - Height of scan rect (in pixels) +* +* +* Return Value: +* +* Status +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +WIAMICRO_API HRESULT SetPixelWindow(_Inout_ PSCANINFO pScanInfo, LONG x, LONG y, LONG xExtent, LONG yExtent) +{ + if(pScanInfo == NULL) { + return E_INVALIDARG; + } + + pScanInfo->Window.xPos = x; + pScanInfo->Window.yPos = y; + pScanInfo->Window.xExtent = xExtent; + pScanInfo->Window.yExtent = yExtent; + return S_OK; +} + + +/**************************************************************************\ +* ReadRegistryInformation (helper) +* +* Called by the MicroDriver to Read registry information from the device's +* installed device section. The HKEY passed in will be closed by the host +* driver after CMD_INITIALIZE is completed. +* +* Arguments: +* +* none +* +* Return Value: +* +* void +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ +VOID ReadRegistryInformation(PVAL pValue) +{ + HKEY hKey = NULL; + if(NULL != pValue->pHandle){ + hKey = (HKEY)*pValue->pHandle; + + // + // Open DeviceData section to read driver specific information + // + + HKEY hOpenKey = NULL; + if (RegOpenKeyEx(hKey, // handle to open key + TEXT("DeviceData"), // address of name of subkey to open + 0, // options (must be NULL) + KEY_QUERY_VALUE|KEY_READ, // just want to QUERY a value + &hOpenKey // address of handle to open key + ) == ERROR_SUCCESS) { + + DWORD dwWritten = sizeof(DWORD); + DWORD dwType = REG_DWORD; + + LONG lSampleEntry = 0; + RegQueryValueEx(hOpenKey, + TEXT("Sample Entry"), + NULL, + &dwType, + (LPBYTE)&lSampleEntry, + &dwWritten); + Trace(TEXT("lSampleEntry Value = %d"),lSampleEntry); + } else { + Trace(TEXT("Could not open DeviceData section")); + } + } +} + +/**************************************************************************\ +* InitScannerDefaults (helper) +* +* Called by the MicroDriver to Initialize the SCANINFO structure +* +* Arguments: +* +* none +* +* Return Value: +* +* void +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +VOID InitScannerDefaults(PSCANINFO pScanInfo) +{ + + pScanInfo->ADF = 0; // set to no ADF in Test device + pScanInfo->RawDataFormat = WIA_PACKED_PIXEL; + pScanInfo->RawPixelOrder = WIA_ORDER_BGR; + pScanInfo->bNeedDataAlignment = TRUE; + + pScanInfo->SupportedCompressionType = 0; + pScanInfo->SupportedDataTypes = SUPPORT_BW|SUPPORT_GRAYSCALE|SUPPORT_COLOR; + + pScanInfo->BedWidth = 8500; // 1000's of an inch (WIA compatible unit) + pScanInfo->BedHeight = 11000; // 1000's of an inch (WIA compatible unit) + + pScanInfo->OpticalXResolution = 300; + pScanInfo->OpticalYResolution = 300; + + pScanInfo->IntensityRange.lMin = -127; + pScanInfo->IntensityRange.lMax = 127; + pScanInfo->IntensityRange.lStep = 1; + + pScanInfo->ContrastRange.lMin = -127; + pScanInfo->ContrastRange.lMax = 127; + pScanInfo->ContrastRange.lStep = 1; + + // Scanner settings + pScanInfo->Intensity = 0; + pScanInfo->Contrast = 0; + + pScanInfo->Xresolution = 150; + pScanInfo->Yresolution = 150; + + pScanInfo->Window.xPos = 0; + pScanInfo->Window.yPos = 0; + pScanInfo->Window.xExtent = (pScanInfo->Xresolution * pScanInfo->BedWidth)/1000; + pScanInfo->Window.yExtent = (pScanInfo->Yresolution * pScanInfo->BedHeight)/1000; + + // Scanner options + pScanInfo->DitherPattern = 0; + pScanInfo->Negative = 0; + pScanInfo->Mirror = 0; + pScanInfo->AutoBack = 0; + pScanInfo->ColorDitherPattern = 0; + pScanInfo->ToneMap = 0; + pScanInfo->Compression = 0; + + // Image Info + pScanInfo->DataType = WIA_DATA_GRAYSCALE; + pScanInfo->WidthPixels = (pScanInfo->Window.xExtent)-(pScanInfo->Window.xPos); + + switch(pScanInfo->DataType) { + case WIA_DATA_THRESHOLD: + pScanInfo->PixelBits = 1; + break; + case WIA_DATA_COLOR: + pScanInfo->PixelBits = 24; + break; + case WIA_DATA_GRAYSCALE: + default: + pScanInfo->PixelBits = 8; + break; + } + + pScanInfo->WidthBytes = pScanInfo->Window.xExtent * (pScanInfo->PixelBits/8); + pScanInfo->Lines = pScanInfo->Window.yExtent; +} + +/**************************************************************************\ +* SetScannerSettings (helper) +* +* Called by the MicroDriver to set the values stored in the SCANINFO structure +* to the actual device. +* +* Arguments: +* +* none +* +* +* Return Value: +* +* TRUE - Success, FALSE - Failure +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +BOOL SetScannerSettings(PSCANINFO pScanInfo) +{ + if(pScanInfo->DataType == WIA_DATA_THRESHOLD) { + pScanInfo->PixelBits = 1; + pScanInfo->WidthBytes = (pScanInfo->Window.xExtent)-(pScanInfo->Window.xPos) * (pScanInfo->PixelBits/7); + + // + // Set data type to device + // + + // if the set fails.. + // return FALSE; + } + else if(pScanInfo->DataType == WIA_DATA_GRAYSCALE) { + pScanInfo->PixelBits = 8; + pScanInfo->WidthBytes = (pScanInfo->Window.xExtent)-(pScanInfo->Window.xPos) * (pScanInfo->PixelBits/8); + + // + // Set data type to device + // + + // if the set fails.. + // return FALSE; + + } + else { + pScanInfo->PixelBits = 24; + pScanInfo->WidthBytes = (pScanInfo->Window.xExtent)-(pScanInfo->Window.xPos) * (pScanInfo->PixelBits/8); + + // + // Set data type to device + // + + // if the set fails.. + // return FALSE; + + } + +#ifdef DEBUG + Trace(TEXT("ScanInfo")); + Trace(TEXT("x res = %d"),pScanInfo->Xresolution); + Trace(TEXT("y res = %d"),pScanInfo->Yresolution); + Trace(TEXT("bpp = %d"),pScanInfo->PixelBits); + Trace(TEXT("xpos = %d"),pScanInfo->Window.xPos); + Trace(TEXT("ypos = %d"),pScanInfo->Window.yPos); + Trace(TEXT("xext = %d"),pScanInfo->Window.xExtent); + Trace(TEXT("yext = %d"),pScanInfo->Window.yExtent); +#endif + + // + // send other values to device, use the values set in pScanInfo to set them to your + // device. + // + + return TRUE; +} + +/**************************************************************************\ +* InitializeScanner (helper) +* +* Called by the MicroDriver to Iniitialize any device specific operations +* +* Arguments: +* +* none +* +* Return Value: +* +* TRUE - Success, FALSE - Failure +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +BOOL InitializeScanner(PSCANINFO pScanInfo) +{ + UNREFERENCED_PARAMETER(pScanInfo); + + HRESULT hr = S_OK; + + // + // Do any device initialization here... + // The test device does not need any. + // + + if (SUCCEEDED(hr)) { + return TRUE; + } + return FALSE; +} + +/**************************************************************************\ +* CheckButtonStatus (helper) +* +* Called by the MicroDriver to Set the current Button pressed value. +* +* Arguments: +* +* pValue - VAL structure used for settings +* +* +* Return Value: +* +* VOID +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + + +VOID CheckButtonStatus(PVAL pValue) +{ + // + // Button Polling is done here... + // + + // + // Check your device for button presses + // + + LONG lButtonValue = 0; + + GetButtonPress(&lButtonValue); + switch (lButtonValue) { + case 1: + pValue->pGuid = (GUID*) &guidScanButton; + Trace(TEXT("Scan Button Pressed!")); + break; + default: + pValue->pGuid = (GUID*) &GUID_NULL; + break; + } +} +/**************************************************************************\ +* GetInterruptEvent (helper) +* +* Called by the MicroDriver to handle USB interrupt events. +* +* Arguments: +* +* pValue - VAL structure used for settings +* +* +* Return Value: +* +* Status +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +HRESULT GetInterruptEvent(PVAL pValue) +{ + // + // Below is a simple example of how DeviceIOControl() can be used to + // determine interrupts with a USB device. + // + // The test device does not support events, + // So this should not be called. + // + + HRESULT hr = S_OK; + BYTE InterruptData; + DWORD dwIndex; + DWORD dwError; + + OVERLAPPED Overlapped; + ZeroMemory( &Overlapped, sizeof( Overlapped )); + Overlapped.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + + HANDLE hEventArray[2] = {pValue->handle, Overlapped.hEvent}; + BOOL fLooping = TRUE; + BOOL bRet = TRUE; + + // + // use the Handle created in CMD_INITIALIZE. + // + + HANDLE InterruptHandle = pValue->pScanInfo->DeviceIOHandles[1]; + + while (fLooping) { + + // + // Set the wait event, for the interrupt + // + + bRet = DeviceIoControl( InterruptHandle, + (DWORD) IOCTL_WAIT_ON_DEVICE_EVENT, + NULL, + 0, + &InterruptData, + sizeof(InterruptData), + &dwError, + &Overlapped ); + + if ( bRet || ( !bRet && ( ::GetLastError() == ERROR_IO_PENDING ))) { + + // + // Wait for the event to happen + // + + dwIndex = WaitForMultipleObjects( 2, + hEventArray, + FALSE, + INFINITE ); + + // + // Trap the result of the event + // + + switch ( dwIndex ) { + case WAIT_OBJECT_0+1: + DWORD dwBytesRet; + bRet = GetOverlappedResult( InterruptHandle, &Overlapped, &dwBytesRet, FALSE ); + + if ( dwBytesRet ) { + + // + // assign the corresponding button GUID to the *pValue->pGuid + // member., and Set the event. + // + + // Change detected - signal + if (*pValue->pHandle != INVALID_HANDLE_VALUE) { + switch ( InterruptData ) { + case 1: + *pValue->pGuid = guidScanButton; + Trace(TEXT("Scan Button Pressed!")); + break; + default: + *pValue->pGuid = GUID_NULL; + break; + } + Trace(TEXT("Setting This Event by Handle %d"),*pValue->pHandle); + + // + // signal the event, after a button GUID was assigned. + // + + SetEvent(*pValue->pHandle); + } + break; + } + + // + // reset the overlapped event + // + + ResetEvent( Overlapped.hEvent ); + break; + + case WAIT_OBJECT_0: + // Fall through + default: + fLooping = FALSE; + } + } + else { + hr = HRESULT_FROM_WIN32(::GetLastError()); + break; + } + } + return hr; +} + +/**************************************************************************\ +* GetButtonPress (helper) +* +* Called by the MicroDriver to set the actual button value pressed +* +* Arguments: +* +* pButtonValue - actual button pressed +* +* +* Return Value: +* +* Status +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +VOID GetButtonPress(LONG *pButtonValue) +{ + + // + // This where you can set your button value + // + + pButtonValue = 0; +} + +/**************************************************************************\ +* GetButtonCount (helper) +* +* Called by the MicroDriver to get the number of buttons a device supports +* +* Arguments: +* +* none +* +* Return Value: +* +* LONG - number of supported buttons +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +LONG GetButtonCount() +{ + LONG ButtonCount = 0; + + // + // Since the test device does not have a button, + // set this value to 0. For a real device with a button, + // set (LONG ButtonCount = 1;) + // + + // + // determine the button count of your device + // + + return ButtonCount; +} + +/**************************************************************************\ +* GetOLDSTRResourceString (helper) +* +* Called by the MicroDriver to Load a resource string in OLESTR format +* +* Arguments: +* +* lResourceID - String resource ID +* ppsz - Pointer to a OLESTR to be filled with the loaded string +* value +* bLocal - Possible, other source for loading a resource string. +* +* +* Return Value: +* +* Status +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +HRESULT GetOLESTRResourceString(LONG lResourceID,_Outptr_ LPOLESTR *ppsz,BOOL bLocal) +{ + HRESULT hr = S_OK; + TCHAR szStringValue[255]; + if(bLocal) { + + // + // We are looking for a resource in our own private resource file + // + + INT NumTCHARs = LoadString(g_hInst, lResourceID, szStringValue, sizeof(szStringValue)/sizeof(TCHAR)); + + if (NumTCHARs <= 0) + { + +#ifdef UNICODE + DWORD dwError = GetLastError(); + Trace(TEXT("NumTCHARs = %d dwError = %d Resource ID = %d (UNICODE)szString = %ws"), + NumTCHARs, + dwError, + lResourceID, + szStringValue); +#else + DWORD dwError = GetLastError(); + Trace(TEXT("NumTCHARs = %d dwError = %d Resource ID = %d (ANSI)szString = %s"), + NumTCHARs, + dwError, + lResourceID, + szStringValue); +#endif + + return E_FAIL; + } + + // + // NOTE: caller must free this allocated BSTR + // + +#ifdef UNICODE + + *ppsz = NULL; + *ppsz = (LPOLESTR)CoTaskMemAlloc(sizeof(szStringValue)); + if(*ppsz != NULL) + { + + // + // The call to LoadString previously guarantees that szStringValue is null terminated (maybe truncated) + // so a buffer of 'sizeof(szStringValue)/sizeof(TCHAR)' should suffice + // + + hr = StringCchCopy(*ppsz, sizeof(szStringValue)/sizeof(TCHAR), szStringValue); + } + else + { + hr = E_OUTOFMEMORY; + } + +#else + WCHAR wszStringValue[255]; + ZeroMemory(wszStringValue,sizeof(wszStringValue)); + + // + // convert szStringValue from char* to unsigned short* (ANSI only) + // + + MultiByteToWideChar(CP_ACP, + MB_PRECOMPOSED, + szStringValue, + lstrlenA(szStringValue)+1, + wszStringValue, + (sizeof(wszStringValue)/sizeof(WCHAR))); + + *ppsz = NULL; + *ppsz = (LPOLESTR)CoTaskMemAlloc(sizeof(wszStringValue)); + if(*ppsz != NULL) + { + + // + // The call to LoadString & MultiByteToWideChar previously guarantees that wszStringValue is null terminated + // (maybe truncated) so a buffer of 'sizeof(wszStringValue)/sizeof(WCHAR)' should suffice + // + + hr = StringCchCopyW(*ppsz,sizeof(wszStringValue)/sizeof(WCHAR),wszStringValue); + } + else + { + hr = E_OUTOFMEMORY; + } +#endif + + } + else + { + + // + // looking another place for resources?? + // + + hr = E_NOTIMPL; + } + + return hr; +} + +/**************************************************************************\ +* Trace +* +* Called by the MicroDriver to output strings to a debugger +* +* Arguments: +* +* format - formatted string to output +* +* +* Return Value: +* +* VOID +* +* History: +* +* 1/20/2000 Original Version +* +\**************************************************************************/ + +VOID Trace(_In_ LPCTSTR format,...) +{ + +#ifdef DEBUG + + TCHAR Buffer[1024]; + va_list arglist; + va_start(arglist, format); + + // + // StringCchVPrintf API guarantees the buffer to be null terminated (though it maybe truncated) + // + + StringCchVPrintf(Buffer, sizeof(Buffer)/sizeof(TCHAR), format, arglist); + va_end(arglist); + OutputDebugString(Buffer); + OutputDebugString(TEXT("\n")); + +#else + + UNREFERENCED_PARAMETER(format); + +#endif + +} + + diff --git a/wia/microdrv/testmcro.def b/wia/microdrv/testmcro.def new file mode 100644 index 00000000..9fffdbcb --- /dev/null +++ b/wia/microdrv/testmcro.def @@ -0,0 +1,6 @@ +LIBRARY TESTMCRO + +EXPORTS + MicroEntry + Scan + SetPixelWindow diff --git a/wia/microdrv/testmcro.h b/wia/microdrv/testmcro.h new file mode 100644 index 00000000..ac88f1ef --- /dev/null +++ b/wia/microdrv/testmcro.h @@ -0,0 +1,31 @@ +#ifndef TESTMCRO +#define TESTMCRO + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define INITGUID +#include <windows.h> + +// +// Button GUIDS +// + +DEFINE_GUID( guidScanButton, 0xa6c5a715, 0x8c6e, 0x11d2, 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f); + +// copy any known formats defined in wiadef.h to this location for use in your driver. + +DEFINE_GUID(WiaImgFmt_MEMORYBMP, 0xb96b3caa,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e); +DEFINE_GUID(WiaImgFmt_BMP, 0xb96b3cab,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e); +DEFINE_GUID(WiaImgFmt_JPEG, 0xb96b3cae,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e); +DEFINE_GUID(WiaImgFmt_TIFF, 0xb96b3cb1,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e); + +// define your custom-defined supported formats here +// {3B5DE639-B2C6-4952-98A9-1DC06F3703BD} +DEFINE_GUID(WiaImgFmt_MYNEWFORMAT, 0x3b5de639, 0xb2c6, 0x4952, 0x98, 0xa9, 0x1d, 0xc0, 0x6f, 0x37, 0x3, 0xbd); + +#undef INITGUID + +#endif + diff --git a/wia/microdrv/testmcro.inf b/wia/microdrv/testmcro.inf new file mode 100644 index 00000000..4b59377f --- /dev/null +++ b/wia/microdrv/testmcro.inf @@ -0,0 +1,82 @@ +; TESTMCRO.INF -- WIA sample MicroDriver scanner setup file +; Copyright (c) 2001 Microsoft Corporation +; Manufacturer: Microsoft + +[Version] +Signature="$WINDOWS NT$" +Class=Image +ClassGUID={6bdd1fc6-810f-11d0-bec7-08002be2092f} +Provider=%ProviderString% +DriverVer=11/02/2007,1.0.0.1 +CatalogFile=testmcro.cat + +[SourceDisksFiles.x86] +testmcro.dll=1 +[SourceDisksNames.x86] +1=%Location%,,, + +[SourceDisksFiles.ia64] +testmcro.dll=1 +[SourceDisksNames.ia64] +1=%Location%,,, + +[SourceDisksFiles.amd64] +testmcro.dll=1 +[SourceDisksNames.amd64] +1=%Location%,,, + +[DestinationDirs] +; By default, files will be copied to \windows\system32. +DefaultDestDir=11 + +[Manufacturer] +%ManufacturerName%=Models, NTx86, NTamd64, NTia64 + +; This is the models section for the x86 driver +[Models.NTx86] +%WIASample.DeviceDesc% = WIASample.Scanner, PnPIDInformation + +; This is the models section for the amd64 driver +[Models.NTamd64] +%WIASample.DeviceDesc% = WIASample.Scanner, PnPIDInformation + +; This is the models section for the ia64 driver +[Models.NTia64] +%WIASample.DeviceDesc% = WIASample.Scanner, PnPIDInformation + +[WIASample.Scanner] +Include=sti.inf +Needs=STI.SerialSection, STI.MICRODRIVERSection +SubClass=StillImage +DeviceType=1 +DeviceSubType=0x1 +Capabilities=0x30 +Events=WIASample.Events +DeviceData=WIASample.DeviceData +AddReg=WIASample.AddReg +CopyFiles=WIASample.CopyFiles +ICMProfiles="sRGB Color Space Profile.icm" + +[WIASample.Events] + +[WIASample.Scanner.Services] +Include=sti.inf +Needs=STI.SerialSection.Services + +[WIASample.DeviceData] +Server=local +UI Class ID={4DB1AD10-3391-11D2-9A33-00C04FA36145} +MicroDriver="TESTMCRO.DLL" +Sample Entry=1,1 + +[WIASample.AddReg] +HKR,,HardwareConfig,1,1 + +[WIASample.CopyFiles] +testmcro.dll + +[Strings] +ManufacturerName="TODO-Set-Manufacturer" +ProviderString="TODO-Set-Provider" +Location="Install Source" +WIASample.DeviceDesc="WIA Sample MicroDriver Scanner Device" diff --git a/wia/microdrv/testmcro.rc b/wia/microdrv/testmcro.rc new file mode 100644 index 00000000..2c55a579 --- /dev/null +++ b/wia/microdrv/testmcro.rc @@ -0,0 +1,14 @@ +#include "testmcro.rcv" +#include "resource.h" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + +IDS_SCAN_BUTTON_NAME "My Scan Button" + +END diff --git a/wia/microdrv/testmcro.rcv b/wia/microdrv/testmcro.rcv new file mode 100644 index 00000000..ff7f25c6 --- /dev/null +++ b/wia/microdrv/testmcro.rcv @@ -0,0 +1,18 @@ +/*****************************************************************/ +/** Microsoft Windows **/ +/** Copyright (C) Microsoft Corp., 1996-2000 **/ +/*****************************************************************/ + +#include <windows.h> +#include <ntverp.h> + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TEST Flatbed Scanner Still Image Device Micro Driver DLL" +#define VER_INTERNALNAME_STR "TESTMCRO" +#define VER_ORIGINALFILENAME_STR "TESTMCRO.DLL" + +#include <common.ver> + + + diff --git a/wia/microdrv/testmcro.vcxproj b/wia/microdrv/testmcro.vcxproj new file mode 100644 index 00000000..4fedb7a2 --- /dev/null +++ b/wia/microdrv/testmcro.vcxproj @@ -0,0 +1,199 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{823A3A7D-47CE-46A7-BEC6-87E16E61CCE7}</ProjectGuid> + <RootNamespace>$(MSBuildProjectName)</RootNamespace> + <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> + <Platform Condition="'$(Platform)' == ''">Win32</Platform> + <SampleGuid>{72A46237-DB33-46EF-A427-E62F5F6F6664}</SampleGuid> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>False</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>DynamicLibrary</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>True</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>DynamicLibrary</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>False</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>DynamicLibrary</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>True</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>DynamicLibrary</ConfigurationType> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <PropertyGroup> + <OutDir>$(IntDir)</OutDir> + </PropertyGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='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)'=='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)'=='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)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ItemGroup Label="WrappedTaskItems" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <TargetName>testmcro</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <TargetName>testmcro</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <TargetName>testmcro</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <TargetName>testmcro</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Link> + <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> + <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Link> + <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> + <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Link> + <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> + <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Link> + <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> + <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </Midl> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;advapi32.lib;user32.lib;gdi32.lib;ole32.lib;uuid.lib;oleaut32.lib</AdditionalDependencies> + <ModuleDefinitionFile>testmcro.def</ModuleDefinitionFile> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </Midl> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;advapi32.lib;user32.lib;gdi32.lib;ole32.lib;uuid.lib;oleaut32.lib</AdditionalDependencies> + <ModuleDefinitionFile>testmcro.def</ModuleDefinitionFile> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </Midl> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;advapi32.lib;user32.lib;gdi32.lib;ole32.lib;uuid.lib;oleaut32.lib</AdditionalDependencies> + <ModuleDefinitionFile>testmcro.def</ModuleDefinitionFile> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories> + </Midl> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;advapi32.lib;user32.lib;gdi32.lib;ole32.lib;uuid.lib;oleaut32.lib</AdditionalDependencies> + <ModuleDefinitionFile>testmcro.def</ModuleDefinitionFile> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="testmcro.cpp" /> + <ResourceCompile Include="testmcro.rc" /> + </ItemGroup> + <ItemGroup> + <Inf Exclude="@(Inf)" Include="*.inf" /> + <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> + </ItemGroup> + <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" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> +</Project>
\ No newline at end of file diff --git a/wia/microdrv/testmcro.vcxproj.Filters b/wia/microdrv/testmcro.vcxproj.Filters new file mode 100644 index 00000000..77007970 --- /dev/null +++ b/wia/microdrv/testmcro.vcxproj.Filters @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> + <UniqueIdentifier>{4B344312-D67F-43C4-ADEA-219822B0DA3C}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files"> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + <UniqueIdentifier>{3EB64FCC-F632-49F7-BA8D-65BFC005D073}</UniqueIdentifier> + </Filter> + <Filter Include="Resource Files"> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> + <UniqueIdentifier>{2EAD88AF-FB87-4771-BA31-D241D7C7DD93}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="testmcro.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <None Include="testmcro.def"> + <Filter>Source Files</Filter> + </None> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="testmcro.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> +</Project>
\ No newline at end of file |
