1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
/**************************************************************************
*
* Copyright � Microsoft Corporation
*
* File Title: stdafx.h
*
* Project: Production Scanner Driver Sample
*
* Description: precompiled header file
*
***************************************************************************/
#pragma once
//
// This is the size of the buffer the driver uses to write data to the
// WIA image download stream and also to declare for legacy applications
// through WIA_IPA_BUFFER_SIZE. The buffer size chosen is 64KB (65536 bytes):
//
#define DEFAULT_BUFFER_SIZE 65536
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
//
// WIA_DEBUG is needed in order to enable WIA tracing in free
// builds (see WIAS_TRACE and WIAEX_ERROR in wiamdef.h):
//
#ifndef WIA_DEBUG
#define WIA_DEBUG
#endif
//
// Windows system headers:
//
#include <windows.h> // Windows
#include <stdlib.h> // C standard library
#include <stdio.h> // std out
#include <coguid.h> // COM
#include <objbase.h> // COM
#include <shobjidl.h> // Shell UI Extension
#include <shlobj.h> // Shell UI Extension
#include <shlwapi.h> // Shell light weight API
#include <strsafe.h> // Safe character string APIs
#include <gdiplus.h> // GDI+
#include <limits.h>
#include <initguid.h>
//
// WIA driver core headers:
//
#include <sti.h> // STI defines
#include <stiusd.h> // IStiUsd interface
#include <wiamindr.h> // IWiaMinidrv interface
#include <wiadevd.h> // IWiaUIExtension interface
#include <wiamdef.h>
//
// WIA driver headers:
//
#include "constants.h" // Constant declarations
#include "basicarray.h" // CSimpleDynamicArray class
#include "propman.h" // WIA driver property manager class
#include "capman.h" // WIA driver capability manager class
#include "wiautil.h" // WIA driver helper functions
#include "resource.h" // WIA driver resource definitions
#include "minidrv.h" // WIA driver header
//
// Helpers for image file format translations (using GDI+):
//
using namespace Gdiplus;
#include "fileconv.h"
//
// WIA tracing macro helpers:
//
#define WIAEX_ERROR(args) { WIAS_ERROR((g_hInst, "Error in %s (%u):", __FUNCTION__, __LINE__)); WIAS_ERROR(args); }
#define WIAEX_TRACE(args) { FAILED(hr) ? WIAS_ERROR(args) : WIAS_TRACE(args); }
#define WIAEX_TRACE_FUNC_HR { FAILED(hr) ? WIAS_ERROR((g_hInst, "%s failed, hr = 0x%08X", __FUNCTION__, hr)) : WIAS_TRACE((g_hInst, "%s succeeded, hr = 0x%08X", __FUNCTION__, hr)); }
#define WIAEX_TRACE_BEGIN { WIAS_TRACE((g_hInst, "%s..", __FUNCTION__)); }
|