summaryrefslogtreecommitdiff
path: root/wia/ProdScan/PropMan.h
diff options
context:
space:
mode:
authorkarlf <[email protected]>2016-08-11 13:28:13 -0700
committerkarlf <[email protected]>2016-08-11 13:28:13 -0700
commit96eb96dfb613e4c745db6bd1f53a92fe7e2290fc (patch)
treead5f3ede5cbcd6b598677ce41bcf8318471bdd92 /wia/ProdScan/PropMan.h
parent687b274aa38fd05c8c26e3068932121876d7f745 (diff)
Updated for "Windows 10 Anniversary Update" (Version 1607)
Diffstat (limited to 'wia/ProdScan/PropMan.h')
-rw-r--r--wia/ProdScan/PropMan.h205
1 files changed, 205 insertions, 0 deletions
diff --git a/wia/ProdScan/PropMan.h b/wia/ProdScan/PropMan.h
new file mode 100644
index 00000000..c7436b92
--- /dev/null
+++ b/wia/ProdScan/PropMan.h
@@ -0,0 +1,205 @@
+/**************************************************************************
+*
+* Copyright � Microsoft Corporation
+*
+* File Title: PropMan.h
+*
+* Project: Production Scanner Driver Sample
+*
+* Description: This file contains the class definition of the
+* CWIAPropertyManager class that encapsulates
+* WIA property creation for this driver.
+*
+***************************************************************************/
+
+#pragma once
+
+
+//
+// Structure definitions:
+//
+
+typedef struct _WIA_PROPERTY_INFO_DATA{
+ LPOLESTR pszName; // property name
+ PROPID pid; // property id
+ PROPVARIANT pv; // property variant
+ PROPSPEC ps; // property spec
+ WIA_PROPERTY_INFO wpi; // property info
+} WIA_PROPERTY_INFO_DATA,*PWIA_PROPERTY_INFO_DATA;
+
+//
+// WIA access flag combinations:
+//
+
+#define RN (WIA_PROP_READ | WIA_PROP_NONE)
+#define RF (WIA_PROP_READ | WIA_PROP_FLAG)
+#define RW (WIA_PROP_READ | WIA_PROP_WRITE | WIA_PROP_NONE)
+#define RWL (WIA_PROP_READ | WIA_PROP_WRITE | WIA_PROP_LIST)
+#define RWR (WIA_PROP_READ | WIA_PROP_WRITE | WIA_PROP_RANGE)
+#define RWF (WIA_PROP_READ | WIA_PROP_WRITE | WIA_PROP_FLAG)
+#define RWLC (WIA_PROP_READ | WIA_PROP_WRITE | WIA_PROP_LIST|WIA_PROP_CACHEABLE)
+#define RWRC (WIA_PROP_READ | WIA_PROP_WRITE | WIA_PROP_RANGE|WIA_PROP_CACHEABLE)
+#define RWFC (WIA_PROP_READ | WIA_PROP_WRITE | WIA_PROP_FLAG|WIA_PROP_CACHEABLE)
+
+//
+// CWIAPropertyManager class:
+//
+
+class CWIAPropertyManager
+{
+private:
+ CBasicDynamicArray<PWIA_PROPERTY_INFO_DATA> m_List;
+
+ PWIA_PROPERTY_INFO_DATA
+ FindProperty(
+ LONG lPropertyID);
+
+ HRESULT
+ DeletePropertyData(
+ _Inout_ PWIA_PROPERTY_INFO_DATA pInfo);
+
+ PWIA_PROPERTY_INFO_DATA
+ AllocatePropertyData();
+
+ HRESULT
+ RemovePropertyAndDeleteData(
+ LONG lPropertyID);
+
+public:
+ CWIAPropertyManager();
+ ~CWIAPropertyManager();
+
+ //
+ // LONG type property creation:
+ //
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ LONG lCurrValue);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ ULONG ulCurrValueItems,
+ _In_reads_(ulCurrValueItems) LONG *pCurrValue);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ _In_reads_(ulNumItems) BYTE *pbCurrValue,
+ ULONG ulNumItems);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ LONG lCurrValue,
+ LONG lNomValue,
+ LONG lMinValue,
+ LONG lMaxValue,
+ LONG lInc);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ LONG lCurrValue,
+ LONG lNomValue,
+ _In_ LONG *plValues,
+ LONG lNumValues);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ LONG lCurrValue,
+ LONG lNomValue,
+ _In_ CBasicDynamicArray<LONG> *pValueList);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ LONG lCurrValue,
+ LONG lValidBits);
+
+ //
+ // ULONG type property creation
+ //
+
+ HRESULT
+ AddPropertyUL(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ ULONG ulCurrValue);
+
+ HRESULT
+ AddPropertyUL(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ ULONG ulCurrValue,
+ ULONG ulNomValue,
+ ULONG ulMinValue,
+ ULONG ulMaxValue,
+ ULONG ulInc);
+
+ //
+ // BSTR type property creation:
+ //
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ _In_ BSTR bstrCurrValue);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ ULONG ulCurrValueItems,
+ _In_reads_(ulCurrValueItems) BSTR *pCurrValue);
+
+ //
+ // GUID type property creation:
+ //
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ GUID guidCurrValue);
+
+ HRESULT
+ AddProperty(
+ LONG lPropertyID,
+ _In_ LPOLESTR pszName,
+ LONG lAccessFlags,
+ GUID guidCurrValue,
+ GUID guidNomValue,
+ _In_ CBasicDynamicArray<GUID> *pValueList);
+
+ HRESULT
+ RemoveProperty(
+ LONG lPropertyID);
+
+ HRESULT
+ SetItemProperties(
+ _Inout_ BYTE *pWiasContext);
+};